- Timestamp:
- Jun 11, 2006, 1:57:27 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 55 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/collision_detection/cd_engine.cc
r8186 r8316 99 99 if( likely( this->terrain != NULL)) 100 100 { 101 Quadtree* q = dynamic_cast<Terrain*>(this->terrain)->ssp->getQuadtree();101 // Quadtree* q = dynamic_cast<Terrain*>(this->terrain)->ssp->getQuadtree(); 102 102 // QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor()); 103 103 } 104 104 105 105 if( likely( this->bspManager != NULL)) 106 106 { -
trunk/src/lib/collision_detection/obb_tree.cc
r7711 r8316 74 74 /* triangles indexes created */ 75 75 int* triangleIndexes = new int[modelInf.numTriangles]; 76 for( int i = 0; i < modelInf.numTriangles; ++i)76 for(unsigned int i = 0; i < modelInf.numTriangles; ++i) 77 77 triangleIndexes[i] = i; 78 78 -
trunk/src/lib/collision_detection/obb_tree_node.cc
r8190 r8316 152 152 Vector p, q, r; //!< holder of the polygon data, much more conveniant to work with Vector than sVec3d 153 153 Vector t1, t2; //!< temporary values 154 float covariance[3][3] = {0,0,0, 0,0,0, 0,0,0};//!< the covariance matrix 155 const float* tmpVec = NULL; //!< a temp saving place for sVec3Ds 154 float covariance[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};//!< the covariance matrix 156 155 157 156 /* fist compute all the convex hull face/facelets and centroids */ … … 275 274 PRINTF(4)("Calculate Box Axis\n"); 276 275 /* now get the axis length */ 277 float halfLength[3]; //!< half length of the axis278 276 float tmpLength; //!< tmp save point for the length 279 277 Plane p0(box.axis[0], box.center); //!< the axis planes … … 371 369 PRINTF(4)("Separating along the longest axis\n"); 372 370 /* get the closest vertex near the center */ 373 float dist = 999999.0f; //!< the smallest distance to each vertex374 371 float tmpDist; //!< variable to save diverse distances temporarily 375 int vertexIndex; //!< index of the vertex near the center376 372 Plane middlePlane(box.axis[longestAxisIndex], box.center); //!< the middle plane 377 const sVec3D* tmpVec; //!< temp simple 3D vector378 373 379 374 … … 662 657 glBegin(GL_POINTS); 663 658 glColor3f(0.3, 0.8, 0.54); 664 for( int i = 0; i < this->bvElement->modelInf->numVertices*3; i+=3)659 for(unsigned int i = 0; i < this->bvElement->modelInf->numVertices*3; i+=3) 665 660 glVertex3f(this->bvElement->modelInf->pVertices[i], 666 661 this->bvElement->modelInf->pVertices[i+1], -
trunk/src/lib/coord/p_node.cc
r7954 r8316 36 36 */ 37 37 PNode::PNode (PNode* parent, long nodeFlags) 38 : Synchronizeable(), BaseObject()38 : BaseObject(), Synchronizeable() 39 39 { 40 40 this->setClassID(CL_PARENT_NODE, "PNode"); … … 798 798 { 799 799 this->relDirection = rotQuat; 800 this->bRelDirChanged ;800 this->bRelDirChanged = true; 801 801 } 802 802 else … … 805 805 this->toDirection = NULL; 806 806 PRINTF(5)("SmoothRotate of %s finished\n", this->getName()); 807 this->bRelDirChanged ;807 this->bRelDirChanged = true; 808 808 } 809 809 } … … 1058 1058 else if (parentingMode == PNODE_ROTATE_AND_MOVE) 1059 1059 return "rotate-and-move"; 1060 else 1061 return "all"; 1060 1062 } 1061 1063 … … 1077 1079 else if (parentingMode == "rotate-and-move") 1078 1080 return (PNODE_ROTATE_AND_MOVE); 1081 else 1082 return PNODE_ALL; 1079 1083 } 1080 1084 -
trunk/src/lib/event/event_handler.cc
r8228 r8316 369 369 SDL_Event event; 370 370 Event ev; 371 EventListener* listener = NULL;372 371 while( SDL_PollEvent (&event)) 373 372 { -
trunk/src/lib/graphics/effects/fog_effect.cc
r8255 r8316 72 72 this->fogFadeDuration = 0; 73 73 this->localTimer = 0; 74 74 75 75 this->fogMode = GL_EXP2; 76 76 this->fogDensity = 0.001; … … 79 79 this->colorVector = Vector(0.7, 0.7, 0.7); 80 80 81 return true; 81 82 } 82 83 … … 87 88 88 89 this->fogActivate = true; 89 90 90 91 GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0}; 91 92 glFogi(GL_FOG_MODE, this->fogMode); … … 95 96 glFogf(GL_FOG_START, this->fogStart); 96 97 glFogf(GL_FOG_END, this->fogEnd); 97 98 98 99 glEnable(GL_FOG); 99 100 // glClearColor(0.5, 0.5, 0.5, 1.0); 101 return true; 100 102 } 101 103 … … 106 108 107 109 this->fogActivate = false; 108 110 109 111 glDisable(GL_FOG); 112 113 return true; 110 114 } 111 115 … … 122 126 if (!this->fogActivate) 123 127 return; 124 128 125 129 126 130 if (this->fogFadeDuration != 0 && this->localTimer < this->fogFadeDuration) { -
trunk/src/lib/graphics/effects/graphics_effect.cc
r7193 r8316 61 61 */ 62 62 bool GraphicsEffect::init() 63 {} 63 { 64 return true; 65 } 64 66 65 67 -
trunk/src/lib/graphics/effects/lense_flare.cc
r7844 r8316 104 104 */ 105 105 bool LenseFlare::init() 106 {} 106 { 107 return true; 108 } 107 109 108 110 … … 113 115 { 114 116 this->bActivated = true; 117 118 return true; 115 119 } 116 120 … … 122 126 { 123 127 this->bActivated = false; 128 129 return true; 124 130 } 125 131 … … 130 136 */ 131 137 GLint LenseFlare::stringToFogMode(const std::string& mode) 132 {} 138 { 139 PRINTF(1)("NOT IMPLEMENTED"); 140 return 0; 141 } 133 142 134 143 -
trunk/src/lib/graphics/effects/lightening_effect.cc
r8255 r8316 36 36 { 37 37 this->setClassID(CL_LIGHTENING_EFFECT, "LighteningEffect"); 38 38 39 39 this->init(); 40 40 … … 54 54 { 55 55 WeatherEffect::loadParams(root); 56 56 57 57 LoadParam(root, "coord", this, LighteningEffect, coord); 58 58 LoadParam(root, "option", this, LighteningEffect, setLighteningOption); … … 68 68 { 69 69 lighteningActivate = false; 70 70 71 71 this->time = 0.0; 72 72 this->flashFrequency = 1.4f; … … 117 117 ResourceManager::getInstance()->unload(this->thunderBuffer); 118 118 this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/thunder.wav", WAV);*/ 119 120 return true; 119 121 } 120 122 … … 149 151 this->time = 0; 150 152 lighteningActivate = true; 153 154 return true; 151 155 } 152 156 … … 160 164 this->billboard[3]->setVisibiliy(false); 161 165 lighteningActivate = false; 166 167 168 return true; 162 169 } 163 170 … … 166 173 if(!lighteningActivate) 167 174 return; 168 175 169 176 this->time += dt; 170 177 … … 175 182 else 176 183 this->flashLight->setDiffuseColor(100,100,100); 177 184 178 185 //PRINTF(0)("100*time: %f %i\n", 100*time, (int)(100*time)); 179 186 }*/ 180 187 181 188 if( this->time > this->flashFrequency) 182 189 { 183 190 this->billboard[0]->setVisibiliy(true); 184 191 this->time = 0.0f; 185 192 186 193 this->flashLight = new Light(); 187 194 this->flashLight->setAbsCoor(this->billboard[0]->getAbsCoor().x, this->billboard[0]->getAbsCoor().y, this->billboard[0]->getAbsCoor().z); 188 195 this->flashLight->setDiffuseColor(100,100,100); 189 196 190 197 //this->soundSource.play(this->thunderBuffer); 191 198 } … … 195 202 this->time = 0.0f; 196 203 this->bNewCoordinate = true; 197 204 198 205 if(flashLight != NULL) 199 206 { -
trunk/src/lib/graphics/effects/rain_effect.cc
r8255 r8316 117 117 lightMan = LightManager::getInstance(); 118 118 this->rainAmbient = lightMan->getAmbientColor(); 119 120 return true; 119 121 } 120 122 … … 150 152 151 153 this->emitter->setSpread(this->rainWindForce / 50, 0.2); 152 154 153 155 this->soundSource.loop(this->rainBuffer, this->soundRainVolume); 154 156 if (this->rainWindForce != 0) this->soundSource.loop(this->windBuffer, 0.1f * this->rainWindForce); 155 157 156 158 lightMan->setAmbientColor(.1,.1,.1); 159 160 return true; 157 161 } 158 162 … … 161 165 { 162 166 PRINTF(0)("Deactivating RainEffect\n"); 163 167 164 168 this->rainActivate = false; 165 169 this->emitter->setSystem(NULL); … … 170 174 // Restore Light Ambient 171 175 lightMan->setAmbientColor(this->rainAmbient, this->rainAmbient, this->rainAmbient); 176 177 return true; 172 178 } 173 179 … … 176 182 if (!this->rainActivate) 177 183 return; 178 184 179 185 if (this->rainMove) { 180 186 this->rainCoord = State::getCameraNode()->getAbsCoor(); … … 202 208 // this->soundSource.fadein(this->rainBuffer, 10); 203 209 } 204 210 205 211 } 206 212 -
trunk/src/lib/graphics/effects/snow_effect.cc
r8255 r8316 79 79 LoadParam(root, "size", this, SnowEffect, size); 80 80 LoadParam(root, "coord", this, SnowEffect, coord); 81 81 82 82 LOAD_PARAM_START_CYCLE(root, element); 83 83 { … … 111 111 this->snowCoord = Vector(100,450,400); 112 112 this->snowWindForce = 1; 113 114 return true; 113 115 } 114 116 … … 143 145 if (this->snowWindForce > 1) 144 146 this->soundSource.loop(this->windBuffer); 147 148 return true; 145 149 } 146 150 … … 156 160 ResourceManager::getInstance()->unload(this->windBuffer); 157 161 162 return true; 158 163 } 159 164 … … 171 176 /* 172 177 float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len(); 173 178 174 179 if(activated) 175 180 { … … 182 187 else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y) 183 188 this->alpha = 0.4; 184 189 185 190 SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha); 186 191 SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2); … … 197 202 else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y ) 198 203 this->alpha = 0.5; 199 204 200 205 SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha); 201 206 SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2); -
trunk/src/lib/graphics/effects/volfog_effect.cc
r7810 r8316 29 29 30 30 //#include <GL/glext.h> //OpenGL Extensions 31 //#include <GL/glxext.h> // GLX Extensions 31 //#include <GL/glxext.h> // GLX Extensions 32 32 33 33 #ifndef GL_EXT_fog_coord … … 92 92 // Set fog color 93 93 float fogColor[4] = {0.6f,0.58f,0.79f,0.0f}; 94 94 95 95 96 96 glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfEXT"); … … 132 132 { 133 133 PRINTF(0)("Activating VolFogEffect\n"); 134 135 return true; 134 136 } 135 137 … … 139 141 140 142 glDisable(GL_FOG); 143 144 return true; 141 145 } 142 146 … … 160 164 //glEnable(GL_BLEND); 161 165 //glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA); 162 166 163 167 int i; 164 168 glLoadIdentity(); 165 169 166 170 167 171 glBegin( GL_LINES ); 168 172 glNormal3f(0,1,0); … … 210 214 * ticks the effect if there is any time dependancy 211 215 */ 212 void VolFogEffect::tick(float dt) 213 { 214 } 216 void VolFogEffect::tick(float dt) 217 { 218 } -
trunk/src/lib/graphics/effects/weather_effect.cc
r8255 r8316 56 56 */ 57 57 bool WeatherEffect::init() 58 {} 58 { 59 return true; 60 } 59 61 60 62 -
trunk/src/lib/graphics/graphics_engine.cc
r8148 r8316 145 145 return -1; 146 146 this->initVideo(640, 480, 16); 147 return 1; 147 148 } 148 149 … … 161 162 // looking if we are in fullscreen-mode 162 163 MultiType textures = Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO_ADVANCED, CONFIG_NAME_TEXTURES, "1"); 163 164 Texture::setTextureEnableState(textures.getBool()); 164 165 165 166 // searching for a usefull resolution … … 167 168 //resolution.debug(); 168 169 MultiType x = resolution.getString(0), y = resolution.getString(1); 169 this->initVideo(x.getInt(), y.getInt(), 16);170 return this->initVideo(x.getInt(), y.getInt(), 16); 170 171 171 172 // GraphicsEffect* fe = new FogEffect(NULL); … … 203 204 { 204 205 PRINTF(1)("could not initialize SDL Video\n"); 205 //return -1;206 return -1; 206 207 } 207 208 // initialize SDL_GL-settings … … 238 239 239 240 this->isInit = true; 241 return 1; 240 242 } 241 243 … … 263 265 * @brief Sets the GL-attributes 264 266 */ 265 intGraphicsEngine::setGLattribs()267 void GraphicsEngine::setGLattribs() 266 268 { 267 269 // Set video mode … … 358 360 // SDL_Quit(); 359 361 // return -1; 362 return -1; 360 363 } 361 364 glViewport(0, 0, width, height); // Reset The Current Viewport … … 379 382 } 380 383 #endif /* __WIN32__ */ 384 return 1; 381 385 } 382 386 … … 410 414 * @param resizeInfo SDL information about the size of the new screen size 411 415 */ 412 intGraphicsEngine::resolutionChanged(const SDL_ResizeEvent& resizeInfo)416 void GraphicsEngine::resolutionChanged(const SDL_ResizeEvent& resizeInfo) 413 417 { 414 418 this->setResolution(resizeInfo.w, resizeInfo.h, this->bitsPerPixel); … … 655 659 switch (event.type) 656 660 { 657 case EV_VIDEO_RESIZE:658 this->resolutionChanged(event.resize);659 break;660 } 661 } 661 case EV_VIDEO_RESIZE: 662 this->resolutionChanged(event.resize); 663 break; 664 } 665 } -
trunk/src/lib/graphics/graphics_engine.h
r7840 r8316 54 54 inline int getbbp() const { return this->bitsPerPixel; }; 55 55 56 intresolutionChanged(const SDL_ResizeEvent& resizeInfo);56 void resolutionChanged(const SDL_ResizeEvent& resizeInfo); 57 57 58 58 static void enter2DMode(); … … 88 88 GraphicsEngine(); 89 89 int initVideo(unsigned int resX, unsigned int resY, unsigned int bbp); 90 intsetGLattribs();90 void setGLattribs(); 91 91 void grabHardwareSettings(); 92 92 -
trunk/src/lib/graphics/importer/height_map.cc
r8068 r8316 108 108 109 109 float height = 0; 110 int offset = 0;111 110 112 111 float r = 0.0; … … 474 473 Vector v = State::getCameraNode()->getAbsCoor(); 475 474 476 int i_min = 0;477 475 int i_max = (heightMap->h )/ HM_TILE_SIZE; 478 int j_min = 0;479 476 int j_max= (heightMap->w ) / HM_TILE_SIZE; 480 477 -
trunk/src/lib/graphics/importer/material.cc
r8312 r8316 169 169 } 170 170 Material::selectedMaterial = this; 171 172 return true; 171 173 } 172 174 … … 411 413 void Material::setAmbientMap(const std::string& aMap, GLenum target) 412 414 { 413 SDL_Surface* ambientMap;415 /// FIXME SDL_Surface* ambientMap; 414 416 415 417 } … … 422 424 void Material::setSpecularMap(const std::string& sMap, GLenum target) 423 425 { 424 SDL_Surface* specularMap;426 /// FIXME SDL_Surface* specularMap; 425 427 426 428 } … … 437 439 438 440 439 int Material::getMaxTextureUnits()441 unsigned int Material::getMaxTextureUnits() 440 442 { 441 443 int maxTexUnits = 0; -
trunk/src/lib/graphics/importer/material.h
r8037 r8316 69 69 static const GLenum glTextureArbs[]; //!< The Texture ARB's 70 70 71 static int getMaxTextureUnits();71 static unsigned int getMaxTextureUnits(); 72 72 73 73 private: -
trunk/src/lib/graphics/importer/md2Model.cc
r8309 r8316 290 290 { 291 291 //static sVec3D this->verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */ 292 int* pCommands = this->data->pGLCommands;292 // int* pCommands = this->data->pGLCommands; 293 293 /* some face culling stuff */ 294 294 // glPushAttrib(GL_POLYGON_BIT); … … 541 541 delete [] buffer; 542 542 fclose(pFile); 543 return true; 543 544 } 544 545 … … 563 564 this->material.setIllum(3); 564 565 this->material.setAmbient(1.0, 1.0, 1.0); 565 } 566 return true; 567 } -
trunk/src/lib/graphics/importer/media_container.cc
r7221 r8316 182 182 183 183 // get all the frames and save them in the sequence 184 while(this->addFrame(this->getNextFrame()) != NULL);184 while(this->addFrame(this->getNextFrame()) != 0); 185 185 } 186 186 -
trunk/src/lib/graphics/importer/model.cc
r7732 r8316 67 67 68 68 glBegin(GL_TRIANGLES); 69 for( int i = 0; i < this->pModelInfo.numTriangles; ++i)69 for(unsigned int i = 0; i < this->pModelInfo.numTriangles; ++i) 70 70 { 71 71 //printf("int i = %i\n", i); -
trunk/src/lib/graphics/importer/primitive_model.cc
r8145 r8316 105 105 // defining the binding Faces. 106 106 int v1, v2, v3, v4; 107 for ( int i = 0; i <= detail * 2 -1; i++)108 { 109 for ( int j = 0; j <= detail; j++)107 for (unsigned int i = 0; i <= detail * 2 -1; i++) 108 { 109 for (unsigned int j = 0; j <= detail; j++) 110 110 { 111 111 … … 147 147 if (detail <= 3) 148 148 detail = 3; 149 int count = 0;149 unsigned int count = 0; 150 150 // defining Points of the Cylinder. 151 151 for (float phi = 0.0; phi < 2.0*PI; phi += 2.0*PI/(float)detail) … … 163 163 } 164 164 // adding Faces 165 for ( int i = 0; i < detail-1; i++)165 for (unsigned int i = 0; i < detail-1; i++) 166 166 { 167 167 int p1, p2, p3, p4; … … 204 204 205 205 //defining Faces 206 for ( int i = 0; i < detail; i++)206 for (unsigned int i = 0; i < detail; i++) 207 207 { 208 208 unsigned int v1, v2; 209 209 v1 = i+2; 210 if (i == detail -1)210 if (i+1 == detail) 211 211 v2 = 2; 212 212 else … … 225 225 { 226 226 //defining vertices 227 for ( int i = 0; i < detail; i++)228 for ( int j = 0; j < detail; j++)227 for (unsigned int i = 0; i < detail; i++) 228 for (unsigned int j = 0; j < detail; j++) 229 229 { 230 230 this->addVertex(((float)i/(float)(detail-1) -.5)*size, … … 236 236 //defining Faces 237 237 int v1, v2, v3, v4; 238 for ( int i = 0; i < detail-1; i++)239 for ( int j = 0; j < detail-1; j++)238 for (unsigned int i = 0; i < detail-1; i++) 239 for (unsigned int j = 0; j < detail-1; j++) 240 240 { 241 241 v1 = i*detail + j; -
trunk/src/lib/graphics/importer/static_model.cc
r7732 r8316 386 386 } 387 387 ++this->groupCount; 388 return true; 388 389 } 389 390 … … 558 559 this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount -2; 559 560 this->faceCount += this->currentGroup->currentFace->vertexCount -2; 561 return true; 560 562 } 561 563 … … 591 593 this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount - 2; 592 594 this->faceCount += this->currentGroup->currentFace->vertexCount -2; 595 return true; 593 596 } 594 597 … … 606 609 if (this->currentGroup->faceCount == 0) 607 610 this->currentGroup->faceCount++; 611 return true; 608 612 } 609 613 … … 621 625 if (this->currentGroup->faceCount == 0) 622 626 this->currentGroup->faceCount++; 627 return true; 623 628 } 624 629 … … 637 642 638 643 Vector* normArray = new Vector [vertices.size()/3]; 639 for ( int i=0; i<vertices.size()/3;i++)644 for (unsigned int i=0; i<vertices.size()/3;i++) 640 645 normArray[i] = Vector(.0,.0,.0); 641 646 642 int firstTouch;643 int secondTouch;644 647 Vector prevV; 645 648 Vector nextV; … … 668 671 669 672 curElem = firstElem; 670 for ( int j=0; j<tmpFace->vertexCount; j++)673 for (unsigned int j = 0; j < tmpFace->vertexCount; j++) 671 674 { 672 675 if (!(nextElem = curElem->next)) … … 696 699 } 697 700 698 for ( int i=0; i < this->vertices.size()/3;i++)701 for (unsigned int i=0; i < this->vertices.size()/3;i++) 699 702 { 700 703 normArray[i].normalize(); … … 705 708 } 706 709 delete[] normArray; 710 return true; 707 711 } 708 712 … … 741 745 glEnd(); 742 746 this->currentGroup->faceMode = 0; 743 Material* tmpMat;744 747 if (tmpFace->material != NULL) 745 748 { … … 797 800 this->currentGroup = this->currentGroup->next; 798 801 } 802 return true; 799 803 } 800 804 … … 933 937 PRINTF(5)("importing grafical Element to openGL.\n"); 934 938 935 if (elem->texCoordNumber !=-1)936 { 937 if (likely( elem->texCoordNumber < this->pModelInfo.numTexCoor))939 if (elem->texCoordNumber > -1) 940 { 941 if (likely((unsigned int)elem->texCoordNumber < this->pModelInfo.numTexCoor)) 938 942 glTexCoord2fv(&this->vTexture[0] + elem->texCoordNumber * 2); 939 943 else … … 941 945 elem->texCoordNumber, this->pModelInfo.numTexCoor); 942 946 } 943 if (elem->normalNumber !=-1)944 { 945 if (likely( elem->normalNumber < this->pModelInfo.numNormals))947 if (elem->normalNumber > -1) 948 { 949 if (likely((unsigned int)elem->normalNumber < this->pModelInfo.numNormals)) 946 950 glNormal3fv(&this->normals[0] + elem->normalNumber * 3); 947 951 else … … 949 953 elem->normalNumber, this->pModelInfo.numNormals); 950 954 } 951 if (elem->vertexNumber !=-1)952 { 953 if (likely( elem->vertexNumber < this->pModelInfo.numVertices))955 if (elem->vertexNumber > -1) 956 { 957 if (likely((unsigned int)elem->vertexNumber < this->pModelInfo.numVertices)) 954 958 glVertex3fv(&this->vertices[0]+ elem->vertexNumber * 3); 955 959 else … … 958 962 } 959 963 964 return true; 960 965 } 961 966 -
trunk/src/lib/graphics/importer/tc.cc
r6608 r8316 707 707 if(tc->UsingStaticVerts) { 708 708 double edgeTotal; 709 for(i = 0; i <tc->VertRange; i++) {709 for(i = 0; i < (int)tc->VertRange; i++) { 710 710 v = &tc->StaticVerts[i]; 711 711 if(v->Count > 0) { … … 830 830 { 831 831 int i; 832 int size ;832 int size = 1; 833 833 ACTCVertex *v; 834 834 … … 838 838 if(tc->UsingStaticVerts) { 839 839 size = tc->VertRange * sizeof(ACTCVertex); 840 for(i = 0; i < tc->VertRange; i++) {840 for(i = 0; i < (int)tc->VertRange; i++) { 841 841 v = &tc->StaticVerts[i]; 842 842 if(v->Count > 0) … … 915 915 916 916 case ACTC_IN_MAX_VERT: 917 if(value <tc->MinInputVert) {917 if(value < (int)tc->MinInputVert) { 918 918 ACTC_DEBUG(fprintf(stderr, "actcParami : tried to set " 919 919 "MAX_INPUT_VERT to %d, less than MIN_INPUT_VERT (%d)\n", … … 925 925 926 926 case ACTC_IN_MIN_VERT: 927 if(value >tc->MaxInputVert) {927 if(value > (int)tc->MaxInputVert) { 928 928 ACTC_DEBUG(fprintf(stderr, "actcParami : tried to set " 929 929 "MIN_INPUT_VERT to %d, greater than MAX_INPUT_VERT (%d)\n", … … 1065 1065 static int mapVertexEdge(ACTCData *tc, ACTCVertex *v1, ACTCVertex *v2, ACTCEdge **edge) 1066 1066 { 1067 unsignedint i;1067 int i; 1068 1068 ACTCEdge tmp; 1069 1069 void *r; -
trunk/src/lib/graphics/importer/texture.cc
r8312 r8316 33 33 /* 34 34 * On the BIG_ENDIAN architecture, the 24 and 32bit bitmaps have 35 * different masks. If you don't do this distinction properly, 35 * different masks. If you don't do this distinction properly, 36 36 * you will get weird-looking textures. 37 37 */ … … 161 161 unsigned int* pixels = new unsigned int[width * height * channels]; 162 162 memset(pixels, 0, width * height * channels * sizeof(unsigned int)); 163 164 163 164 165 165 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); 166 166 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); … … 169 169 170 170 glTexImage2D(target, 0, channels, width, height, 0, type, GL_UNSIGNED_INT, pixels); 171 172 173 171 172 173 174 174 delete[] pixels; 175 175 … … 309 309 310 310 Uint32* mask = opaqueMask; 311 311 312 312 /* Save the alpha blending attributes */ 313 313 saved_flags = surface->flags&(SDL_SRCALPHA | SDL_RLEACCELOK); … … 320 320 mask = alphaMask; 321 321 } 322 322 323 323 retSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, 324 324 surface->w, surface->h, … … 360 360 int errorCode = 0; //!< the error code for the texture loading functions 361 361 GLuint texture = 0; //!< the OpenGL texture handle 362 int mipmapLevel = 0; //!< the maximum mipmap level for this texture363 int mipmapWidth = 0; //!< the width of the mipmap364 int mipmapHight = 0; //!< the height of the mipmap362 //int mipmapLevel = 0; //!< the maximum mipmap level for this texture 363 //int mipmapWidth = 0; //!< the width of the mipmap 364 //int mipmapHight = 0; //!< the height of the mipmap 365 365 GLenum format = GL_RGB; 366 366 if (surface->format->BitsPerPixel == 32) -
trunk/src/lib/graphics/render2D/element_2d.cc
r8035 r8316 961 961 /* update the current absCoordinate */ 962 962 this->prevRelCoordinate = this->relCoordinate; 963 float sine = sin(this->parent->getAbsDir2D());964 float cose = cos(this->parent->getAbsDir2D());963 // float sine = sin(this->parent->getAbsDir2D()); 964 // float cose = cos(this->parent->getAbsDir2D()); 965 965 // this->absCoordinate.x = this->relCoordinate.x*cose - this->relCoordinate.y*sine + this->parent->getRelCoor2D().x*(1-cose) +this->parent->getRelCoor2D().y*sine; 966 966 // this->absCoordinate.y = this->relCoordinate.x*sine + this->relCoordinate.y*cose + this->parent->getRelCoor2D().y*(1-cose) +this->parent->getRelCoor2D().x*sine; … … 1167 1167 else if (parentingMode == E2D_PARENT_ROTATE_AND_MOVE) 1168 1168 return "rotate-and-move"; 1169 else return "all"; 1169 1170 } 1170 1171 … … 1186 1187 else if (parentingMode == "rotate-and-move") 1187 1188 return (E2D_PARENT_ROTATE_AND_MOVE); 1189 else return E2D_PARENT_ALL; 1188 1190 } 1189 1191 -
trunk/src/lib/graphics/shader.cc
r8255 r8316 153 153 glAttachObjectARB(this->shaderProgram, shader); 154 154 } 155 return true; 155 156 } 156 157 -
trunk/src/lib/graphics/text_engine/font.cc
r7727 r8316 220 220 221 221 /** 222 * sets a specific renderStyle222 * @brief sets a specific renderStyle 223 223 * @param renderStyle the Style to render: a string (char-array) containing: 224 224 * i: italic, b: bold, u, underline … … 228 228 this->renderStyle = TTF_STYLE_NORMAL; 229 229 230 for ( int i = 0; i < renderStyle.size(); i++)230 for (unsigned int i = 0; i < renderStyle.size(); i++) 231 231 { 232 232 if (renderStyle[i] == 'b') … … 246 246 247 247 /** 248 * creates and exports an Image, that has all the characters248 * @brief creates and exports an Image, that has all the characters 249 249 * stored in a Array (as an image) 250 250 * @param fileName the File to write the image into. … … 257 257 258 258 // 259 SDL_Color tmpColor = {0, 0, 0};260 259 // Surface definition. 261 260 SDL_Rect tmpRect; // this represents a Rectangle for blitting. … … 277 276 tmpRect.x = 0; tmpRect.y = 0; tmpRect.w = tmpSurf->w; tmpRect.h = tmpSurf->h; 278 277 SDL_SetClipRect(tmpSurf, &tmpRect); 279 int maxLineHeight = 0;280 278 281 279 int posX, posY; … … 339 337 /** 340 338 * @returns the maximum ascent of the Font, if the font was initialized, 0 otherwise 341 342 339 * 340 * the ascent is the pixels of the font above the baseline 343 341 */ 344 342 int Font::getMaxAscent() const … … 352 350 /** 353 351 * @returns the maximum descent of the Font, if the font was initialized, 0 otherwise 354 355 352 * 353 * the descent is the pixels of the font below the baseline 356 354 */ 357 355 int Font::getMaxDescent() const … … 404 402 405 403 /** 406 * creates a Fast-Texture of this Font404 * @brief creates a Fast-Texture of this Font 407 405 */ 408 406 bool Font::createFastTexture() … … 497 495 if (this->setSurface(tmpSurf)) 498 496 (this->setTexture(Texture::loadTexToGL(tmpSurf))); 497 return true; 499 498 } 500 499 … … 547 546 return 0; 548 547 549 int i;550 int x,y; // the counters548 unsigned int i; 549 unsigned int x,y; // the counters 551 550 int maxLineHeight = this->getMaxHeight(); 552 551 unsigned int size = 32; // starting Value, we have to start somewhere 32 seems reasonable. (take any small enough 2^i number) … … 587 586 588 587 /** 589 * a simple function to get some interesting information about this class588 * @brief a simple function to get some interesting information about this class 590 589 */ 591 590 void Font::debug() 592 591 { 593 592 // print the loaded font's style 594 int style ;593 int style = TTF_STYLE_NORMAL; 595 594 if (likely(this->fontTTF != NULL)) 596 595 style = TTF_GetFontStyle(this->fontTTF); -
trunk/src/lib/gui/gl/glmenu/glmenu_imagescreen.cc
r8145 r8316 269 269 glEnd(); 270 270 271 /* draw black border272 271 glBegin(GL_QUADS); 273 272 glColor3f(0.0, 0.0, 0.0); -
trunk/src/lib/gui/gl/signal_connector.cc
r8271 r8316 72 72 this->object = signalConnector.object; 73 73 this->exec = (signalConnector.exec == NULL) ? NULL : signalConnector.exec->clone(); 74 75 return *this; 74 76 } 75 77 -
trunk/src/lib/gui/qt/gui_control.cc
r8145 r8316 283 283 ///case Qt::Key_Power: return SDLK_POWER; 284 284 ///case Qt::Key_Euro: return SDLK_EURO; 285 default: 285 286 return -1; 286 287 } -
trunk/src/lib/lang/class_list.cc
r8271 r8316 367 367 while (std::pow((float)10, (int)lenCount) <= (*cl).objectList.size()) 368 368 ++lenCount; 369 for ( int i=0; i < 30-(*cl).className.size() - lenCount; i++)369 for (unsigned int i=0; i < 30-(*cl).className.size() - lenCount; i++) 370 370 (niceString[i]) = ' '; 371 371 niceString[30-(*cl).className.size() - lenCount] = '\0'; -
trunk/src/lib/parser/cmdline_parser/cmdline_parser.cc
r7319 r8316 52 52 else 53 53 argTable.push_front( entry ); 54 return true; 54 55 } 55 56 … … 70 71 if ( s.length() > 2 && s[0] == '-' && s[1] != '-' ) 71 72 { 72 for ( int j = 1; j < s.length(); j++ )73 for (unsigned int j = 1; j < s.length(); j++ ) 73 74 { 74 75 std::string t = "-"; … … 95 96 } 96 97 97 int i = 0;98 unsigned int i = 0; 98 99 99 100 ArgTable::iterator it; … … 110 111 found = true; 111 112 112 int posArgs = 1;113 unsigned int posArgs = 1; 113 114 114 115 while ( i + posArgs < args.size() ) … … 130 131 std::vector<MultiType> argArgs; 131 132 132 for ( int j = 1; j <= it->numArgs; j++ )133 for (unsigned int j = 1; j <= it->numArgs; j++ ) 133 134 argArgs.push_back( args[i+j] ); 134 135 … … 219 220 assert( it->numArgs == substr.size() ); 220 221 221 for ( int i = 0; i<it->numArgs; i++ )222 for (unsigned int i = 0; i<it->numArgs; i++ ) 222 223 { 223 224 args += " [" + substr[i] + "]"; … … 251 252 output.reverse(); 252 253 253 int maxShort = 0;254 int maxLong = 0;254 unsigned int maxShort = 0; 255 unsigned int maxLong = 0; 255 256 256 257 std::list<std::vector<std::string> >::const_iterator it; … … 269 270 printf("%s ", (*it)[0].c_str()); 270 271 271 for ( int i = 0; i<maxShort-(*it)[0].length(); i++ )272 for (unsigned int i = 0; i<maxShort-(*it)[0].length(); i++ ) 272 273 printf(" "); 273 274 274 275 printf("%s ", (*it)[1].c_str()); 275 276 276 for ( int i = 0; i<maxLong-(*it)[1].length(); i++ )277 for (unsigned int i = 0; i<maxLong-(*it)[1].length(); i++ ) 277 278 printf(" "); 278 279 -
trunk/src/lib/parser/cmdline_parser/cmdline_parser.h
r7256 r8316 17 17 struct ArgTableEntry 18 18 { 19 intid;20 std::string longOption;21 char shortOption;22 intnumArgs;23 std::string argNames;24 std::string help;19 unsigned int id; 20 std::string longOption; 21 char shortOption; 22 unsigned int numArgs; 23 std::string argNames; 24 std::string help; 25 25 }; 26 26 … … 36 36 CmdLineParser(); 37 37 virtual ~CmdLineParser(); 38 38 39 39 bool add( int id, const std::string& longOption, char shortOption, int numArgs, const std::string & argNames, const std::string& help, bool back=false ); 40 40 41 41 bool parse( ArgParserCallback cb, void* data, int argc, char** argv ); 42 42 43 43 void showHelp(); 44 44 45 45 private: 46 46 ArgTable argTable; 47 47 std::string exeName; 48 48 49 49 inline bool matches( ArgTableEntry entry, std::string arg, bool & finish ); 50 50 -
trunk/src/lib/parser/preferences/cmd_line_prefs_reader.cc
r7261 r8316 43 43 { 44 44 CallbackData * cbd = (CallbackData *)data; 45 45 46 46 switch ( entry.id ) 47 47 { … … 54 54 key.erase( 0, key.find(".")+1 ); 55 55 //PRINTF(0)("SECTION '%s', KEY '%s'\n", section.c_str(), key.c_str()); 56 56 57 57 if ( key == "" || section == "" || argArgs.size() != 1 ) 58 58 { … … 60 60 return false; 61 61 } 62 62 63 63 //Preferences::getInstance()->setMultiType( section, key, argArgs[0], true ); 64 64 cbd->iniEntries.push_back( IniEntry() ); … … 72 72 return true; 73 73 } 74 75 if ( entry.id >= ID_PREFS && entry.id - ID_PREFS < regArgs.size())74 75 if ( entry.id >= ID_PREFS && entry.id < regArgs.size() + ID_PREFS) 76 76 { 77 77 if ( regArgs[entry.id - ID_PREFS].value == "%arg%" ) 78 78 { 79 79 assert( argArgs.size() == 1 ); 80 80 81 81 cbd->iniEntries.push_back( IniEntry() ); 82 82 cbd->iniEntries.back().section = regArgs[entry.id - ID_PREFS].section; … … 96 96 assert(false); 97 97 } 98 98 99 99 return true; 100 100 } … … 104 104 { 105 105 CmdLineParser parser; 106 106 107 107 parser.add( ID_HELP, "help", 'h', 0, "", "Shows this help and exits"); 108 109 for ( int i = 0; i<regArgs.size(); i++ )108 109 for (unsigned int i = 0; i<regArgs.size(); i++ ) 110 110 { 111 111 if ( regArgs[i].value == "%arg%" ) … … 118 118 } 119 119 } 120 120 121 121 parser.add( ID_SET_INI, "set-%", '\0', 1, "value", "Override a configuration element." ); 122 122 123 123 CallbackData cbd; 124 124 125 125 cbd.parser = &parser; 126 126 127 127 if ( parser.parse( &callBack, &cbd, argc, argv ) ) 128 128 { … … 137 137 exit(EXIT_FAILURE); 138 138 } 139 139 140 140 return true; 141 141 } … … 144 144 { 145 145 RegistredArgument arg; 146 146 147 147 arg.longOption = longOption; 148 148 while ( arg.longOption.find("_") != std::string::npos ) … … 158 158 arg.section = section; 159 159 arg.key = key; 160 160 161 161 regArgs.push_back( arg ); 162 return true; 162 163 } 163 164 -
trunk/src/lib/sound/ogg_player.cc
r8293 r8316 163 163 bool OggPlayer::play() 164 164 { 165 /*if (!(this->state & OggPlayer::FileOpened))165 if (!(this->state & OggPlayer::FileOpened)) 166 166 return false; 167 167 … … 173 173 if (this->musicThreadID == NULL) 174 174 return ((this->musicThreadID = SDL_CreateThread(OggPlayer::musicThread, (void*)this)) != NULL); 175 return true; */175 return true; 176 176 } 177 177 -
trunk/src/lib/util/loading/dynamic_loader.cc
r7355 r8316 60 60 } 61 61 void *mkr = dlsym( this->handle, "maker"); 62 return (mkr != NULL); 62 63 } 63 64 … … 72 73 } 73 74 // void *mkr = dlsym("maker"); 74 75 return true; 75 76 } 76 77 … … 78 79 BaseObject* DynamicLoader::fabricateObject(const TiXmlElement* root) const 79 80 { 81 /// FIXME 82 return NULL; 80 83 } 81 84 #endif -
trunk/src/lib/util/loading/load_param.cc
r7721 r8316 29 29 */ 30 30 CLoadParam::CLoadParam(const TiXmlElement* root, const std::string& paramName, BaseObject* object, Executor* executor, bool inLoadCycle) 31 : paramName(paramName), object(object)31 : object(object), paramName(paramName) 32 32 { 33 33 this->object = object; -
trunk/src/lib/util/loading/load_param_description.cc
r7221 r8316 275 275 276 276 return retVal;*/ 277 } 277 std::list<std::string> a; 278 return a; 279 } -
trunk/src/lib/util/loading/resource_manager.cc
r7676 r8316 557 557 bool ResourceManager::unloadAllByPriority(ResourcePriority prio) 558 558 { 559 bool removedAll = true; 559 560 unsigned int removeCount; 560 561 for (unsigned int round = 0; round < 3; round++) … … 571 572 { 572 573 if (round == 3) 574 { 573 575 PRINTF(2)("unable to unload %s because there are still %d references to it\n", 574 576 this->resourceList[index]->name.c_str(), this->resourceList[index]->count); 577 removedAll = false; 578 } 575 579 removeCount++; 576 580 } … … 580 584 if (removeCount == 0) break; 581 585 } 586 return removedAll; 582 587 } 583 588 … … 711 716 } 712 717 return tmp;*/ 718 return ""; 713 719 } 714 720 … … 733 739 return this->cache(splits[1], ResourceManager::stringToResourceType(splits[0]), 734 740 RP_LEVEL, splits[2], splits[3], splits[4]);*/ 741 return false; 735 742 } 736 743 -
trunk/src/lib/util/multi_type.cc
r8035 r8316 160 160 case MT_STRING: 161 161 return (this->storedString == mt.storedString); 162 default: 163 return false; 162 164 } 163 165 } … … 190 192 this->setString(this->getString()); 191 193 break; 194 default: 195 this->type = type; 192 196 } 193 197 } … … 477 481 case MT_STRING: 478 482 return MultiType::typeNames[5]; 479 } 480 return MultiType::typeNames[0]; 483 default: 484 return MultiType::typeNames[0]; 485 } 481 486 } 482 487 -
trunk/src/orxonox.cc
r8145 r8316 203 203 204 204 PRINTF(3)("Parsed Config File: '%s'\n", this->configFileName.c_str()); 205 return this->configFileName; 205 206 } 206 207 … … 459 460 460 461 return startOrxonox(argc, argv, "", -1); 461 return 0;462 462 } 463 463 … … 497 497 startOrxonox(argc, argv, "", port); 498 498 } 499 return 1; 499 500 } 500 501 … … 546 547 delete orx; 547 548 File("~/.orxonox/orxonox.lock").remove(); 548 } 549 return 1; 550 } -
trunk/src/world_entities/playable.cc
r8147 r8316 79 79 // this->setPlayer(NULL); 80 80 // IN ITS DESTRUCTOR. 81 81 82 82 assert(this->currentPlayer == NULL); 83 83 } … … 118 118 this->increaseHealthMax(ppu->getValue()); 119 119 return true; 120 default: 121 /// EVERYTHING THAT IS NOT HANDLED 122 /// FIXME 123 return false; 120 124 } 121 125 } -
trunk/src/world_entities/player.cc
r8147 r8316 81 81 return true; 82 82 } 83 83 84 84 if ( playable == NULL ) 85 85 this->playable = NULL; … … 90 90 bool Player::eject() 91 91 { 92 this->setPlayable(NULL);92 return this->setPlayable(NULL); 93 93 } 94 94 -
trunk/src/world_entities/projectiles/bomb.cc
r7368 r8316 37 37 this->loadParams(root); 38 38 39 float modelSize = 1.0;40 39 this->loadModel("models/projectiles/RadioActiveBomb.obj", 1.0); 41 40 -
trunk/src/world_entities/projectiles/guided_missile.cc
r7193 r8316 35 35 this->setClassID(CL_GUIDED_MISSILE, "GuidedMissile"); 36 36 37 float modelSize = .3;38 37 this->loadModel("models/projectiles/orx-rocket.obj", .3); 39 38 this->loadExplosionSound("sound/explosions/explosion_4.wav"); -
trunk/src/world_entities/projectiles/hyperblast.cc
r7193 r8316 36 36 this->setClassID(CL_HYPERBLAST, "Hyperblast"); 37 37 38 float modelSize = .3;39 38 this->loadModel("models/projectiles/hyperblast.obj", 5); 40 39 -
trunk/src/world_entities/projectiles/rocket.cc
r7193 r8316 36 36 this->setClassID(CL_ROCKET, "Rocket"); 37 37 38 float modelSize = .3;39 38 this->loadModel("models/projectiles/orx-rocket.obj", .3); 40 39 -
trunk/src/world_entities/projectiles/test_bullet.cc
r7193 r8316 35 35 this->setClassID(CL_TEST_BULLET, "TestBullet"); 36 36 37 float modelSize = .3;38 37 this->loadModel("models/projectiles/orx-rocket.obj", .3); 39 38 -
trunk/src/world_entities/space_ships/hover.cc
r7954 r8316 175 175 this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode); 176 176 this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0); 177 177 178 178 // NETWORK THINGS 179 179 180 180 registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) ); 181 181 registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) ); … … 184 184 registerVar( new SynchronizeableBool( &bAscend, &bAscend, "bAscend", PERMISSION_OWNER ) ); 185 185 registerVar( new SynchronizeableBool( &bDescend, &bDescend, "bDescend", PERMISSION_OWNER ) ); 186 186 187 187 registerVar( new SynchronizeableFloat( &rotation, &rotation, "rotation", PERMISSION_OWNER ) ); 188 188 } … … 262 262 { 263 263 Vector accel(0.0, 0.0, 0.0); 264 float rotSpeed = .3;265 264 266 265 if( this->bForward ) -
trunk/src/world_entities/space_ships/turbine_hover.cc
r7868 r8316 297 297 { 298 298 Vector accel(0.0, 0.0, 0.0); 299 float rotSpeed = .3;300 299 301 300 if( this->bForward ) … … 416 415 } 417 416 break; 417 default: 418 PRINTF(2)("Playmode %s Not Implemented\n", Playable::playmodeToString(this->getPlaymode()).c_str()); 418 419 } 419 420 } -
trunk/src/world_entities/terrain.cc
r8037 r8316 63 63 this->init(); 64 64 65 if (fileName.rfind(".obj" ) != -1 || fileName.rfind(".OBJ") != -1)65 if (fileName.rfind(".obj" ) != std::string::npos || fileName.rfind(".OBJ") != std::string::npos ) 66 66 { 67 67 this->loadModel(fileName); -
trunk/src/world_entities/test_entity.cc
r7713 r8316 122 122 123 123 this->bDeath = true; 124 float anim;125 124 int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX); 126 125 -
trunk/src/world_entities/weapons/weapon.cc
r7779 r8316 86 86 } 87 87 } 88 return NULL; 88 89 } 89 90 … … 421 422 return this->activateW(); 422 423 break; 424 default: 425 PRINTF(2)("Action %s Not Implemented yet \n", Weapon::actionToChar(action)); 426 return false; 423 427 } 424 428 } … … 442 446 this->enterState(WS_ACTIVATING); 443 447 } 448 return true; 444 449 } 445 450 … … 460 465 this->enterState(WS_DEACTIVATING); 461 466 } 467 468 return true; 462 469 } 463 470 … … 483 490 this->requestAction(WA_RELOAD); 484 491 } 492 return true; 485 493 } 486 494 … … 509 517 this->execute(); 510 518 } 519 return true; 511 520 } 512 521 … … 539 548 this->reload(); 540 549 this->enterState(WS_RELOADING); 550 551 return true; 541 552 } 542 553 -
trunk/src/world_entities/world_entity.cc
r8190 r8316 401 401 if( this->collisionHandles[i] != NULL) 402 402 this->collisionHandles[i]->registerCollisionEvent(c); 403 return true; 403 404 } 404 405 … … 424 425 if( this->collisionHandles[i] != NULL) 425 426 this->collisionHandles[i]->registerCollisionEvent(c); 427 return true; 426 428 } 427 429
Note: See TracChangeset
for help on using the changeset viewer.