Changeset 5465 in orxonox.OLD for trunk/src/world_entities/terrain.cc
- Timestamp:
- Nov 2, 2005, 9:01:12 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/terrain.cc
r5415 r5465 21 21 #include "factory.h" 22 22 #include "spatial_separation.h" 23 24 #include "resource_manager.h" 23 25 24 26 using namespace std; … … 78 80 if( this->ssp) 79 81 delete ssp; 82 if (this->vegetation) 83 { 84 ResourceManager::getInstance()->unload(this->vegetation); 85 } 80 86 } 81 87 … … 87 93 this->objectList = 0; 88 94 this->ssp = NULL; 95 this->vegetation = NULL; 89 96 } 90 97 … … 94 101 static_cast<WorldEntity*>(this)->loadParams(root); 95 102 103 LoadParam<Terrain>(root, "vegetation", this, &Terrain::loadVegetation) 104 .describe("the fileName of the vegetation, that should be loaded onto this terrain. (must be relative to the data-dir)") ; 105 96 106 //LoadParam<Terrain>(root, "DebugTerrain", ); 97 107 } 108 109 void Terrain::loadVegetation(const char* vegetationFile) 110 { 111 if (this->vegetation) 112 ResourceManager::getInstance()->unload(this->vegetation, RP_LEVEL); 113 if (vegetationFile != NULL) 114 { 115 PRINTF(4)("fetching %s\n", vegetationFile); 116 this->vegetation = (Model*)ResourceManager::getInstance()->load(vegetationFile, OBJ, RP_CAMPAIGN); 117 } 118 else 119 this->vegetation = NULL; 120 } 121 122 98 123 99 124 void Terrain::draw () … … 114 139 else if (this->model) 115 140 this->model->draw(); 141 if (this->vegetation) 142 this->vegetation->draw(); 116 143 glPopMatrix(); 117 144
Note: See TracChangeset
for help on using the changeset viewer.