- Timestamp:
- Jun 21, 2006, 4:49:06 PM (18 years ago)
- Location:
- branches/gui/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/defs/error.h
r5039 r8677 1 1 2 2 3 /* 3 /* 4 4 orxonox - the future of 3D-vertical-scrollers 5 5 … … 17 17 18 18 19 /*! 19 /*! 20 20 * @file error.h 21 21 * A compendium of Error codes used in the program 22 */ 22 */ 23 23 24 24 … … 54 54 */ 55 55 56 typedef struct 56 struct ErrorMessage 57 57 { 58 ErrorMessage(int code = 0, char* message = NULL, char* location = NULL) 59 : code(code), message(message), location(location) {}; 58 60 int code; 59 61 char* message; 60 62 char* location; 61 } ErrorMessage;63 }; 62 64 63 65 #endif /* _ERROR_H */ -
branches/gui/src/lib/data/data_tank.h
r7370 r8677 23 23 24 24 /** initializes the DataTank to be able to load the data */ 25 virtual ErrorMessage init() { }25 virtual ErrorMessage init() { return ErrorMessage(); } 26 26 /** loads the data into the DataTank @param root is the xml root parameter for for loadParams() connection */ 27 virtual ErrorMessage loadData(const TiXmlElement* root = NULL) { }27 virtual ErrorMessage loadData(const TiXmlElement* root = NULL) { return ErrorMessage(); } 28 28 /** unloads the data again from the DataTank */ 29 virtual ErrorMessage unloadData() { }29 virtual ErrorMessage unloadData() { return ErrorMessage(); } 30 30 }; 31 31 -
branches/gui/src/lib/util/loading/game_loader.cc
r7868 r8677 73 73 this->subscribeEvent(ES_GAME, KeyMapper::PEV_NEXT_WORLD); 74 74 this->subscribeEvent(ES_GAME, KeyMapper::PEV_PREVIOUS_WORLD); 75 76 return ErrorMessage(); 75 77 } 76 78 … … 91 93 this->currentCampaign = this->fileToCampaign(campaignName); 92 94 } 95 96 return ErrorMessage(); 93 97 } 94 98 … … 109 113 this->currentCampaign = this->fileToCampaign(campaignName); 110 114 } 115 116 return ErrorMessage(); 111 117 } 112 118 … … 147 153 } 148 154 } 155 156 return ErrorMessage(); 149 157 } 150 158 … … 160 168 this->currentCampaign->start(); 161 169 } 170 171 return ErrorMessage(); 162 172 } 163 173 … … 191 201 if(this->currentCampaign != NULL) 192 202 this->currentCampaign->pause(); 203 204 return ErrorMessage(); 193 205 } 194 206 … … 205 217 if(this->currentCampaign != NULL) 206 218 this->currentCampaign->resume(); 219 220 return ErrorMessage(); 207 221 } 208 222 -
branches/gui/src/story_entities/campaign.cc
r7283 r8677 82 82 this->bReturnToMenu = false; 83 83 this->run(); 84 85 return true; 84 86 } 85 87 … … 90 92 bool Campaign::pause() 91 93 { 92 this->bPaused = true;94 return (this->bPaused = true); 93 95 } 94 96 … … 100 102 { 101 103 PRINTF(4)("Resuming the current Campaign\n"); 102 this->bPaused = false;104 return (this->bPaused = false); 103 105 } 104 106 … … 118 120 this->currentEntity->stop(); 119 121 } 122 123 return true; 120 124 } 121 125 … … 127 131 { 128 132 ErrorMessage errorCode; 129 int storyID = WORLD_ID_0;133 // int storyID = WORLD_ID_0; 130 134 131 135 for( this->currentEntity = this->campaignData->getFirstLevel(), this->bRunning = true; -
branches/gui/src/story_entities/game_menu.cc
r8674 r8677 68 68 69 69 State::setMenuID(this->getNextStoryID()); 70 }71 72 /// HACK only for testing.73 void GameMenu::enterGui()74 {75 70 } 76 71 … … 126 121 GraphicsEngine::getInstance()->displayFPS(false); 127 122 123 return ErrorMessage(); 128 124 } 129 125 … … 134 130 ErrorMessage GameMenu::loadData() 135 131 { 136 this->mainMenuBox = new OrxGui::GLGuiBox(); 132 this->mainMenuBox = NULL; 133 134 this->levelsBox = NULL; 135 this->networkBox = NULL; 136 137 this->optionsBox = NULL; 138 this->audioBox = NULL; 139 this->videoBox = NULL; 140 this->controlBox = NULL; 141 this->levelsBox = NULL; 142 143 return GameWorld::loadData(); 144 } 145 146 147 void GameMenu::showMainMenu() 148 { 149 if (mainMenuBox == NULL) 137 150 { 138 OrxGui::GLGuiButton* startButton = new OrxGui::GLGuiPushButton("Play"); 139 this->mainMenuBox->pack(startButton); 140 141 142 OrxGui::GLGuiButton* quitButton = new OrxGui::GLGuiPushButton("Quit"); 143 this->mainMenuBox->pack(quitButton); 144 quitButton->connect(SIGNAL(quitButton, released), this, SLOT(GameMenu, quitMenu)); 145 146 151 this->mainMenuBox = new OrxGui::GLGuiBox(); 152 { 153 OrxGui::GLGuiButton* startButton = new OrxGui::GLGuiPushButton("Play"); 154 startButton->connect(SIGNAL(startButton, released), this, SLOT(GameMenu, showCampaigns)); 155 this->mainMenuBox->pack(startButton); 156 157 OrxGui::GLGuiButton* networkButton = new OrxGui::GLGuiPushButton("MultiPlayer"); 158 networkButton->connect(SIGNAL(networkButton, released), this, SLOT(GameMenu, showMultiPlayer)); 159 this->mainMenuBox->pack(networkButton); 160 161 OrxGui::GLGuiButton* optionsButton = new OrxGui::GLGuiPushButton("Options"); 162 optionsButton->connect(SIGNAL(optionsButton, released), this, SLOT(GameMenu, showOptionsMenu)); 163 this->mainMenuBox->pack(optionsButton); 164 165 166 OrxGui::GLGuiButton* quitButton = new OrxGui::GLGuiPushButton("Quit"); 167 this->mainMenuBox->pack(quitButton); 168 quitButton->connect(SIGNAL(quitButton, released), this, SLOT(GameMenu, quitMenu)); 169 } 147 170 } 148 149 150 GameWorld::loadData(); 151 } 171 this->mainMenuBox->showAll(); 172 173 this->mainMenuBox->setRelCoor2D(200, 100); 174 } 175 176 void GameMenu::showCampaigns() 177 { 178 179 if (this->levelsBox == NULL) 180 { 181 this->levelsBox = new OrxGui::GLGuiBox(); 182 { 183 const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY); 184 std::list<BaseObject*>::const_iterator it; 185 for( it = storyEntities->begin(); it != storyEntities->end(); it++) 186 { 187 StoryEntity* se = dynamic_cast<StoryEntity*>(*it); 188 if( se->isContainedInMenu()) 189 { 190 OrxGui::GLGuiWidget* button = new OrxGui::GLGuiPushButton(se->getName()); 191 levelsBox->pack(button); 192 193 // generating screenshoot item 194 /* 195 ImageEntity* ie = new ImageEntity(); 196 ie->setVisibility(false); 197 ie->setBindNode((const PNode*)NULL); 198 ie->setTexture(se->getMenuScreenshoot()); 199 ie->setRelCoor2D(State::getResX() / 2.0f + 250.0f, State::getResY() / 2.0f); 200 ie->setSize2D(140.0f, 105.0f); 201 this->menuLayers[1].screenshootList.push_back(ie); 202 */ 203 } 204 } 205 } 206 } 207 208 this->levelsBox->showAll(); 209 this->levelsBox->setRelCoor2D(200, 100); 210 this->mainMenuBox->setRelCoorSoft2D(50, 100, 5); 211 212 } 213 214 void GameMenu::showMultiPlayer() 215 { 216 217 } 218 219 void GameMenu::showOptionsMenu() 220 { 221 if (this->optionsBox == NULL) 222 { 223 this->optionsBox = new OrxGui::GLGuiBox(); 224 { 225 OrxGui::GLGuiButton* generalButton = new OrxGui::GLGuiPushButton("General"); 226 optionsBox->pack(generalButton); 227 228 OrxGui::GLGuiButton* audioButton = new OrxGui::GLGuiPushButton("Audio"); 229 optionsBox->pack(audioButton); 230 231 OrxGui::GLGuiButton* videoButton = new OrxGui::GLGuiPushButton("Video"); 232 optionsBox->pack(videoButton); 233 234 OrxGui::GLGuiButton* controlButton = new OrxGui::GLGuiPushButton("Control"); 235 optionsBox->pack(controlButton); 236 237 238 // for (unsigned int i = 0; i < 239 //OrxGui::GLGuiButton* 240 241 } 242 } 243 this->optionsBox->showAll(); 244 this->optionsBox->setRelCoor2D(200, 100); 245 246 this->mainMenuBox->setRelCoorSoft2D(50, 100, 5); 247 248 } 249 250 251 252 253 254 255 256 257 152 258 153 259 /** … … 164 270 this->unsubscribeEvents(ES_MENU); 165 271 166 GameWorld::unloadData();272 return GameWorld::unloadData(); 167 273 } 168 274 … … 175 281 EventHandler::getInstance()->pushState(ES_MENU); 176 282 177 this-> mainMenuBox->showAll();283 this->showMainMenu(); 178 284 179 285 /* now call the underlying*/ 180 GameWorld::start();286 return GameWorld::start(); 181 287 } 182 288 … … 191 297 192 298 /* now call the underlying*/ 193 GameWorld::stop();299 return GameWorld::stop(); 194 300 } 195 301 … … 276 382 { 277 383 /* call underlying function */ 278 GameWorldData::init();384 return GameWorldData::init(); 279 385 } 280 386 … … 287 393 { 288 394 /* call underlying function */ 289 GameWorldData::loadGUI(root);395 return GameWorldData::loadGUI(root); 290 396 } 291 397 … … 297 403 { 298 404 /* call underlying function */ 299 GameWorldData::unloadGUI();405 return GameWorldData::unloadGUI(); 300 406 } 301 407 … … 307 413 ErrorMessage GameMenuData::loadWorldEntities(const TiXmlElement* root) 308 414 { 309 GameWorldData::loadWorldEntities(root);415 return GameWorldData::loadWorldEntities(root); 310 416 } 311 417 … … 317 423 { 318 424 /* call underlying function */ 319 GameWorldData::unloadWorldEntities();425 return GameWorldData::unloadWorldEntities(); 320 426 } 321 427 … … 328 434 { 329 435 /* call underlying function */ 330 GameWorldData::loadScene(root);436 return GameWorldData::loadScene(root); 331 437 } 332 438 … … 338 444 { 339 445 /* call underlying function */ 340 GameWorldData::unloadScene();341 } 342 343 344 446 return GameWorldData::unloadScene(); 447 } 448 449 450 -
branches/gui/src/story_entities/game_menu.h
r8674 r8677 27 27 virtual ~GameMenu(); 28 28 29 /// TODO TAKE THIS OUT30 void enterGui();31 void execURL() const;32 static int startURL(void* data);33 34 void setImage(int i);35 OrxGui::GLGuiImage* image;36 OrxGui::GLGuiInputLine* imageName;37 ///38 29 virtual void loadParams(const TiXmlElement* root); 39 30 … … 49 40 50 41 void startLevel(int level); 42 43 void showMainMenu(); 44 void showCampaigns(); 45 void showMultiPlayer(); 46 void showOptionsMenu(); 47 51 48 void quitMenu(); 52 49 … … 65 62 private: 66 63 OrxGui::GLGuiBox* mainMenuBox; 64 OrxGui::GLGuiBox* levelsBox; 65 OrxGui::GLGuiBox* networkBox; 66 67 OrxGui::GLGuiBox* optionsBox; 67 68 OrxGui::GLGuiBox* audioBox; 68 69 OrxGui::GLGuiBox* videoBox; 69 70 OrxGui::GLGuiBox* controlBox; 70 OrxGui::GLGuiBox* levelsBox;71 71 72 72 Vector cameraVector; -
branches/gui/src/story_entities/game_world.cc
r8490 r8677 140 140 State::setScriptManager(&this->scriptManager); 141 141 142 return ErrorMessage(); 142 143 } 143 144 … … 155 156 156 157 PRINTF(3)("> Loading world: '%s'\n", getLoadFile().c_str()); 157 TiXmlElement* element;158 GameLoader* loader = GameLoader::getInstance();158 // TiXmlElement* element; 159 // GameLoader* loader = GameLoader::getInstance(); 159 160 160 161 if( getLoadFile().empty()) 161 162 { 162 163 PRINTF(1)("GameWorld has no path specified for loading\n"); 163 return (ErrorMessage ){213,"Path not specified","GameWorld::load()"};164 return (ErrorMessage(213,"Path not specified","GameWorld::load()")); 164 165 } 165 166 … … 170 171 PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc->ErrorDesc(), this->getLoadFile().c_str(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol()); 171 172 delete XMLDoc; 172 return (ErrorMessage){213,"XML File parsing error","GameWorld::load()"};173 return ErrorMessage(213,"XML File parsing error","GameWorld::load()"); 173 174 } 174 175 // check basic validity … … 180 181 PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n"); 181 182 delete XMLDoc; 182 return (ErrorMessage){213,"Path not a WorldDataFile","GameWorld::load()"};183 return ErrorMessage(213,"Path not a WorldDataFile","GameWorld::load()"); 183 184 } 184 185 /* the whole loading process for the GameWorld */ … … 193 194 Account *b = new Account(30); 194 195 b->setName("b"); 195 196 196 197 197 198 LoadParamXML(root, "ScriptManager", &this->scriptManager, ScriptManager, loadParams); 198 199 199 200 delete XMLDoc; 200 201 this->releaseLoadScreen(); 202 203 return ErrorMessage(); 201 204 } 202 205 … … 223 226 if (this->dataXML) 224 227 delete this->dataXML; 228 229 return ErrorMessage(); 225 230 } 226 231 … … 235 240 State::setScriptManager(&this->scriptManager); //make sure we have the right script manager 236 241 this->run(); 242 243 return true; 237 244 } 238 245 … … 245 252 PRINTF(3)("GameWorld::stop() - got stop signal\n"); 246 253 State::setScriptManager(NULL); 247 this->bRunning = false;254 return (this->bRunning = false); 248 255 } 249 256 … … 254 261 bool GameWorld::pause() 255 262 { 256 this->bPaused = true;263 return (this->bPaused = true); 257 264 } 258 265 … … 263 270 bool GameWorld::resume() 264 271 { 265 this->bPaused = false;272 return(this->bPaused = false); 266 273 } 267 274 … … 413 420 if( likely(this->dataTank->gameRule != NULL)) 414 421 this->dataTank->gameRule->tick(this->dtS); 415 422 416 423 } 417 424 } -
branches/gui/src/story_entities/game_world_data.cc
r8490 r8677 108 108 109 109 GraphicsEngine::getInstance()->displayFPS(true); 110 111 return ErrorMessage(); 110 112 } 111 113 … … 131 133 this->loadWorldEntities(root); 132 134 this->loadScene(root); 135 136 return ErrorMessage(); 133 137 } 134 138 … … 142 146 this->unloadWorldEntities(); 143 147 this->unloadScene(); 148 149 return ErrorMessage(); 144 150 } 145 151 … … 166 172 } 167 173 this->glmis->draw(); 174 175 return ErrorMessage(); 168 176 } 169 177 … … 175 183 { 176 184 delete this->glmis; 185 186 return ErrorMessage(); 177 187 } 178 188 … … 250 260 /* init the pnode tree */ 251 261 PNode::getNullParent()->init(); 262 263 return ErrorMessage(); 252 264 } 253 265 … … 312 324 313 325 this->glmis = NULL; 326 327 return ErrorMessage(); 314 328 } 315 329 … … 337 351 this->localCamera->addChild(this->sky); 338 352 OrxSound::SoundEngine::getInstance()->setListener(this->localCamera); 353 354 return ErrorMessage(); 339 355 } 340 356 … … 357 373 358 374 State::setGameRules(NULL); 375 376 return ErrorMessage(); 359 377 } 360 378 -
branches/gui/src/story_entities/multi_player_world.cc
r8228 r8677 123 123 /** 124 124 * cleanup 125 * @return 125 * @return 126 126 */ 127 127 ErrorMessage MultiPlayerWorld::unloadData( ) 128 128 { 129 129 130 130 GameWorld::unloadData(); 131 131 132 132 delete NetworkManager::getInstance(); 133 133 delete NetworkGameManager::getInstance(); 134 134 135 return ErrorMessage(); 135 136 } -
branches/gui/src/story_entities/multi_player_world_data.cc
r8490 r8677 78 78 { 79 79 /* call underlying function */ 80 GameWorldData::init();80 return GameWorldData::init(); 81 81 } 82 82 … … 89 89 { 90 90 /* call underlying function */ 91 GameWorldData::loadGUI(root);91 return GameWorldData::loadGUI(root); 92 92 } 93 93 … … 99 99 { 100 100 /* call underlying function */ 101 GameWorldData::unloadGUI();101 return GameWorldData::unloadGUI(); 102 102 } 103 103 … … 245 245 this->drawLists.push_back(OM_GROUP_01); 246 246 this->drawLists.push_back(OM_GROUP_01_PROJ); 247 247 248 248 State::setPlayer(this->localPlayer); 249 249 250 return ErrorMessage(); 250 251 } 251 252 … … 257 258 { 258 259 /* call underlying function */ 259 GameWorldData::unloadWorldEntities();260 return GameWorldData::unloadWorldEntities(); 260 261 } 261 262 … … 269 270 /* call underlying function */ 270 271 GameWorldData::loadScene(root); 271 272 272 273 // create server playable 273 274 if ( NetworkManager::getInstance()->isGameServer() ) … … 276 277 State::getPlayer()->setPlayable( PlayerStats::getStats( 0 )->getPlayable() ); 277 278 } 279 280 return ErrorMessage(); 278 281 } 279 282 … … 285 288 { 286 289 /* call underlying function */ 287 GameWorldData::unloadScene();290 return GameWorldData::unloadScene(); 288 291 } 289 292 -
branches/gui/src/story_entities/single_player_world_data.cc
r7370 r8677 45 45 { 46 46 /* call underlying function */ 47 GameWorldData::init();47 return GameWorldData::init(); 48 48 } 49 49 … … 56 56 { 57 57 /* call underlying function */ 58 GameWorldData::loadGUI(root);58 return GameWorldData::loadGUI(root); 59 59 } 60 60 … … 66 66 { 67 67 /* call underlying function */ 68 GameWorldData::unloadGUI();68 return GameWorldData::unloadGUI(); 69 69 } 70 70 … … 77 77 { 78 78 /* call underlying function */ 79 GameWorldData::loadWorldEntities(root);79 return GameWorldData::loadWorldEntities(root); 80 80 } 81 81 … … 87 87 { 88 88 /* call underlying function */ 89 GameWorldData::unloadWorldEntities();89 return GameWorldData::unloadWorldEntities(); 90 90 } 91 91 … … 98 98 { 99 99 /* call underlying function */ 100 GameWorldData::loadScene(root);100 return GameWorldData::loadScene(root); 101 101 } 102 102 … … 108 108 { 109 109 /* call underlying function */ 110 GameWorldData::unloadScene();110 return GameWorldData::unloadScene(); 111 111 } 112 112 -
branches/gui/src/story_entities/story_entity.h
r7283 r8677 35 35 /* initialisation and loading */ 36 36 /** initializes a Story Entity to the needed values */ 37 virtual ErrorMessage init() { };37 virtual ErrorMessage init() { return ErrorMessage(); }; 38 38 /** called to load the data into the StoryEntity*/ 39 virtual ErrorMessage loadData() { };39 virtual ErrorMessage loadData() { return ErrorMessage(); }; 40 40 /** function that unloads the data from the StoryEntity */ 41 virtual ErrorMessage unloadData() { };41 virtual ErrorMessage unloadData() { return ErrorMessage(); }; 42 42 43 43 /* running, stopping and pausing */
Note: See TracChangeset
for help on using the changeset viewer.