Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8316 in orxonox.OLD for trunk/src/lib/graphics/importer


Ignore:
Timestamp:
Jun 11, 2006, 1:57:27 PM (18 years ago)
Author:
bensch
Message:

trunk: fixed most -Wall warnings… but there are still many missing :/

Location:
trunk/src/lib/graphics/importer
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/height_map.cc

    r8068 r8316  
    108108
    109109  float height = 0;
    110   int offset = 0;
    111110
    112111  float r = 0.0;
     
    474473  Vector v = State::getCameraNode()->getAbsCoor();
    475474
    476   int i_min = 0;
    477475  int i_max = (heightMap->h )/ HM_TILE_SIZE;
    478   int j_min = 0;
    479476  int j_max= (heightMap->w  ) / HM_TILE_SIZE;
    480477
  • trunk/src/lib/graphics/importer/material.cc

    r8312 r8316  
    169169  }
    170170  Material::selectedMaterial = this;
     171
     172  return true;
    171173}
    172174
     
    411413void Material::setAmbientMap(const std::string& aMap, GLenum target)
    412414{
    413   SDL_Surface* ambientMap;
     415  /// FIXME SDL_Surface* ambientMap;
    414416
    415417}
     
    422424void Material::setSpecularMap(const std::string& sMap, GLenum target)
    423425{
    424   SDL_Surface* specularMap;
     426  /// FIXME SDL_Surface* specularMap;
    425427
    426428}
     
    437439
    438440
    439 int Material::getMaxTextureUnits()
     441unsigned int Material::getMaxTextureUnits()
    440442{
    441443  int maxTexUnits = 0;
  • trunk/src/lib/graphics/importer/material.h

    r8037 r8316  
    6969    static const GLenum glTextureArbs[];  //!< The Texture ARB's
    7070
    71     static int getMaxTextureUnits();
     71    static unsigned int getMaxTextureUnits();
    7272
    7373  private:
  • trunk/src/lib/graphics/importer/md2Model.cc

    r8309 r8316  
    290290{
    291291  //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;
    293293  /* some face culling stuff */
    294294//   glPushAttrib(GL_POLYGON_BIT);
     
    541541  delete [] buffer;
    542542  fclose(pFile);
     543  return true;
    543544}
    544545
     
    563564  this->material.setIllum(3);
    564565  this->material.setAmbient(1.0, 1.0, 1.0);
    565 }
     566  return true;
     567}
  • trunk/src/lib/graphics/importer/media_container.cc

    r7221 r8316  
    182182
    183183  // get all the frames and save them in the sequence
    184   while(this->addFrame(this->getNextFrame()) != NULL);
     184  while(this->addFrame(this->getNextFrame()) != 0);
    185185}
    186186
  • trunk/src/lib/graphics/importer/model.cc

    r7732 r8316  
    6767
    6868  glBegin(GL_TRIANGLES);
    69   for( int i = 0; i < this->pModelInfo.numTriangles; ++i)
     69  for(unsigned int i = 0; i < this->pModelInfo.numTriangles; ++i)
    7070    {
    7171      //printf("int i = %i\n", i);
  • trunk/src/lib/graphics/importer/primitive_model.cc

    r8145 r8316  
    105105  // defining the binding Faces.
    106106  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++)
    110110    {
    111111
     
    147147  if (detail <= 3)
    148148    detail = 3;
    149   int count = 0;
     149  unsigned int count = 0;
    150150  // defining Points of the Cylinder.
    151151  for (float phi = 0.0; phi < 2.0*PI; phi += 2.0*PI/(float)detail)
     
    163163  }
    164164  // adding Faces
    165   for (int i = 0; i < detail-1; i++)
     165  for (unsigned int i = 0; i < detail-1; i++)
    166166  {
    167167    int p1, p2, p3, p4;
     
    204204
    205205  //defining Faces
    206   for (int i = 0; i < detail; i++)
     206  for (unsigned int i = 0; i < detail; i++)
    207207  {
    208208    unsigned int v1, v2;
    209209    v1 = i+2;
    210     if (i == detail -1)
     210    if (i+1 == detail)
    211211      v2 = 2;
    212212    else
     
    225225{
    226226  //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++)
    229229    {
    230230      this->addVertex(((float)i/(float)(detail-1) -.5)*size,
     
    236236  //defining Faces
    237237  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++)
    240240    {
    241241      v1 = i*detail + j;
  • trunk/src/lib/graphics/importer/static_model.cc

    r7732 r8316  
    386386  }
    387387  ++this->groupCount;
     388  return true;
    388389}
    389390
     
    558559  this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount -2;
    559560  this->faceCount += this->currentGroup->currentFace->vertexCount -2;
     561  return true;
    560562}
    561563
     
    591593  this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount - 2;
    592594  this->faceCount += this->currentGroup->currentFace->vertexCount -2;
     595  return true;
    593596}
    594597
     
    606609  if (this->currentGroup->faceCount == 0)
    607610    this->currentGroup->faceCount++;
     611  return true;
    608612}
    609613
     
    621625  if (this->currentGroup->faceCount == 0)
    622626    this->currentGroup->faceCount++;
     627  return true;
    623628}
    624629
     
    637642
    638643  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++)
    640645    normArray[i] = Vector(.0,.0,.0);
    641646
    642   int firstTouch;
    643   int secondTouch;
    644647  Vector prevV;
    645648  Vector nextV;
     
    668671
    669672        curElem = firstElem;
    670         for (int j=0; j<tmpFace->vertexCount; j++)
     673        for (unsigned int j = 0; j < tmpFace->vertexCount; j++)
    671674        {
    672675          if (!(nextElem = curElem->next))
     
    696699  }
    697700
    698   for (int i=0; i < this->vertices.size()/3;i++)
     701  for (unsigned int i=0; i < this->vertices.size()/3;i++)
    699702  {
    700703    normArray[i].normalize();
     
    705708  }
    706709  delete[] normArray;
     710  return true;
    707711}
    708712
     
    741745          glEnd();
    742746        this->currentGroup->faceMode = 0;
    743         Material* tmpMat;
    744747        if (tmpFace->material != NULL)
    745748        {
     
    797800    this->currentGroup = this->currentGroup->next;
    798801  }
     802  return true;
    799803}
    800804
     
    933937  PRINTF(5)("importing grafical Element to openGL.\n");
    934938
    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))
    938942      glTexCoord2fv(&this->vTexture[0] + elem->texCoordNumber * 2);
    939943    else
     
    941945                elem->texCoordNumber, this->pModelInfo.numTexCoor);
    942946  }
    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))
    946950      glNormal3fv(&this->normals[0] + elem->normalNumber * 3);
    947951    else
     
    949953                elem->normalNumber, this->pModelInfo.numNormals);
    950954  }
    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))
    954958      glVertex3fv(&this->vertices[0]+ elem->vertexNumber * 3);
    955959    else
     
    958962  }
    959963
     964  return true;
    960965}
    961966
  • trunk/src/lib/graphics/importer/tc.cc

    r6608 r8316  
    707707    if(tc->UsingStaticVerts) {
    708708        double edgeTotal;
    709         for(i = 0; i < tc->VertRange; i++) {
     709        for(i = 0; i < (int)tc->VertRange; i++) {
    710710            v = &tc->StaticVerts[i];
    711711            if(v->Count > 0) {
     
    830830{
    831831    int i;
    832     int size;
     832    int size = 1;
    833833    ACTCVertex *v;
    834834
     
    838838    if(tc->UsingStaticVerts) {
    839839        size = tc->VertRange * sizeof(ACTCVertex);
    840         for(i = 0; i < tc->VertRange; i++) {
     840        for(i = 0; i < (int)tc->VertRange; i++) {
    841841            v = &tc->StaticVerts[i];
    842842            if(v->Count > 0)
     
    915915
    916916        case ACTC_IN_MAX_VERT:
    917             if(value < tc->MinInputVert) {
     917          if(value < (int)tc->MinInputVert) {
    918918                ACTC_DEBUG(fprintf(stderr, "actcParami : tried to set "
    919919                    "MAX_INPUT_VERT to %d, less than MIN_INPUT_VERT (%d)\n",
     
    925925
    926926        case ACTC_IN_MIN_VERT:
    927             if(value > tc->MaxInputVert) {
     927          if(value > (int)tc->MaxInputVert) {
    928928                ACTC_DEBUG(fprintf(stderr, "actcParami : tried to set "
    929929                    "MIN_INPUT_VERT to %d, greater than MAX_INPUT_VERT (%d)\n",
     
    10651065static int mapVertexEdge(ACTCData *tc, ACTCVertex *v1, ACTCVertex *v2, ACTCEdge **edge)
    10661066{
    1067     unsigned int i;
     1067    int i;
    10681068    ACTCEdge tmp;
    10691069    void *r;
  • trunk/src/lib/graphics/importer/texture.cc

    r8312 r8316  
    3333/*
    3434 * 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,
    3636 * you will get weird-looking textures.
    3737 */
     
    161161  unsigned int* pixels = new unsigned int[width * height * channels];
    162162  memset(pixels, 0, width * height * channels * sizeof(unsigned int));
    163  
    164  
     163
     164
    165165  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
    166166  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
     
    169169
    170170  glTexImage2D(target, 0, channels, width, height, 0, type, GL_UNSIGNED_INT, pixels);
    171  
    172  
    173  
     171
     172
     173
    174174  delete[] pixels;
    175175
     
    309309
    310310        Uint32* mask = opaqueMask;
    311        
     311
    312312  /* Save the alpha blending attributes */
    313313  saved_flags = surface->flags&(SDL_SRCALPHA | SDL_RLEACCELOK);
     
    320320                mask = alphaMask;
    321321  }
    322                
     322
    323323  retSurface = SDL_CreateRGBSurface(SDL_HWSURFACE,
    324324                                    surface->w, surface->h,
     
    360360  int      errorCode = 0;           //!< the error code for the texture loading functions
    361361  GLuint   texture = 0;             //!< the OpenGL texture handle
    362   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
     362  //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
    365365  GLenum   format = GL_RGB;
    366366  if (surface->format->BitsPerPixel == 32)
Note: See TracChangeset for help on using the changeset viewer.