Changeset 9709 in orxonox.OLD for branches/new_class_id/src/story_entities
- Timestamp:
- Aug 31, 2006, 10:51:08 PM (18 years ago)
- Location:
- branches/new_class_id/src/story_entities
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/story_entities/campaign.cc
r9406 r9709 27 27 28 28 29 NewObjectListDefinition(Campaign); 29 30 30 31 /** … … 36 37 Campaign::Campaign ( TiXmlElement* root) 37 38 { 38 this-> setClassID(CL_CAMPAIGN, "Campaign");39 this->registerObject(this, Campaign::_objectList); 39 40 40 41 PRINTF(4)("Loading Campaign...\n"); -
branches/new_class_id/src/story_entities/campaign.h
r6874 r9709 18 18 class Campaign : public StoryEntity 19 19 { 20 20 NewObjectListDeclaration(Campaign); 21 21 public: 22 22 Campaign( TiXmlElement* root); -
branches/new_class_id/src/story_entities/campaign_data.cc
r9406 r9709 25 25 26 26 27 NewObjectListDefinition(CampaignData); 27 28 28 29 /** … … 31 32 CampaignData::CampaignData(const TiXmlElement* root) 32 33 { 33 this-> setClassID(CL_CAMPAIGN_DATA, "CampaignData");34 this->registerObject(this, CampaignData::_objectList); 34 35 35 36 this->currentEntity = NULL; -
branches/new_class_id/src/story_entities/campaign_data.h
r7370 r9709 16 16 class CampaignData : public DataTank 17 17 { 18 NewObjectListDeclaration(CampaignData); 18 19 19 20 public: -
branches/new_class_id/src/story_entities/dedicated_server_world.cc
r9406 r9709 21 21 22 22 #include "util/loading/load_param.h" 23 #include " fast_factory.h"23 #include "loading/fast_factory.h" 24 24 #include "util/loading/factory.h" 25 25 -
branches/new_class_id/src/story_entities/game_world.cc
r9494 r9709 22 22 #include "util/loading/resource_manager.h" 23 23 #include "state.h" 24 #include "class_list.h"25 24 26 25 #include "util/loading/game_loader.h" … … 40 39 #include "util/loading/factory.h" 41 40 #include "util/loading/load_param.h" 42 #include " fast_factory.h"41 #include "loading/fast_factory.h" 43 42 #include "shell_command.h" 44 43 … … 63 62 64 63 #include "script_class.h" 65 CREATE_SCRIPTABLE_CLASS(GameWorld, CL_GAME_WORLD, 64 NewObjectListDefinition(GameWorld); 65 CREATE_SCRIPTABLE_CLASS(GameWorld, GameWorld::classID(), 66 66 addMethod("setPlaymode", ExecutorLua1<GameWorld,const std::string&>(&GameWorld::setPlaymode)) 67 67 ->addMethod("setSoundtrack", ExecutorLua1<GameWorld, const std::string&>(&GameWorld::setSoundtrack)) … … 77 77 78 78 79 80 79 GameWorld::GameWorld() 81 80 : StoryEntity() 82 81 { 83 this-> setClassID(CL_GAME_WORLD, "GameWorld");82 this->registerObject(this, GameWorld::_objectList); 84 83 this->setName("Preloaded World - no name yet"); 85 84 … … 432 431 // TICK everything 433 432 for (i = 0; i < this->dataTank->tickLists.size(); ++i) 434 this->tick(this->dataTank->objectManager->get ObjectList(this->dataTank->tickLists[i]), this->dtS);433 this->tick(this->dataTank->objectManager->getEntityList(this->dataTank->tickLists[i]), this->dtS); 435 434 436 435 /* update tick the rest */ … … 471 470 { 472 471 // object-object collision detection 473 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_00),474 this->dataTank->objectManager->get ObjectList(OM_GROUP_01_PROJ));475 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),476 this->dataTank->objectManager->get ObjectList(OM_GROUP_00_PROJ));477 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),478 this->dataTank->objectManager->get ObjectList(OM_GROUP_00));479 480 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),481 this->dataTank->objectManager->get ObjectList(OM_GROUP_02));482 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_02),483 this->dataTank->objectManager->get ObjectList(OM_GROUP_01_PROJ));484 485 486 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_00),487 this->dataTank->objectManager->get ObjectList(OM_COMMON));488 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),489 this->dataTank->objectManager->get ObjectList(OM_COMMON));472 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00), 473 this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ)); 474 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01), 475 this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ)); 476 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01), 477 this->dataTank->objectManager->getEntityList(OM_GROUP_00)); 478 479 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01), 480 this->dataTank->objectManager->getEntityList(OM_GROUP_02)); 481 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_02), 482 this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ)); 483 484 485 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00), 486 this->dataTank->objectManager->getEntityList(OM_COMMON)); 487 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_01), 488 this->dataTank->objectManager->getEntityList(OM_COMMON)); 490 489 491 490 // ground collision detection: BSP Model 492 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->get ObjectList(OM_GROUP_00));493 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->get ObjectList(OM_GROUP_01));491 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00)); 492 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01)); 494 493 } 495 494 … … 567 566 // glLoadIdentity(); 568 567 569 const std::list<BaseObject*>* reflectedWaters;570 568 MappedWater* mw; 571 569 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 } 570 for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin(); 571 it != MappedWater::objectList().end(); 572 ++it) 573 { 574 mw = (*it); 575 576 //camera and light 577 //this->dataTank->localCamera->apply (); 578 //this->dataTank->localCamera->project (); 579 580 LightManager::getInstance()->draw(); 581 582 583 // prepare for reflection rendering 584 mw->activateReflection(); 585 586 // draw everything to be included in the reflection 587 this->drawEntityList(State::getObjectManager()->getReflectionList()); 588 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 589 // this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i])); 590 591 // clean up from reflection rendering 592 mw->deactivateReflection(); 597 593 } 598 594 … … 609 605 //glLoadIdentity(); 610 606 611 const std::list<BaseObject*>* reflectedWaters;612 607 MappedWater* mw; 613 608 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 } 609 for (NewObjectList<MappedWater>::const_iterator it = MappedWater::objectList().begin(); 610 it != MappedWater::objectList().end(); 611 ++it) 612 { 613 mw = dynamic_cast<MappedWater*>(*it); 614 615 //camera and light 616 //this->dataTank->localCamera->apply (); 617 //this->dataTank->localCamera->project (); 618 // prepare for reflection rendering 619 mw->activateRefraction(); 620 621 622 LightManager::getInstance()->draw(); 623 // draw everything to be included in the reflection 624 this->drawEntityList(State::getObjectManager()->getReflectionList()); 625 // for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 626 // this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i])); 627 628 // clean up from reflection rendering 629 mw->deactivateRefraction(); 637 630 } 638 631 } … … 659 652 { 660 653 /* Draw the BackGround */ 661 this->drawEntityList(State::getObjectManager()->get ObjectList(OM_BACKGROUND));654 this->drawEntityList(State::getObjectManager()->getEntityList(OM_BACKGROUND)); 662 655 engine->drawBackgroundElements(); 663 656 664 657 /* draw all WorldEntiy groups */ 665 658 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 666 this->drawEntityList(State::getObjectManager()->get ObjectList(this->dataTank->drawLists[i]));659 this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i])); 667 660 668 661 AtmosphericEngine::getInstance()->draw(); … … 672 665 CDEngine* engine = CDEngine::getInstance(); 673 666 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 674 engine->drawBV(State::getObjectManager()->get ObjectList(this->dataTank->drawLists[i]), this->showBVLevel);667 engine->drawBV(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]), this->showBVLevel); 675 668 } 676 669 -
branches/new_class_id/src/story_entities/game_world.h
r9235 r9709 31 31 class GameWorld : public StoryEntity 32 32 { 33 NewObjectListDeclaration(GameWorld); 34 33 35 public: 34 36 GameWorld (); -
branches/new_class_id/src/story_entities/game_world_data.cc
r9406 r9709 23 23 #include "util/loading/resource_manager.h" 24 24 #include "state.h" 25 #include "class_list.h"26 25 #include "substring.h" 27 26 … … 41 40 42 41 #include "util/loading/factory.h" 43 #include " fast_factory.h"42 #include "loading/fast_factory.h" 44 43 #include "util/loading/load_param.h" 45 44 46 45 #include "graphics_engine.h" 46 #include "effects/graphics_effect.h" 47 47 #include "effects/atmospheric_engine.h" 48 48 #include "event_handler.h" … … 61 61 62 62 63 64 65 63 NewObjectListDefinition(GameWorldData); 66 64 /** 67 65 * constructor of the GameWorldData … … 69 67 GameWorldData::GameWorldData() 70 68 { 71 this-> setClassID(CL_GAME_WORLD_DATA, "GameWorldData");69 this->registerObject(this, GameWorldData::_objectList); 72 70 73 71 this->glmis = NULL; … … 215 213 216 214 //todo do this more elegant 217 if( element->Value() == "SkyBox" && created->isA( CL_SKYBOX))215 if( element->Value() == "SkyBox" && created->isA(SkyBox::classID())) 218 216 { 219 217 this->sky = dynamic_cast<WorldEntity*>(created); 220 218 State::setSkyBox(dynamic_cast<SkyBox*>(this->sky)); 221 219 } 222 if( element->Value() == "Terrain" && created->isA( CL_TERRAIN))220 if( element->Value() == "Terrain" && created->isA(Terrain::classID())) 223 221 { 224 222 this->terrain = dynamic_cast<Terrain*>(created); … … 236 234 237 235 Playable* playable; 238 const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE); 239 if (playableList != NULL && !playableList->empty()) 236 if (!Playable::objectList().empty()) 240 237 { 241 238 /// TODO Make this also loadable 242 playable = dynamic_cast<Playable*>(playableList->front()); 243 this->localPlayer->setPlayable(playable); 239 this->localPlayer->setPlayable(Playable::objectList().back()); 244 240 } 245 241 … … 280 276 GraphicsEngine::getInstance()->displayFPS(false); 281 277 // 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;284 278 //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 } 279 while (!PNode::objectList().empty()) 280 delete PNode::objectList().front(); 281 294 282 /* remove the player object */ 295 283 if( this->localPlayer) … … 302 290 this->terrain = NULL; 303 291 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(); 292 while (!GraphicsEffect::objectList().empty()) 293 delete GraphicsEffect::objectList().front(); 294 295 296 while (!Element2D::objectList().empty()) 297 delete Element2D::objectList().front(); 314 298 315 299 // At this Point all the WorldEntites should be unloaded. … … 414 398 PRINTF(2)("creating %s\n", element->Value()); 415 399 BaseObject* created = Factory::fabricate(element); 416 if (created != NULL && created->isA( CL_GAME_RULES))400 if (created != NULL && created->isA(GameRules::classID())) 417 401 { 418 402 this->gameRule = dynamic_cast<GameRules*>(created); -
branches/new_class_id/src/story_entities/game_world_data.h
r9406 r9709 30 30 class GameWorldData : public DataTank 31 31 { 32 NewObjectListDeclaration(GameWorldData); 32 33 public: 33 34 GameWorldData(); -
branches/new_class_id/src/story_entities/menu/game_menu.cc
r9656 r9709 22 22 23 23 #include "state.h" 24 #include "class_list.h"25 24 26 25 #include "util/loading/load_param.h" … … 43 42 #include "preferences.h" 44 43 44 #include "class_id.h" 45 45 //! This creates a Factory to fabricate a GameMenu 46 CREATE_FACTORY(GameMenu, CL_GAME_MENU);47 46 NewObjectListDefinitionID(GameMenu, CL_GAME_MENU); 47 CREATE_FACTORY(GameMenu); 48 48 49 49 … … 51 51 : GameWorld() 52 52 { 53 this-> setClassID(CL_GAME_MENU, "GameMenu");53 this->registerObject(this, GameMenu::_objectList); 54 54 this->setName("GameMenu uninitialized"); 55 55 … … 191 191 image->setForegroundColor(Color( 1,1,1,.6)); 192 192 193 const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);194 std::list<BaseObject*>::const_iterator it;195 193 bool first = true; 196 for( it = storyEntities->begin(); it != storyEntities->end(); it++) 194 for(NewObjectList<StoryEntity>::const_iterator it = StoryEntity::objectList().begin(); 195 it != StoryEntity::objectList().end(); 196 ++it) 197 197 { 198 StoryEntity* se = dynamic_cast<StoryEntity*>(*it);198 StoryEntity* se = *it; 199 199 if( se->isContainedInMenu()) 200 200 { -
branches/new_class_id/src/story_entities/menu/game_menu.h
r9406 r9709 22 22 class GameMenu : virtual public GameWorld, virtual public EventListener 23 23 { 24 24 NewObjectListDeclaration(GameMenu); 25 25 public: 26 26 GameMenu(const TiXmlElement* root = NULL); … … 45 45 void showMultiPlayer(); 46 46 void showOptionsMenu(); 47 47 48 48 void showClientMenu(); 49 49 void connectToServer(); 50 50 51 51 void showServerMenu(); 52 52 void createMasterServer(); … … 69 69 void setSelectorSound(const std::string& selectorSound); 70 70 71 71 72 72 73 73 … … 76 76 OrxGui::GLGuiBox* levelsBox; 77 77 OrxGui::GLGuiBox* networkBox; 78 78 79 79 OrxGui::GLGuiBox* clientNetworkBox; 80 80 OrxGui::GLGuiInputLine* ipInputLine; 81 81 82 82 OrxGui::GLGuiBox* serverNetworkBox; 83 83 -
branches/new_class_id/src/story_entities/movie_loader.cc
r9406 r9709 25 25 26 26 27 28 CREATE_FACTORY(MovieLoader, CL_MOVIE_LOADER); 27 #include "class_id.h" 28 NewObjectListDefinitionID(MovieLoader, CL_MOVIE_LOADER); 29 CREATE_FACTORY(MovieLoader); 29 30 30 31 MovieLoader::MovieLoader(const TiXmlElement* root) 31 32 { 32 this-> setClassID(CL_MOVIE_LOADER, "MovieLoader");33 this->registerObject(this, MovieLoader::_objectList); 33 34 34 35 movie_player = new MoviePlayer(); -
branches/new_class_id/src/story_entities/movie_loader.h
r7221 r9709 15 15 class MovieLoader : public StoryEntity, virtual public EventListener 16 16 { 17 NewObjectListDeclaration(MovieLoader); 17 18 private: 18 19 MoviePlayer* movie_player; -
branches/new_class_id/src/story_entities/multi_player_world.cc
r9656 r9709 36 36 SHELL_COMMAND(debug, MultiPlayerWorld, debug); 37 37 38 38 #include "class_id.h" 39 39 //! This creates a Factory to fabricate a MultiPlayerWorld 40 CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);41 40 NewObjectListDefinitionID(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD); 41 CREATE_FACTORY(MultiPlayerWorld); 42 42 43 43 MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root) 44 44 : GameWorld() 45 45 { 46 this-> setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld");46 this->registerObject(this, MultiPlayerWorld::_objectList); 47 47 48 48 this->dataTank = new MultiPlayerWorldData(); … … 95 95 void MultiPlayerWorld::collisionDetection() 96 96 { 97 //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_PLAYERS), this->dataTank->objectManager->getObjectList(OM_PLAYERS));97 //CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS), this->dataTank->objectManager->getEntityList(OM_PLAYERS)); 98 98 99 99 PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n"); 100 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_PLAYERS),101 this->dataTank->objectManager->get ObjectList(OM_GROUP_00_PROJ));100 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS), 101 this->dataTank->objectManager->getEntityList(OM_GROUP_00_PROJ)); 102 102 PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_GROUP_01_PROJ\n\n"); 103 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_PLAYERS),104 this->dataTank->objectManager->get ObjectList(OM_GROUP_01_PROJ));103 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS), 104 this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ)); 105 105 PRINTF(5)("\n-----------------------------------------\nchecking OM_PLAYERS vs OM_PLAYERS_PROJ\n\n"); 106 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_PLAYERS),107 this->dataTank->objectManager->get ObjectList(OM_PLAYERS_PROJ));106 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_PLAYERS), 107 this->dataTank->objectManager->getEntityList(OM_PLAYERS_PROJ)); 108 108 109 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_00),110 this->dataTank->objectManager->get ObjectList(OM_PLAYERS));111 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),112 this->dataTank->objectManager->get ObjectList(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)); 113 113 114 114 115 115 116 116 PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01_PROJ\n\n"); 117 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_00),118 this->dataTank->objectManager->get ObjectList(OM_GROUP_01_PROJ));117 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getEntityList(OM_GROUP_00), 118 this->dataTank->objectManager->getEntityList(OM_GROUP_01_PROJ)); 119 119 PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_00 vs OM_GROUP_01\n\n"); 120 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_00),121 this->dataTank->objectManager->get ObjectList(OM_GROUP_01));122 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_00),123 this->dataTank->objectManager->get ObjectList(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)); 124 124 125 125 PRINTF(5)("\n-----------------------------------------\nchecking OM_GROUP_01 vs OM_GROUP_00_PROJ\n\n"); 126 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),127 this->dataTank->objectManager->get ObjectList(OM_GROUP_00_PROJ));128 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),129 this->dataTank->objectManager->get ObjectList(OM_GROUP_00));130 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->get ObjectList(OM_GROUP_01),131 this->dataTank->objectManager->get ObjectList(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)); 132 132 133 133 134 134 135 135 // ground collision detection: BSP Model 136 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->get ObjectList(OM_GROUP_00));137 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->get ObjectList(OM_GROUP_01));138 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->get ObjectList(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)); 139 139 } 140 140 -
branches/new_class_id/src/story_entities/multi_player_world.h
r8228 r9709 20 20 */ 21 21 class MultiPlayerWorld : public GameWorld { 22 22 NewObjectListDeclaration(MultiPlayerWorld); 23 23 public: 24 24 MultiPlayerWorld (const TiXmlElement* root = NULL); … … 26 26 27 27 virtual void loadParams(const TiXmlElement* root); 28 28 29 29 virtual ErrorMessage unloadData(); 30 30 -
branches/new_class_id/src/story_entities/multi_player_world_data.cc
r9494 r9709 20 20 #include "util/loading/resource_manager.h" 21 21 #include "state.h" 22 #include "class_list.h"23 22 #include "substring.h" 24 23 … … 40 39 41 40 #include "util/loading/factory.h" 42 #include " fast_factory.h"41 #include "loading/fast_factory.h" 43 42 #include "util/loading/load_param.h" 44 43 … … 50 49 51 50 #include "glmenu_imagescreen.h" 52 53 54 55 56 51 57 52 … … 313 308 { 314 309 PRINT(0)("==================================================\n"); 310 315 311 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); 312 313 for (NewObjectList<Playable>::const_iterator entity = Playable::objectList().begin(); 314 entity != Playable::objectList().end(); 315 ++entity) 316 { 317 Playable* p = *entity; 325 318 PRINTF(0)("Got a playable, class: %s, name: %s, uid: %i\n", (*entity)->getClassCName(), (*entity)->getCName(), p->getUniqueID()); 326 319 } … … 329 322 if( this->toggle) 330 323 { 331 playable = dynamic_cast<Playable*>(playableList->front());324 playable = Playable::objectList().front(); 332 325 this->localPlayer->setPlayable(playable); 333 326 this->toggle = !this->toggle; … … 335 328 else 336 329 { 337 playable = dynamic_cast<Playable*>(playableList->back());330 playable = Playable::objectList().back(); 338 331 this->localPlayer->setPlayable(playable); 339 332 this->toggle = !this->toggle; -
branches/new_class_id/src/story_entities/single_player_world.cc
r9406 r9709 20 20 21 21 #include "state.h" 22 #include "class_list.h"23 22 24 23 #include "util/loading/load_param.h" 25 #include " fast_factory.h"24 #include "loading/fast_factory.h" 26 25 #include "util/loading/factory.h" 27 26 … … 30 29 31 30 32 33 34 31 #include "class_id.h" 35 32 //! This creates a Factory to fabricate a SinglePlayerWorld 36 CREATE_FACTORY(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD); 37 38 33 NewObjectListDefinitionID(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD); 34 CREATE_FACTORY(SinglePlayerWorld); 39 35 40 36 SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root) 41 37 : GameWorld() 42 38 { 43 this-> setClassID(CL_SINGLE_PLAYER_WORLD, "SinglePlayerWorld");39 this->registerObject(this, SinglePlayerWorld::_objectList); 44 40 this->setName("SinglePlayerWorld uninitialized"); 45 41 -
branches/new_class_id/src/story_entities/single_player_world.h
r6512 r9709 22 22 class SinglePlayerWorld : public GameWorld 23 23 { 24 NewObjectListDeclaration(SinglePlayerWorld); 24 25 25 26 public: -
branches/new_class_id/src/story_entities/story_entity.cc
r9406 r9709 27 27 28 28 29 29 NewObjectListDefinition(StoryEntity); 30 30 31 31 /** … … 34 34 StoryEntity::StoryEntity () 35 35 { 36 this-> setClassID(CL_STORY_ENTITY, "StoryEntity");36 this->registerObject(this, StoryEntity::_objectList); 37 37 38 38 this->bInit = false; -
branches/new_class_id/src/story_entities/story_entity.h
r8717 r9709 26 26 class StoryEntity : virtual public BaseObject 27 27 { 28 NewObjectListDeclaration(StoryEntity); 28 29 29 30 public:
Note: See TracChangeset
for help on using the changeset viewer.