예제 #1
0
파일: ADT.cs 프로젝트: zneel/TheNoobBot
        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);
            }
        }
예제 #2
0
파일: ADT.cs 프로젝트: Bia10/meshReader
        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);
        }