private static void ReadEffects(Tileart t, BinaryReader r) { byte count = r.ReadByte(); t.effects = new EffectItem[count]; for (int i = 0; i < count; ++i) { t.effects[i] = EffectItem.ReadEffect(r); } }
private static void ReadStackAliases(Tileart t, BinaryReader r) { int count3 = r.ReadInt32(); t.stackaliases = new StackAlias[count3]; for (int i = 0; i < count3; ++i) { t.stackaliases[i] = StackAlias.ReadStackAlias(r); } }
private static TileartPropItem[] ReadProps(Tileart t, BinaryReader r) { byte count1 = r.ReadByte(); TileartPropItem[] props = new TileartPropItem[count1]; for (int i = 0; i < count1; ++i) { props[i] = TileartPropItem.ReadProp(r); } return(props); }
public UOSprite(uint spriteID) { tileart = UOResourceManager.getTileart(spriteID); resource = UOResourceManager.getResource(tileart); if (resource.isLegacy) { _imageOffset = tileart.offset2D; } else _imageOffset = tileart.offsetEC; _drawOffsetX = tileart.offsetEC.offX / UOEC_SIZE; _drawOffsetY = tileart.offsetEC.offY / UOEC_SIZE; }
public static Tileart readTileart(BinaryReader r) { Tileart t = new Tileart(); t.header = r.ReadUInt16();//fixed 03 t.nameIndex = r.ReadUInt32();//t.group = Enum.Parse(typeof(TileGroup), r.ReadUInt32().ToString()); t.id = r.ReadUInt32(); t.unk = r.ReadByte(); t.unk7 = r.ReadByte(); t.unk2 = r.ReadSingle(); t.unk3 = r.ReadSingle(); t.fixedZero = r.ReadInt32(); t.oldID = r.ReadInt32(); t.unk6 = r.ReadInt32(); t.unk_type = r.ReadInt32(); t.unk8 = r.ReadByte(); t.unk9 = r.ReadInt32(); t.unk10 = r.ReadInt32(); t.unk11 = r.ReadSingle(); t.unk12 = r.ReadSingle(); t.unk13 = r.ReadInt32(); t.int_flags = r.ReadInt64(); t.int_flags_full = r.ReadInt64(); t.flags = (TileFlag)Enum.Parse(typeof(TileFlag), t.int_flags.ToString()); t.flags2 = (TileFlag)Enum.Parse(typeof(TileFlag), t.int_flags_full.ToString()); t.unk16 = r.ReadInt32(); //IMAGE OFFSET for (int i = 0; i < 6; ++i) { t.imgoffEC[i] = r.ReadInt32(); } for (int i = 0; i < 6; ++i) { t.imgoff2D[i] = r.ReadInt32(); } t.offsetEC = new TileartImageOffset(t.imgoffEC); t.offset2D = new TileartImageOffset(t.imgoff2D); try { //PROPERTIES t.props = ReadProps(t, r); t.props2 = ReadProps(t, r); //Repetition (?) //9_3 ReadStackAliases(t,r); //9_4 t.appearance = AnimationAppearanceItem.ReadAnimationAppearance(r); //9_5 t.sittingAnimation = SittingAnimationItem.ReadSittingAnimation(r); //Radarcol t.radarCol = RadarColItem.ReadRadarCol(r); t.textures[0] = TextureInfo.readTextureInfo(r); t.textures[1] = TextureInfo.readTextureInfo(r); t.textures[2] = TextureInfo.readTextureInfo(r); t.textures[3] = TextureInfo.readTextureInfo(r);//New Format //9_8 ReadEffects(t,r); } catch { } return t; }
private static TileartPropItem[] ReadProps(Tileart t, BinaryReader r) { byte count1 = r.ReadByte(); TileartPropItem[] props = new TileartPropItem[count1]; for (int i = 0; i < count1; ++i) { props[i] = TileartPropItem.ReadProp(r); } return props; }
public static Tileart readTileart(BinaryReader r) { Tileart t = new Tileart(); t.header = r.ReadUInt16(); //fixed 03 t.nameIndex = r.ReadUInt32(); //t.group = Enum.Parse(typeof(TileGroup), r.ReadUInt32().ToString()); t.id = r.ReadUInt32(); t.unk = r.ReadByte(); t.unk7 = r.ReadByte(); t.unk2 = r.ReadSingle(); t.unk3 = r.ReadSingle(); t.fixedZero = r.ReadInt32(); t.oldID = r.ReadInt32(); t.unk6 = r.ReadInt32(); t.unk_type = r.ReadInt32(); t.unk8 = r.ReadByte(); t.unk9 = r.ReadInt32(); t.unk10 = r.ReadInt32(); t.unk11 = r.ReadSingle(); t.unk12 = r.ReadSingle(); t.unk13 = r.ReadInt32(); t.int_flags = r.ReadInt64(); t.int_flags_full = r.ReadInt64(); t.flags = (TileFlag)Enum.Parse(typeof(TileFlag), t.int_flags.ToString()); t.flags2 = (TileFlag)Enum.Parse(typeof(TileFlag), t.int_flags_full.ToString()); t.unk16 = r.ReadInt32(); //IMAGE OFFSET for (int i = 0; i < 6; ++i) { t.imgoffEC[i] = r.ReadInt32(); } for (int i = 0; i < 6; ++i) { t.imgoff2D[i] = r.ReadInt32(); } t.offsetEC = new TileartImageOffset(t.imgoffEC); t.offset2D = new TileartImageOffset(t.imgoff2D); try { //PROPERTIES t.props = ReadProps(t, r); t.props2 = ReadProps(t, r); //Repetition (?) //9_3 ReadStackAliases(t, r); //9_4 t.appearance = AnimationAppearanceItem.ReadAnimationAppearance(r); //9_5 t.sittingAnimation = SittingAnimationItem.ReadSittingAnimation(r); //Radarcol t.radarCol = RadarColItem.ReadRadarCol(r); t.textures[0] = TextureInfo.readTextureInfo(r); t.textures[1] = TextureInfo.readTextureInfo(r); t.textures[2] = TextureInfo.readTextureInfo(r); t.textures[3] = TextureInfo.readTextureInfo(r); //New Format //9_8 ReadEffects(t, r); } catch { } return(t); }
//Get a resource given an id // the id is coming from TILEART -> TEXTURES // or TERRAINDEF -> TEXTURES public static UOResource getResource( Tileart tileart ){ UOResource resource = null; //WorldArt Texture if (tileart.textures[0].texturePresent == 1) { resource = getResource(tileart.textures[0].texturesArray[0], ShaderTypes.Sprite); } //LegacyTexture if (resource == null && tileart.textures[1].texturePresent == 1) { resource = getLegacyResource(tileart.textures[1].texturesArray[0]); } //EnhancedTexture //Is this really necessary? //Light Texture if (resource != null && tileart.textures[3].texturePresent == 1) { //TODO: light texture load } // if (resource == null){ UOConsole.Fatal("texture is not present {0}", tileart.id); tileart = UOResourceManager.getTileart(1); resource = getResource(tileart.textures[0].texturesArray[0], ShaderTypes.Sprite); } return resource; }