Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/story_entities


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 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..

Location:
trunk/src/story_entities
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/campaign.cc

    r9406 r9869  
    2424
    2525#include "campaign_data.h"
     26#include "debug.h"
    2627
    2728
    2829
     30ObjectListDefinition(Campaign);
    2931
    3032/**
     
    3638Campaign::Campaign ( TiXmlElement* root)
    3739{
    38   this->setClassID(CL_CAMPAIGN, "Campaign");
     40  this->registerObject(this, Campaign::_objectList);
    3941
    4042  PRINTF(4)("Loading Campaign...\n");
  • trunk/src/story_entities/campaign.h

    r6874 r9869  
    1818class Campaign : public StoryEntity
    1919{
    20 
     20  ObjectListDeclaration(Campaign);
    2121  public:
    2222    Campaign( TiXmlElement* root);
  • trunk/src/story_entities/campaign_data.cc

    r9406 r9869  
    1818
    1919#include "util/loading/factory.h"
    20 #include "util/loading/load_param.h"
     20#include "util/loading/load_param_xml.h"
    2121
    2222#include "story_entity.h"
    2323
     24#include "debug.h"
    2425
    2526
    2627
     28ObjectListDefinition(CampaignData);
    2729
    2830/**
     
    3133CampaignData::CampaignData(const TiXmlElement* root)
    3234{
    33   this->setClassID(CL_CAMPAIGN_DATA, "CampaignData");
     35  this->registerObject(this, CampaignData::_objectList);
    3436
    3537  this->currentEntity = NULL;
  • trunk/src/story_entities/campaign_data.h

    r7370 r9869  
    1616class CampaignData : public DataTank
    1717{
     18  ObjectListDeclaration(CampaignData);
    1819
    1920public:
  • trunk/src/story_entities/dedicated_server_world.cc

    r9406 r9869  
    2121
    2222#include "util/loading/load_param.h"
    23 #include "fast_factory.h"
     23#include "loading/fast_factory.h"
    2424#include "util/loading/factory.h"
    2525
  • trunk/src/story_entities/game_world.cc

    r9494 r9869  
    2020#include "game_world_data.h"
    2121
    22 #include "util/loading/resource_manager.h"
    2322#include "state.h"
    24 #include "class_list.h"
    2523
    2624#include "util/loading/game_loader.h"
     
    3937
    4038#include "util/loading/factory.h"
    41 #include "util/loading/load_param.h"
    42 #include "fast_factory.h"
     39#include "util/loading/load_param_xml.h"
     40#include "loading/fast_factory.h"
    4341#include "shell_command.h"
    4442
    4543#include "graphics_engine.h"
    46 #include "effects/atmospheric_engine.h"
     44#include "weather_effects/atmospheric_engine.h"
    4745#include "event_handler.h"
    4846#include "sound_engine.h"
     
    5048#include "network_manager.h"
    5149#include "physics_engine.h"
    52 #include "fields.h"
    5350
    5451#include "glmenu_imagescreen.h"
     
    6360
    6461#include "script_class.h"
    65 CREATE_SCRIPTABLE_CLASS(GameWorld, CL_GAME_WORLD,
    66                         addMethod("setPlaymode", ExecutorLua1<GameWorld,const std::string&>(&GameWorld::setPlaymode))
    67                         ->addMethod("setSoundtrack", ExecutorLua1<GameWorld, const std::string&>(&GameWorld::setSoundtrack))
     62ObjectListDefinition(GameWorld);
     63CREATE_SCRIPTABLE_CLASS(GameWorld,
     64                        addMethod("setPlaymode", Executor1<GameWorld, lua_State*,const std::string&>(&GameWorld::setPlaymode))
     65                        ->addMethod("setSoundtrack", Executor1<GameWorld, lua_State*, const std::string&>(&GameWorld::setSoundtrack))
    6866                       );
    6967
     
    7775
    7876
    79 
    8077GameWorld::GameWorld()
    8178    : StoryEntity()
    8279{
    83   this->setClassID(CL_GAME_WORLD, "GameWorld");
     80  this->registerObject(this, GameWorld::_objectList);
    8481  this->setName("Preloaded World - no name yet");
    8582
     
    154151
    155152
    156   PRINTF(0)("Loading the GameWorld\n");
     153  PRINTF(4)("Loading the GameWorld\n");
    157154
    158155  PRINTF(3)("> Loading world: '%s'\n", getLoadFile().c_str());
     
    339336  }
    340337
    341   PRINTF(0)("GameWorld::mainLoop() - Exiting the main loop\n");
     338  PRINTF(4)("GameWorld::mainLoop() - Exiting the main loop\n");
    342339}
    343340
     
    416413    if (currentFrame - this->lastFrame < .01)
    417414    {
    418       SDL_Delay(1000.0 * (0.01 - (currentFrame - lastFrame)));
     415      SDL_Delay((int)(1000.0 * (0.01 - (currentFrame - lastFrame))));
    419416      currentFrame = Timer::getNow();
    420417    }
     
    432429    // TICK everything
    433430    for (i = 0; i < this->dataTank->tickLists.size(); ++i)
    434       this->tick(this->dataTank->objectManager->getObjectList(this->dataTank->tickLists[i]), this->dtS);
     431      this->tick(this->dataTank->objectManager->getEntityList(this->dataTank->tickLists[i]), this->dtS);
    435432
    436433    /* update tick the rest */
     
    471468{
    472469  // object-object collision detection
    473   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    474       this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
    475   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    476       this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
    477   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    478       this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    479 
    480   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    481       this->dataTank->objectManager->getObjectList(OM_GROUP_02));
    482   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_02),
    483       this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
    484 
    485 
    486   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    487       this->dataTank->objectManager->getObjectList(OM_COMMON));
    488   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    489       this->dataTank->objectManager->getObjectList(OM_COMMON));
     470  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     471      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
     472  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     473      this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
     474  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     475      this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     476
     477  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     478      this->dataTank->objectManager->getEntityList(OM_GROUP_02));
     479  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_02),
     480      this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
     481
     482
     483  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     484      this->dataTank->objectManager->getEntityList(OM_COMMON));
     485  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     486      this->dataTank->objectManager->getEntityList(OM_COMMON));
    490487
    491488  // ground collision detection: BSP Model
    492   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    493   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
     489  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     490  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01));
    494491}
    495492
     
    567564  //  glLoadIdentity();
    568565
    569   const std::list<BaseObject*>* reflectedWaters;
    570566  MappedWater* mw;
    571567
    572   if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
    573   {
    574     std::list<BaseObject*>::const_iterator it;
    575     for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
    576     {
    577       mw =  dynamic_cast<MappedWater*>(*it);
    578 
    579       //camera and light
    580       //this->dataTank->localCamera->apply ();
    581       //this->dataTank->localCamera->project ();
    582 
    583       LightManager::getInstance()->draw();
    584 
    585 
    586       // prepare for reflection rendering
    587       mw->activateReflection();
    588 
    589       // draw everything to be included in the reflection
    590       this->drawEntityList(State::getObjectManager()->getReflectionList());
    591       //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    592       //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
    593 
    594       // clean up from reflection rendering
    595       mw->deactivateReflection();
    596     }
     568  for (ObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
     569       it != MappedWater::objectList().end();
     570       ++it)
     571  {
     572    mw =  (*it);
     573
     574    //camera and light
     575    //this->dataTank->localCamera->apply ();
     576    //this->dataTank->localCamera->project ();
     577
     578    LightManager::getInstance()->draw();
     579
     580
     581    // prepare for reflection rendering
     582    mw->activateReflection();
     583
     584    // draw everything to be included in the reflection
     585    this->drawEntityList(State::getObjectManager()->getReflectionList());
     586    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
     587    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
     588
     589    // clean up from reflection rendering
     590    mw->deactivateReflection();
    597591  }
    598592
     
    609603  //glLoadIdentity();
    610604
    611   const std::list<BaseObject*>* reflectedWaters;
    612605  MappedWater* mw;
    613606
    614   if( (reflectedWaters = ClassList::getList(CL_MAPPED_WATER)) != NULL)
    615   {
    616     std::list<BaseObject*>::const_iterator it;
    617     for (it = reflectedWaters->begin(); it != reflectedWaters->end(); it++)
    618     {
    619       mw =  dynamic_cast<MappedWater*>(*it);
    620 
    621       //camera and light
    622       //this->dataTank->localCamera->apply ();
    623       //this->dataTank->localCamera->project ();
    624       // prepare for reflection rendering
    625       mw->activateRefraction();
    626 
    627 
    628       LightManager::getInstance()->draw();
    629       // draw everything to be included in the reflection
    630       this->drawEntityList(State::getObjectManager()->getReflectionList());
    631       //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    632       //         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
    633 
    634       // clean up from reflection rendering
    635       mw->deactivateRefraction();
    636     }
     607  for (ObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin();
     608       it != MappedWater::objectList().end();
     609       ++it)
     610  {
     611    mw =  dynamic_cast<MappedWater*>(*it);
     612
     613    //camera and light
     614    //this->dataTank->localCamera->apply ();
     615    //this->dataTank->localCamera->project ();
     616    // prepare for reflection rendering
     617    mw->activateRefraction();
     618
     619
     620    LightManager::getInstance()->draw();
     621    // draw everything to be included in the reflection
     622    this->drawEntityList(State::getObjectManager()->getReflectionList());
     623    //       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
     624    //         this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
     625
     626    // clean up from reflection rendering
     627    mw->deactivateRefraction();
    637628  }
    638629}
     
    659650  {
    660651    /* Draw the BackGround */
    661     this->drawEntityList(State::getObjectManager()->getObjectList(OM_BACKGROUND));
     652    this->drawEntityList(State::getObjectManager()->getEntityList(OM_BACKGROUND));
    662653    engine->drawBackgroundElements();
    663654
    664655    /* draw all WorldEntiy groups */
    665656    for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    666       this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
     657      this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]));
    667658
    668659    AtmosphericEngine::getInstance()->draw();
     
    672663      CDEngine* engine = CDEngine::getInstance();
    673664      for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    674         engine->drawBV(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]), this->showBVLevel);
     665        engine->drawBV(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]), this->showBVLevel);
    675666    }
    676667
     
    702693 *  removes the loadscreen, and changes over to the game
    703694 */
    704 void GameWorld::releaseLoadScreen ()
     695void GameWorld::releaseLoadScreen()
    705696{
    706697  PRINTF(3)("GameWorld::releaseLoadScreen - start\n");
  • trunk/src/story_entities/game_world.h

    r9235 r9869  
    3131class GameWorld : public StoryEntity
    3232{
     33  ObjectListDeclaration(GameWorld);
     34
    3335public:
    3436  GameWorld ();
  • trunk/src/story_entities/game_world_data.cc

    r9406 r9869  
    2121#include "game_world_data.h"
    2222
     23#include "state.h"
     24#include "substring.h"
     25
     26#include "util/loading/game_loader.h"
    2327#include "util/loading/resource_manager.h"
    24 #include "state.h"
    25 #include "class_list.h"
    26 #include "substring.h"
    27 
    28 #include "util/loading/game_loader.h"
    2928
    3029#include "world_entity.h"
     
    4140
    4241#include "util/loading/factory.h"
    43 #include "fast_factory.h"
    44 #include "util/loading/load_param.h"
     42#include "loading/fast_factory.h"
     43#include "util/loading/load_param_xml.h"
    4544
    4645#include "graphics_engine.h"
    47 #include "effects/atmospheric_engine.h"
     46#include "graphics_effect.h"
     47#include "weather_effects/atmospheric_engine.h"
    4848#include "event_handler.h"
    4949#include "sound_engine.h"
     
    5151#include "network_manager.h"
    5252#include "physics_engine.h"
    53 #include "fields.h"
    5453
    5554#include "glmenu_imagescreen.h"
     
    6160
    6261
    63 
    64 
    65 
     62ObjectListDefinition(GameWorldData);
    6663/**
    6764 * constructor of the GameWorldData
     
    6966GameWorldData::GameWorldData()
    7067{
    71   this->setClassID(CL_GAME_WORLD_DATA, "GameWorldData");
     68  this->registerObject(this, GameWorldData::_objectList);
    7269
    7370  this->glmis = NULL;
     
    119116ErrorMessage GameWorldData::loadData(const TiXmlElement* root)
    120117{
     118  assert (root != NULL);
    121119  // load the parameters
    122120  // name
    123   std::string string = grabParameter( root, "name");
     121  std::string string = LoadParamBase::grabParameter( root, "name");
    124122  if( string.empty() )
    125123  {
     
    194192ErrorMessage GameWorldData::loadWorldEntities(const TiXmlElement* root)
    195193{
    196 
    197194  const TiXmlElement* element = root->FirstChildElement("WorldEntities");
    198195  bool mouseCaptured = EventHandler::getInstance()->grabbedEvents();
     
    215212
    216213      //todo do this more elegant
    217       if( element->Value() == "SkyBox" && created->isA(CL_SKYBOX))
     214      if( element->Value() == "SkyBox" && created->isA(SkyBox::staticClassID()))
    218215      {
    219216        this->sky = dynamic_cast<WorldEntity*>(created);
    220217        State::setSkyBox(dynamic_cast<SkyBox*>(this->sky));
    221218      }
    222       if( element->Value() == "Terrain" && created->isA(CL_TERRAIN))
     219      if( element->Value() == "Terrain" && created->isA(Terrain::staticClassID()))
    223220      {
    224221        this->terrain = dynamic_cast<Terrain*>(created);
     
    236233
    237234  Playable* playable;
    238   const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
    239   if (playableList != NULL && !playableList->empty())
     235  if (!Playable::objectList().empty())
    240236  {
    241237    /// TODO Make this also loadable
    242     playable = dynamic_cast<Playable*>(playableList->front());
    243     this->localPlayer->setPlayable(playable);
     238    this->localPlayer->setPlayable(Playable::objectList().front());
    244239  }
    245240
     
    280275  GraphicsEngine::getInstance()->displayFPS(false);
    281276  // erease everything that is left.
    282   // delete PNode::getNullParent(); // not needed as this is also done in the next step (and also much cleaner)
    283   const std::list<BaseObject*>* nodeList;
    284277  //secondary cleanup of PNodes;
    285   nodeList = ClassList::getList(CL_PARENT_NODE);
    286   if (nodeList != NULL)
    287     while (!nodeList->empty())
    288     {
    289       //    ClassList::debug( 3, CL_PARENT_NODE);
    290       //    PNode::getNullParent()->debugNode(0);
    291       //    printf("%s::%s\n", nodeList->front()->getClassCName(), nodeList->front()->getName());
    292       delete nodeList->front();
    293     }
     278  while (!PNode::objectList().empty())
     279    delete PNode::objectList().front();
     280
    294281  /* remove the player object */
    295282  if( this->localPlayer)
     
    302289  this->terrain = NULL;
    303290
    304   nodeList = ClassList::getList(CL_GRAPHICS_EFFECT);
    305   if (nodeList != NULL)
    306     while (!nodeList->empty())
    307       delete nodeList->front();
    308 
    309 
    310   nodeList = ClassList::getList(CL_ELEMENT_2D);
    311   if (nodeList != NULL)
    312     while (!nodeList->empty())
    313       delete nodeList->front();
     291  while (!GraphicsEffect::objectList().empty())
     292    delete GraphicsEffect::objectList().front();
     293
     294
     295  while (!Element2D::objectList().empty())
     296    delete Element2D::objectList().front();
    314297
    315298  // At this Point all the WorldEntites should be unloaded.
     
    318301
    319302  // unload the resources loaded in this Level !!
    320   ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
     303  /// FIXME TODO HACK!!
     304//  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
    321305
    322306  if (State::getObjectManager() == this->objectManager)
     
    395379  {
    396380    PRINTF(3)("Setting Sound Track to %s\n", name.c_str());
    397     std::string oggFile = ResourceManager::getFullName(name);
     381    std::string oggFile = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(name);
    398382    this->music = new OrxSound::OggPlayer(oggFile);
    399383    if (this->localPlayer != NULL)
     
    414398    PRINTF(2)("creating %s\n", element->Value());
    415399    BaseObject* created = Factory::fabricate(element);
    416     if (created != NULL && created->isA(CL_GAME_RULES))
     400    if (created != NULL && created->isA(GameRules::staticClassID()))
    417401    {
    418402      this->gameRule = dynamic_cast<GameRules*>(created);
  • trunk/src/story_entities/game_world_data.h

    r9406 r9869  
    3030class GameWorldData : public DataTank
    3131{
     32  ObjectListDeclaration(GameWorldData);
    3233  public:
    3334    GameWorldData();
  • trunk/src/story_entities/menu/game_menu.cc

    r9656 r9869  
    2222
    2323#include "state.h"
    24 #include "class_list.h"
    2524
    2625#include "util/loading/load_param.h"
    2726#include "util/loading/factory.h"
    28 #include "util/loading/resource_manager.h"
    2927
    3028#include "graphics_engine.h"
     
    4139#include "network_manager.h"
    4240
    43 #include "preferences.h"
    44 
     41#include "parser/preferences/preferences.h"
     42
     43#include "class_id_DEPRECATED.h"
    4544//! This creates a Factory to fabricate a GameMenu
    46 CREATE_FACTORY(GameMenu, CL_GAME_MENU);
    47 
     45ObjectListDefinitionID(GameMenu, CL_GAME_MENU);
     46CREATE_FACTORY(GameMenu);
    4847
    4948
     
    5150    : GameWorld()
    5251{
    53   this->setClassID(CL_GAME_MENU, "GameMenu");
     52  this->registerObject(this, GameMenu::_objectList);
    5453  this->setName("GameMenu uninitialized");
    5554
     
    191190      image->setForegroundColor(Color( 1,1,1,.6));
    192191
    193       const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);
    194       std::list<BaseObject*>::const_iterator it;
    195192      bool first = true;
    196       for( it = storyEntities->begin(); it != storyEntities->end(); it++)
     193      for(ObjectList<StoryEntity>::const_iterator it = StoryEntity::objectList().begin();
     194          it != StoryEntity::objectList().end();
     195          ++it)
    197196      {
    198         StoryEntity* se = dynamic_cast<StoryEntity*>(*it);
     197        StoryEntity* se = *it;
    199198        if( se->isContainedInMenu())
    200199        {
    201200
    202           printf("%s\n", se->getMenuScreenshoot().c_str());
     201          PRINTF(3)("Load image %s\n", se->getMenuScreenshoot().c_str());
    203202          OrxGui::GLGuiImageButton* button = new OrxGui::GLGuiImageButton(se->getName(), se->getStoryID(), se->getMenuScreenshoot(), image);
    204203          button->startLevel.connect(this, &GameMenu::startLevel);
  • trunk/src/story_entities/menu/game_menu.h

    r9406 r9869  
    2222class GameMenu : virtual public GameWorld, virtual public EventListener
    2323{
    24 
     24  ObjectListDeclaration(GameMenu);
    2525  public:
    2626    GameMenu(const TiXmlElement* root = NULL);
     
    4545    void showMultiPlayer();
    4646    void showOptionsMenu();
    47    
     47
    4848    void showClientMenu();
    4949    void connectToServer();
    50    
     50
    5151    void showServerMenu();
    5252    void createMasterServer();
     
    6969    void setSelectorSound(const std::string& selectorSound);
    7070
    71    
     71
    7272
    7373
     
    7676    OrxGui::GLGuiBox*                 levelsBox;
    7777    OrxGui::GLGuiBox*                 networkBox;
    78    
     78
    7979    OrxGui::GLGuiBox*                 clientNetworkBox;
    8080    OrxGui::GLGuiInputLine*           ipInputLine;
    81    
     81
    8282    OrxGui::GLGuiBox*                 serverNetworkBox;
    8383
  • trunk/src/story_entities/menu/glgui_imagebutton.cc

    r9406 r9869  
    1414*/
    1515
    16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SHELL
    1716
    1817#include "glgui_imagebutton.h"
     
    4544  void GLGuiImageButton::receivedFocus()
    4645  {
    47     printf("%s:: %s\n", this->label().c_str(), this->imageName.c_str());
     46    PRINTF(4)("%s:: %s\n", this->label().c_str(), this->imageName.c_str());
    4847
    4948    this->image->loadImageFromFile(this->imageName);
  • trunk/src/story_entities/movie_loader.cc

    r9406 r9869  
    2525
    2626
    27 
    28 CREATE_FACTORY(MovieLoader, CL_MOVIE_LOADER);
     27#include "class_id_DEPRECATED.h"
     28ObjectListDefinitionID(MovieLoader, CL_MOVIE_LOADER);
     29CREATE_FACTORY(MovieLoader);
    2930
    3031MovieLoader::MovieLoader(const TiXmlElement* root)
    3132{
    32   this->setClassID(CL_MOVIE_LOADER, "MovieLoader");
     33  this->registerObject(this, MovieLoader::_objectList);
    3334
    3435  movie_player = new MoviePlayer();
  • trunk/src/story_entities/movie_loader.h

    r7221 r9869  
    1515class MovieLoader : public StoryEntity, virtual public EventListener
    1616{
     17  ObjectListDeclaration(MovieLoader);
    1718  private:
    1819    MoviePlayer* movie_player;
  • trunk/src/story_entities/multi_player_world.cc

    r9656 r9869  
    3636SHELL_COMMAND(debug, MultiPlayerWorld, debug);
    3737
    38 
     38#include "class_id_DEPRECATED.h"
    3939//! This creates a Factory to fabricate a MultiPlayerWorld
    40 CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);
    41 
     40ObjectListDefinitionID(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);
     41CREATE_FACTORY(MultiPlayerWorld);
    4242
    4343MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root)
    4444  : GameWorld()
    4545{
    46   this->setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld");
     46  this->registerObject(this, MultiPlayerWorld::_objectList);
    4747
    4848  this->dataTank = new MultiPlayerWorldData();
     
    9595void MultiPlayerWorld::collisionDetection()
    9696{
    97   //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS), this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     97  //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS), this->dataTank->objectManager->getEntityList(OM_PLAYERS));
    9898
    9999  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
    100   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    101     this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
     100  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
     101    this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
    102102  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n");
    103   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    104     this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
     103  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
     104    this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
    105105  PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_PLAYERS_PROJ\n\n");
    106   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_PLAYERS),
    107     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     106  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS),
     107    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
    108108
    109   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    110   this->dataTank->objectManager->getObjectList(OM_PLAYERS));
    111   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    112   this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     109  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     110  this->dataTank->objectManager->getEntityList(OM_PLAYERS));
     111  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     112  this->dataTank->objectManager->getEntityList(OM_PLAYERS));
    113113
    114114
    115115
    116116  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01_PROJ\n\n");
    117   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    118     this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
     117  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     118    this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ));
    119119  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01\n\n");
    120   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    121     this->dataTank->objectManager->getObjectList(OM_GROUP_01));
    122   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    123     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     120  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     121    this->dataTank->objectManager->getEntityList(OM_GROUP_01));
     122  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00),
     123    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
    124124
    125125  PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_01 vs OM_GROUP_00_PROJ\n\n");
    126   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    127     this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
    128   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    129     this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    130   CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    131     this->dataTank->objectManager->getObjectList(OM_PLAYERS_PROJ));
     126  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     127    this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ));
     128  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     129    this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     130  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01),
     131    this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ));
    132132
    133133
    134134
    135135    // ground collision detection: BSP Model
    136   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_00));
    137   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_GROUP_01));
    138   CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getObjectList(OM_PLAYERS));
     136  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00));
     137  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01));
     138  CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_PLAYERS));
    139139}
    140140
  • trunk/src/story_entities/multi_player_world.h

    r8228 r9869  
    2020 */
    2121class MultiPlayerWorld : public GameWorld {
    22 
     22  ObjectListDeclaration(MultiPlayerWorld);
    2323 public:
    2424  MultiPlayerWorld (const TiXmlElement* root = NULL);
     
    2626
    2727  virtual void loadParams(const TiXmlElement* root);
    28  
     28
    2929  virtual ErrorMessage unloadData();
    3030
  • trunk/src/story_entities/multi_player_world_data.cc

    r9494 r9869  
    1818#include "multi_player_world_data.h"
    1919
    20 #include "util/loading/resource_manager.h"
    2120#include "state.h"
    22 #include "class_list.h"
    2321#include "substring.h"
    2422
     
    4038
    4139#include "util/loading/factory.h"
    42 #include "fast_factory.h"
     40#include "loading/fast_factory.h"
    4341#include "util/loading/load_param.h"
    4442
     
    5048
    5149#include "glmenu_imagescreen.h"
    52 
    53 
    54 
    55 
    5650
    5751
     
    313307{
    314308  PRINT(0)("==================================================\n");
     309
    315310  Playable* playable;
    316   const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
    317   assert(playableList != NULL);
    318   std::list<BaseObject*>::const_iterator entity;
    319 
    320 
    321 
    322   for (entity = playableList->begin(); entity != playableList->end(); entity++)
    323   {
    324     Playable* p = dynamic_cast<Playable*>(*entity);
     311
     312  for (ObjectList<Playable>::const_iterator entity = Playable::objectList().begin();
     313       entity != Playable::objectList().end();
     314      ++entity)
     315  {
     316    Playable* p = *entity;
    325317    PRINTF(0)("Got a playable, class: %s, name: %s, uid: %i\n", (*entity)->getClassCName(), (*entity)->getCName(), p->getUniqueID());
    326318  }
     
    329321  if( this->toggle)
    330322  {
    331     playable = dynamic_cast<Playable*>(playableList->front());
     323    playable = Playable::objectList().front();
    332324    this->localPlayer->setPlayable(playable);
    333325    this->toggle = !this->toggle;
     
    335327  else
    336328  {
    337     playable = dynamic_cast<Playable*>(playableList->back());
     329    playable = Playable::objectList().back();
    338330    this->localPlayer->setPlayable(playable);
    339331    this->toggle = !this->toggle;
  • trunk/src/story_entities/single_player_world.cc

    r9406 r9869  
    2020
    2121#include "state.h"
    22 #include "class_list.h"
     22#include "debug.h"
    2323
    2424#include "util/loading/load_param.h"
    25 #include "fast_factory.h"
     25#include "loading/fast_factory.h"
    2626#include "util/loading/factory.h"
    2727
     
    3030
    3131
    32 
    33 
    34 
     32#include "class_id_DEPRECATED.h"
    3533//! This creates a Factory to fabricate a SinglePlayerWorld
    36 CREATE_FACTORY(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
    37 
    38 
     34ObjectListDefinitionID(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD);
     35CREATE_FACTORY(SinglePlayerWorld);
    3936
    4037SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root)
    4138  : GameWorld()
    4239{
    43   this->setClassID(CL_SINGLE_PLAYER_WORLD, "SinglePlayerWorld");
     40  this->registerObject(this, SinglePlayerWorld::_objectList);
    4441  this->setName("SinglePlayerWorld uninitialized");
    4542
  • trunk/src/story_entities/single_player_world.h

    r6512 r9869  
    2222class SinglePlayerWorld : public GameWorld
    2323{
     24  ObjectListDeclaration(SinglePlayerWorld);
    2425
    2526  public:
  • trunk/src/story_entities/story_entity.cc

    r9406 r9869  
    2222#include "story_entity.h"
    2323
    24 #include "util/loading/load_param.h"
    25 #include "util/loading/resource_manager.h"
     24#include "loading/load_param.h"
     25#include "loading/resource_manager.h"
    2626
     27#include "debug.h"
    2728
    28 
    29 
     29ObjectListDefinition(StoryEntity);
    3030
    3131/**
     
    3434StoryEntity::StoryEntity ()
    3535{
    36   this->setClassID(CL_STORY_ENTITY, "StoryEntity");
     36  this->registerObject(this, StoryEntity::_objectList);
    3737
    3838  this->bInit = false;
     
    107107  }
    108108  else
    109     this->loadFile = ResourceManager::getFullName(fileName);
     109    this->loadFile = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName);
    110110
    111111  this->grabWorldInfo();
  • trunk/src/story_entities/story_entity.h

    r8717 r9869  
    2626class StoryEntity : virtual public BaseObject
    2727{
     28  ObjectListDeclaration(StoryEntity);
    2829
    2930public:
Note: See TracChangeset for help on using the changeset viewer.