Changeset 1089 for code/trunk/src
- Timestamp:
- Apr 17, 2008, 1:25:06 PM (17 years ago)
- Location:
- code/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/audio/AudioManager.cc
r1064 r1089 60 60 { 61 61 // currentBgSound = 0; 62 currentBgSound = rand() % bgSounds.size();63 62 if (bgSounds.size() > 0) 64 63 { 64 currentBgSound = rand() % bgSounds.size(); 65 65 if(!bgSounds[currentBgSound]->playback()) 66 66 { … … 72 72 } 73 73 } 74 75 74 } 76 75 -
code/trunk/src/core/Debug.h
r1062 r1089 260 260 #endif /* ifndef COUT */ 261 261 262 263 ///////////////////////////////////////////////////////////////////// 264 /// CCOUT: Prints output with std::cout and adds the classname /// 265 ///////////////////////////////////////////////////////////////////// 266 267 #define CCOUT_EXEC(x) \ 268 orxonox::OutputHandler::getOutStream().setOutputLevel(x) \ 269 << "*** " << this->getIdentifier()->getName() << ": " 270 271 #ifndef CCOUT 272 #if ORX_PRINT_DEBUG_OUTPUT 273 #define CCOUT(x) \ 274 CCOUT ## x 275 276 #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR 277 #define CCOUT1 \ 278 if (getSoftDebugLevel() >= ORX_ERROR) \ 279 CCOUT_EXEC(1) 280 #else 281 #define CCOUT1 if (ORX_NONE)\ 282 CCOUT_EXEC(1) 283 #endif 284 285 #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING 286 #define CCOUT2 \ 287 if (getSoftDebugLevel() >= ORX_WARNING) \ 288 CCOUT_EXEC(2) 289 #else 290 #define CCOUT2 if (ORX_NONE) \ 291 CCOUT_EXEC(2) 292 #endif 293 294 #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO 295 #define CCOUT3 \ 296 if (getSoftDebugLevel() >= ORX_INFO) \ 297 CCOUT_EXEC(3) 298 #else 299 #define CCOUT3 if (ORX_NONE) \ 300 CCOUT_EXEC(3) 301 #endif 302 303 #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG 304 #define CCOUT4 \ 305 if (getSoftDebugLevel() >= ORX_DEBUG) \ 306 CCOUT_EXEC(4) 307 #else 308 #define CCOUT4 if (ORX_NONE) \ 309 CCOUT_EXEC(4) 310 #endif 311 312 #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG 313 #define CCOUT5 \ 314 if (getSoftDebugLevel() >= ORX_vDEBUG) \ 315 CCOUT_EXEC(5) 316 #else 317 #define CCOUT5 if (ORX_NONE) \ 318 CCOUT_EXEC(5) 319 #endif 320 321 #else /* if ORX_PRINT_DEBUG_OUTPUT */ 322 #define CCOUT(x) if (ORX_NONE) \ 323 CCOUT_EXEC(5) 324 #endif /* if ORX_PRINT_DEBUG_OUTPUT */ 325 326 #define CCOUT0 \ 327 CCOUT_EXEC(0) 328 #endif /* ifndef CCOUT */ 329 262 330 #endif /* _Debug_H__ */ -
code/trunk/src/core/InputManager.cc
r1084 r1089 53 53 handlerGUI_(0), handlerBuffer_(0), handlerGame_(0) 54 54 { 55 RegisterObject(InputManager); 55 56 } 56 57 -
code/trunk/src/orxonox/Orxonox.cc
r1084 r1089 75 75 #include "tools/Timer.h" 76 76 #include "hud/HUD.h" 77 //#include "objects/weapon/BulletManager.h"78 77 79 78 // FIXME: is this really file scope? … … 140 139 this->auMan_ = 0; 141 140 this->inputHandler_ = 0; 142 //this->root_ = 0;143 141 // turn on frame smoothing by setting a value different from 0 144 142 this->frameSmoothingTime_ = 0.0f; … … 153 151 { 154 152 // keep in mind: the order of deletion is very important! 155 // if (this->bulletMgr_)156 // delete this->bulletMgr_;157 153 if (this->orxonoxHUD_) 158 154 delete this->orxonoxHUD_; … … 172 168 173 169 /** 174 * error kills orxonox 175 */ 176 void Orxonox::abortImmediate(/* some error code */) 177 { 178 //TODO: destroy and destruct everything and print nice error msg 170 @brief Immediately deletes the orxonox object. 171 Never use if you can help it while rendering! 172 */ 173 void Orxonox::abortImmediateForce() 174 { 175 COUT(1) << "*** Orxonox Error: Orxonox object was unexpectedly destroyed." << std::endl; 179 176 delete this; 180 177 } … … 185 182 void Orxonox::abortRequest() 186 183 { 184 COUT(3) << "*** Orxonox: Abort requested." << std::endl; 187 185 bAbort_ = true; 188 186 } … … 225 223 ar.checkArgument("data", this->dataPath_, false); 226 224 ar.checkArgument("ip", serverIp_, false); 227 if(ar.errorHandling()) abortImmediate ();225 if(ar.errorHandling()) abortImmediateForce(); 228 226 if(mode == std::string("client")) 229 227 { … … 248 246 ogre_->setup(); 249 247 //root_ = ogre_->getRoot(); 250 if(!ogre_->load(this->dataPath_)) abortImmediate (/* unable to load */);248 if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */); 251 249 252 250 server_g = new network::Server(); … … 263 261 else 264 262 client_g = new network::Client(serverIp_, NETWORK_PORT); 265 if(!ogre_->load(this->dataPath_)) abortImmediate (/* unable to load */);263 if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */); 266 264 } 267 265 … … 272 270 ogre_->setConfigPath(path); 273 271 ogre_->setup(); 274 //root_ = ogre_->getRoot(); 275 if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */); 272 if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */); 276 273 } 277 274 … … 301 298 auMan_ = new audio::AudioManager(); 302 299 303 //bulletMgr_ = new BulletManager();304 305 300 Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2"); 306 301 HUD* orxonoxHud; … … 350 345 auMan_ = new audio::AudioManager(); 351 346 352 //bulletMgr_ = new BulletManager();353 354 347 // load this file from config 355 348 Level* startlevel = new Level("levels/sample.oxw"); … … 380 373 if (!inputHandler_->initialise(ogre_->getWindowHandle(), 381 374 ogre_->getWindowWidth(), ogre_->getWindowHeight())) 382 abortImmediate ();375 abortImmediateForce(); 383 376 inputHandler_->setInputMode(IM_INGAME); 384 377 } … … 414 407 if (Ogre::Root::getSingletonPtr() == 0) 415 408 { 416 COUT(2) << " Error: Could not start rendering. No Ogre root object found" << std::endl;409 COUT(2) << "*** Orxonox Error: Could not start rendering. No Ogre root object found" << std::endl; 417 410 return; 418 411 } -
code/trunk/src/orxonox/Orxonox.h
r1056 r1089 61 61 void init(int argc, char **argv, std::string path); 62 62 void start(); 63 // not sure if this should be private 64 void abortImmediate(/* some error code */); 63 void abortImmediateForce(); 65 64 void abortRequest(); 66 65 inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
Note: See TracChangeset
for help on using the changeset viewer.