Changeset 677
- Timestamp:
- Dec 23, 2007, 7:19:07 PM (17 years ago)
- Location:
- code/branches/FICN/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/audio/AudioIncludes.h
r420 r677 12 12 13 13 #include "../orxonox/core/Error.h" 14 -
code/branches/FICN/src/audio/AudioStream.cc
r560 r677 105 105 { 106 106 COUT(3) 107 << "version " << vorbisInfo->version << "\n"108 << "channels " << vorbisInfo->channels << "\n"109 << "rate (hz) " << vorbisInfo->rate << "\n"110 << "bitrate upper " << vorbisInfo->bitrate_upper << "\n"111 << "bitrate nominal " << vorbisInfo->bitrate_nominal << "\n"112 << "bitrate lower " << vorbisInfo->bitrate_lower << "\n"113 << "bitrate window " << vorbisInfo->bitrate_window << "\n"114 << "\n"115 << "vendor " << vorbisComment->vendor << "\n";107 << "version " << vorbisInfo->version << std::endl 108 << "channels " << vorbisInfo->channels << std::endl 109 << "rate (hz) " << vorbisInfo->rate << std::endl 110 << "bitrate upper " << vorbisInfo->bitrate_upper << std::endl 111 << "bitrate nominal " << vorbisInfo->bitrate_nominal << std::endl 112 << "bitrate lower " << vorbisInfo->bitrate_lower << std::endl 113 << "bitrate window " << vorbisInfo->bitrate_window << std::endl 114 << std::endl 115 << "vendor " << vorbisComment->vendor << std::endl; 116 116 117 117 for(int i = 0; i < vorbisComment->comments; i++) 118 COUT(3) << " " << vorbisComment->user_comments[i] << "\n";118 COUT(3) << " " << vorbisComment->user_comments[i] << std::endl; 119 119 120 120 COUT(3) << std::endl; -
code/branches/FICN/src/audio/AudioStream.h
r673 r677 6 6 namespace audio 7 7 { 8 #define BUFFER_SIZE (4096 * 4) 9 10 class AudioStream 11 { 12 public: 13 AudioStream(std::string path); 14 void open(); 15 void release(); 16 void display(); 17 bool playback(); 18 bool playing(); 19 bool update(); 20 inline bool isLoaded() { return loaded; } 8 #define BUFFER_SIZE (4096 * 4) 21 9 22 protected: 23 24 bool stream(ALuint buffer); 25 void empty(); 26 void check(); 27 std::string errorString(int code); 28 29 private: 30 31 std::string path; 10 class AudioStream 11 { 12 public: 13 AudioStream(std::string path); 14 void open(); 15 void release(); 16 void display(); 17 bool playback(); 18 bool playing(); 19 bool update(); 20 inline bool isLoaded() { return loaded; } 32 21 33 FILE* oggFile; 34 OggVorbis_File oggStream;35 vorbis_info* vorbisInfo;36 vorbis_comment* vorbisComment;37 bool loaded; 22 protected: 23 bool stream(ALuint buffer); 24 void empty(); 25 void check(); 26 std::string errorString(int code); 38 27 39 ALuint buffers[2]; 40 ALuint source; 41 ALenum format; 42 }; 28 private: 29 std::string path; 30 31 FILE* oggFile; 32 OggVorbis_File oggStream; 33 vorbis_info* vorbisInfo; 34 vorbis_comment* vorbisComment; 35 bool loaded; 36 37 ALuint buffers[2]; 38 ALuint source; 39 ALenum format; 40 }; 43 41 } 44 42 -
code/branches/FICN/src/loader/LevelLoader.cc
r663 r677 136 136 mLoadOverlay->show(); 137 137 138 COUT(0) << "\n\n\nThis is Orxonox\nthe hottest 3D action shooter ever to exist\n\n\n"; 139 COUT(0) << "Level: " << name() << "\nDescription:" << description() << "\nImage:"<<image()<<"\n\n\n"; 140 COUT(4) << "Backgroundcolor: " << loadingBackgroundColor_ << "\nBackgroundimage:" << loadingBackgroundImage_ << "\n\n\n"; 138 COUT(0) << "This is Orxonox" << std::endl; 139 COUT(0) << "the hottest 3D action shooter ever to exist" << std::endl; 140 COUT(0) << "Level: " << name() << std::endl << "Description:" << description() << std::endl << "Image:" << image() << std::endl; 141 COUT(4) << "Backgroundcolor: " << loadingBackgroundColor_ << std::endl << "Backgroundimage:" << loadingBackgroundImage_ << std::endl; 141 142 142 143 } … … 162 163 if (elemVal == "ogg") 163 164 { 164 COUT(0) << "Adding sound "<< tElem->Attribute("src") << "\n\n\n";165 COUT(3) << "Adding sound "<< tElem->Attribute("src") << std::endl; 165 166 166 167 auMan->ambientAdd(tElem->Attribute("src")); … … 186 187 if (id) 187 188 { 188 189 189 orxonox::BaseObject* obj = id->fabricate(); 190 obj->loadParams(tElem); 190 191 } 191 192 else 192 193 { 193 COUT(2) << "Warning: '"<< tElem->Value() <<"' is not a valid classname. \n";194 COUT(2) << "Warning: '"<< tElem->Value() <<"' is not a valid classname." << std::endl; 194 195 } 195 196 } … … 203 204 204 205 205 COUT(0) << "Loading finished! \n\n\n\n\n";206 COUT(0) << "Loading finished!" << std::endl << std::endl; 206 207 } 207 208 } -
code/branches/FICN/src/orxonox/core/ClassFactory.h
r673 r677 67 67 bool ClassFactory<T>::create(const std::string& name) 68 68 { 69 COUT(4) << "*** Create entry for " << name << " in Factory. \n";69 COUT(4) << "*** Create entry for " << name << " in Factory." << std::endl; 70 70 ClassIdentifier<T>::getIdentifier()->addFactory(new ClassFactory<T>); 71 71 Factory::add(name, ClassIdentifier<T>::getIdentifier()); -
code/branches/FICN/src/orxonox/core/ConfigValueContainer.cc
r670 r677 57 57 if (!string2Number(this->value_.value_int_, valueString, defvalue)) // Try to convert the string to a value 58 58 this->setConfigFileEntyToDefault(); // The conversion failed 59 60 std::cout << "CVC: int: " << this->value_.value_int_ << std::endl;61 59 } 62 60 … … 80 78 if (!string2Number(this->value_.value_uint_, valueString, defvalue)) // Try to convert the string to a value 81 79 this->setConfigFileEntyToDefault(); // The conversion failed 82 83 std::cout << "CVC: uint: " << this->value_.value_uint_ << std::endl;84 80 } 85 81 -
code/branches/FICN/src/orxonox/core/CoreIncludes.h
r676 r677 95 95 */ 96 96 #define RegisterObject(ClassName) \ 97 COUT(4) << "*** Register Object: " << #ClassName << "\n"; \97 COUT(4) << "*** Register Object: " << #ClassName << std::endl; \ 98 98 InternRegisterObject(ClassName, false) 99 99 … … 103 103 */ 104 104 #define RegisterRootObject(ClassName) \ 105 COUT(4) << "*** Register Root-Object: " << #ClassName << "\n"; \105 COUT(4) << "*** Register Root-Object: " << #ClassName << std::endl; \ 106 106 InternRegisterRootObject(ClassName) 107 107 -
code/branches/FICN/src/orxonox/core/Factory.cc
r670 r677 84 84 void Factory::createClassHierarchy() 85 85 { 86 COUT(3) << "*** Factory -> Create class-hierarchy \n";86 COUT(3) << "*** Factory -> Create class-hierarchy" << std::endl; 87 87 std::map<std::string, Identifier*>::iterator it; 88 88 it = getFactoryPointer()->identifierStringMap_.begin(); … … 95 95 } 96 96 (*getFactoryPointer()->identifierStringMap_.begin()).second->stopCreatingHierarchy(); 97 COUT(3) << "*** Factory -> Finished class-hierarchy creation \n";97 COUT(3) << "*** Factory -> Finished class-hierarchy creation" << std::endl; 98 98 } 99 99 -
code/branches/FICN/src/orxonox/core/Identifier.cc
r670 r677 68 68 void Identifier::initialize(const IdentifierList* parents) 69 69 { 70 COUT(4) << "*** Initialize " << this->name_ << "-Singleton. \n";70 COUT(4) << "*** Initialize " << this->name_ << "-Singleton." << std::endl; 71 71 this->bCreatedOneObject_ = true; 72 72 … … 97 97 { 98 98 // Abstract classes don't have a factory and therefore can't create new objects 99 COUT(1) << "Error: Cannot create an object of type '" << this->name_ << "'. Class is abstract. \n";100 COUT(1) << "Aborting..." ;99 COUT(1) << "Error: Cannot create an object of type '" << this->name_ << "'. Class is abstract." << std::endl; 100 COUT(1) << "Aborting..." << std::endl; 101 101 abort(); 102 102 return NULL; -
code/branches/FICN/src/orxonox/core/Identifier.h
r673 r677 117 117 { 118 118 hierarchyCreatingCounter_s++; 119 COUT(4) << "*** Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n";119 COUT(4) << "*** Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << std::endl; 120 120 } 121 121 … … 126 126 { 127 127 hierarchyCreatingCounter_s--; 128 COUT(4) << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n";128 COUT(4) << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << std::endl; 129 129 } 130 130 … … 201 201 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass) 202 202 { 203 COUT(4) << "*** Register Class in " << name << "-Singleton. \n";203 COUT(4) << "*** Register Class in " << name << "-Singleton." << std::endl; 204 204 205 205 // It's a singleton, so maybe we have to create it first 206 206 if (!pointer_s) 207 207 { 208 COUT(4) << "*** Register Class in " << name << "-Singleton -> Create Singleton. \n";208 COUT(4) << "*** Register Class in " << name << "-Singleton -> Create Singleton." << std::endl; 209 209 pointer_s = new ClassIdentifier(); 210 210 } … … 214 214 { 215 215 // If no: We have to store the informations and initialize the Identifier 216 217 COUT(4) << "*** Register Class in " << name << "-Singleton -> Initialize Singleton.\n"; 216 COUT(4) << "*** Register Class in " << name << "-Singleton -> Initialize Singleton." << std::endl; 218 217 pointer_s->name_ = name; 219 // Factory::add(name, pointer_s); // Add the Identifier to the Factory220 221 218 if (bRootClass) 222 219 pointer_s->initialize(NULL); // If a class is derived from two interfaces, the second interface might think it's derived from the first because of the order of constructor-calls. Thats why we set parents to zero in that case. … … 236 233 if (!pointer_s) 237 234 { 238 COUT(4) << "*** Create Singleton. \n";235 COUT(4) << "*** Create Singleton." << std::endl; 239 236 pointer_s = new ClassIdentifier(); 240 237 } … … 250 247 void ClassIdentifier<T>::addObject(T* object) 251 248 { 252 COUT(4) << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list. \n";249 COUT(4) << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list." << std::endl; 253 250 object->getMetaList().add(ClassIdentifier<T>::getIdentifier()->objects_, ClassIdentifier<T>::getIdentifier()->objects_->add(object)); 254 251 } … … 285 282 if (!identifier->isA(ClassIdentifier<T>::getIdentifier())) 286 283 { 287 COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "! \n";288 COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden. \n";289 COUT(1) << "Aborting... \n";284 COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!" << std::endl; 285 COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl; 286 COUT(1) << "Aborting..." << std::endl; 290 287 abort(); 291 288 } … … 331 328 if (this->identifier_) 332 329 { 333 COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "! \n";334 COUT(1) << "Error: Couldn't fabricate a new Object. \n";335 COUT(1) << "Aborting... \n";330 COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!" << std::endl; 331 COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl; 332 COUT(1) << "Aborting..." << std::endl; 336 333 } 337 334 else 338 335 { 339 COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined. \n";340 COUT(1) << "Aborting... \n";336 COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined." << std::endl; 337 COUT(1) << "Aborting..." << std::endl; 341 338 } 342 339 -
code/branches/FICN/src/orxonox/core/Iterator.h
r673 r677 151 151 // Comparing with anything except zero makes no sense 152 152 if (compare != 0) 153 COUT(2) << "Warning: Comparing the " << ClassIdentifier<T>::getIdentifier()->getName() << "-List-Iterator with " << compare << " has no effect. Only comparison with 0 works. \n";153 COUT(2) << "Warning: Comparing the " << ClassIdentifier<T>::getIdentifier()->getName() << "-List-Iterator with " << compare << " has no effect. Only comparison with 0 works." << std::endl; 154 154 155 155 return (this->element_ != 0); -
code/branches/FICN/src/orxonox/core/MetaObjectList.h
r673 r677 70 70 71 71 72 COUT(4) << "*** Removing Object from " << ClassIdentifier<T>::getIdentifier()->getName() << "-list. \n";72 COUT(4) << "*** Removing Object from " << ClassIdentifier<T>::getIdentifier()->getName() << "-list." << std::endl; 73 73 delete this->element_; 74 74 } -
code/branches/FICN/src/orxonox/objects/test1.cc
r670 r677 52 52 void Test1::tick(float dt) 53 53 { 54 std::cout << "Test1: " << this << "\n";54 std::cout << "Test1: " << this << std::endl; 55 55 } 56 56 … … 72 72 void Test1::setUsefullClass1(Identifier* identifier) 73 73 { 74 std::cout << "\n";75 std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";76 std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";77 std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";74 std::cout << std::endl; 75 std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; 76 std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; 77 std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; 78 78 this->usefullClass1_ = identifier; 79 79 } … … 81 81 void Test1::setUsefullClass2(Identifier* identifier) 82 82 { 83 std::cout << "\n";84 std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";85 std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";86 std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";83 std::cout << std::endl; 84 std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; 85 std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; 86 std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; 87 87 this->usefullClass2_ = identifier; 88 88 } … … 90 90 void Test1::setUsefullClassOfTypeTest3(Identifier* identifier) 91 91 { 92 std::cout << "\n";93 std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";94 std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";95 std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";92 std::cout << std::endl; 93 std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; 94 std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; 95 std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; 96 96 this->usefullClass3_ = identifier; 97 97 } -
code/branches/FICN/src/orxonox/objects/test2.cc
r670 r677 53 53 void Test2::timerFunction1() 54 54 { 55 std::cout << "Test2: 1 Sekunde \n";55 std::cout << "Test2: 1 Sekunde" << std::endl; 56 56 } 57 57 58 58 void Test2::timerFunction2() 59 59 { 60 std::cout << "Test2: 5 Sekunden \n";60 std::cout << "Test2: 5 Sekunden" << std::endl; 61 61 } 62 62 63 63 void Test2::timerFunction3() 64 64 { 65 std::cout << "Test2: 10 Sekunden sind um! \n";65 std::cout << "Test2: 10 Sekunden sind um!" << std::endl; 66 66 } 67 67 … … 83 83 void Test2::setUsefullClass1(Identifier* identifier) 84 84 { 85 std::cout << "\n";86 std::cout << "Test2: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";87 std::cout << "Test2: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";88 std::cout << "Test2: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";85 std::cout << std::endl; 86 std::cout << "Test2: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; 87 std::cout << "Test2: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; 88 std::cout << "Test2: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; 89 89 this->usefullClass1_ = identifier; 90 90 } … … 92 92 void Test2::setUsefullClass2(Identifier* identifier) 93 93 { 94 std::cout << "\n";95 std::cout << "Test2: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";96 std::cout << "Test2: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";97 std::cout << "Test2: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";94 std::cout << std::endl; 95 std::cout << "Test2: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; 96 std::cout << "Test2: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; 97 std::cout << "Test2: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; 98 98 this->usefullClass2_ = identifier; 99 99 } … … 101 101 void Test2::setUsefullClassOfTypeTest3(Identifier* identifier) 102 102 { 103 std::cout << "\n";104 std::cout << "Test2: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";105 std::cout << "Test2: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";106 std::cout << "Test2: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";103 std::cout << std::endl; 104 std::cout << "Test2: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << std::endl; 105 std::cout << "Test2: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << std::endl; 106 std::cout << "Test2: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << std::endl; 107 107 this->usefullClass3_ = identifier; 108 108 } -
code/branches/FICN/src/orxonox/objects/test3.cc
r670 r677 78 78 79 79 #define testandcout(code) \ 80 std::cout << #code << " " << code << "\n"80 std::cout << #code << " " << code << std::endl 81 81 82 82 void Test3::usefullClassesIsATest(Test1* test1) 83 83 { 84 std::cout << "\n";85 std::cout << "Test1: \n";84 std::cout << std::endl; 85 std::cout << "Test1:" << std::endl; 86 86 testandcout(test1->usefullClass1isA(Class(Test1))); 87 87 testandcout(test1->usefullClass1isA(Class(Test2))); 88 88 testandcout(test1->usefullClass1isA(Class(Test3))); 89 std::cout << "\n";89 std::cout << std::endl; 90 90 testandcout(test1->usefullClass2isA(Class(Test1))); 91 91 testandcout(test1->usefullClass2isA(Class(Test2))); 92 92 testandcout(test1->usefullClass2isA(Class(Test3))); 93 std::cout << "\n";93 std::cout << std::endl; 94 94 testandcout(test1->usefullClass3isA(Class(Test1))); 95 95 testandcout(test1->usefullClass3isA(Class(Test2))); … … 99 99 void Test3::usefullClassesIsATest(Test2* test2) 100 100 { 101 std::cout << "\n";102 std::cout << "Test2: \n";101 std::cout << std::endl; 102 std::cout << "Test2:" << std::endl; 103 103 testandcout(test2->usefullClass1isA(Class(Test1))); 104 104 testandcout(test2->usefullClass1isA(Class(Test2))); 105 105 testandcout(test2->usefullClass1isA(Class(Test3))); 106 std::cout << "\n";106 std::cout << std::endl; 107 107 testandcout(test2->usefullClass2isA(Class(Test1))); 108 108 testandcout(test2->usefullClass2isA(Class(Test2))); 109 109 testandcout(test2->usefullClass2isA(Class(Test3))); 110 std::cout << "\n";110 std::cout << std::endl; 111 111 testandcout(test2->usefullClass3isA(Class(Test1))); 112 112 testandcout(test2->usefullClass3isA(Class(Test2)));
Note: See TracChangeset
for help on using the changeset viewer.