Changeset 8806 for code/branches/output/src/libraries/core/Game.cc
- Timestamp:
- Jul 31, 2011, 5:15:13 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/core/Game.cc
r8788 r8806 60 60 SetConsoleCommand("exit", &stop_game); 61 61 static void printFPS() 62 { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; }62 { orxout(message) << Game::getInstance().getAvgFPS() << endl; } 63 63 SetConsoleCommand("Stats", "printFPS", &printFPS); 64 64 static void printTickTime() 65 { COUT(0) << Game::getInstance().getAvgTickTime() << std::endl; }65 { orxout(message) << Game::getInstance().getAvgTickTime() << endl; } 66 66 SetConsoleCommand("Stats", "printTickTime", &printTickTime); 67 67 … … 163 163 { 164 164 if (this->requestedStateNodes_.empty()) 165 COUT(0) << "Warning: Starting game without requesting GameState. This automatically terminates the program." << std::endl;165 orxout(user_error) << "Starting game without requesting GameState. This automatically terminates the program." << endl; 166 166 167 167 // START GAME … … 189 189 catch (...) 190 190 { 191 COUT(0) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << std::endl;192 COUT(0) << "This should really never happen! Closing the program." << std::endl;191 orxout(user_error) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << endl; 192 orxout(user_error) << "This should really never happen! Closing the program." << endl; 193 193 this->stop(); 194 194 break; … … 203 203 catch (...) 204 204 { 205 COUT(0) << "An exception occurred in the Core postUpdate: " << Exception::handleMessage() << std::endl;206 COUT(0) << "This should really never happen! Closing the program." << std::endl;205 orxout(user_error) << "An exception occurred in the Core postUpdate: " << Exception::handleMessage() << endl; 206 orxout(user_error) << "This should really never happen! Closing the program." << endl; 207 207 this->stop(); 208 208 break; … … 241 241 catch (...) 242 242 { 243 COUT(1) << "Error: Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << std::endl;243 orxout(user_error) << "Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << endl; 244 244 // All scheduled operations have now been rendered inert --> flush them and issue a warning 245 245 if (this->requestedStateNodes_.size() > 1) 246 COUT(4) << "All " << this->requestedStateNodes_.size() - 1 << " scheduled transitions have been ignored." << std::endl;246 orxout(internal_info) << "All " << this->requestedStateNodes_.size() - 1 << " scheduled transitions have been ignored." << endl; 247 247 this->requestedStateNodes_.clear(); 248 248 break; … … 272 272 catch (...) 273 273 { 274 COUT(1) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << std::endl;275 COUT(1) << "This should really never happen!" << std::endl;276 COUT(1) << "Unloading all GameStates depending on the one that crashed." << std::endl;274 orxout(user_error) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << endl; 275 orxout(user_error) << "This should really never happen!" << endl; 276 orxout(user_error) << "Unloading all GameStates depending on the one that crashed." << endl; 277 277 shared_ptr<GameStateTreeNode> current = this->loadedTopStateNode_; 278 278 while (current->name_ != (*it)->getName() && current) … … 355 355 if (!this->checkState(name)) 356 356 { 357 COUT(2) << "Warning: GameState named '" << name << "' doesn't exist!" << std::endl;357 orxout(user_warning) << "GameState named '" << name << "' doesn't exist!" << endl; 358 358 return; 359 359 } … … 361 361 if (this->bChangingState_) 362 362 { 363 COUT(2) << "Warning: Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << std::endl;363 orxout(user_warning) << "Requesting GameStates while loading/unloading a GameState is illegal! Ignoring." << endl; 364 364 return; 365 365 } … … 372 372 if (name == lastRequestedNode->name_) 373 373 { 374 COUT(2) << "Warning: Requesting the currently active state! Ignoring." << std::endl;374 orxout(user_warning) << "Requesting the currently active state! Ignoring." << endl; 375 375 return; 376 376 } … … 403 403 404 404 if (requestedNodes.empty()) 405 COUT(1) << "Error: Requested GameState transition is not allowed. Ignoring." << std::endl;405 orxout(user_error) << "Requested GameState transition is not allowed. Ignoring." << endl; 406 406 else 407 407 this->requestedStateNodes_.insert(requestedStateNodes_.end(), requestedNodes.begin(), requestedNodes.end()); … … 425 425 this->requestState(lastRequestedNode->parent_.lock()->name_); 426 426 else 427 COUT(2) << "Warning: Can't pop the internal dummy root GameState" << std::endl;427 orxout(internal_warning) << "Can't pop the internal dummy root GameState" << endl; 428 428 } 429 429 … … 437 437 std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.find(name); 438 438 if (it != gameStateDeclarations_s.end()) 439 COUT(1) << "Error: GameState '" << name << "' has not yet been loaded." << std::endl;439 orxout(internal_error) << "GameState '" << name << "' has not yet been loaded." << endl; 440 440 else 441 COUT(1) << "Error: Could not find GameState '" << name << "'." << std::endl;441 orxout(internal_error) << "Could not find GameState '" << name << "'." << endl; 442 442 return shared_ptr<GameState>(); 443 443 } … … 589 589 catch (...) 590 590 { 591 COUT(2) << "Warning: Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << std::endl;592 COUT(2) << " There might be potential resource leaks involved! To avoid this, improve exception-safety." << std::endl;591 orxout(internal_warning) << "Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << endl; 592 orxout(internal_warning) << "There might be potential resource leaks involved! To avoid this, improve exception-safety." << endl; 593 593 } 594 594 // Check if graphics is still required
Note: See TracChangeset
for help on using the changeset viewer.