Changeset 7193 in orxonox.OLD for trunk/src/world_entities/world_entity.cc
- Timestamp:
- Mar 7, 2006, 5:05:50 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/world_entity.cc
r7125 r7193 22 22 #include "model.h" 23 23 #include "md2Model.h" 24 #include " resource_manager.h"25 #include " load_param.h"24 #include "util/loading/resource_manager.h" 25 #include "util/loading/load_param.h" 26 26 #include "vector.h" 27 27 #include "obb_tree.h" … … 86 86 if (this->healthWidget != NULL) 87 87 delete this->healthWidget; 88 89 88 } 90 89 … … 147 146 if (this->scaling <= 0.0) 148 147 { 148 PRINTF(1)("YOU GAVE ME A CRAPY SCALE resetting to 1.0\n"); 149 149 this->scaling = 1.0; 150 PRINTF(1)("YOU GAVE ME A CRAPY SCALE resetting to 1\n");151 150 } 152 151 if(strstr(fileName, ".obj")) 153 152 { 154 153 PRINTF(4)("fetching OBJ file: %s\n", fileName); 155 if (this->scaling == 1.0) 156 this->setModel((Model*)ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN), modelNumber); 157 else 158 this->setModel((Model*)ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN, this->scaling), modelNumber); 154 BaseObject* loadedModel = ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN, this->scaling); 155 if (loadedModel != NULL) 156 this->setModel(dynamic_cast<Model*>(loadedModel), modelNumber); 159 157 160 158 if( modelNumber == 0) … … 190 188 if (this->models[modelNumber] != NULL) 191 189 { 192 Resource* resource = ResourceManager::getInstance()->locateResourceByPointer( this->models[modelNumber]);190 Resource* resource = ResourceManager::getInstance()->locateResourceByPointer(dynamic_cast<BaseObject*>(this->models[modelNumber])); 193 191 if (resource != NULL) 194 192 ResourceManager::getInstance()->unload(resource, RP_LEVEL);
Note: See TracChangeset
for help on using the changeset viewer.