Changeset 3548 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 14, 2005, 8:57:25 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/defs/debug.h
r3511 r3548 27 27 #define INFO 3 28 28 #define DEBUGING 4 29 #define vDEBUGING 5 29 30 30 31 #if HAVE_CONFIG_H … … 76 77 #endif 77 78 78 79 #if DEBUG >= vDEBUGING 80 #define PRINTF5 \ 81 if (verbose >= vDEBUGING) \ 82 printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf 83 #else 84 #define PRINTF5 if (NO) 85 #endif 86 79 87 #else 80 88 #define PRINTF(x) if (NO) … … 124 132 #else 125 133 #define PRINT4 if (NO) 134 #endif 135 136 #if DEBUG >= vDEBUGING 137 #define PRINT5 \ 138 if (verbose >= vDEBUGING) \ 139 printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf 140 #else 141 #define PRINT5 if (NO) 126 142 #endif 127 143 -
orxonox/trunk/src/lib/graphics/font/fontset.cc
r3478 r3548 45 45 #include <stdarg.h> 46 46 47 #include "../importer/texture.h" 47 #include "texture.h" 48 #include <string.h> 48 49 49 50 /** -
orxonox/trunk/src/lib/graphics/importer/array.cc
r3206 r3548 30 30 Array::~Array() 31 31 { 32 PRINTF( 2)("deleting array\n");32 PRINTF(4)("deleting array\n"); 33 33 Entry* walker = this->firstEntry; 34 34 Entry* previous; … … 49 49 void Array::initializeArray () 50 50 { 51 PRINTF( 2)("crating new Array\n");51 PRINTF(4)("crating new Array\n"); 52 52 this->firstEntry = new Entry; 53 53 this->firstEntry->next =NULL; … … 64 64 void Array::finalizeArray (void) 65 65 { 66 PRINTF( 3)("Finalizing array. Length: %i\n", entryCount);66 PRINTF(4)("Finalizing array. Length: %i\n", entryCount); 67 67 // if ((array = (GLfloat*)malloc( entryCount* sizeof(GLfloat))) == NULL) 68 68 if (!(this->array = new GLfloat [this->entryCount])) … … 87 87 if (!this->finalized) 88 88 { 89 PRINTF( 3)("adding new Entry to Array: %f\n", entry);89 PRINTF(5)("adding new Entry to Array: %f\n", entry); 90 90 91 91 this->currentEntry->value = entry; … … 96 96 } 97 97 else 98 PRINTF( 1)("adding failed, because list has been finalized\n");98 PRINTF(2)("adding failed, because list has been finalized\n"); 99 99 } 100 100 … … 131 131 void Array::debug () 132 132 { 133 PRINT F(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);133 PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array); 134 134 } -
orxonox/trunk/src/lib/graphics/importer/material.cc
r3536 r3548 18 18 19 19 #include "texture.h" 20 #include "debug.h" 20 21 #include <stdlib.h> 21 22 #include <string.h> … … 51 52 Material::~Material() 52 53 { 53 PRINTF( 2)("delete Material %s.\n", this->name);54 PRINTF(4)("delete Material %s.\n", this->name); 54 55 if (this->name) 55 56 delete []this->name; … … 83 84 void Material::init(void) 84 85 { 85 PRINTF( 2)("initializing new Material.\n");86 PRINTF(4)("initializing new Material.\n"); 86 87 this->nextMat = NULL; 87 88 this->name =""; … … 112 113 Material* Material::search(char* mtlName) 113 114 { 114 PRINTF( 2)("Searching for material %s", mtlName);115 PRINTF(5)("Searching for material %s", mtlName); 115 116 Material* searcher = this; 116 117 while (searcher != NULL) 117 118 { 118 PRINT( 2)(".");119 PRINT(5)("."); 119 120 if (!strcmp (searcher->getName(), mtlName)) 120 121 { 121 PRINT( 2)("found.\n");122 PRINT(5)("found.\n"); 122 123 return searcher; 123 124 } 124 125 searcher = searcher->nextMat; 125 126 } 126 PRINT(2)(" not found\n");127 PRINT(2)("material %s not found\n", mtlName); 127 128 return NULL; 128 129 } … … 171 172 void Material::setName (char* mtlName) 172 173 { 173 PRINTF( 3)("setting Material Name to %s.\n", this->name);174 PRINTF(4)("setting Material Name to %s.\n", this->name); 174 175 this->name = new char [strlen(mtlName)+1]; 175 176 strcpy(this->name, mtlName); … … 190 191 void Material::setIllum (int illum) 191 192 { 192 PRINTF( 3)("setting illumModel of Material %s to %i\n", this->name, illum);193 PRINTF(4)("setting illumModel of Material %s to %i\n", this->name, illum); 193 194 this->illumModel = illum; 194 // PRINTF(3)("setting illumModel to: %i\n", illumModel);195 195 } 196 196 /** … … 210 210 void Material::setDiffuse (float r, float g, float b) 211 211 { 212 PRINTF( 3)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);212 PRINTF(4)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b); 213 213 this->diffuse[0] = r; 214 214 this->diffuse[1] = g; … … 236 236 void Material::setAmbient (float r, float g, float b) 237 237 { 238 PRINTF( 3)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);238 PRINTF(4)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b); 239 239 this->ambient[0] = r; 240 240 this->ambient[1] = g; … … 261 261 void Material::setSpecular (float r, float g, float b) 262 262 { 263 PRINTF( 3)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);263 PRINTF(4)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b); 264 264 this->specular[0] = r; 265 265 this->specular[1] = g; … … 301 301 void Material::setTransparency (float trans) 302 302 { 303 PRINTF( 3)("setting Transparency of Material %s to %f.\n", this->name, trans);303 PRINTF(4)("setting Transparency of Material %s to %f.\n", this->name, trans); 304 304 this->transparency = trans; 305 305 } … … 330 330 void Material::setDiffuseMap(char* dMap) 331 331 { 332 PRINTF( 3)("setting Diffuse Map %s\n", dMap);332 PRINTF(4)("setting Diffuse Map %s\n", dMap); 333 333 diffuseTexture = new Texture(); 334 334 this->diffuseTextureSet = diffuseTexture->loadImage(dMap); -
orxonox/trunk/src/lib/graphics/importer/model.cc
r3495 r3548 80 80 Model::~Model(void) 81 81 { 82 PRINTF( 3)("Deleting Model ");82 PRINTF(4)("Deleting Model "); 83 83 if (this->name) 84 84 { 85 PRINT( 3)("%s\n", this->name);85 PRINT(4)("%s\n", this->name); 86 86 delete []this->name; 87 87 } 88 88 else 89 PRINT( 3)("\n");90 91 PRINTF( 3)("Deleting display Lists.\n");89 PRINT(4)("\n"); 90 91 PRINTF(4)("Deleting display Lists.\n"); 92 92 Group* walker = this->firstGroup; 93 93 while (walker != NULL) … … 99 99 } 100 100 101 PRINTF( 3)("Deleting Materials.\n");101 PRINTF(4)("Deleting Materials.\n"); 102 102 if (this->material) 103 103 delete this->material; … … 122 122 void Model::draw (void) const 123 123 { 124 PRINTF( 2)("drawing the 3D-Models\n");124 PRINTF(4)("drawing the 3D-Models\n"); 125 125 Group* walker = this->firstGroup; 126 126 while (walker != NULL) 127 127 { 128 PRINTF( 3)("Drawing model %s\n", walker->name);128 PRINTF(5)("Drawing model %s\n", walker->name); 129 129 glCallList (walker->listNumber); 130 130 walker = walker->next; … … 142 142 if (groupNumber >= this->groupCount) 143 143 { 144 PRINTF( 1)("You requested model number %i, but this File only contains of %i Models.\n", groupNumber-1, this->groupCount);144 PRINTF(2)("You requested model number %i, but this File only contains of %i Models.\n", groupNumber-1, this->groupCount); 145 145 return; 146 146 } 147 PRINTF( 2)("drawing the requested 3D-Models if found.\n");147 PRINTF(4)("drawing the requested 3D-Models if found.\n"); 148 148 Group* walker = this->firstGroup; 149 149 int counter = 0; … … 152 152 if (counter == groupNumber) 153 153 { 154 PRINTF( 2)("Drawing model number %i named %s\n", counter, walker->name);154 PRINTF(4)("Drawing model number %i named %s\n", counter, walker->name); 155 155 glCallList (walker->listNumber); 156 156 return; … … 159 159 walker = walker->next; 160 160 } 161 PRINTF( 1)("Model number %i in %s not Found.\n", groupNumber, this->name);161 PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->name); 162 162 return; 163 163 … … 172 172 void Model::draw (char* groupName) const 173 173 { 174 PRINTF( 2)("drawing the requested 3D-Models if found.\n");174 PRINTF(4)("drawing the requested 3D-Models if found.\n"); 175 175 Group* walker = this->firstGroup; 176 176 while (walker != NULL) … … 178 178 if (!strcmp(walker->name, groupName)) 179 179 { 180 PRINTF( 2)("Drawing model %s\n", walker->name);180 PRINTF(4)("Drawing model %s\n", walker->name); 181 181 glCallList (walker->listNumber); 182 182 return; … … 184 184 walker = walker->next; 185 185 } 186 PRINTF( 1)("Model Named %s in %s not Found.\n", groupName, this->name);186 PRINTF(2)("Model Named %s in %s not Found.\n", groupName, this->name); 187 187 return; 188 188 } … … 204 204 bool Model::initialize (void) 205 205 { 206 PRINTF( 2)("new 3D-Model is being created\n");206 PRINTF(4)("new 3D-Model is being created\n"); 207 207 208 208 this->name = NULL; … … 243 243 bool Model::initGroup(Group* group) 244 244 { 245 PRINTF( 3)("Adding new Group\n");245 PRINTF(4)("Adding new Group\n"); 246 246 group->name = ""; 247 247 group->faceMode = -1; … … 277 277 bool Model::cleanup(void) 278 278 { 279 PRINTF( 3)("cleaning up the 3D-Model to save Memory.\n");279 PRINTF(4)("cleaning up the 3D-Model to save Memory.\n"); 280 280 281 281 if (this->vertices) … … 296 296 bool Model::cleanupGroup (Group* group) 297 297 { 298 PRINTF( 3)("Cleaning up group\n");298 PRINTF(5)("Cleaning up group\n"); 299 299 if (group->firstFace != NULL) 300 300 { … … 314 314 bool Model::cleanupFace (Face* face) 315 315 { 316 PRINTF( 3)("Cleaning up Face\n");316 PRINTF(5)("Cleaning up Face\n"); 317 317 318 318 if (face->materialString != NULL) … … 355 355 bool Model::addGroup (char* groupString) 356 356 { 357 PRINTF( 3)("Read Group: %s.\n", groupString);357 PRINTF(5)("Read Group: %s.\n", groupString); 358 358 if (this->groupCount != 0 && this->currentGroup->faceCount>0) 359 359 { … … 384 384 float subbuffer3; 385 385 sscanf (vertexString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3); 386 PRINTF( 3)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);386 PRINTF(5)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3); 387 387 this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor); 388 388 return true; … … 398 398 bool Model::addVertex(const float x, const float y, const float z) 399 399 { 400 PRINTF( 4)("reading in a vertex: %f %f %f\n", x, y, z);400 PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z); 401 401 this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor); 402 402 return true; … … 513 513 float subbuffer3; 514 514 sscanf (normalString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3); 515 PRINTF( 3)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);515 PRINTF(5)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3); 516 516 this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3); 517 517 return true; … … 544 544 float subbuffer2; 545 545 sscanf (vTextureString, "%f %f", &subbuffer1, &subbuffer2); 546 PRINTF( 3)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);546 PRINTF(5)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2); 547 547 this->vTexture->addEntry(subbuffer1); 548 548 this->vTexture->addEntry(subbuffer2); … … 610 610 if ((this->currentGroup->listNumber = glGenLists(1)) == 0) 611 611 { 612 PRINTF( 1)("list could not be created for this Model\n");612 PRINTF(2)("glList could not be created for this Model\n"); 613 613 return false; 614 614 } … … 628 628 { 629 629 tmpMat->select(); 630 PRINTF( 2)("using material %s for coming Faces.\n", tmpFace->materialString);630 PRINTF(5)("using material %s for coming Faces.\n", tmpFace->materialString); 631 631 } 632 632 else 633 PRINTF( 1)("material %s not found.\n", tmpFace->materialString);633 PRINTF(2)("material %s not found.\n", tmpFace->materialString); 634 634 635 635 … … 646 646 647 647 this->currentGroup->faceMode = 3; 648 PRINTF( 3)("found triag.\n");648 PRINTF(5)("found triag.\n"); 649 649 } 650 650 … … 658 658 } 659 659 this->currentGroup->faceMode = 4; 660 PRINTF( 3)("found quad.\n");660 PRINTF(5)("found quad.\n"); 661 661 } 662 662 … … 666 666 glEnd(); 667 667 glBegin(GL_POLYGON); 668 PRINTF( 3)("Polygon with %i faces found.", tmpFace->vertexCount);668 PRINTF(5)("Polygon with %i faces found.", tmpFace->vertexCount); 669 669 this->currentGroup->faceMode = tmpFace->vertexCount; 670 670 } … … 698 698 bool Model::addGLElement (FaceElement* elem) 699 699 { 700 PRINTF( 3)("importing grafical Element to openGL.\n");700 PRINTF(5)("importing grafical Element to openGL.\n"); 701 701 702 702 if (elem->texCoordNumber != -1) … … 721 721 { 722 722 723 PRINTF( 2)("Normals are being calculated.\n");723 PRINTF(4)("Normals are being calculated.\n"); 724 724 725 725 Vector* normArray = new Vector [vertices->getCount()/3]; … … 778 778 { 779 779 normArray[i].normalize(); 780 PRINTF( 3)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);780 PRINTF(5)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z); 781 781 782 782 this->normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z); … … 881 881 //printf ("%f %f\n", vz, sin (vz)); 882 882 if (i==0.0) 883 printf("%f, %f\n", j/df*2.0*PI, cos(j/df*PI));883 PRINTF(0)("%f, %f\n", j/df*2.0*PI, cos(j/df*PI)); 884 884 } 885 885 } -
orxonox/trunk/src/lib/graphics/importer/objModel.cc
r3475 r3548 86 86 bool OBJModel::importFile (char* fileName) 87 87 { 88 PRINTF( 3)("preparing to read in file: %s\n", fileName);88 PRINTF(4)("preparing to read in file: %s\n", fileName); 89 89 90 90 … … 107 107 strncpy(this->objPath, fileName, name-fileName); 108 108 this->objPath[name-fileName] = '\0'; 109 if (verbose>=2) 110 if (strlen(objPath)> 0) 111 PRINTF(0)("Resolved file %s to folder: %s.\n", name, objPath); 112 else 113 PRINTF(0)("Resolved file %s.\n", name); 109 if (strlen(objPath)> 0) 110 PRINTF(5)("Resolved file %s to folder: %s.\n", name, objPath); 111 else 112 PRINTF(5)("Resolved file %s.\n", name); 114 113 115 114 this->setName(name); … … 144 143 return false; 145 144 } 146 PRINTF( 2)("Reading from opened file %s\n", fileName);145 PRINTF(4)("Reading from opened file %s\n", fileName); 147 146 char Buffer[10000]; 148 147 while(!OBJ_FILE->eof()) 149 148 { 150 149 OBJ_FILE->getline(Buffer, 10000); 151 PRINTF( 3)("Read input line: %s\n", Buffer);150 PRINTF(5)("Read input line: %s\n", Buffer); 152 151 153 152 … … 192 191 else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented 193 192 { 194 if (verbose >= 2) 195 PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer); 193 PRINTF(3)("smoothing groups not supportet yet. line: %s\n", Buffer); 196 194 } 197 195 } … … 221 219 222 220 223 PRINTF( 3)("Opening mtlFile: %s\n", fileName);221 PRINTF(4)("Opening mtlFile: %s\n", fileName); 224 222 225 223 ifstream* MTL_FILE = new ifstream (fileName); 226 224 if (MTL_FILE->fail()) 227 225 { 228 PRINTF( 1)("unable to open file: %s\n", fileName);226 PRINTF(2)("unable to open file: %s\n", fileName); 229 227 MTL_FILE->close(); 230 228 delete []fileName; … … 237 235 { 238 236 MTL_FILE->getline(Buffer, 500); 239 PRINTF( 4)("found line in mtlFile: %s\n", Buffer);237 PRINTF(5)("found line in mtlFile: %s\n", Buffer); 240 238 241 239 -
orxonox/trunk/src/lib/graphics/importer/texture.cc
r3454 r3548 87 87 if (pName[0] == '\0') 88 88 { 89 PRINTF( 3)("not Adding empty Path to the List.\n");89 PRINTF(2)("not Adding empty Path to the List.\n"); 90 90 return; 91 91 } … … 99 99 if (status.st_mode & S_IFDIR) 100 100 { 101 PRINTF( 2)("Adding Path %s to the PathList.\n", pName);101 PRINTF(4)("Adding Path %s to the PathList.\n", pName); 102 102 PathList* tmpPathList = this; 103 103 while (tmpPathList->next) … … 193 193 bool Texture::loadTexToGL (Image* pImage) 194 194 { 195 PRINTF( 2)("Loading texture to OpenGL-Environment.\n");195 PRINTF(4)("Loading texture to OpenGL-Environment.\n"); 196 196 glGenTextures(1, &this->texture); 197 197 glBindTexture(GL_TEXTURE_2D, this->texture); … … 229 229 pImage->format = GL_RGBA; 230 230 231 PRINTF(0)("Bits Per Pixel: %d\n", pImage->bpp);232 231 if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb"))) 233 232 for (int i=0;i<map->h * map->w *3;i+=3) … … 249 248 else 250 249 { 251 PRINTF( 1)("Image not Found: %s\n", imgNameWithPath);250 PRINTF(2)("Image not Found: %s\n", imgNameWithPath); 252 251 return false; 253 252 } … … 268 267 if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".bmp", 4)) 269 268 { 270 PRINTF( 3)("Requested bmp-image. Trying to Import.\n");269 PRINTF(4)("Requested bmp-image. Trying to Import.\n"); 271 270 return this->loadBMP(imgNameWithPath); 272 271 } … … 274 273 else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".jpg", 4) || !strncmp(imgNameWithPath+strlen(imgNameWithPath)-5, ".jpg", 5)) 275 274 { 276 PRINTF( 3)("Requested jpeg-image. Trying to Import\n");275 PRINTF(4)("Requested jpeg-image. Trying to Import\n"); 277 276 return this->loadJPG(imgNameWithPath); 278 277 } 279 278 else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".tga", 4)) 280 279 { 281 PRINTF( 3)("Requested tga-image. Trying to Import\n");280 PRINTF(4)("Requested tga-image. Trying to Import\n"); 282 281 return this->loadTGA(imgNameWithPath); 283 282 } 284 283 else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".png", 4)) 285 284 { 286 PRINTF( 3)("Requested png-image. Trying to Import\n");285 PRINTF(4)("Requested png-image. Trying to Import\n"); 287 286 return this->loadPNG(imgNameWithPath); 288 287 } 289 288 else 290 289 { 291 PRINTF( 1)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);290 PRINTF(2)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath); 292 291 return false; 293 292 } … … 295 294 else 296 295 { 297 PRINTF( 1)("Image not Found: %s\n", imgNameWithPath);296 PRINTF(2)("Image not Found: %s\n", imgNameWithPath); 298 297 return false; 299 298 } … … 316 315 if ((file = fopen(bmpName, "rb"))==NULL) 317 316 { 318 PRINTF( 1)("File Not Found : %s\n",bmpName);317 PRINTF(2)("File Not Found : %s\n",bmpName); 319 318 return false; 320 319 } … … 325 324 if ((i = fread(&pImage->width, 4, 1, file)) != 1) 326 325 { 327 PRINTF( 1)("Error reading width from %s.\n", bmpName);326 PRINTF(2)("Error reading width from %s.\n", bmpName); 328 327 return false; 329 328 } … … 331 330 if ((i = fread(&pImage->height, 4, 1, file)) != 1) 332 331 { 333 PRINTF( 1)("Error reading height from %s.\n", bmpName);332 PRINTF(2)("Error reading height from %s.\n", bmpName); 334 333 return false; 335 334 } … … 341 340 if ((fread(&planes, 2, 1, file)) != 1) 342 341 { 343 PRINTF( 1)("Error reading planes from %s.\n", bmpName);342 PRINTF(2)("Error reading planes from %s.\n", bmpName); 344 343 return false; 345 344 } … … 353 352 if ((i = fread(&bpp, 2, 1, file)) != 1) 354 353 { 355 PRINTF( 1)("Error reading bpp from %s.\n", bmpName);354 PRINTF(2)("Error reading bpp from %s.\n", bmpName); 356 355 return false; 357 356 } 358 357 if (bpp != 24) 359 358 { 360 PRINTF( 1)("Bpp from %s is not 24: %u\n", bmpName, bpp);359 PRINTF(2)("Bpp from %s is not 24: %u\n", bmpName, bpp); 361 360 return false; 362 361 } … … 369 368 if (pImage->data == NULL) 370 369 { 371 PRINTF( 1)("Error allocating memory for color-corrected image data");370 PRINTF(2)("Error allocating memory for color-corrected image data"); 372 371 return false; 373 372 } … … 375 374 if ((i = fread(pImage->data, size, 1, file)) != 1) 376 375 { 377 PRINTF( 1)("Error reading image data from %s.\n", bmpName);376 PRINTF(2)("Error reading image data from %s.\n", bmpName); 378 377 return false; 379 378 } … … 418 417 { 419 418 // Display an error message saying the file was not found, then return NULL 420 PRINTF( 1)("Unable to load JPG File %s.\n", jpgName);419 PRINTF(2)("Unable to load JPG File %s.\n", jpgName); 421 420 return false; 422 421 } … … 521 520 if(fTGA == NULL) 522 521 { 523 PRINTF( 1)("Error could not open texture file: %s\n", tgaName);522 PRINTF(2)("Error could not open texture file: %s\n", tgaName); 524 523 return false; 525 524 } … … 527 526 if(fread(&tgaHeader, sizeof(TGAHeader), 1, fTGA) == 0) 528 527 { 529 PRINTF( 1)("Error could not read file header of %s\n", tgaName);528 PRINTF(2)("Error could not read file header of %s\n", tgaName); 530 529 if(fTGA != NULL) 531 530 { … … 549 548 else 550 549 { 551 PRINTF( 1)("Error TGA file be type 2 or type 10\n");550 PRINTF(2)("Error TGA file be type 2 or type 10\n"); 552 551 if (fTGA) 553 552 fclose(fTGA); … … 576 575 if(fread(header, sizeof(header), 1, fTGA) == 0) 577 576 { 578 PRINTF( 1)("Error could not read info header\n");577 PRINTF(2)("Error could not read info header\n"); 579 578 return false; 580 579 } … … 586 585 if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32))) 587 586 { 588 PRINTF( 1)("Error invalid texture information\n");587 PRINTF(2)("Error invalid texture information\n"); 589 588 return false; 590 589 } … … 605 604 if(pImage->data == NULL) 606 605 { 607 PRINTF( 1)("Error could not allocate memory for image\n");606 PRINTF(2)("Error could not allocate memory for image\n"); 608 607 return false; 609 608 } … … 611 610 if(fread(pImage->data, 1, imageSize, fTGA) != imageSize) 612 611 { 613 PRINTF( 1)("Error could not read image data\n");612 PRINTF(2)("Error could not read image data\n"); 614 613 if(pImage->data != NULL) 615 614 { … … 648 647 if(fread(header, sizeof(header), 1, fTGA) == 0) 649 648 { 650 PRINTF( 1)("Error could not read info header\n");649 PRINTF(2)("Error could not read info header\n"); 651 650 return false; 652 651 } … … 664 663 if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32))) 665 664 { 666 PRINTF( 1)("Error Invalid pImage information\n");665 PRINTF(2)("Error Invalid pImage information\n"); 667 666 return false; 668 667 } … … 674 673 if(pImage->data == NULL) 675 674 { 676 PRINTF( 1)("Error could not allocate memory for image\n");675 PRINTF(2)("Error could not allocate memory for image\n"); 677 676 return false; 678 677 } … … 684 683 if(fread(&chunkheader, sizeof(GLubyte), 1, fTGA) == 0) 685 684 { 686 PRINTF( 1)("Error could not read RLE header\n");685 PRINTF(2)("Error could not read RLE header\n"); 687 686 if(pImage->data != NULL) 688 687 { … … 702 701 if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel) 703 702 { 704 PRINTF( 1)("Error could not read image data\n");703 PRINTF(2)("Error could not read image data\n"); 705 704 if(colorbuffer != NULL) 706 705 { … … 732 731 if(currentpixel > pixelcount) 733 732 { 734 PRINTF( 1)("Error too many pixels read\n");733 PRINTF(2)("Error too many pixels read\n"); 735 734 if(colorbuffer != NULL) 736 735 { … … 754 753 if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel) // Attempt to read following color values 755 754 { 756 PRINTF( 1)("Error could not read from file");755 PRINTF(2)("Error could not read from file"); 757 756 if(colorbuffer != NULL) 758 757 { … … 785 784 if(currentpixel > pixelcount) 786 785 { 787 PRINTF( 1)("Error too many pixels read\n");786 PRINTF(2)("Error too many pixels read\n"); 788 787 if(colorbuffer != NULL) 789 788 { -
orxonox/trunk/src/lib/graphics/importer/texture.h
r3475 r3548 10 10 #define _TEXTURE_H 11 11 12 #include "stdincl.h" 12 #include "glincl.h" 13 14 #include "debug.h" 15 13 16 #ifdef HAVE_SDL_SDL_IMAGE_H 14 17 #include <SDL/SDL_image.h> -
orxonox/trunk/src/orxonox.cc
r3546 r3548 31 31 #include "game_loader.h" 32 32 #include <string.h> 33 int verbose = 2;33 int verbose = 3; 34 34 35 35 using namespace std; -
orxonox/trunk/src/story_entities/world.cc
r3546 r3548 701 701 // Draw 702 702 this->display (); 703 704 (TrackNode::getInstance()->getAbsCoor() - localPlayer->getAbsCoor()).debug(); 703 705 704 706 for( int i = 0; i < 5000000; i++) {}
Note: See TracChangeset
for help on using the changeset viewer.