Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/world_entities/terrain.cc


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File:
1 edited

Legend:

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

    r9406 r9869  
    1818#include "terrain.h"
    1919
     20#include "util/loading/resource_manager.h"
    2021#include "util/loading/load_param.h"
    2122#include "util/loading/factory.h"
    2223#include "spatial_separation.h"
    2324
    24 #include "util/loading/resource_manager.h"
    2525#include "model.h"
    2626#include "network_game_manager.h"
     
    3232
    3333#include "state.h"
    34 
    35 
    36 
    37 CREATE_FACTORY(Terrain, CL_TERRAIN);
     34#include "debug.h"
     35
     36#include "class_id_DEPRECATED.h"
     37ObjectListDefinitionID(Terrain, CL_TERRAIN);
     38CREATE_FACTORY(Terrain);
    3839
    3940/**
     
    8889Terrain::~Terrain ()
    8990{
    90   if (objectList)
    91     glDeleteLists(this->objectList, 1);
     91  if (modelList)
     92    glDeleteLists(this->modelList, 1);
    9293  if( this->ssp)
    9394    delete ssp;
    94   if (this->vegetation)
    95   {
    96     ResourceManager::getInstance()->unload(this->vegetation);
    97   }
    9895
    9996  if(this->heightMap)
     
    104101void Terrain::init()
    105102{
    106   this->setClassID(CL_TERRAIN, "Terrain");
     103  this->registerObject(this, Terrain::_objectList);
    107104  this->toList(OM_ENVIRON_NOTICK);
    108105  this->toReflectionList();
    109106
    110   this->objectList = 0;
     107  this->modelList = 0;
    111108  this->ssp = NULL;
    112109  this->vegetation = NULL;
     
    147144  this->heightMap = NULL;
    148145
    149   std::string hmName = ResourceManager::getFullName(heightMapFile);
    150   std::string hmColorName = ResourceManager::getFullName(colorMap);
     146  std::string hmName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(heightMapFile);
     147  std::string hmColorName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(colorMap);
    151148
    152149
     
    180177  PRINTF(4)("loadVegetation: %s\n", vegetationFile.c_str());
    181178  if (this->vegetation)
    182     ResourceManager::getInstance()->unload(this->vegetation, RP_LEVEL);
     179    this->vegetation = 0;
    183180  if (!vegetationFile.empty())
    184181  {
    185182    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);
    187185  }
    188186  else
     
    206204  //glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    207205
    208   if (this->objectList)
    209     glCallList(this->objectList);
     206  if (this->modelList)
     207    glCallList(this->modelList);
    210208  else if (this->getModel())
    211209    this->getModel()->draw();
     
    256254  if (debugTerrain == TERRAIN_DAVE)
    257255  {
    258     objectList = glGenLists(1);
    259     glNewList (objectList, GL_COMPILE);
     256    modelList = glGenLists(1);
     257    glNewList (modelList, GL_COMPILE);
    260258
    261259    glColor3f(1.0,0,0);
Note: See TracChangeset for help on using the changeset viewer.