Changeset 9869 in orxonox.OLD for trunk/src/story_entities
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (18 years ago)
- Location:
- trunk/src/story_entities
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/campaign.cc
r9406 r9869 24 24 25 25 #include "campaign_data.h" 26 #include "debug.h" 26 27 27 28 28 29 30 ObjectListDefinition(Campaign); 29 31 30 32 /** … … 36 38 Campaign::Campaign ( TiXmlElement* root) 37 39 { 38 this-> setClassID(CL_CAMPAIGN, "Campaign");40 this->registerObject(this, Campaign::_objectList); 39 41 40 42 PRINTF(4)("Loading Campaign...\n"); -
trunk/src/story_entities/campaign.h
r6874 r9869 18 18 class Campaign : public StoryEntity 19 19 { 20 20 ObjectListDeclaration(Campaign); 21 21 public: 22 22 Campaign( TiXmlElement* root); -
trunk/src/story_entities/campaign_data.cc
r9406 r9869 18 18 19 19 #include "util/loading/factory.h" 20 #include "util/loading/load_param .h"20 #include "util/loading/load_param_xml.h" 21 21 22 22 #include "story_entity.h" 23 23 24 #include "debug.h" 24 25 25 26 26 27 28 ObjectListDefinition(CampaignData); 27 29 28 30 /** … … 31 33 CampaignData::CampaignData(const TiXmlElement* root) 32 34 { 33 this-> setClassID(CL_CAMPAIGN_DATA, "CampaignData");35 this->registerObject(this, CampaignData::_objectList); 34 36 35 37 this->currentEntity = NULL; -
trunk/src/story_entities/campaign_data.h
r7370 r9869 16 16 class CampaignData : public DataTank 17 17 { 18 ObjectListDeclaration(CampaignData); 18 19 19 20 public: -
trunk/src/story_entities/dedicated_server_world.cc
r9406 r9869 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 -
trunk/src/story_entities/game_world.cc
r9494 r9869 20 20 #include "game_world_data.h" 21 21 22 #include "util/loading/resource_manager.h"23 22 #include "state.h" 24 #include "class_list.h"25 23 26 24 #include "util/loading/game_loader.h" … … 39 37 40 38 #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" 43 41 #include "shell_command.h" 44 42 45 43 #include "graphics_engine.h" 46 #include " effects/atmospheric_engine.h"44 #include "weather_effects/atmospheric_engine.h" 47 45 #include "event_handler.h" 48 46 #include "sound_engine.h" … … 50 48 #include "network_manager.h" 51 49 #include "physics_engine.h" 52 #include "fields.h"53 50 54 51 #include "glmenu_imagescreen.h" … … 63 60 64 61 #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)) 62 ObjectListDefinition(GameWorld); 63 CREATE_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)) 68 66 ); 69 67 … … 77 75 78 76 79 80 77 GameWorld::GameWorld() 81 78 : StoryEntity() 82 79 { 83 this-> setClassID(CL_GAME_WORLD, "GameWorld");80 this->registerObject(this, GameWorld::_objectList); 84 81 this->setName("Preloaded World - no name yet"); 85 82 … … 154 151 155 152 156 PRINTF( 0)("Loading the GameWorld\n");153 PRINTF(4)("Loading the GameWorld\n"); 157 154 158 155 PRINTF(3)("> Loading world: '%s'\n", getLoadFile().c_str()); … … 339 336 } 340 337 341 PRINTF( 0)("GameWorld::mainLoop() - Exiting the main loop\n");338 PRINTF(4)("GameWorld::mainLoop() - Exiting the main loop\n"); 342 339 } 343 340 … … 416 413 if (currentFrame - this->lastFrame < .01) 417 414 { 418 SDL_Delay( 1000.0 * (0.01 - (currentFrame - lastFrame)));415 SDL_Delay((int)(1000.0 * (0.01 - (currentFrame - lastFrame)))); 419 416 currentFrame = Timer::getNow(); 420 417 } … … 432 429 // TICK everything 433 430 for (i = 0; i < this->dataTank->tickLists.size(); ++i) 434 this->tick(this->dataTank->objectManager->get ObjectList(this->dataTank->tickLists[i]), this->dtS);431 this->tick(this->dataTank->objectManager->getEntityList(this->dataTank->tickLists[i]), this->dtS); 435 432 436 433 /* update tick the rest */ … … 471 468 { 472 469 // 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));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)); 490 487 491 488 // 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));489 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_00)); 490 CDEngine::getInstance()->checkCollisionGround(this->dataTank->objectManager->getEntityList(OM_GROUP_01)); 494 491 } 495 492 … … 567 564 // glLoadIdentity(); 568 565 569 const std::list<BaseObject*>* reflectedWaters;570 566 MappedWater* mw; 571 567 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(); 597 591 } 598 592 … … 609 603 //glLoadIdentity(); 610 604 611 const std::list<BaseObject*>* reflectedWaters;612 605 MappedWater* mw; 613 606 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(); 637 628 } 638 629 } … … 659 650 { 660 651 /* Draw the BackGround */ 661 this->drawEntityList(State::getObjectManager()->get ObjectList(OM_BACKGROUND));652 this->drawEntityList(State::getObjectManager()->getEntityList(OM_BACKGROUND)); 662 653 engine->drawBackgroundElements(); 663 654 664 655 /* draw all WorldEntiy groups */ 665 656 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 666 this->drawEntityList(State::getObjectManager()->get ObjectList(this->dataTank->drawLists[i]));657 this->drawEntityList(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i])); 667 658 668 659 AtmosphericEngine::getInstance()->draw(); … … 672 663 CDEngine* engine = CDEngine::getInstance(); 673 664 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 674 engine->drawBV(State::getObjectManager()->get ObjectList(this->dataTank->drawLists[i]), this->showBVLevel);665 engine->drawBV(State::getObjectManager()->getEntityList(this->dataTank->drawLists[i]), this->showBVLevel); 675 666 } 676 667 … … 702 693 * removes the loadscreen, and changes over to the game 703 694 */ 704 void GameWorld::releaseLoadScreen 695 void GameWorld::releaseLoadScreen() 705 696 { 706 697 PRINTF(3)("GameWorld::releaseLoadScreen - start\n"); -
trunk/src/story_entities/game_world.h
r9235 r9869 31 31 class GameWorld : public StoryEntity 32 32 { 33 ObjectListDeclaration(GameWorld); 34 33 35 public: 34 36 GameWorld (); -
trunk/src/story_entities/game_world_data.cc
r9406 r9869 21 21 #include "game_world_data.h" 22 22 23 #include "state.h" 24 #include "substring.h" 25 26 #include "util/loading/game_loader.h" 23 27 #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"29 28 30 29 #include "world_entity.h" … … 41 40 42 41 #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" 45 44 46 45 #include "graphics_engine.h" 47 #include "effects/atmospheric_engine.h" 46 #include "graphics_effect.h" 47 #include "weather_effects/atmospheric_engine.h" 48 48 #include "event_handler.h" 49 49 #include "sound_engine.h" … … 51 51 #include "network_manager.h" 52 52 #include "physics_engine.h" 53 #include "fields.h"54 53 55 54 #include "glmenu_imagescreen.h" … … 61 60 62 61 63 64 65 62 ObjectListDefinition(GameWorldData); 66 63 /** 67 64 * constructor of the GameWorldData … … 69 66 GameWorldData::GameWorldData() 70 67 { 71 this-> setClassID(CL_GAME_WORLD_DATA, "GameWorldData");68 this->registerObject(this, GameWorldData::_objectList); 72 69 73 70 this->glmis = NULL; … … 119 116 ErrorMessage GameWorldData::loadData(const TiXmlElement* root) 120 117 { 118 assert (root != NULL); 121 119 // load the parameters 122 120 // name 123 std::string string = grabParameter( root, "name");121 std::string string = LoadParamBase::grabParameter( root, "name"); 124 122 if( string.empty() ) 125 123 { … … 194 192 ErrorMessage GameWorldData::loadWorldEntities(const TiXmlElement* root) 195 193 { 196 197 194 const TiXmlElement* element = root->FirstChildElement("WorldEntities"); 198 195 bool mouseCaptured = EventHandler::getInstance()->grabbedEvents(); … … 215 212 216 213 //todo do this more elegant 217 if( element->Value() == "SkyBox" && created->isA( CL_SKYBOX))214 if( element->Value() == "SkyBox" && created->isA(SkyBox::staticClassID())) 218 215 { 219 216 this->sky = dynamic_cast<WorldEntity*>(created); 220 217 State::setSkyBox(dynamic_cast<SkyBox*>(this->sky)); 221 218 } 222 if( element->Value() == "Terrain" && created->isA( CL_TERRAIN))219 if( element->Value() == "Terrain" && created->isA(Terrain::staticClassID())) 223 220 { 224 221 this->terrain = dynamic_cast<Terrain*>(created); … … 236 233 237 234 Playable* playable; 238 const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE); 239 if (playableList != NULL && !playableList->empty()) 235 if (!Playable::objectList().empty()) 240 236 { 241 237 /// TODO Make this also loadable 242 playable = dynamic_cast<Playable*>(playableList->front()); 243 this->localPlayer->setPlayable(playable); 238 this->localPlayer->setPlayable(Playable::objectList().front()); 244 239 } 245 240 … … 280 275 GraphicsEngine::getInstance()->displayFPS(false); 281 276 // 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 277 //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 294 281 /* remove the player object */ 295 282 if( this->localPlayer) … … 302 289 this->terrain = NULL; 303 290 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(); 314 297 315 298 // At this Point all the WorldEntites should be unloaded. … … 318 301 319 302 // unload the resources loaded in this Level !! 320 ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL); 303 /// FIXME TODO HACK!! 304 // ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL); 321 305 322 306 if (State::getObjectManager() == this->objectManager) … … 395 379 { 396 380 PRINTF(3)("Setting Sound Track to %s\n", name.c_str()); 397 std::string oggFile = Resource Manager::getFullName(name);381 std::string oggFile = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(name); 398 382 this->music = new OrxSound::OggPlayer(oggFile); 399 383 if (this->localPlayer != NULL) … … 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::staticClassID())) 417 401 { 418 402 this->gameRule = dynamic_cast<GameRules*>(created); -
trunk/src/story_entities/game_world_data.h
r9406 r9869 30 30 class GameWorldData : public DataTank 31 31 { 32 ObjectListDeclaration(GameWorldData); 32 33 public: 33 34 GameWorldData(); -
trunk/src/story_entities/menu/game_menu.cc
r9656 r9869 22 22 23 23 #include "state.h" 24 #include "class_list.h"25 24 26 25 #include "util/loading/load_param.h" 27 26 #include "util/loading/factory.h" 28 #include "util/loading/resource_manager.h"29 27 30 28 #include "graphics_engine.h" … … 41 39 #include "network_manager.h" 42 40 43 #include "preferences.h" 44 41 #include "parser/preferences/preferences.h" 42 43 #include "class_id_DEPRECATED.h" 45 44 //! This creates a Factory to fabricate a GameMenu 46 CREATE_FACTORY(GameMenu, CL_GAME_MENU);47 45 ObjectListDefinitionID(GameMenu, CL_GAME_MENU); 46 CREATE_FACTORY(GameMenu); 48 47 49 48 … … 51 50 : GameWorld() 52 51 { 53 this-> setClassID(CL_GAME_MENU, "GameMenu");52 this->registerObject(this, GameMenu::_objectList); 54 53 this->setName("GameMenu uninitialized"); 55 54 … … 191 190 image->setForegroundColor(Color( 1,1,1,.6)); 192 191 193 const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);194 std::list<BaseObject*>::const_iterator it;195 192 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) 197 196 { 198 StoryEntity* se = dynamic_cast<StoryEntity*>(*it);197 StoryEntity* se = *it; 199 198 if( se->isContainedInMenu()) 200 199 { 201 200 202 printf("%s\n", se->getMenuScreenshoot().c_str());201 PRINTF(3)("Load image %s\n", se->getMenuScreenshoot().c_str()); 203 202 OrxGui::GLGuiImageButton* button = new OrxGui::GLGuiImageButton(se->getName(), se->getStoryID(), se->getMenuScreenshoot(), image); 204 203 button->startLevel.connect(this, &GameMenu::startLevel); -
trunk/src/story_entities/menu/game_menu.h
r9406 r9869 22 22 class GameMenu : virtual public GameWorld, virtual public EventListener 23 23 { 24 24 ObjectListDeclaration(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 -
trunk/src/story_entities/menu/glgui_imagebutton.cc
r9406 r9869 14 14 */ 15 15 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SHELL17 16 18 17 #include "glgui_imagebutton.h" … … 45 44 void GLGuiImageButton::receivedFocus() 46 45 { 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()); 48 47 49 48 this->image->loadImageFromFile(this->imageName); -
trunk/src/story_entities/movie_loader.cc
r9406 r9869 25 25 26 26 27 28 CREATE_FACTORY(MovieLoader, CL_MOVIE_LOADER); 27 #include "class_id_DEPRECATED.h" 28 ObjectListDefinitionID(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(); -
trunk/src/story_entities/movie_loader.h
r7221 r9869 15 15 class MovieLoader : public StoryEntity, virtual public EventListener 16 16 { 17 ObjectListDeclaration(MovieLoader); 17 18 private: 18 19 MoviePlayer* movie_player; -
trunk/src/story_entities/multi_player_world.cc
r9656 r9869 36 36 SHELL_COMMAND(debug, MultiPlayerWorld, debug); 37 37 38 38 #include "class_id_DEPRECATED.h" 39 39 //! This creates a Factory to fabricate a MultiPlayerWorld 40 CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD);41 40 ObjectListDefinitionID(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 -
trunk/src/story_entities/multi_player_world.h
r8228 r9869 20 20 */ 21 21 class MultiPlayerWorld : public GameWorld { 22 22 ObjectListDeclaration(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 -
trunk/src/story_entities/multi_player_world_data.cc
r9494 r9869 18 18 #include "multi_player_world_data.h" 19 19 20 #include "util/loading/resource_manager.h"21 20 #include "state.h" 22 #include "class_list.h"23 21 #include "substring.h" 24 22 … … 40 38 41 39 #include "util/loading/factory.h" 42 #include " fast_factory.h"40 #include "loading/fast_factory.h" 43 41 #include "util/loading/load_param.h" 44 42 … … 50 48 51 49 #include "glmenu_imagescreen.h" 52 53 54 55 56 50 57 51 … … 313 307 { 314 308 PRINT(0)("==================================================\n"); 309 315 310 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; 325 317 PRINTF(0)("Got a playable, class: %s, name: %s, uid: %i\n", (*entity)->getClassCName(), (*entity)->getCName(), p->getUniqueID()); 326 318 } … … 329 321 if( this->toggle) 330 322 { 331 playable = dynamic_cast<Playable*>(playableList->front());323 playable = Playable::objectList().front(); 332 324 this->localPlayer->setPlayable(playable); 333 325 this->toggle = !this->toggle; … … 335 327 else 336 328 { 337 playable = dynamic_cast<Playable*>(playableList->back());329 playable = Playable::objectList().back(); 338 330 this->localPlayer->setPlayable(playable); 339 331 this->toggle = !this->toggle; -
trunk/src/story_entities/single_player_world.cc
r9406 r9869 20 20 21 21 #include "state.h" 22 #include " class_list.h"22 #include "debug.h" 23 23 24 24 #include "util/loading/load_param.h" 25 #include " fast_factory.h"25 #include "loading/fast_factory.h" 26 26 #include "util/loading/factory.h" 27 27 … … 30 30 31 31 32 33 34 32 #include "class_id_DEPRECATED.h" 35 33 //! This creates a Factory to fabricate a SinglePlayerWorld 36 CREATE_FACTORY(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD); 37 38 34 ObjectListDefinitionID(SinglePlayerWorld, CL_SINGLE_PLAYER_WORLD); 35 CREATE_FACTORY(SinglePlayerWorld); 39 36 40 37 SinglePlayerWorld::SinglePlayerWorld(const TiXmlElement* root) 41 38 : GameWorld() 42 39 { 43 this-> setClassID(CL_SINGLE_PLAYER_WORLD, "SinglePlayerWorld");40 this->registerObject(this, SinglePlayerWorld::_objectList); 44 41 this->setName("SinglePlayerWorld uninitialized"); 45 42 -
trunk/src/story_entities/single_player_world.h
r6512 r9869 22 22 class SinglePlayerWorld : public GameWorld 23 23 { 24 ObjectListDeclaration(SinglePlayerWorld); 24 25 25 26 public: -
trunk/src/story_entities/story_entity.cc
r9406 r9869 22 22 #include "story_entity.h" 23 23 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" 26 26 27 #include "debug.h" 27 28 28 29 29 ObjectListDefinition(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; … … 107 107 } 108 108 else 109 this->loadFile = Resource Manager::getFullName(fileName);109 this->loadFile = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath(fileName); 110 110 111 111 this->grabWorldInfo(); -
trunk/src/story_entities/story_entity.h
r8717 r9869 26 26 class StoryEntity : virtual public BaseObject 27 27 { 28 ObjectListDeclaration(StoryEntity); 28 29 29 30 public:
Note: See TracChangeset
for help on using the changeset viewer.