Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7193 in orxonox.OLD for trunk/src/world_entities/world_entity.cc


Ignore:
Timestamp:
Mar 7, 2006, 5:05:50 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: new style for resources (prework/movement)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/world_entity.cc

    r7125 r7193  
    2222#include "model.h"
    2323#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"
    2626#include "vector.h"
    2727#include "obb_tree.h"
     
    8686  if (this->healthWidget != NULL)
    8787    delete this->healthWidget;
    88 
    8988}
    9089
     
    147146    if (this->scaling <= 0.0)
    148147    {
     148      PRINTF(1)("YOU GAVE ME A CRAPY SCALE resetting to 1.0\n");
    149149      this->scaling = 1.0;
    150       PRINTF(1)("YOU GAVE ME A CRAPY SCALE resetting to 1\n");
    151150    }
    152151    if(strstr(fileName, ".obj"))
    153152    {
    154153      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);
    159157
    160158      if( modelNumber == 0)
     
    190188  if (this->models[modelNumber] != NULL)
    191189  {
    192     Resource* resource = ResourceManager::getInstance()->locateResourceByPointer(this->models[modelNumber]);
     190    Resource* resource = ResourceManager::getInstance()->locateResourceByPointer(dynamic_cast<BaseObject*>(this->models[modelNumber]));
    193191    if (resource != NULL)
    194192      ResourceManager::getInstance()->unload(resource, RP_LEVEL);
Note: See TracChangeset for help on using the changeset viewer.