Changeset 9406 in orxonox.OLD for trunk/src/story_entities
- Timestamp:
- Jul 24, 2006, 11:09:47 AM (19 years ago)
- Location:
- trunk/src/story_entities
- Files:
-
- 2 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/Makefile.am
r8717 r9406 13 13 story_entities/multi_player_world_data.cc \ 14 14 story_entities/movie_loader.cc \ 15 story_entities/simple_game_menu.cc \16 15 \ 17 16 story_entities/menu/game_menu.cc \ … … 30 29 story_entities/multi_player_world_data.h \ 31 30 story_entities/movie_loader.h \ 32 story_entities/simple_game_menu.h \33 31 \ 34 32 story_entities/menu/game_menu.h \ -
trunk/src/story_entities/campaign.cc
r8717 r9406 25 25 #include "campaign_data.h" 26 26 27 using namespace std; 27 28 28 29 29 -
trunk/src/story_entities/campaign_data.cc
r7370 r9406 23 23 24 24 25 using namespace std; 25 26 26 27 27 … … 103 103 int nextStoryID; 104 104 int storyID; 105 list<StoryEntity*>::iterator it;105 std::list<StoryEntity*>::iterator it; 106 106 107 107 nextStoryID = 0; … … 124 124 int nextStoryID; 125 125 int storyID; 126 list<StoryEntity*>::iterator it;126 std::list<StoryEntity*>::iterator it; 127 127 128 128 nextStoryID = this->currentEntity->getNextStoryID(); … … 145 145 StoryEntity* CampaignData::getLevel(int storyID) 146 146 { 147 list<StoryEntity*>::iterator it;147 std::list<StoryEntity*>::iterator it; 148 148 for( it = this->storyEntities.begin(); it != this->storyEntities.end(); it++) 149 149 { -
trunk/src/story_entities/dedicated_server_world.cc
r7193 r9406 28 28 29 29 30 using namespace std; 30 31 31 32 32 //! This creates a Factory to fabricate a DedicatedServerWorld -
trunk/src/story_entities/game_world.cc
r9235 r9406 512 512 void GameWorld::display () 513 513 { 514 515 // if this server is a dedicated server the game workd does not need to be drawn 516 if( !GraphicsEngine::getInstance()->isDedicated()) 517 { 514 518 // render the reflection texture 515 519 this->renderPassReflection(); 516 520 // redner the refraction texture 517 521 this->renderPassRefraction(); 522 } 518 523 // render all 519 524 this->renderPassAll(); … … 643 648 LightManager::getInstance()->draw(); 644 649 645 /* Draw the BackGround */ 646 this->drawEntityList(State::getObjectManager()->getObjectList(OM_BACKGROUND)); 647 engine->drawBackgroundElements(); 648 649 /* draw all WorldEntiy groups */ 650 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 651 this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i])); 652 653 AtmosphericEngine::getInstance()->draw(); 654 655 if( unlikely( this->showBV)) 656 { 657 CDEngine* engine = CDEngine::getInstance(); 650 // only render the world if its not dedicated mode 651 if( !GraphicsEngine::getInstance()->isDedicated()) 652 { 653 /* Draw the BackGround */ 654 this->drawEntityList(State::getObjectManager()->getObjectList(OM_BACKGROUND)); 655 engine->drawBackgroundElements(); 656 657 /* draw all WorldEntiy groups */ 658 658 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 659 engine->drawBV(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]), this->showBVLevel); 660 } 661 662 if( unlikely(this->showPNodes)) 663 PNode::getNullParent()->debugDraw(0); 659 this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i])); 660 661 AtmosphericEngine::getInstance()->draw(); 662 663 if( unlikely( this->showBV)) 664 { 665 CDEngine* engine = CDEngine::getInstance(); 666 for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i) 667 engine->drawBV(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]), this->showBVLevel); 668 } 669 670 if( unlikely(this->showPNodes)) 671 PNode::getNullParent()->debugDraw(0); 672 673 // draw the game ruls 674 if( likely(this->dataTank->gameRule != NULL)) 675 this->dataTank->gameRule->draw(); 676 } 664 677 665 678 engine->draw(); 666 667 // draw the game ruls668 if( likely(this->dataTank->gameRule != NULL))669 this->dataTank->gameRule->draw();670 679 } 671 680 -
trunk/src/story_entities/game_world_data.cc
r9235 r9406 61 61 62 62 63 using namespace std; 63 64 64 65 65 … … 194 194 ErrorMessage GameWorldData::loadWorldEntities(const TiXmlElement* root) 195 195 { 196 196 197 const TiXmlElement* element = root->FirstChildElement("WorldEntities"); 198 bool mouseCaptured = EventHandler::getInstance()->grabbedEvents(); 199 EventHandler::getInstance()->grabEvents(false); 197 200 198 201 if( element == NULL) … … 209 212 BaseObject* created = Factory::fabricate(element); 210 213 if( created != NULL ) 211 PRINTF(4)("Created a %s: %s\n", created->getClass Name(), created->getName());214 PRINTF(4)("Created a %s: %s\n", created->getClassCName(), created->getCName()); 212 215 213 216 //todo do this more elegant … … 233 236 234 237 Playable* playable; 235 const list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);238 const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE); 236 239 if (playableList != NULL && !playableList->empty()) 237 240 { … … 262 265 /* init the pnode tree */ 263 266 PNode::getNullParent()->init(); 267 268 EventHandler::getInstance()->grabEvents(mouseCaptured); 264 269 265 270 return ErrorMessage(); … … 284 289 // ClassList::debug( 3, CL_PARENT_NODE); 285 290 // PNode::getNullParent()->debugNode(0); 286 // printf("%s::%s\n", nodeList->front()->getClass Name(), nodeList->front()->getName());291 // printf("%s::%s\n", nodeList->front()->getClassCName(), nodeList->front()->getName()); 287 292 delete nodeList->front(); 288 293 } -
trunk/src/story_entities/game_world_data.h
r7460 r9406 42 42 void loadGameRule(const TiXmlElement* root); 43 43 44 44 45 protected: 45 46 virtual ErrorMessage loadGUI(const TiXmlElement* root); -
trunk/src/story_entities/menu/game_menu.cc
r9235 r9406 152 152 { 153 153 OrxGui::GLGuiButton* startButton = new OrxGui::GLGuiPushButton("Play"); 154 startButton-> connect(SIGNAL(startButton, released), this, SLOT(GameMenu, showCampaigns));154 startButton->released.connect(this, &GameMenu::showCampaigns); 155 155 this->mainMenuBox->pack(startButton); 156 156 startButton->select(); 157 157 158 158 OrxGui::GLGuiButton* networkButton = new OrxGui::GLGuiPushButton("MultiPlayer"); 159 networkButton-> connect(SIGNAL(networkButton, released), this, SLOT(GameMenu, showMultiPlayer));159 networkButton->released.connect(this, &GameMenu::showMultiPlayer); 160 160 this->mainMenuBox->pack(networkButton); 161 161 162 162 OrxGui::GLGuiButton* optionsButton = new OrxGui::GLGuiPushButton("Options"); 163 optionsButton-> connect(SIGNAL(optionsButton, released), this, SLOT(GameMenu, showOptionsMenu));163 optionsButton->released.connect(this, &GameMenu::showOptionsMenu); 164 164 this->mainMenuBox->pack(optionsButton); 165 165 … … 167 167 OrxGui::GLGuiButton* quitButton = new OrxGui::GLGuiPushButton("Quit"); 168 168 this->mainMenuBox->pack(quitButton); 169 quitButton-> connect(SIGNAL(quitButton, released), this, SLOT(GameMenu, quitMenu));169 quitButton->released.connect(this, &GameMenu::quitMenu); 170 170 } 171 171 } … … 202 202 printf("%s\n", se->getMenuScreenshoot().c_str()); 203 203 OrxGui::GLGuiImageButton* button = new OrxGui::GLGuiImageButton(se->getName(), se->getStoryID(), se->getMenuScreenshoot(), image); 204 button-> connect(SIGNAL(button, startLevel), this, SLOT(GameMenu, startLevel));204 button->startLevel.connect(this, &GameMenu::startLevel); 205 205 labelBox->pack(button); 206 206 … … 244 244 OrxGui::GLGuiButton* clientButton = new OrxGui::GLGuiPushButton("Client"); 245 245 box->pack(clientButton); 246 clientButton-> connect(SIGNAL(clientButton, released), this, SLOT(GameMenu, showClientMenu));246 clientButton->released.connect(this, &GameMenu::showClientMenu); 247 247 248 248 OrxGui::GLGuiButton* serverButton = new OrxGui::GLGuiPushButton("Server"); 249 249 box->pack(serverButton); 250 serverButton-> connect(SIGNAL(serverButton, released), this, SLOT(GameMenu, showServerMenu));250 serverButton->released.connect(this, &GameMenu::showServerMenu); 251 251 252 252 networkBox->pack( box ); … … 531 531 this->ipInputLine->setText( Preferences::getInstance()->getString( "multiplayer", "lastVisitedServer", "localhost" ) ); 532 532 this->clientNetworkBox->pack( this->ipInputLine ); 533 this->ipInputLine->connect(SIGNAL(ipInputLine, enterPushed), this, SLOT(GameMenu, connectToServer));533 //this->ipInputLine->enterPushed.connect(this, &GameMenu::connectToServer); /// redo this. 534 534 this->ipInputLine->select(); 535 535 536 536 OrxGui::GLGuiButton* connectButton = new OrxGui::GLGuiPushButton("Connect"); 537 537 clientNetworkBox->pack(connectButton); 538 connectButton-> connect(SIGNAL(connectButton, released), this, SLOT(GameMenu, connectToServer));538 connectButton->released.connect(this, &GameMenu::connectToServer); 539 539 } 540 540 } … … 574 574 OrxGui::GLGuiButton* createButton = new OrxGui::GLGuiPushButton("Create Server"); 575 575 serverNetworkBox->pack(createButton); 576 createButton-> connect(SIGNAL(createButton, released), this, SLOT(GameMenu, createServer));576 createButton->released.connect(this, &GameMenu::createMasterServer); 577 577 } 578 578 } … … 593 593 594 594 State::setOnline(true); 595 NetworkManager::getInstance()-> establishConnection( this->ipInputLine->_getText(), 9999 );595 NetworkManager::getInstance()->createClient( this->ipInputLine->_getText(), 9999 ); 596 596 597 597 Preferences::getInstance()->setString( "multiplayer", "lastVisitedServer", this->ipInputLine->_getText() ); … … 600 600 } 601 601 602 void GameMenu::create Server( )602 void GameMenu::createMasterServer( ) 603 603 { 604 604 PRINTF(0)("Create server\n" ); 605 605 606 606 State::setOnline(true); 607 NetworkManager::getInstance()->create Server( 9999 );607 NetworkManager::getInstance()->createMasterServer( 9999 ); 608 608 609 609 this->startLevel( 5 ); -
trunk/src/story_entities/menu/game_menu.h
r9059 r9406 50 50 51 51 void showServerMenu(); 52 void create Server();52 void createMasterServer(); 53 53 54 54 -
trunk/src/story_entities/menu/glgui_imagebutton.cc
r8740 r9406 40 40 GLGuiPushButton::releasing(pos, focused); 41 41 if (focused) 42 this-> emit(startLevel(this->levelID));42 this->startLevel.emit(this->levelID); 43 43 } 44 44 … … 77 77 { 78 78 // emit(released()); 79 emit(startLevel(this->levelID));79 startLevel.emit(this->levelID); 80 80 } 81 81 return true; -
trunk/src/story_entities/menu/glgui_imagebutton.h
r8740 r9406 25 25 void release(); 26 26 27 DeclareSignal1(startLevel, int);27 sigslot::signal1<int> startLevel; 28 28 29 29 protected: -
trunk/src/story_entities/movie_loader.cc
r7919 r9406 24 24 25 25 26 using namespace std; 26 27 27 28 28 CREATE_FACTORY(MovieLoader, CL_MOVIE_LOADER); -
trunk/src/story_entities/multi_player_world.cc
r9235 r9406 31 31 32 32 33 using namespace std; 34 33 #include "glgui_handler.h" 35 34 36 35 //! Register a command to print some multiplayer world infos … … 64 63 if( this->dataTank) 65 64 delete this->dataTank; 65 delete OrxGui::GLGuiHandler::getInstance( ); 66 66 } 67 67 -
trunk/src/story_entities/multi_player_world_data.cc
r9235 r9406 47 47 #include "player_stats.h" 48 48 49 #include "proxy/network_settings.h" 49 50 50 51 #include "glmenu_imagescreen.h" … … 52 53 53 54 54 using namespace std; 55 55 56 56 57 … … 110 111 { 111 112 const TiXmlElement* element = NULL; 112 113 if( NetworkManager::getInstance()->isGameServer())113 114 if( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()) 114 115 { 115 116 /* load the spawning points */ … … 128 129 BaseObject* created = Factory::fabricate(element); 129 130 if( created != NULL ) 130 printf("Created a Spawning Point %s: %s\n", created->getClass Name(), created->getName());131 printf("Created a Spawning Point %s: %s\n", created->getClassCName(), created->getCName()); 131 132 132 133 element = element->NextSiblingElement(); … … 147 148 element = element->FirstChildElement(); 148 149 149 if( NetworkManager::getInstance()->isGameServer())150 if( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()) 150 151 { 151 152 while( element != NULL) … … 154 155 BaseObject* created = Factory::fabricate(element); 155 156 if( created != NULL ) 156 PRINTF(1)("Created a %s: %s (0x%8x) from %s\n", created->getClass Name(), created->getName(), created->getLeafClassID(), element->Value());157 PRINTF(1)("Created a %s: %s (0x%8x) from %s\n", created->getClassCName(), created->getCName(), created->getLeafClassID(), element->Value()); 157 158 else 158 159 PRINTF(1)("NetworkWorld: could not create this entity\n"); … … 185 186 186 187 if( created != NULL ) 187 PRINTF(1)("Created a %s: %s (0x%8x) from %s\n", created->getClass Name(), created->getName(), created->getLeafClassID(), element->Value());188 PRINTF(1)("Created a %s: %s (0x%8x) from %s\n", created->getClassCName(), created->getCName(), created->getLeafClassID(), element->Value()); 188 189 else 189 190 PRINTF(1)("NetworkWorld: could not create this entity\n"); … … 205 206 206 207 207 if( NetworkManager::getInstance()->isGameServer())208 if( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()) 208 209 { 209 210 this->localPlayer = new Player(); … … 280 281 GameWorldData::loadScene(root); 281 282 283 // LoadParamXML(root, "NetworkSettings", NetworkSettings::getInstance(), NetworkSettings, loadNetworkSettings); 284 282 285 // create server playable 283 if ( NetworkManager::getInstance()->isGameServer())286 if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()) 284 287 { 285 288 NetworkGameManager::getInstance()->signalNewPlayer( 0 ); … … 296 299 ErrorMessage MultiPlayerWorldData::unloadScene() 297 300 { 301 // delete the proxy settings 302 delete NetworkSettings::getInstance(); 303 298 304 /* call underlying function */ 299 305 return GameWorldData::unloadScene(); … … 317 323 { 318 324 Playable* p = dynamic_cast<Playable*>(*entity); 319 PRINTF(0)("Got a playable, class: %s, name: %s, uid: %i\n", (*entity)->getClass Name(), (*entity)->getName(), p->getUniqueID());325 PRINTF(0)("Got a playable, class: %s, name: %s, uid: %i\n", (*entity)->getClassCName(), (*entity)->getCName(), p->getUniqueID()); 320 326 } 321 327 … … 340 346 341 347 PNode* cam = State::getCameraTargetNode(); 342 PRINT(0)("Camera has target - class: %s, name: %s, uid: %i\n", cam->getClass Name(), cam->getName(), cam->getUniqueID());348 PRINT(0)("Camera has target - class: %s, name: %s, uid: %i\n", cam->getClassCName(), cam->getCName(), cam->getUniqueID()); 343 349 344 350 PRINT(0)("==================================================\n"); -
trunk/src/story_entities/single_player_world.cc
r7287 r9406 30 30 31 31 32 using namespace std; 32 33 33 34 34 -
trunk/src/story_entities/single_player_world_data.cc
r8717 r9406 21 21 22 22 23 using namespace std; 23 24 24 25 25 -
trunk/src/story_entities/story_entity.cc
r8330 r9406 26 26 27 27 28 using namespace std; 28 29 29 30 30
Note: See TracChangeset
for help on using the changeset viewer.