public void Read() { Header = new MHDR(); Header.Read(Data.GetChunkByName("MHDR").GetStream()); MapChunks = new MapChunk[16 * 16]; int mapChunkIndex = 0; foreach (var mapChunk in Data.Chunks.Where(c => c.Name == "MCNK")) { MapChunks[mapChunkIndex++] = new MapChunk(this, mapChunk); } LiquidHandler = new LiquidHandler(this); // do this seperate from map chunk initialization to access liquid data foreach (var mapChunk in MapChunks) { mapChunk.GenerateTriangles(); } DoodadHandler = new DoodadHandler(this); foreach (var mapChunk in MapChunks) { DoodadHandler.ProcessMapChunk(mapChunk); } WorldModelHandler = new WorldModelHandler(this); foreach (var mapChunk in MapChunks) { WorldModelHandler.ProcessMapChunk(mapChunk); } }
public void Read() { Header = new MHDR(); Header.Read(Data.GetChunkByName("MHDR").GetStream()); MapChunks = new MapChunk[16 * 16]; int mapChunkIndex = 0; foreach (var mapChunk in Data.Chunks.Where(c => c.Name == "MCNK")) MapChunks[mapChunkIndex++] = new MapChunk(this, mapChunk); LiquidHandler = new LiquidHandler(this); // do this seperate from map chunk initialization to access liquid data foreach (var mapChunk in MapChunks) mapChunk.GenerateTriangles(); DoodadHandler = new DoodadHandler(this); foreach (var mapChunk in MapChunks) DoodadHandler.ProcessMapChunk(mapChunk); WorldModelHandler = new WorldModelHandler(this); foreach (var mapChunk in MapChunks) WorldModelHandler.ProcessMapChunk(mapChunk); }