Changeset 7729 in orxonox.OLD for trunk/src/lib
- Timestamp:
- May 19, 2006, 3:07:09 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/primitive_model.cc
r6912 r7729 34 34 { 35 35 switch (type) 36 36 { 37 37 default: 38 38 case PRIM_CUBE: … … 51 51 this->planeModel(size, detail); 52 52 break; 53 53 } 54 54 this->finalize(); 55 55 } … … 79 79 // defining the Vertices 80 80 for (float i = 0; i < df *2.0; i+=1.0) 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 81 { 82 float vi = i/df * PI; 83 for (float j = -df / 2.0 +1.0; j <= df / 2.0; j+=1.0 *df/(df+1.0)) 84 { 85 float vj = j/df *PI; 86 this->addVertexNormal(cos(vi) * cos(vj), 87 sin(vj), 88 sin(vi) * cos(vj)); 89 90 this->addVertex(size * cos(vi) * cos(vj), 91 size * sin(vj), 92 size * sin(vi) * cos(vj)); 93 94 this->addVertexTexture( i / (df *2.0), 95 (j-1.0)/(df)+.5); 96 } 97 } 98 98 this->addVertex(0, -size, 0); 99 99 this->addVertexNormal(0, -1, 0); … … 106 106 unsigned int v1, v2, v3, v4; 107 107 for (int i = 0; i <= detail * 2 -1; i++) 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 108 { 109 for (int j = 0; j <= detail; j++) 110 { 111 112 v1 = i*detail + j-1; 113 v4 = i*detail + j; 114 115 if (i == detail*2 -1) 116 { 117 v2 = j-1; 118 v3 = j; 119 } 120 else 121 { 122 v2 = (i+1)*detail + j-1; 123 v3 = (i+1)*detail + j; 124 } 125 126 if (j == 0) 127 { 128 v1 = this->getVertexCount() - 2; 129 this->addFace(3, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v3, v3, v3, v4, v4, v4); 130 } 131 else if (j == detail) 132 { 133 v3 = this->getVertexCount()-1; 134 this->addFace(3, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v2, v2, v2, v3, v3, v3); 135 } 136 else 137 this->addFace(4, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v2, v2, v2, v3, v3, v3, v4, v4, v4); 138 } 139 } 140 140 } 141 141 /** … … 150 150 // defining Points of the Cylinder. 151 151 for (float phi = 0.0; phi < 2.0*PI; phi += 2.0*PI/(float)detail) 152 153 154 155 156 152 { 153 this->addVertex(size*cos(phi), size*sin(phi), -size); 154 this->addVertex(size*cos(phi), size*sin(phi), size); 155 count ++; 156 } 157 157 this->addVertex(0, 0, -size); 158 158 this->addVertex(0, 0, size); 159 159 160 160 if (count != detail) 161 { 161 162 PRINTF(1)("calculation error, count should be %d but is %d.\n", detail, count); 162 163 } 163 164 // adding Faces 164 165 for (int i = 0; i < detail-1; i++) 165 166 167 168 169 170 171 172 173 174 175 166 { 167 int p1, p2, p3, p4; 168 p1 = 2*i; 169 p2 = 2*i+1; 170 p3 = 2*i+3; 171 p4 = 2*i+2; 172 // something is wrong here 173 this->addFace(4, VERTEX_ONLY, p1, p2, p3, p4); 174 this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail); 175 this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+1); 176 } 176 177 // caps 177 178 this->addFace(4, VERTEX_ONLY, 2*detail-2, 2*detail-1, 1, 0); … … 195 196 // defining the Vertices 196 197 for (float i = 0; i < df; i+=1.0) 197 198 199 200 201 202 198 { 199 float vi = i/df *2.0*PI; 200 this->addVertex(size* sin(vi), 201 -size, 202 size* cos(vi)); 203 } 203 204 204 205 //defining Faces 205 206 for (int i = 0; i < detail; i++) 206 207 208 209 210 211 212 213 214 215 207 { 208 unsigned int v1, v2; 209 v1 = i+2; 210 if (i == detail -1) 211 v2 = 2; 212 else 213 v2 = i+3; 214 this->addFace(3, VERTEX_ONLY, 0, v1, v2); 215 this->addFace(3, VERTEX_ONLY, 1, v1, v2); 216 } 216 217 } 217 218 … … 226 227 for (int i = 0; i < detail; i++) 227 228 for (int j = 0; j < detail; j++) 228 229 230 231 232 233 234 229 { 230 this->addVertex(((float)i/(float)(detail-1) -.5)*size, 231 0, 232 ((float)j/(float)(detail-1) -.5)*size); 233 this->addVertexTexture((float)i/(float)(detail-1), 234 (float)j/(float)(detail-1)); 235 } 235 236 //defining Faces 236 237 unsigned int v1, v2, v3, v4; 237 238 for (int i = 0; i < detail-1; i++) 238 239 for (int j = 0; j < detail-1; j++) 239 240 241 242 243 244 245 246 } 240 { 241 v1 = i*detail + j; 242 v2 = (i+1)*detail + j; 243 v3 = (i+1)*detail + (j+1); 244 v4 = i*detail + (j+1); 245 this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4); 246 } 247 } -
trunk/src/lib/gui/gtk_gui/gui_exec.cc
r7661 r7729 76 76 #ifdef DEBUG 77 77 verboseMode = new Menu(CONFIG_NAME_VERBOSE_MODE, "nothing", 78 #if DEBUG >=178 #if DEBUG_LEVEL >=1 79 79 "error", 80 80 #endif 81 #if DEBUG >=281 #if DEBUG_LEVEL >=2 82 82 "warning", 83 83 #endif 84 #if DEBUG >=384 #if DEBUG_LEVEL >=3 85 85 "info", 86 86 #endif 87 #if DEBUG >=487 #if DEBUG_LEVEL >=4 88 88 "debug", 89 89 #endif 90 #if DEBUG >=590 #if DEBUG_LEVEL >=5 91 91 "heavydebug", 92 92 #endif … … 95 95 verboseMode->setDescription("Sets the Output Mode", "This Enables Outbug messages\n" 96 96 "0: nothing will be displayed, but stuff one cannot do without (eg.GUI)\n" 97 #if DEBUG >=197 #if DEBUG_LEVEL >=1 98 98 "1: error: outputs all the above and errors" 99 99 #endif 100 #if DEBUG >=2100 #if DEBUG_LEVEL >=2 101 101 "2: warning: outputs all the above plus warnings" 102 102 #endif 103 #if DEBUG >=3103 #if DEBUG_LEVEL >=3 104 104 "3: info: outputs all the above plus Information" 105 105 #endif 106 #if DEBUG >=4106 #if DEBUG_LEVEL >=4 107 107 "4: debug: displays all the above plus debug information" 108 108 #endif 109 #if DEBUG >=5109 #if DEBUG_LEVEL >=5 110 110 "5: heavydebug: displays all the above plus heavy debug information: WARNING: the game will run very slow with this." 111 111 #endif -
trunk/src/lib/parser/ini_parser/ini_parser.cc
r7676 r7729 28 28 #endif 29 29 30 #ifdef DEBUG 30 #ifdef DEBUG_LEVEL 31 31 #include "../../../defs/debug.h" 32 32 #else 33 33 #define PRINTF(x) printf 34 #define PRINT(x) printf 34 35 #endif 35 36 -
trunk/src/lib/shell/shell_buffer.cc
r7375 r7729 103 103 104 104 SDL_mutexP(ShellBuffer::bufferMutex); 105 #if DEBUG < 3105 #if DEBUG_LEVEL < 3 106 106 if (ShellBuffer::singletonRef == NULL) 107 107 #endif 108 108 vprintf(line, arguments); 109 #if DEBUG < 3109 #if DEBUG_LEVEL < 3 110 110 else 111 111 #else … … 180 180 181 181 /** 182 * displays some nice output from the Shell182 * @brief displays some nice output from the Shell 183 183 */ 184 184 void ShellBuffer::debug() const -
trunk/src/lib/shell/shell_input.cc
r7676 r7729 44 44 45 45 this->inputLine = ""; 46 this->historyIT = this->history.begin();46 this->historyIT = ShellInput::history.begin(); 47 47 this->setHistoryLength(50); 48 48 this->historyScrolling = false; … … 65 65 } 66 66 67 std::list<std::string> ShellInput::history; 68 67 69 /** 68 70 * @brief standard deconstructor 69 71 */ 70 72 ShellInput::~ShellInput () 71 {}73 {} 72 74 73 75 /** … … 173 175 174 176 // adding the new Command to the History 175 this->history.push_back(this->inputLine); 177 if (history.back() != this->inputLine) 178 this->history.push_back(this->inputLine); 176 179 if (this->history.size() > this->historyLength) 177 180 { -
trunk/src/lib/shell/shell_input.h
r7458 r7729 69 69 Uint16 pressedKey; //!< the pressed key that will be repeated. 70 70 71 st d::list<std::string>history; //!< The history of given commands.71 static std::list<std::string> history; //!< The history of given commands. 72 72 std::list<std::string>::iterator historyIT; //!< The locator that tells us, where we are in the history. 73 73 unsigned int historyLength; //!< The maximum length of the InputHistory. -
trunk/src/lib/sound/ogg_player.cc
r7460 r7729 290 290 291 291 alSourceQueueBuffers(this->source, 2, this->buffers); 292 if (DEBUG >= 3)292 if (DEBUG_LEVEL >= 3) 293 293 SoundEngine::checkError("OggPlayer::playback()::alSourceQueueBuffers", __LINE__); 294 294 295 295 alSourcePlay(this->source); 296 if (DEBUG >= 3)296 if (DEBUG_LEVEL >= 3) 297 297 SoundEngine::checkError("OggPlayer::playback()::alSourcePlay", __LINE__); 298 298 SDL_mutexV(this->musicMutex); … … 329 329 330 330 alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed); 331 if (DEBUG >= 3)331 if (DEBUG_LEVEL >= 3) 332 332 SoundEngine::checkError("OggPlayer::update()::alGetSourceI", __LINE__); 333 333 … … 337 337 338 338 alSourceUnqueueBuffers(source, 1, &buffer); 339 if (DEBUG >= 3)339 if (DEBUG_LEVEL >= 3) 340 340 SoundEngine::checkError("OggPlayer::update()::unqueue", __LINE__); 341 341 … … 343 343 344 344 alSourceQueueBuffers(source, 1, &buffer); 345 if (DEBUG >= 3)345 if (DEBUG_LEVEL >= 3) 346 346 SoundEngine::checkError("OggPlayer::update()::queue", __LINE__); 347 347 } … … 380 380 381 381 alBufferData(buffer, format, pcm, size, vorbisInfo->rate); 382 if (DEBUG >= 3)382 if (DEBUG_LEVEL >= 3) 383 383 SoundEngine::checkError("OggPlayer::stream()::BUFFER", __LINE__); 384 384 … … 448 448 449 449 ///////////////////// 450 // DEBUG FUNCTIONS //450 // DEBUG_LEVEL FUNCTIONS // 451 451 ///////////////////// 452 452 /** -
trunk/src/lib/sound/sound_engine.cc
r7460 r7729 223 223 int play = 0x000; 224 224 alGetSourcei(source->getID(), AL_SOURCE_STATE, &play); 225 if (DEBUG > 2)225 if (DEBUG_LEVEL > 2) 226 226 SoundEngine::checkError("SoundEngine::update() Play", __LINE__); 227 227 if(play == AL_PLAYING) … … 233 233 source->getNode()->getAbsCoor().y, 234 234 source->getNode()->getAbsCoor().z); 235 if (DEBUG > 2)235 if (DEBUG_LEVEL > 2) 236 236 SoundEngine::checkError("SoundEngine::update() Set Source Position", __LINE__); 237 237 alSource3f(source->getID(), AL_VELOCITY, … … 239 239 source->getNode()->getVelocity().y, 240 240 source->getNode()->getVelocity().z); 241 if (DEBUG > 2)241 if (DEBUG_LEVEL > 2) 242 242 SoundEngine::checkError("SoundEngine::update() Set Source Velocity", __LINE__); 243 243 } -
trunk/src/lib/sound/sound_source.cc
r7460 r7729 124 124 alSourcePlay(this->sourceID); 125 125 126 if (DEBUG >= 3)126 if (DEBUG_LEVEL >= 3) 127 127 SoundEngine::checkError("Play Source", __LINE__); 128 128 this->bPlay = true; … … 151 151 this->bPlay = true; 152 152 153 if (DEBUG >= 3)153 if (DEBUG_LEVEL >= 3) 154 154 SoundEngine::checkError("Play Source", __LINE__); 155 155 } … … 165 165 { 166 166 alSourceStop(this->sourceID); 167 if (DEBUG >= 3)167 if (DEBUG_LEVEL >= 3) 168 168 SoundEngine::checkError("StopSource", __LINE__); 169 169 alSourcei(this->sourceID, AL_BUFFER, 0); … … 181 181 { 182 182 alSourcePause(this->sourceID); 183 if (DEBUG >= 3)183 if (DEBUG_LEVEL >= 3) 184 184 SoundEngine::checkError("Pause Source", __LINE__); 185 185 } … … 193 193 alSourceRewind(this->sourceID); 194 194 195 if (DEBUG >= 3)195 if (DEBUG_LEVEL >= 3) 196 196 SoundEngine::checkError("Rewind Source", __LINE__); 197 197 } … … 208 208 alSourcef(this->sourceID, AL_ROLLOFF_FACTOR, rolloffFactor); 209 209 210 if (DEBUG >= 3)210 if (DEBUG_LEVEL >= 3) 211 211 SoundEngine::checkError("Set Source Rolloff-factor", __LINE__); 212 212 }
Note: See TracChangeset
for help on using the changeset viewer.