Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 18, 2005, 11:52:15 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged trunk back to levelloader
merged with command:
svn merge -r 3499:HEAD trunk branches/levelloader

Conflicts in
C track_manager.h
C world_entities/player.cc
C world_entities/player.h
C world_entities/environment.h
C lib/coord/p_node.cc
C defs/debug.h
C track_manager.cc
C story_entities/campaign.h

solved in merge-favouring. It was quite easy because Chris only worked on the headers, and he didi it quite clean. Thats the spirit :)

Conflits in world.cc are a MESS: fix it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/lib/graphics/importer/texture.cc

    r3499 r3605  
    1717*/
    1818
     19
     20#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
    1921
    2022#include "texture.h"
     
    8789  if (pName[0] == '\0')
    8890    {
    89       PRINTF(3)("not Adding empty Path to the List.\n");
     91      PRINTF(2)("not Adding empty Path to the List.\n");
    9092      return;
    9193    }
     
    99101      if (status.st_mode & S_IFDIR)
    100102        {
    101           PRINTF(2)("Adding Path %s to the PathList.\n", pName);
     103          PRINTF(4)("Adding Path %s to the PathList.\n", pName);
    102104          PathList* tmpPathList = this;
    103105          while (tmpPathList->next)
     
    193195bool Texture::loadTexToGL (Image* pImage)
    194196{
    195   PRINTF(2)("Loading texture to OpenGL-Environment.\n");
     197  PRINTF(4)("Loading texture to OpenGL-Environment.\n");
    196198  glGenTextures(1, &this->texture);
    197199  glBindTexture(GL_TEXTURE_2D, this->texture);
     
    229231        pImage->format = GL_RGBA;
    230232         
    231       PRINTF(0)("Bits Per Pixel: %d\n", pImage->bpp);
    232233      if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb")))
    233234        for (int i=0;i<map->h * map->w *3;i+=3)
     
    249250  else
    250251    {
    251       PRINTF(1)("Image not Found: %s\n", imgNameWithPath);
     252      PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
    252253      return false;
    253254    }
     
    268269      if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".bmp", 4))
    269270        {
    270           PRINTF(3)("Requested bmp-image. Trying to Import.\n");
     271          PRINTF(4)("Requested bmp-image. Trying to Import.\n");
    271272          return this->loadBMP(imgNameWithPath);
    272273        }
     
    274275      else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".jpg", 4) || !strncmp(imgNameWithPath+strlen(imgNameWithPath)-5, ".jpg", 5))
    275276        {
    276           PRINTF(3)("Requested jpeg-image. Trying to Import\n");
     277          PRINTF(4)("Requested jpeg-image. Trying to Import\n");
    277278          return this->loadJPG(imgNameWithPath);
    278279        }
    279280      else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".tga", 4))
    280281        {
    281           PRINTF(3)("Requested tga-image. Trying to Import\n");
     282          PRINTF(4)("Requested tga-image. Trying to Import\n");
    282283          return this->loadTGA(imgNameWithPath);
    283284        }
    284285      else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".png", 4))
    285286        {
    286           PRINTF(3)("Requested png-image. Trying to Import\n");
     287          PRINTF(4)("Requested png-image. Trying to Import\n");
    287288          return this->loadPNG(imgNameWithPath);
    288289        }
    289290      else
    290291        {
    291           PRINTF(1)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);
     292          PRINTF(2)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);
    292293          return false;
    293294        }
     
    295296  else
    296297    {
    297       PRINTF(1)("Image not Found: %s\n", imgNameWithPath);
     298      PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
    298299      return false;
    299300    }
     
    316317  if ((file = fopen(bmpName, "rb"))==NULL)
    317318    {
    318       PRINTF(1)("File Not Found : %s\n",bmpName);
     319      PRINTF(2)("File Not Found : %s\n",bmpName);
    319320      return false;
    320321    }
     
    325326  if ((i = fread(&pImage->width, 4, 1, file)) != 1)
    326327    {
    327       PRINTF(1)("Error reading width from %s.\n", bmpName);
     328      PRINTF(2)("Error reading width from %s.\n", bmpName);
    328329      return false;
    329330    }
     
    331332  if ((i = fread(&pImage->height, 4, 1, file)) != 1)
    332333    {
    333       PRINTF(1)("Error reading height from %s.\n", bmpName);
     334      PRINTF(2)("Error reading height from %s.\n", bmpName);
    334335      return false;
    335336    }
     
    341342  if ((fread(&planes, 2, 1, file)) != 1)
    342343    {
    343       PRINTF(1)("Error reading planes from %s.\n", bmpName);
     344      PRINTF(2)("Error reading planes from %s.\n", bmpName);
    344345      return false;
    345346    }
     
    353354  if ((i = fread(&bpp, 2, 1, file)) != 1)
    354355    {
    355       PRINTF(1)("Error reading bpp from %s.\n", bmpName);
     356      PRINTF(2)("Error reading bpp from %s.\n", bmpName);
    356357      return false;
    357358    }
    358359  if (bpp != 24)
    359360    {
    360       PRINTF(1)("Bpp from %s is not 24: %u\n", bmpName, bpp);
     361      PRINTF(2)("Bpp from %s is not 24: %u\n", bmpName, bpp);
    361362      return false;
    362363    }
     
    369370  if (pImage->data == NULL)
    370371    {
    371       PRINTF(1)("Error allocating memory for color-corrected image data");
     372      PRINTF(2)("Error allocating memory for color-corrected image data");
    372373      return false;     
    373374    }
     
    375376  if ((i = fread(pImage->data, size, 1, file)) != 1)
    376377    {
    377       PRINTF(1)("Error reading image data from %s.\n", bmpName);
     378      PRINTF(2)("Error reading image data from %s.\n", bmpName);
    378379      return false;
    379380    }
     
    418419    {
    419420      // Display an error message saying the file was not found, then return NULL
    420       PRINTF(1)("Unable to load JPG File %s.\n", jpgName);
     421      PRINTF(2)("Unable to load JPG File %s.\n", jpgName);
    421422      return false;
    422423    }
     
    521522  if(fTGA == NULL)
    522523    {
    523       PRINTF(1)("Error could not open texture file: %s\n", tgaName);
     524      PRINTF(2)("Error could not open texture file: %s\n", tgaName);
    524525      return false;
    525526    }
     
    527528  if(fread(&tgaHeader, sizeof(TGAHeader), 1, fTGA) == 0)
    528529    {
    529       PRINTF(1)("Error could not read file header of %s\n", tgaName);
     530      PRINTF(2)("Error could not read file header of %s\n", tgaName);
    530531      if(fTGA != NULL)
    531532        {
     
    549550  else
    550551    {
    551       PRINTF(1)("Error TGA file be type 2 or type 10\n");
     552      PRINTF(2)("Error TGA file be type 2 or type 10\n");
    552553      if (fTGA)
    553554        fclose(fTGA);
     
    576577  if(fread(header, sizeof(header), 1, fTGA) == 0)
    577578    {
    578       PRINTF(1)("Error could not read info header\n");
     579      PRINTF(2)("Error could not read info header\n");
    579580      return false;
    580581    }
     
    586587  if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32)))
    587588    {
    588       PRINTF(1)("Error invalid texture information\n");
     589      PRINTF(2)("Error invalid texture information\n");
    589590      return false;
    590591    }
     
    605606  if(pImage->data == NULL)
    606607    {
    607       PRINTF(1)("Error could not allocate memory for image\n");
     608      PRINTF(2)("Error could not allocate memory for image\n");
    608609      return false;
    609610    }
     
    611612  if(fread(pImage->data, 1, imageSize, fTGA) != imageSize)
    612613    {
    613       PRINTF(1)("Error could not read image data\n");
     614      PRINTF(2)("Error could not read image data\n");
    614615      if(pImage->data != NULL)
    615616        {
     
    648649  if(fread(header, sizeof(header), 1, fTGA) == 0)
    649650    {
    650       PRINTF(1)("Error could not read info header\n");
     651      PRINTF(2)("Error could not read info header\n");
    651652      return false;
    652653    }
     
    664665  if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32)))
    665666    {
    666       PRINTF(1)("Error Invalid pImage information\n");
     667      PRINTF(2)("Error Invalid pImage information\n");
    667668      return false;
    668669    }
     
    674675  if(pImage->data == NULL)
    675676    {
    676       PRINTF(1)("Error could not allocate memory for image\n");
     677      PRINTF(2)("Error could not allocate memory for image\n");
    677678      return false;
    678679    }
     
    684685      if(fread(&chunkheader, sizeof(GLubyte), 1, fTGA) == 0)
    685686        {
    686           PRINTF(1)("Error could not read RLE header\n");
     687          PRINTF(2)("Error could not read RLE header\n");
    687688          if(pImage->data != NULL)
    688689            {
     
    702703              if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel)
    703704                {
    704                   PRINTF(1)("Error could not read image data\n");
     705                  PRINTF(2)("Error could not read image data\n");
    705706                  if(colorbuffer != NULL)
    706707                    {
     
    732733              if(currentpixel > pixelcount)     
    733734                {
    734                   PRINTF(1)("Error too many pixels read\n");
     735                  PRINTF(2)("Error too many pixels read\n");
    735736                  if(colorbuffer != NULL)
    736737                    {
     
    754755          if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel) // Attempt to read following color values
    755756            {
    756               PRINTF(1)("Error could not read from file");
     757              PRINTF(2)("Error could not read from file");
    757758              if(colorbuffer != NULL)
    758759                {
     
    785786              if(currentpixel > pixelcount)
    786787                {
    787                   PRINTF(1)("Error too many pixels read\n");
     788                  PRINTF(2)("Error too many pixels read\n");
    788789                  if(colorbuffer != NULL)
    789790                    {
Note: See TracChangeset for help on using the changeset viewer.