private AddMeshes ( |
||
renderer | ||
path | string | |
package | ValveResourceFormat.Package | |
return | void |
internal void AddObjects(Renderer.Renderer renderer, string path, Package package) { var data = Resource.Blocks[BlockType.DATA] as NTRO; // Output is World_t we need to iterate m_worldNodes inside it. var worldNodes = (NTROArray)data.Output["m_worldNodes"]; if (worldNodes.Count > 0) { var nodeData = ((NTROValue <NTROStruct>)worldNodes[0]).Value; //TODO: Not be 0. var worldNode = ((NTROValue <string>)nodeData["m_worldNodePrefix"]).Value; if (worldNode != null) { var newResource = FileExtensions.LoadFileByAnyMeansNecessary(worldNode + ".vwnod_c", path, package); if (newResource == null) { Console.WriteLine("unable to load model " + worldNode + ".vwnod_c"); throw new Exception("WTF"); } var node = new WorldNode(newResource); node.AddMeshes(renderer, path, package); } } var entityLumps = (NTROArray)data.Output["m_entityLumps"]; foreach (var lump in entityLumps) { LoadEntities(lump, renderer, path, package); } }
internal void AddObjects(Renderer.Renderer renderer, string path, Package package) { var data = Resource.Blocks[BlockType.DATA] as NTRO; // Output is World_t we need to iterate m_worldNodes inside it. var worldNodes = (NTROArray)data.Output["m_worldNodes"]; if (worldNodes.Count > 0) { var nodeData = ((NTROValue<NTROStruct>)worldNodes[0]).Value; //TODO: Not be 0. var worldNode = ((NTROValue<string>)nodeData["m_worldNodePrefix"]).Value; if (worldNode != null) { var newResource = FileExtensions.LoadFileByAnyMeansNecessary(worldNode + ".vwnod_c", path, package); if (newResource == null) { Console.WriteLine("unable to load model " + worldNode + ".vwnod_c"); throw new Exception("WTF"); } var node = new WorldNode(newResource); node.AddMeshes(renderer, path, package); } } var entityLumps = (NTROArray)data.Output["m_entityLumps"]; foreach (var lump in entityLumps) { LoadEntities(lump, renderer, path, package); } }