Changeset 6407 in orxonox.OLD for branches/network/src/story_entities
- Timestamp:
- Jan 4, 2006, 3:40:30 PM (19 years ago)
- Location:
- branches/network/src/story_entities
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/story_entities/campaign.cc
r6402 r6407 77 77 this->isRunning = true; 78 78 this->run(); 79 80 PRINTF(2)("There is no StoryEnity left to play, quitting\n");81 79 } 82 80 … … 130 128 131 129 this->currentEntity->init(); 130 132 131 this->currentEntity->loadData(); 133 132 this->currentEntity->start(); 134 133 this->currentEntity->unloadData(); 135 134 } 135 PRINTF(2)("There is no StoryEnity left to play, quitting\n"); 136 136 } 137 137 -
branches/network/src/story_entities/campaign_data.cc
r6404 r6407 33 33 34 34 this->currentEntity = NULL; 35 35 36 this->loadParams(root); 36 37 } … … 42 43 CampaignData::~CampaignData() 43 44 { 44 PRINTF( 3)("Deleting CampaignData\n");45 PRINTF(4)("Deleting CampaignData\n"); 45 46 while( !this->storyEntities.empty()) 46 47 { 47 48 StoryEntity* bo = this->storyEntities.back(); 48 49 this->storyEntities.pop_back(); 49 PRINTF( 3)("CampaignData is been deleted: nr %i\n", bo->getStoryID());50 PRINTF(4)("CampaignData is been deleted: nr %i\n", bo->getStoryID()); 50 51 delete bo; 51 52 } 52 53 } 53 54 54 55 55 … … 58 58 * @param root: The XML-element to load from 59 59 */ 60 void CampaignData::load Data(const TiXmlElement* root)60 void CampaignData::loadParams(const TiXmlElement* root) 61 61 { 62 LoadParamXML(root, "WorldList", this, CampaignData, load ParamsWorldList)62 LoadParamXML(root, "WorldList", this, CampaignData, loadData) 63 63 .describe("A List of Worlds to be loaded in this Campaign"); 64 64 } … … 69 69 * @param root: the XML-element to load from 70 70 */ 71 void CampaignData::load ParamsWorldList(const TiXmlElement* root)71 void CampaignData::loadData(const TiXmlElement* root) 72 72 { 73 73 if( root == NULL) … … 79 79 if( created != NULL) 80 80 this->addStoryEntity(created); 81 PRINTF(4)("Created a new StoryEntity and added it to the Campaign: id=%i\n", created->getStoryID()); 81 82 } 82 83 LOAD_PARAM_END_CYCLE(element); -
branches/network/src/story_entities/campaign_data.h
r6404 r6407 21 21 virtual ~CampaignData(); 22 22 23 void loadParams(const TiXmlElement* root); 24 23 25 void loadData(const TiXmlElement* root); 24 26 … … 27 29 StoryEntity* getFirstLevel(); 28 30 StoryEntity* getNextLevel(); 29 30 31 private:32 void loadParamsWorldList(const TiXmlElement* root);33 31 34 32 -
branches/network/src/story_entities/game_world.cc
r6404 r6407 90 90 this->path = NULL; 91 91 92 this->gameWorldData= new GameWorldData();92 //this->dataTank = new GameWorldData(); 93 93 } 94 94 … … 101 101 GameWorld::~GameWorld () 102 102 { 103 if( this-> gameWorldData)104 delete this-> gameWorldData;103 if( this->dataTank) 104 delete this->dataTank; 105 105 106 106 PRINTF(0)("Deleted GameWorld\n"); … … 136 136 this->shell = new Shell(); 137 137 138 this-> gameWorldData->init();138 this->dataTank->init(); 139 139 } 140 140 … … 146 146 { 147 147 this->displayLoadScreen(); 148 149 PRINTF(0)("Loading the GameWorld\n"); 148 150 149 151 PRINTF(3)("> Loading world: '%s'\n", getPath()); … … 176 178 } 177 179 /* the whole loading process for the GameWorld */ 178 this-> gameWorldData->loadData(root);180 this->dataTank->loadData(root); 179 181 180 182 delete XMLDoc; … … 191 193 PRINTF(3)("GameWorld::~GameWorld() - unloading the current GameWorld\n"); 192 194 193 this-> gameWorldData->unloadData();195 this->dataTank->unloadData(); 194 196 } 195 197 … … 330 332 this->gameTime += this->dtS; 331 333 332 this->tick(this-> gameWorldData->objectManager->getObjectList(OM_DEAD_TICK), this->dtS);333 this->tick(this-> gameWorldData->objectManager->getObjectList(OM_COMMON), this->dtS);334 this->tick(this-> gameWorldData->objectManager->getObjectList(OM_GROUP_00), this->dtS);335 this->tick(this-> gameWorldData->objectManager->getObjectList(OM_GROUP_01), this->dtS);336 this->tick(this-> gameWorldData->objectManager->getObjectList(OM_GROUP_01_PROJ), this->dtS);334 this->tick(this->dataTank->objectManager->getObjectList(OM_DEAD_TICK), this->dtS); 335 this->tick(this->dataTank->objectManager->getObjectList(OM_COMMON), this->dtS); 336 this->tick(this->dataTank->objectManager->getObjectList(OM_GROUP_00), this->dtS); 337 this->tick(this->dataTank->objectManager->getObjectList(OM_GROUP_01), this->dtS); 338 this->tick(this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ), this->dtS); 337 339 338 340 /* update tick the rest */ 339 this-> gameWorldData->localCamera->tick(this->dtS);341 this->dataTank->localCamera->tick(this->dtS); 340 342 AnimationPlayer::getInstance()->tick(this->dtS); 341 343 ParticleEngine::getInstance()->tick(this->dtS); … … 368 370 void GameWorld::collide() 369 371 { 370 CDEngine::getInstance()->checkCollisions(this-> gameWorldData->objectManager->getObjectList(OM_GROUP_00),371 this-> gameWorldData->objectManager->getObjectList(OM_GROUP_01_PROJ));372 CDEngine::getInstance()->checkCollisions(this-> gameWorldData->objectManager->getObjectList(OM_GROUP_01),373 this-> gameWorldData->objectManager->getObjectList(OM_COMMON));372 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00), 373 this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ)); 374 CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01), 375 this->dataTank->objectManager->getObjectList(OM_COMMON)); 374 376 } 375 377 … … 384 386 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 385 387 // set camera 386 this-> gameWorldData->localCamera->apply ();388 this->dataTank->localCamera->apply (); 387 389 // draw world 388 390 this->draw(); … … 456 458 { 457 459 PRINTF(3)("GameWorld::displayLoadScreen - start\n"); 458 this-> gameWorldData->glmis = new GLMenuImageScreen();459 this-> gameWorldData->glmis->setMaximum(8);460 this->dataTank->glmis = new GLMenuImageScreen(); 461 this->dataTank->glmis->setMaximum(8); 460 462 PRINTF(3)("GameWorld::displayLoadScreen - end\n"); 461 463 } … … 468 470 { 469 471 PRINTF(3)("GameWorld::releaseLoadScreen - start\n"); 470 this-> gameWorldData->glmis->setValue(this->gameWorldData->glmis->getMaximum());472 this->dataTank->glmis->setValue(this->dataTank->glmis->getMaximum()); 471 473 PRINTF(3)("GameWorld::releaseLoadScreen - end\n"); 472 474 } -
branches/network/src/story_entities/game_world.h
r6402 r6407 74 74 75 75 protected: 76 GameWorldData* gameWorldData;//!< reference to the GameWorld Data Tank76 GameWorldData* dataTank; //!< reference to the GameWorld Data Tank 77 77 char* path; //!< The file from which this world is loaded 78 78 -
branches/network/src/story_entities/single_player_world.cc
r6404 r6407 42 42 this->setName("SinglePlayerWorld uninitialized"); 43 43 44 this->dataTank = new SinglePlayerWorldData(); 45 44 46 this->loadParams(root); 45 46 this->singlePlayerWorldData = new SinglePlayerWorldData();47 47 } 48 48 -
branches/network/src/story_entities/single_player_world.h
r6404 r6407 6 6 #ifndef _SINGLE_PLAYER_WORLD_H 7 7 #define _SINGLE_PLAYER_WORLD_H 8 8 9 9 10 #include "game_world.h" … … 27 28 28 29 void loadParams(const TiXmlElement* root); 29 30 private:31 SinglePlayerWorldData* singlePlayerWorldData; //!< reference to the data tank32 30 }; 33 31 -
branches/network/src/story_entities/single_player_world_data.cc
r6404 r6407 46 46 /* call underlying function */ 47 47 GameWorldData::init(); 48 }49 50 51 /**52 * loads the data from the xml file53 * @param root reference to the xml root element54 */55 ErrorMessage SinglePlayerWorldData::loadData(TiXmlElement* root)56 {57 // load the parameters58 // name59 const char* string = grabParameter( root, "name");60 if( string == NULL)61 {62 PRINTF(2)("GameWorld is missing a proper 'name'\n");63 this->setName("Unknown");64 }65 else66 this->setName(string);67 68 this->loadGUI(root);69 this->loadWorldEntities(root);70 this->loadScene(root);71 }72 73 74 /**75 * unloads the data from the xml file76 */77 ErrorMessage SinglePlayerWorldData::unloadData()78 {79 this->unloadGUI();80 this->unloadWorldEntities();81 this->unloadScene();82 48 } 83 49 -
branches/network/src/story_entities/single_player_world_data.h
r6404 r6407 20 20 21 21 virtual ErrorMessage init(); 22 virtual ErrorMessage loadData(TiXmlElement* root);23 virtual ErrorMessage unloadData();24 22 25 23
Note: See TracChangeset
for help on using the changeset viewer.