Changeset 9869 in orxonox.OLD for trunk/src/world_entities/terrain.cc
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/terrain.cc
r9406 r9869 18 18 #include "terrain.h" 19 19 20 #include "util/loading/resource_manager.h" 20 21 #include "util/loading/load_param.h" 21 22 #include "util/loading/factory.h" 22 23 #include "spatial_separation.h" 23 24 24 #include "util/loading/resource_manager.h"25 25 #include "model.h" 26 26 #include "network_game_manager.h" … … 32 32 33 33 #include "state.h" 34 35 36 37 CREATE_FACTORY(Terrain, CL_TERRAIN); 34 #include "debug.h" 35 36 #include "class_id_DEPRECATED.h" 37 ObjectListDefinitionID(Terrain, CL_TERRAIN); 38 CREATE_FACTORY(Terrain); 38 39 39 40 /** … … 88 89 Terrain::~Terrain () 89 90 { 90 if ( objectList)91 glDeleteLists(this-> objectList, 1);91 if (modelList) 92 glDeleteLists(this->modelList, 1); 92 93 if( this->ssp) 93 94 delete ssp; 94 if (this->vegetation)95 {96 ResourceManager::getInstance()->unload(this->vegetation);97 }98 95 99 96 if(this->heightMap) … … 104 101 void Terrain::init() 105 102 { 106 this-> setClassID(CL_TERRAIN, "Terrain");103 this->registerObject(this, Terrain::_objectList); 107 104 this->toList(OM_ENVIRON_NOTICK); 108 105 this->toReflectionList(); 109 106 110 this-> objectList = 0;107 this->modelList = 0; 111 108 this->ssp = NULL; 112 109 this->vegetation = NULL; … … 147 144 this->heightMap = NULL; 148 145 149 std::string hmName = Resource Manager::getFullName(heightMapFile);150 std::string hmColorName = Resource Manager::getFullName(colorMap);146 std::string hmName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(heightMapFile); 147 std::string hmColorName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(colorMap); 151 148 152 149 … … 180 177 PRINTF(4)("loadVegetation: %s\n", vegetationFile.c_str()); 181 178 if (this->vegetation) 182 ResourceManager::getInstance()->unload(this->vegetation, RP_LEVEL);179 this->vegetation = 0; 183 180 if (!vegetationFile.empty()) 184 181 { 185 182 PRINTF(4)("fetching %s\n", vegetationFile.c_str()); 186 this->vegetation = dynamic_cast<Model*>(ResourceManager::getInstance()->load(vegetationFile, OBJ, RP_CAMPAIGN)); 183 this->loadModel(vegetationFile, 1.0, 2); 184 this->vegetation = this->getModel(2); 187 185 } 188 186 else … … 206 204 //glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 207 205 208 if (this-> objectList)209 glCallList(this-> objectList);206 if (this->modelList) 207 glCallList(this->modelList); 210 208 else if (this->getModel()) 211 209 this->getModel()->draw(); … … 256 254 if (debugTerrain == TERRAIN_DAVE) 257 255 { 258 objectList = glGenLists(1);259 glNewList ( objectList, GL_COMPILE);256 modelList = glGenLists(1); 257 glNewList (modelList, GL_COMPILE); 260 258 261 259 glColor3f(1.0,0,0);
Note: See TracChangeset
for help on using the changeset viewer.