Changeset 560
- Timestamp:
- Dec 17, 2007, 3:20:46 AM (17 years ago)
- Location:
- code/branches/FICN/src
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/audio/AudioManager.cc
r513 r560 27 27 28 28 #include "AudioManager.h" 29 30 29 #include "../orxonox/core/Debug.h" 31 30 32 31 namespace audio … … 61 60 else 62 61 { 63 std::cout << "Started playing background sound"<<std::endl;62 COUT(3) << "Info: Started playing background sound" << std::endl; 64 63 } 65 64 } … … 69 68 void AudioManager::ambientStop() 70 69 { 71 std::cout << "Stopped playing background sound"<<std::endl;70 COUT(3) << "Info: Stopped playing background sound" << std::endl; 72 71 } 73 72 … … 80 79 { 81 80 bgSounds.push_back(tmp); 82 std::cout << "Added background sound "<<file<<std::endl;81 COUT(3) << "Info: Added background sound " << file << std::endl; 83 82 } 84 83 } … … 118 117 } 119 118 bgSounds[currentBgSound].playback(); 120 std::cout << "Playing next background sound "<<std::endl;119 COUT(3) << "Info: Playing next background sound" << std::endl; 121 120 } 122 121 } -
code/branches/FICN/src/audio/AudioStream.cc
r513 r560 28 28 29 29 #include "AudioStream.h" 30 #include "../orxonox/core/Debug.h" 30 31 31 32 namespace audio … … 103 104 if (loaded) 104 105 { 105 std::cout106 COUT(3) 106 107 << "version " << vorbisInfo->version << "\n" 107 108 << "channels " << vorbisInfo->channels << "\n" … … 115 116 116 117 for(int i = 0; i < vorbisComment->comments; i++) 117 std::cout<< " " << vorbisComment->user_comments[i] << "\n";118 119 std::cout<< std::endl;118 COUT(3) << " " << vorbisComment->user_comments[i] << "\n"; 119 120 COUT(3) << std::endl; 120 121 } 121 122 } -
code/branches/FICN/src/audio/_AudioObject.cc
r513 r560 30 30 #include <string> 31 31 #include "AudioObject.h" 32 #include "../orxonox/core/Debug.h" 32 33 33 34 namespace audio … … 74 75 75 76 SetListenerValues(); 76 std::cout << "Play sone ambient background sound";77 COUT(3) << "Info: Play sone ambient background sound"; 77 78 } 78 79 -
code/branches/FICN/src/loader/LevelLoader.cc
r559 r560 133 133 mLoadOverlay->show(); 134 134 135 std::cout<< "\n\n\nThis is Orxonox\nthe hottest 3D action shooter ever to exist\n\n\n";136 std::cout<< "Level: " << name() << "\nDescription:" << description() << "\nImage:"<<image()<<"\n\n\n";137 std::cout<< "Backgroundcolor: " << loadingBackgroundColor_ << "\nBackgroundimage:" << loadingBackgroundImage_ << "\n\n\n";135 COUT(0) << "\n\n\nThis is Orxonox\nthe hottest 3D action shooter ever to exist\n\n\n"; 136 COUT(0) << "Level: " << name() << "\nDescription:" << description() << "\nImage:"<<image()<<"\n\n\n"; 137 COUT(4) << "Backgroundcolor: " << loadingBackgroundColor_ << "\nBackgroundimage:" << loadingBackgroundImage_ << "\n\n\n"; 138 138 139 139 } … … 170 170 mLoadOverlay->hide(); 171 171 } 172 std::cout<< "Loading finished!\n\n\n\n\n";172 COUT(0) << "Loading finished!\n\n\n\n\n"; 173 173 } 174 174 } -
code/branches/FICN/src/misc/String2Number.h
r507 r560 5 5 #include <sstream> 6 6 #include <iostream> 7 8 #include "../orxonox/core/Debug.h" 7 9 8 10 /** … … 16 18 * 17 19 * @example 18 * float f; 20 * float f; 19 21 * String2Number<float>(f, std::string(" 123.45 ")); 20 22 */ … … 29 31 * 30 32 * First value is the target variable, the second vector is the 31 * string where the number is taken from, the third parameter 33 * string where the number is taken from, the third parameter 32 34 * should be one of std::hex, std::dec or std::oct (dec is default value) 33 35 */ … … 36 38 std::istringstream iss(s); 37 39 success_ = !(iss >> f >> t).fail(); 38 40 39 41 if (!success_ && haltOnError==1) 40 42 { 41 std::cout << "Conversion error from string to number in \"" << s << "\"" << std::endl;43 COUT(1) << "Error: Conversion from string to number in \"" << s << "\" failed." << std::endl; 42 44 exit(1); 43 45 } -
code/branches/FICN/src/orxonox/core/CMakeLists.txt
r555 r560 11 11 SignalHandler.cc 12 12 ArgReader.cc 13 DebugLevel.cc 13 14 ) 14 15 -
code/branches/FICN/src/orxonox/core/Debug.h
r499 r560 25 25 26 26 #include <stdio.h> 27 28 int getSoftDebugLevel(); 27 29 28 30 // DEFINE ERROR MODES … … 38 40 39 41 #define ORX_HARD_DEBUG_LEVEL ORX_DEBUG 40 #define ORX_SOFT_DEBUG_LEVEL ORX_WARNING // <-- fix that! should be a configurable setting42 //#define ORX_SOFT_DEBUG_LEVEL ORX_WARNING // <-- fix that! should be a configurable setting 41 43 42 44 /////////////////////////////////////////////////// … … 61 63 #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR 62 64 #define PRINTF1 \ 63 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_ERROR) \65 if (getSoftDebugLevel() >= ORX_ERROR) \ 64 66 printf("Error (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 65 67 #else … … 69 71 #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING 70 72 #define PRINTF2 \ 71 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_WARNING) \73 if (getSoftDebugLevel() >= ORX_WARNING) \ 72 74 printf("Warning (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 73 75 #else … … 77 79 #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO 78 80 #define PRINTF3 \ 79 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_INFO) \81 if (getSoftDebugLevel() >= ORX_INFO) \ 80 82 printf("Info (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 81 83 #else … … 85 87 #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG 86 88 #define PRINTF4 \ 87 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_DEBUG) \89 if (getSoftDebugLevel() >= ORX_DEBUG) \ 88 90 printf("Debug (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 89 91 #else … … 93 95 #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG 94 96 #define PRINTF5 \ 95 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_vDEBUG) \97 if (getSoftDebugLevel() >= ORX_vDEBUG) \ 96 98 printf("vDebug (in %s, line %d): ", __FILE__, __LINE__), PRINT_EXEC 97 99 #else … … 124 126 #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR 125 127 #define PRINT1 \ 126 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_ERROR) \128 if (getSoftDebugLevel() >= ORX_ERROR) \ 127 129 PRINT_EXEC 128 130 #else … … 132 134 #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING 133 135 #define PRINT2 \ 134 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_WARNING) \136 if (getSoftDebugLevel() >= ORX_WARNING) \ 135 137 PRINT_EXEC 136 138 #else … … 140 142 #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO 141 143 #define PRINT3 \ 142 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_INFO) \144 if (getSoftDebugLevel() >= ORX_INFO) \ 143 145 PRINT_EXEC 144 146 #else … … 148 150 #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG 149 151 #define PRINT4 \ 150 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_DEBUG) \152 if (getSoftDebugLevel() >= ORX_DEBUG) \ 151 153 PRINT_EXEC 152 154 #else … … 156 158 #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG 157 159 #define PRINT5 \ 158 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_vDEBUG) \160 if (getSoftDebugLevel() >= ORX_vDEBUG) \ 159 161 PRINT_EXEC 160 162 #else … … 188 190 #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR 189 191 #define COUT1 \ 190 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_ERROR) \192 if (getSoftDebugLevel() >= ORX_ERROR) \ 191 193 COUT_EXEC 192 194 #else … … 197 199 #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING 198 200 #define COUT2 \ 199 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_WARNING) \201 if (getSoftDebugLevel() >= ORX_WARNING) \ 200 202 COUT_EXEC 201 203 #else … … 206 208 #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO 207 209 #define COUT3 \ 208 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_INFO) \210 if (getSoftDebugLevel() >= ORX_INFO) \ 209 211 COUT_EXEC 210 212 #else … … 215 217 #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG 216 218 #define COUT4 \ 217 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_DEBUG) \219 if (getSoftDebugLevel() >= ORX_DEBUG) \ 218 220 COUT_EXEC 219 221 #else … … 224 226 #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG 225 227 #define COUT5 \ 226 if ( ORX_SOFT_DEBUG_LEVEL>= ORX_vDEBUG) \228 if (getSoftDebugLevel() >= ORX_vDEBUG) \ 227 229 COUT_EXEC 228 230 #else -
code/branches/FICN/src/orxonox/core/Error.cc
r513 r560 27 27 28 28 #include "Error.h" 29 #include "Debug.h" 29 30 30 31 namespace orxonox … … 42 43 Error::Error(int errorCode, std::string errorMsg) 43 44 { 44 std::cout<< "############################ "<< std::endl45 COUT(1) << "############################ "<< std::endl 45 46 << "# Error "<<errorCode<< " #"<< std::endl 46 47 << "############################ "<< std::endl … … 58 59 } 59 60 } 60 std::cout<< errorMsg << std::endl<< std::endl;61 COUT(1) << errorMsg << std::endl<< std::endl; 61 62 } 62 63 } -
code/branches/FICN/src/orxonox/core/SignalHandler.cc
r497 r560 14 14 */ 15 15 16 #include <assert.h> 17 16 18 #include "SignalHandler.h" 17 #include <assert.h>19 #include "Debug.h" 18 20 19 21 SignalHandler * SignalHandler::singletonRef = NULL; … … 101 103 } 102 104 103 printf( "recieved signal %s\ntry to write backtrace to file orxonox.log\n", sigName.c_str() );105 PRINTF(0)( "recieved signal %s\ntry to write backtrace to file orxonox.log\n", sigName.c_str() ); 104 106 105 107 int sigPipe[2]; … … 129 131 if ( someData != 0x12345678 ) 130 132 { 131 printf("something went wrong :(\n");133 PRINTF(0)("something went wrong :(\n"); 132 134 } 133 135 … … 278 280 if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() ) 279 281 { 280 printf( ( std::string("could not write %d byte to ") + getInstance()->fileName ).c_str(), bt.length());282 PRINTF(0)( ( std::string("could not write %d byte to ") + getInstance()->fileName ).c_str(), bt.length()); 281 283 exit(EXIT_FAILURE); 282 284 } -
code/branches/FICN/src/orxonox/graphicsEngine.cc
r546 r560 35 35 #include <OgreConfigFile.h> 36 36 #include <OgreTextureManager.h> 37 #include "core/Debug.h" 37 38 38 39 … … 74 75 { 75 76 scene_ = root_->createSceneManager(ST_GENERIC, "Default SceneManager"); 76 std::cout << "created SceneMan: " << scene_ << std::endl;77 COUT(3) << "Info: Created SceneMan: " << scene_ << std::endl; 77 78 } 78 79 return scene_; -
code/branches/FICN/src/orxonox/objects/Ambient.cc
r513 r560 33 33 #include "../../misc/Tokenizer.h" 34 34 #include "../../misc/String2Number.h" 35 #include "../core/Debug.h" 35 36 36 37 #include "Ambient.h" … … 64 65 mgr->setAmbientLight(ColourValue(r,g,b)); 65 66 66 std::cout<< "Loader: Set ambient light: "<<r<<" " << g << " " << b << std::endl << std::endl;67 COUT(4) << "Loader: Set ambient light: "<<r<<" " << g << " " << b << std::endl << std::endl; 67 68 } 68 69 } -
code/branches/FICN/src/orxonox/objects/Camera.cc
r515 r560 11 11 #include "../../misc/Tokenizer.h" 12 12 #include "../../misc/String2Number.h" 13 #include "../core/Debug.h" 13 14 14 15 #include "Camera.h" … … 30 31 { 31 32 Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager(); 32 33 33 34 if (xmlElem->Attribute("name") && xmlElem->Attribute("pos") && xmlElem->Attribute("lookat") && xmlElem->Attribute("node")) 34 35 { 35 36 // <Camera name="Camera" pos="0,0,-250" lookat="0,0,0" /> 36 37 37 38 std::string name = xmlElem->Attribute("name"); 38 39 std::string pos = xmlElem->Attribute("pos"); … … 57 58 58 59 std::string node = xmlElem->Attribute("node"); 59 60 60 61 Ogre::SceneNode* sceneNode = (Ogre::SceneNode*)mgr->getRootSceneNode()->getChild(node); 61 62 sceneNode->attachObject((Ogre::MovableObject*)cam); 62 63 63 64 64 65 Ogre::Viewport* vp = orxonox::Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam); 65 66 66 67 std::cout << "Loader: Created camera "<< name << std::endl << std::endl; 68 } 67 68 COUT(4) << "Loader: Created camera "<< name << std::endl << std::endl; 69 } 69 70 } 70 71 } -
code/branches/FICN/src/orxonox/objects/Entity.cc
r531 r560 6 6 #include "../../misc/Tokenizer.h" 7 7 #include "../../misc/String2Number.h" 8 #include "../core/Debug.h" 8 9 9 10 #include "Entity.h" … … 25 26 { 26 27 Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager(); 27 28 28 29 if (xmlElem->Attribute("name") && xmlElem->Attribute("src") && xmlElem->Attribute("node")) 29 30 { … … 31 32 std::string src = xmlElem->Attribute("src"); 32 33 std::string node = xmlElem->Attribute("node"); 33 34 34 35 Ogre::Entity* entity = mgr->createEntity(name, src); 35 36 … … 37 38 sceneNode->attachObject((Ogre::MovableObject*)entity); 38 39 39 std::cout<< "Loader: Created entity "<< name <<" with source " << src << " at node " << node << std::endl << std::endl;40 } 40 COUT(4) << "Loader: Created entity "<< name <<" with source " << src << " at node " << node << std::endl << std::endl; 41 } 41 42 } 42 43 43 44 } -
code/branches/FICN/src/orxonox/objects/SceneNode.cc
r515 r560 6 6 #include "../../misc/Tokenizer.h" 7 7 #include "../../misc/String2Number.h" 8 #include "../core/Debug.h" 8 9 9 10 #include "SceneNode.h" … … 25 26 { 26 27 Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager(); 27 28 28 29 if (xmlElem->Attribute("name") && xmlElem->Attribute("pos")) 29 30 { … … 36 37 String2Number<float>(z, pos[2]); 37 38 38 39 39 40 mgr->getRootSceneNode()->createChildSceneNode(name, Vector3(x,y,z)); 40 41 std::cout<< "Loader: Created node "<< name <<" : "<<x<<" " << y << " " << z << std::endl << std::endl;42 } 41 42 COUT(4) << "Loader: Created node "<< name <<" : "<<x<<" " << y << " " << z << std::endl << std::endl; 43 } 43 44 } 44 45 } -
code/branches/FICN/src/orxonox/objects/Skybox.cc
r513 r560 33 33 #include "../../misc/Tokenizer.h" 34 34 #include "../../misc/String2Number.h" 35 #include "../core/Debug.h" 35 36 36 37 #include "Skybox.h" … … 58 59 mgr->setSkyBox(true, skyboxSrc); 59 60 60 std::cout<< "Loader: Set skybox: "<< skyboxSrc << std::endl << std::endl;61 COUT(4) << "Loader: Set skybox: "<< skyboxSrc << std::endl << std::endl; 61 62 } 62 63 } -
code/branches/FICN/src/orxonox/objects/SpaceshipSteeringObject.cc
r519 r560 11 11 #include "../../misc/Tokenizer.h" 12 12 #include "../../misc/String2Number.h" 13 #include "../core/Debug.h" 13 14 14 15 #include "SpaceshipSteeringObject.h" … … 32 33 { 33 34 SpaceshipSteering* steering = orxonox::Orxonox::getSingleton()->getSteeringPointer(); 34 35 35 36 if (xmlElem->Attribute("node") && xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft")) 36 37 { … … 46 47 String2Number<float>(rotaterightleft, rotaterightleftStr); 47 48 String2Number<float>(looprightleft, looprightleftStr); 48 49 49 50 steering = new SpaceshipSteering(forward, rotateupdown, rotaterightleft, looprightleft); 50 51 51 52 Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager(); 52 53 Ogre::SceneNode* sceneNode = (Ogre::SceneNode*)mgr->getRootSceneNode()->getChild(nodeStr); 53 54 54 55 steering->addNode(sceneNode); 55 56 57 58 59 std::cout<< "Loader: Initialized spaceship steering at node " << nodeStr << " values "<< forward << " " << rotateupdown << " "<< rotaterightleft << " "<< looprightleft << " "<< std::endl << std::endl;60 } 56 57 58 59 60 COUT(4) << "Loader: Initialized spaceship steering at node " << nodeStr << " values "<< forward << " " << rotateupdown << " "<< rotaterightleft << " "<< looprightleft << " "<< std::endl << std::endl; 61 } 61 62 } 62 63 } -
code/branches/FICN/src/orxonox/orxonox.cc
r546 r560 56 56 #include "core/ArgReader.h" 57 57 #include "core/Factory.h" 58 #include "core/Debug.h" 58 59 59 60 #include "../loader/LevelLoader.h" … … 310 311 if(ogre_ && ogre_->getRoot()) 311 312 ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); // adds a framelistener for the server 312 std::cout << "network framelistener added" << std::endl;313 COUT(3) << "Info: network framelistener added" << std::endl; 313 314 } 314 315 catch(exception &e) 315 316 { 316 std::cout << "There was a problem initialising the server :(" << std::endl;317 COUT(1) << "Error: There was a problem initialising the server :(" << std::endl; 317 318 } 318 319 startRenderLoop(); -
code/branches/FICN/src/orxonox/spaceship_steering.cc
r531 r560 29 29 #include "spaceship_steering.h" 30 30 #include <iostream> 31 #include "core/Debug.h" 32 31 33 using namespace Ogre; 32 34 … … 34 36 maxSpeedRotateUpDown, float maxSpeedRotateRightLeft, float 35 37 maxSpeedLoopRightLeft) { 36 37 std::cout << "Steering was loaded" << std::endl; 38 39 COUT(3) << "Info: Steering was loaded" << std::endl; 38 40 moveForward_ = 0; 39 41 rotateUp_ = 0;
Note: See TracChangeset
for help on using the changeset viewer.