public void Load(string Path, ClientType myClientType) { this.path = Path; this.clientType = myClientType; BinaryReader binaryReader = new BinaryReader(File.Open(this.path, FileMode.Open)); string text = RoseFile.ReadFString(ref binaryReader, 7); if (text == "ZMD0003") { this.version = 3; } else { if (!(text == "ZMD0002")) { throw new Exception("Wrong file header " + text + " on " + this.path); } this.version = 2; } int num = binaryReader.ReadInt32(); for (int i = 0; i < num; i++) { ZMD.Bone bone = new ZMD.Bone(); bone.Dummy = false; bone.parentid = binaryReader.ReadInt32(); bone.name = RoseFile.ReadZString(ref binaryReader); bone.position = RoseFile.ReadVector3(ref binaryReader); bone.position /= 100f; bone.rotation = RoseFile.ReadVector4(ref binaryReader); bone.matrix = Matrix.CreateFromQuaternion(new Quaternion(bone.rotation.X, bone.rotation.Y, bone.rotation.Z, bone.rotation.W)); bone.matrix *= Matrix.CreateTranslation(bone.position); this.listBone.Add(bone); } int num2 = binaryReader.ReadInt32(); this.DummyOffset = num; for (int i = 0; i < num2; i++) { ZMD.Bone bone2 = new ZMD.Bone(); bone2.Dummy = true; bone2.name = RoseFile.ReadZString(ref binaryReader); bone2.parentid = binaryReader.ReadInt32(); bone2.position = RoseFile.ReadVector3(ref binaryReader); bone2.position /= 100f; bone2.matrix = Matrix.Identity; if (this.version == 3) { bone2.rotation = RoseFile.ReadVector4(ref binaryReader); bone2.matrix = Matrix.CreateFromQuaternion(new Quaternion(bone2.rotation.X, bone2.rotation.Y, bone2.rotation.Z, bone2.rotation.W)); } bone2.matrix *= Matrix.CreateTranslation(bone2.position); this.listBone.Add(bone2); } binaryReader.Close(); this.TransformChildren(0); }
public void Load(string mypath, ClientType myclientType) { this.path = mypath; BinaryReader binaryReader = new BinaryReader(File.Open(mypath, FileMode.Open)); string text = RoseFile.ReadFString(ref binaryReader, 8); if (!text.Equals("ZMO0002\0")) { throw new Exception("wrong file header"); } this.FPS = binaryReader.ReadInt32(); this.frameCount = binaryReader.ReadInt32(); this.channelCount = binaryReader.ReadInt32(); for (int i = 0; i < this.channelCount; i++) { ZMO.Channel channel = new ZMO.Channel(); channel.trackType = (ZMO.TrackType)binaryReader.ReadInt32(); channel.trackID = binaryReader.ReadInt32(); if (channel.trackType == ZMO.TrackType.TRACK_TYPE_NORMAL) { channel.normal = new List <Vector3>(); } else if (channel.trackType == ZMO.TrackType.TRACK_TYPE_ROTATION) { channel.rotation = new List <Vector4>(); } else if (channel.trackType == ZMO.TrackType.TRACK_TYPE_POSITION) { channel.position = new List <Vector3>(); } else if (channel.trackType == ZMO.TrackType.TRACK_TYPE_ALPHA) { channel.alpha = new List <float>(); } else if (channel.trackType == ZMO.TrackType.TRACK_TYPE_UV1) { channel.uv1 = new List <Vector2>(); } else if (channel.trackType == ZMO.TrackType.TRACK_TYPE_UV2) { channel.uv2 = new List <Vector2>(); } else if (channel.trackType == ZMO.TrackType.TRACK_TYPE_UV3) { channel.uv3 = new List <Vector2>(); } else if (channel.trackType == ZMO.TrackType.TRACK_TYPE_UV4) { channel.uv4 = new List <Vector2>(); } else if (channel.trackType == ZMO.TrackType.TRACK_TYPE_TEXTUREANIM) { channel.textureAnim = new List <float>(); } else if (channel.trackType == ZMO.TrackType.TRACK_TYPE_SCALE) { channel.scale = new List <float>(); } this.listChannel.Add(channel); } for (int i = 0; i < this.frameCount; i++) { for (int j = 0; j < this.channelCount; j++) { if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_NORMAL) { this.listChannel[j].normal[i] = RoseFile.ReadVector3(ref binaryReader); } else if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_ROTATION) { this.listChannel[j].rotation[i] = RoseFile.ReadVector4(ref binaryReader); } else if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_POSITION) { this.listChannel[j].position.Add(RoseFile.ReadVector3(ref binaryReader)); } else if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_ALPHA) { this.listChannel[j].alpha[i] = binaryReader.ReadSingle(); } else if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_UV1) { this.listChannel[j].uv1[i] = RoseFile.ReadVector2(ref binaryReader); } else if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_UV2) { this.listChannel[j].uv2[i] = RoseFile.ReadVector2(ref binaryReader); } else if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_UV3) { this.listChannel[j].uv3[i] = RoseFile.ReadVector2(ref binaryReader); } else if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_UV4) { this.listChannel[j].uv4[i] = RoseFile.ReadVector2(ref binaryReader); } else if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_TEXTUREANIM) { this.listChannel[j].textureAnim[i] = binaryReader.ReadSingle(); } else if (this.listChannel[j].trackType == ZMO.TrackType.TRACK_TYPE_SCALE) { this.listChannel[j].scale[i] = binaryReader.ReadSingle(); } } } binaryReader.Close(); }
public void Load(string path, ClientType clientType) { BinaryReader binaryReader = new BinaryReader(File.Open(path, FileMode.Open)); int num = binaryReader.ReadInt32(); int[] array = new int[num]; int[] array2 = new int[num]; for (int i = 0; i < num; i++) { array[i] = binaryReader.ReadInt32(); array2[i] = binaryReader.ReadInt32(); } for (int i = 0; i < num; i++) { binaryReader.BaseStream.Seek((long)array2[i], SeekOrigin.Begin); if (array[i] == 0) { ZON.BasicInfoBlock basicInfoBlock = new ZON.BasicInfoBlock(); basicInfoBlock.zoneType = binaryReader.ReadInt32(); basicInfoBlock.zoneWidth = binaryReader.ReadInt32(); basicInfoBlock.zoneHeight = binaryReader.ReadInt32(); basicInfoBlock.gridCount = binaryReader.ReadInt32(); basicInfoBlock.gridSize = binaryReader.ReadSingle(); basicInfoBlock.xCount = binaryReader.ReadInt32(); basicInfoBlock.yCount = binaryReader.ReadInt32(); basicInfoBlock.zones = new ZON.BasicInfoBlock.Zone[basicInfoBlock.zoneWidth, basicInfoBlock.zoneHeight]; for (int j = 0; j < basicInfoBlock.zoneWidth; j++) { for (int k = 0; k < basicInfoBlock.zoneHeight; k++) { basicInfoBlock.zones[j, k].useMap = binaryReader.ReadByte(); basicInfoBlock.zones[j, k].x = binaryReader.ReadSingle(); basicInfoBlock.zones[j, k].y = binaryReader.ReadSingle(); } } this.listBasicBlock.Add(basicInfoBlock); } else if (array[i] == 1) { ZON.EventPointBlock eventPointBlock = new ZON.EventPointBlock(); eventPointBlock.listEntry = new List <ZON.EventPointBlock.Entry>(); int num2 = binaryReader.ReadInt32(); for (int j = 0; j < num2; j++) { ZON.EventPointBlock.Entry item = default(ZON.EventPointBlock.Entry); item.vect = RoseFile.ReadVector3(ref binaryReader); item.name = RoseFile.ReadBString(ref binaryReader); eventPointBlock.listEntry.Add(item); } this.listEventBlock.Add(eventPointBlock); } else if (array[i] == 2) { ZON.TextureBlock textureBlock = new ZON.TextureBlock(); int num2 = binaryReader.ReadInt32(); textureBlock.texturePath = new string[num2]; for (int j = 0; j < num2; j++) { textureBlock.texturePath[j] = RoseFile.ReadBString(ref binaryReader); } this.listTextureBlock.Add(textureBlock); } else if (array[i] == 3) { ZON.TileListBlock tileListBlock = new ZON.TileListBlock(); tileListBlock.listTileEntry = new List <ZON.TileListBlock.TileEntry>(); int num2 = binaryReader.ReadInt32(); for (int j = 0; j < num2; j++) { ZON.TileListBlock.TileEntry item2 = default(ZON.TileListBlock.TileEntry); item2.base1 = binaryReader.ReadInt32(); item2.base2 = binaryReader.ReadInt32(); item2.offest1 = binaryReader.ReadInt32(); item2.offest2 = binaryReader.ReadInt32(); item2.isBlending = binaryReader.ReadInt32(); item2.orientation = binaryReader.ReadInt32(); item2.tileType = binaryReader.ReadInt32(); tileListBlock.listTileEntry.Add(item2); } this.listTileBlock.Add(tileListBlock); } else if (array[i] == 4) { } } binaryReader.Close(); }
public void Load(string Path, ClientType myClientType) { this.path = Path; this.clientType = myClientType; BinaryReader binaryReader = new BinaryReader(File.Open(this.path, FileMode.Open)); binaryReader.BaseStream.Seek(8L, SeekOrigin.Begin); int num = binaryReader.ReadInt32(); binaryReader.BaseStream.Seek(24L, SeekOrigin.Current); this.boneCount = binaryReader.ReadInt16(); this.boneLookUp = new short[(int)this.boneCount]; for (int i = 0; i < (int)this.boneCount; i++) { this.boneLookUp[i] = binaryReader.ReadInt16(); } this.vertCount = binaryReader.ReadInt16(); this.vertex = new ObjectVertex[(int)this.vertCount]; if ((num & 2) > 0) { for (int i = 0; i < (int)this.vertCount; i++) { this.vertex[i].Position = RoseFile.ReadVector3(ref binaryReader); } } if ((num & 4) > 0) { binaryReader.BaseStream.Seek((long)(12 * this.vertCount), SeekOrigin.Current); } if ((num & 8) > 0) { binaryReader.BaseStream.Seek((long)(4 * this.vertCount), SeekOrigin.Current); } if ((num & 16) > 0 && (num & 32) > 0) { this.vertexWeight = new ZMS.Weight[(int)this.vertCount]; this.vertexBoneID = new ZMS.BoneID[(int)this.vertCount]; for (int i = 0; i < (int)this.vertCount; i++) { this.vertexWeight[i].Weight1 = binaryReader.ReadSingle(); this.vertexWeight[i].Weight2 = binaryReader.ReadSingle(); this.vertexWeight[i].Weight3 = binaryReader.ReadSingle(); this.vertexWeight[i].Weight4 = binaryReader.ReadSingle(); this.vertexBoneID[i].BoneId1 = binaryReader.ReadInt16(); this.vertexBoneID[i].BoneId2 = binaryReader.ReadInt16(); this.vertexBoneID[i].BoneId3 = binaryReader.ReadInt16(); this.vertexBoneID[i].BoneId4 = binaryReader.ReadInt16(); } } if ((num & 64) > 0) { binaryReader.BaseStream.Seek((long)(12 * this.vertCount), SeekOrigin.Current); } if ((num & 128) > 0) { for (int i = 0; i < (int)this.vertCount; i++) { this.vertex[i].TextureCoordinate = RoseFile.ReadVector2(ref binaryReader); } } if ((num & 256) > 0) { binaryReader.BaseStream.Seek((long)(8 * this.vertCount), SeekOrigin.Current); } if ((num & 512) > 0) { } if ((num & 1024) > 0) { } this.faceCount = binaryReader.ReadInt16(); this.indices = new short[(int)(this.faceCount * 3)]; for (int i = 0; i < (int)this.faceCount; i++) { this.indices[i * 3] = binaryReader.ReadInt16(); this.indices[i * 3 + 1] = binaryReader.ReadInt16(); this.indices[i * 3 + 2] = binaryReader.ReadInt16(); } this.vertexBuffer = new VertexBuffer(this.graphics, (int)(20 * this.vertCount), BufferUsage.WriteOnly); this.vertexBuffer.SetData <ObjectVertex>(this.vertex); this.indexBuffer = new IndexBuffer(this.graphics, typeof(short), this.indices.Length, BufferUsage.None); this.indexBuffer.SetData <short>(this.indices); binaryReader.Close(); }
public void Load(string path, ClientType type) { BinaryReader binaryReader = new BinaryReader(File.Open(path, FileMode.Open)); int num = binaryReader.ReadInt32(); IFO.BlockType[] array = new IFO.BlockType[num]; int[] array2 = new int[num]; for (int i = 0; i < num; i++) { array[i] = (IFO.BlockType)binaryReader.ReadInt32(); array2[i] = binaryReader.ReadInt32(); } for (int i = 0; i < num; i++) { binaryReader.BaseStream.Seek((long)array2[i], SeekOrigin.Begin); if (array[i] == IFO.BlockType.ECONOMY_DATA) { IFO.EconomyDataBlock economyDataBlock = new IFO.EconomyDataBlock(); economyDataBlock.width = binaryReader.ReadInt32(); economyDataBlock.height = binaryReader.ReadInt32(); economyDataBlock.mapCellX = binaryReader.ReadInt32(); economyDataBlock.mapCellY = binaryReader.ReadInt32(); economyDataBlock.unused = new float[4, 4]; binaryReader.BaseStream.Seek(64L, SeekOrigin.Current); economyDataBlock.name = RoseFile.ReadBString(ref binaryReader); this.listEconomyBlock.Add(economyDataBlock); } else if (array[i] == IFO.BlockType.DECORATIONS) { IFO.DecorationBlock item = default(IFO.DecorationBlock); int num2 = binaryReader.ReadInt32(); item.listDecoration = new List <IFO.BasicEntry>(); for (int j = 0; j < num2; j++) { IFO.BasicEntry basicEntry = new IFO.BasicEntry(); basicEntry.data = RoseFile.ReadBString(ref binaryReader); basicEntry.warpID = binaryReader.ReadInt16(); basicEntry.eventID = binaryReader.ReadInt16(); basicEntry.objectType = binaryReader.ReadInt32(); basicEntry.objectID = binaryReader.ReadInt32(); basicEntry.mapPositionX = binaryReader.ReadInt32(); basicEntry.mapPositionY = binaryReader.ReadInt32(); basicEntry.rotation = RoseFile.ReadVector4(ref binaryReader); basicEntry.position = RoseFile.ReadVector3(ref binaryReader); basicEntry.scale = RoseFile.ReadVector3(ref binaryReader); item.listDecoration.Add(basicEntry); } this.listDecorationBlock.Add(item); } else if (array[i] == IFO.BlockType.NPC_SPAWNS) { IFO.NpcBlock npcBlock = new IFO.NpcBlock(); int num2 = binaryReader.ReadInt32(); npcBlock.listNPC = new List <IFO.NpcBlock.NpcEntry>(); for (int j = 0; j < num2; j++) { IFO.NpcBlock.NpcEntry npcEntry = new IFO.NpcBlock.NpcEntry(); npcEntry.data = RoseFile.ReadBString(ref binaryReader); npcEntry.warpID = binaryReader.ReadInt16(); npcEntry.eventID = binaryReader.ReadInt16(); npcEntry.objectType = binaryReader.ReadInt32(); npcEntry.objectID = binaryReader.ReadInt32(); npcEntry.mapPositionX = binaryReader.ReadInt32(); npcEntry.mapPositionY = binaryReader.ReadInt32(); npcEntry.rotation = RoseFile.ReadVector4(ref binaryReader); npcEntry.position = RoseFile.ReadVector3(ref binaryReader); npcEntry.scale = RoseFile.ReadVector3(ref binaryReader); npcEntry.aiPartenIndex = binaryReader.ReadInt32(); npcEntry.conFilePath = RoseFile.ReadBString(ref binaryReader); npcBlock.listNPC.Add(npcEntry); } this.listNpcBlock.Add(npcBlock); } else if (array[i] == IFO.BlockType.BUILDINGS) { IFO.BuildingBlock buildingBlock = new IFO.BuildingBlock(); int num2 = binaryReader.ReadInt32(); buildingBlock.listBuilding = new List <IFO.BasicEntry>(); for (int j = 0; j < num2; j++) { IFO.BasicEntry basicEntry = new IFO.BasicEntry(); basicEntry.data = RoseFile.ReadBString(ref binaryReader); basicEntry.warpID = binaryReader.ReadInt16(); basicEntry.eventID = binaryReader.ReadInt16(); basicEntry.objectType = binaryReader.ReadInt32(); basicEntry.objectID = binaryReader.ReadInt32(); basicEntry.mapPositionX = binaryReader.ReadInt32(); basicEntry.mapPositionY = binaryReader.ReadInt32(); basicEntry.rotation = RoseFile.ReadVector4(ref binaryReader); basicEntry.position = RoseFile.ReadVector3(ref binaryReader); basicEntry.scale = RoseFile.ReadVector3(ref binaryReader); buildingBlock.listBuilding.Add(basicEntry); } this.listBuildingBlock.Add(buildingBlock); } else if (array[i] == IFO.BlockType.SOUND_EFFECTS) { IFO.SoundEffectBlock soundEffectBlock = new IFO.SoundEffectBlock(); int num2 = binaryReader.ReadInt32(); soundEffectBlock.listSoundEffect = new List <IFO.SoundEffectBlock.SoundEffectEntry>(); for (int j = 0; j < num2; j++) { IFO.SoundEffectBlock.SoundEffectEntry soundEffectEntry = new IFO.SoundEffectBlock.SoundEffectEntry(); soundEffectEntry.data = RoseFile.ReadBString(ref binaryReader); soundEffectEntry.warpID = binaryReader.ReadInt16(); soundEffectEntry.eventID = binaryReader.ReadInt16(); soundEffectEntry.objectType = binaryReader.ReadInt32(); soundEffectEntry.objectID = binaryReader.ReadInt32(); soundEffectEntry.mapPositionX = binaryReader.ReadInt32(); soundEffectEntry.mapPositionY = binaryReader.ReadInt32(); soundEffectEntry.rotation = RoseFile.ReadVector4(ref binaryReader); soundEffectEntry.position = RoseFile.ReadVector3(ref binaryReader); soundEffectEntry.scale = RoseFile.ReadVector3(ref binaryReader); soundEffectEntry.soundPath = RoseFile.ReadBString(ref binaryReader); soundEffectEntry.range = binaryReader.ReadInt32(); soundEffectEntry.interval = binaryReader.ReadInt32(); soundEffectBlock.listSoundEffect.Add(soundEffectEntry); } this.listSoundEffectBlock.Add(soundEffectBlock); } else if (array[i] == IFO.BlockType.EFFECTS) { IFO.EffectBlock effectBlock = new IFO.EffectBlock(); int num2 = binaryReader.ReadInt32(); effectBlock.listEffect = new List <IFO.EffectBlock.EffectEntry>(); for (int j = 0; j < num2; j++) { IFO.EffectBlock.EffectEntry effectEntry = new IFO.EffectBlock.EffectEntry(); effectEntry.data = RoseFile.ReadBString(ref binaryReader); effectEntry.warpID = binaryReader.ReadInt16(); effectEntry.eventID = binaryReader.ReadInt16(); effectEntry.objectType = binaryReader.ReadInt32(); effectEntry.objectID = binaryReader.ReadInt32(); effectEntry.mapPositionX = binaryReader.ReadInt32(); effectEntry.mapPositionY = binaryReader.ReadInt32(); effectEntry.rotation = RoseFile.ReadVector4(ref binaryReader); effectEntry.position = RoseFile.ReadVector3(ref binaryReader); effectEntry.scale = RoseFile.ReadVector3(ref binaryReader); effectEntry.effectPath = RoseFile.ReadBString(ref binaryReader); effectBlock.listEffect.Add(effectEntry); } this.listEffectBlock.Add(effectBlock); } else if (array[i] == IFO.BlockType.ANIMATABLES) { IFO.AnimatablesBlock animatablesBlock = new IFO.AnimatablesBlock(); int num2 = binaryReader.ReadInt32(); animatablesBlock.listAnimatable = new List <IFO.BasicEntry>(); for (int j = 0; j < num2; j++) { IFO.BasicEntry basicEntry = new IFO.BasicEntry(); basicEntry.data = RoseFile.ReadBString(ref binaryReader); basicEntry.warpID = binaryReader.ReadInt16(); basicEntry.eventID = binaryReader.ReadInt16(); basicEntry.objectType = binaryReader.ReadInt32(); basicEntry.objectID = binaryReader.ReadInt32(); basicEntry.mapPositionX = binaryReader.ReadInt32(); basicEntry.mapPositionY = binaryReader.ReadInt32(); basicEntry.rotation = RoseFile.ReadVector4(ref binaryReader); basicEntry.position = RoseFile.ReadVector3(ref binaryReader); basicEntry.scale = RoseFile.ReadVector3(ref binaryReader); animatablesBlock.listAnimatable.Add(basicEntry); } this.listAnimatablesBlock.Add(animatablesBlock); } else if (array[i] == IFO.BlockType.WATERBIG) { IFO.WaterBigBlock waterBigBlock = new IFO.WaterBigBlock(); int num3 = binaryReader.ReadInt32(); int num4 = binaryReader.ReadInt32(); waterBigBlock.waterCells = new IFO.WaterBigBlock.WaterCell[num3, num4]; for (int j = 0; j < num3; j++) { for (int k = 0; k < num4; k++) { waterBigBlock.waterCells[j, k].use = binaryReader.ReadByte(); waterBigBlock.waterCells[j, k].height = binaryReader.ReadSingle(); waterBigBlock.waterCells[j, k].waterType = binaryReader.ReadInt32(); waterBigBlock.waterCells[j, k].waterIndex = binaryReader.ReadInt32(); waterBigBlock.waterCells[j, k].reserved = binaryReader.ReadInt32(); } } this.listWaterBigBlock.Add(waterBigBlock); } else if (array[i] != IFO.BlockType.MONSTER_SPAWNS) { if (array[i] == IFO.BlockType.WATER_PLANES) { IFO.WaterPlaneBlock waterPlaneBlock = new IFO.WaterPlaneBlock(); waterPlaneBlock.basic = binaryReader.ReadSingle(); int num2 = binaryReader.ReadInt32(); waterPlaneBlock.watersEntries = new IFO.WaterPlaneBlock.WaterEntry[num2]; for (int j = 0; j < num2; j++) { waterPlaneBlock.watersEntries[j] = new IFO.WaterPlaneBlock.WaterEntry(); waterPlaneBlock.watersEntries[j].start = RoseFile.ReadVector3(ref binaryReader); waterPlaneBlock.watersEntries[j].end = RoseFile.ReadVector3(ref binaryReader); } this.listWaterPlaneBlock.Add(waterPlaneBlock); } else if (array[i] == IFO.BlockType.WARP_GATES) { IFO.WarpGateBlock warpGateBlock = new IFO.WarpGateBlock(); int num2 = binaryReader.ReadInt32(); warpGateBlock.listWarpGate = new List <IFO.BasicEntry>(); for (int j = 0; j < num2; j++) { IFO.BasicEntry basicEntry = new IFO.BasicEntry(); basicEntry.data = RoseFile.ReadBString(ref binaryReader); basicEntry.warpID = binaryReader.ReadInt16(); basicEntry.eventID = binaryReader.ReadInt16(); basicEntry.objectType = binaryReader.ReadInt32(); basicEntry.objectID = binaryReader.ReadInt32(); basicEntry.mapPositionX = binaryReader.ReadInt32(); basicEntry.mapPositionY = binaryReader.ReadInt32(); basicEntry.rotation = RoseFile.ReadVector4(ref binaryReader); basicEntry.position = RoseFile.ReadVector3(ref binaryReader); basicEntry.scale = RoseFile.ReadVector3(ref binaryReader); warpGateBlock.listWarpGate.Add(basicEntry); } this.listWarpGateBlock.Add(warpGateBlock); } else if (array[i] == IFO.BlockType.COLLISION_BLOCK) { IFO.CollisionBlock collisionBlock = new IFO.CollisionBlock(); int num2 = binaryReader.ReadInt32(); collisionBlock.listCollision = new List <IFO.BasicEntry>(); for (int j = 0; j < num2; j++) { IFO.BasicEntry basicEntry = new IFO.BasicEntry(); basicEntry.data = RoseFile.ReadBString(ref binaryReader); basicEntry.warpID = binaryReader.ReadInt16(); basicEntry.eventID = binaryReader.ReadInt16(); basicEntry.objectType = binaryReader.ReadInt32(); basicEntry.objectID = binaryReader.ReadInt32(); basicEntry.mapPositionX = binaryReader.ReadInt32(); basicEntry.mapPositionY = binaryReader.ReadInt32(); basicEntry.rotation = RoseFile.ReadVector4(ref binaryReader); basicEntry.position = RoseFile.ReadVector3(ref binaryReader); basicEntry.scale = RoseFile.ReadVector3(ref binaryReader); collisionBlock.listCollision.Add(basicEntry); } this.listCollisionBlock.Add(collisionBlock); } else if (array[i] == IFO.BlockType.TRIGGERS) { IFO.TriggerBlock triggerBlock = new IFO.TriggerBlock(); int num2 = binaryReader.ReadInt32(); triggerBlock.listTrigger = new List <IFO.TriggerBlock.TriggerEntry>(); for (int j = 0; j < num2; j++) { IFO.TriggerBlock.TriggerEntry triggerEntry = new IFO.TriggerBlock.TriggerEntry(); triggerEntry.data = RoseFile.ReadBString(ref binaryReader); triggerEntry.warpID = binaryReader.ReadInt16(); triggerEntry.eventID = binaryReader.ReadInt16(); triggerEntry.objectType = binaryReader.ReadInt32(); triggerEntry.objectID = binaryReader.ReadInt32(); triggerEntry.mapPositionX = binaryReader.ReadInt32(); triggerEntry.mapPositionY = binaryReader.ReadInt32(); triggerEntry.rotation = RoseFile.ReadVector4(ref binaryReader); triggerEntry.position = RoseFile.ReadVector3(ref binaryReader); triggerEntry.scale = RoseFile.ReadVector3(ref binaryReader); triggerEntry.qsdTrigger = RoseFile.ReadBString(ref binaryReader); triggerEntry.luaTrigger = RoseFile.ReadBString(ref binaryReader); triggerBlock.listTrigger.Add(triggerEntry); } this.listTriggerBlock.Add(triggerBlock); } } } binaryReader.Close(); }