- Timestamp:
- Jun 8, 2006, 11:11:37 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/acinclude.m4
r8061 r8293 146 146 for _lib_directory in ${QT_COMMON_LIB_DIRECTORIES} 147 147 do 148 if test -e ${_lib_directory}/libQtCore.so || test -e ${_lib_directory}/libQtCore4.a ; then 148 if test -e ${_lib_directory}/libQtCore.so || test -e ${_lib_directory}/libQtCore4.a || \ 149 test -e ${_lib_directory}/QtCore.framework ; then 149 150 QT_LIB_DIRECTORY=${_lib_directory} 150 151 break 151 152 fi 152 153 done 153 154 if test -n ${QT_LIB_DIRECTORY} ; then … … 205 206 fi 206 207 207 echo "QT_LIBS = ${QT_LIBS}"208 echo "QT_CXXFLAGS = ${QT_CXXFLAGS}"209 echo "QT_LD_FLAGS = ${QT_LDFLAGS}"208 echo "QT_LIBS = ${QT_LIBS}" 209 echo "QT_CXXFLAGS = ${QT_CXXFLAGS}" 210 echo "QT_LD_FLAGS = ${QT_LDFLAGS}" 210 211 echo "QT_BIN_DIRECTORY = ${QT_BIN_DIRECTORY}" 211 212 -
trunk/config.h.in
r8061 r8293 27 27 /* Define to 1 if you have the `m' library (-lm). */ 28 28 #undef HAVE_LIBM 29 30 /* Define to 1 if you have the `OpenGL' library (-lOpenGL). */ 31 #undef HAVE_LIBOPENGL 29 32 30 33 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and -
trunk/configure.ac
r8147 r8293 436 436 *darwin*) 437 437 echo "OS X detected" 438 439 438 osX="yes" 440 439 441 CPPFLAGS="-I/sw/include -I/sw/include ${CPPFLAGS}" 442 LDFLAGS="$LDFLAGS -L/sw/lib" 440 QT_PREFIX="$prefix" 441 CPPFLAGS="-I/$prefix/include $CPPFLAGS -F$prefix/lib -I/opt/local" 442 LDFLAGS="$LDFLAGS -L$prefix/lib -F$prefix/lib -L/opt/local" 443 PCK_CONFIG_PATH='/opt/local' 444 443 445 # checking gl header 444 446 AC_CHECK_HEADERS([OpenGL/gl.h] ,, 445 447 [AC_MSG_ERROR([cannot find opengl headers]) ]) 446 # che king for GLU-header448 # checking for GLU-header 447 449 AC_CHECK_HEADERS([OpenGL/glu.h] ,, 448 450 [AC_MSG_ERROR([cannot find opengl headers]) ]) 449 451 AC_CHECK_LIB( OpenGL, main, , ) 450 452 LIBS="$LIBS -framework OpenGL" 451 453 … … 465 467 fi 466 468 467 469 LIBS="$LIBS" 468 470 AC_CHECK_HEADERS([OpenAL/al.h] ,, 469 471 [AC_MSG_ERROR([cannot find opengl headers]) ]) … … 475 477 SDL_CFLAGS=`sdl-config --cflags` 476 478 SDL_LIBS=`sdl-config --libs` 477 CXXFL \AGS="$CXXFLAGS $SDL_CFLAGS"479 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" 478 480 LIBS="$LIBS $SDL_LIBS" 479 481 AC_CHECK_HEADERS([SDL/SDL.h] ,, … … 557 559 # QT # 558 560 #----# 559 AX_CHECK_QT([${QT_PREFIX}], [QtCore QtCore4],, [http://www.trolltech.com]) 560 if test x$have_qt = xno ; then 561 WITH_QT=no 561 if test x$osX = xyes ; then 562 PKG_CONFIG_PATH="$prefix" 563 PKG_CHECK_MODULES( QT, QtOpenGL >= 4.01 QtCore >= 4.01 QtGui >= 4.0.1 ) 564 QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtOpenGL QtCore QtGui` 565 #----------# 566 AC_PATH_PROG([QT_MOC], [moc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"]) 567 if test x${QT_MOC} = xno ; then 568 AC_MSG_ERROR([QT MOC not found]) 569 fi 570 AC_SUBST([QT_MOC]) 571 572 AC_PATH_PROG([QT_UIC], [uic], [no], ["${QT_BIN_DIRECTORY}:${PATH}"]) 573 AC_SUBST([QT_UIC]) 574 575 AC_PATH_PROG([QT_RCC], [rcc], [no], ["${QT_BIN_DIRECTORY}:${PATH}"]) 576 577 AC_SUBST([QT_RCC]) 578 AC_SUBST( QT_INCLUDE_DIR ) 579 AC_SUBST( QT_CFLAGS ) 580 AC_SUBST( QT_LDFLAGS ) 581 AC_SUBST( QT_LIBS ) 582 echo "QT_LIBS = $QT_LIBS" 583 echo "QT_CFLAGS = $QT_CFLAGS" 584 echo "QT_INCLUDE_DIR = $QT_INCLUDE_DIR" 585 else 586 AX_CHECK_QT([${QT_PREFIX}], [QtCore QtCore4],, [http://www.trolltech.com]) 587 if test x$have_qt = xno ; then 588 WITH_QT=no 589 fi 562 590 fi 563 591 -
trunk/src/lib/graphics/Makefile.am
r7810 r8293 56 56 57 57 58 SUBDIRS = importer \ 59 spatial_separation 60 58 SUBDIRS = importer \ 59 spatial_separation 61 60 EXTRA_DIST = -
trunk/src/lib/graphics/importer/md2Model.cc
r7732 r8293 14 14 15 15 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER 16 16 #include "config.h" 17 #ifdef HAVE_SDL_SDL_H 18 #include <SDL/SDL.h> 19 #include <SDL/SDL_endian.h> 20 #else 21 #include <SDL.h> 22 #include <SDL_endian.h> 23 #endif 17 24 #include "md2Model.h" 18 25 #include "material.h" … … 20 27 #include "debug.h" 21 28 #include "util/loading/resource_manager.h" 22 23 29 24 30 using namespace std; … … 67 73 68 74 75 #ifdef SDL_LIL_ENDIAN 76 #define BULK_CONV( _ptr, _num ) do { \ 77 int _cnt = _num;\ 78 int* _iptr = (int*)_ptr;\ 79 for( int _l = 0; _l<_cnt; ++_l )\ 80 _iptr[_l] = SDL_SwapLE32( _iptr[_l] );\ 81 } while( 0 ) 82 #define BULK_CONV16( _ptr, _num ) do { \ 83 short _cnt = _num;\ 84 short* _iptr = (short*)_ptr;\ 85 for( int _l = 0; _l<_cnt; ++_l )\ 86 _iptr[_l] = SDL_SwapLE16( _iptr[_l] );\ 87 } while( 0 ) 88 #else 89 #define BULK_CONV( _ptr, _num ) 90 #define BULK_CONV16( _ptr, _num ) 91 #endif 69 92 70 93 /******************************************************************************** … … 80 103 /* this creates the data container via ressource manager */ 81 104 if (!modelFileName.empty()) 82 this->data = (MD2Data*)ResourceManager::getInstance()->load(modelFileName, MD2, RP_GAME, skinFileName, scale); 105 this->data = (MD2Data*)ResourceManager::getInstance()->load( 106 modelFileName, MD2, RP_GAME, skinFileName, scale); 107 108 //When arriving here it is assumed that everything is in the correct byte order. 83 109 if( unlikely(this->data == NULL)) 84 110 PRINTF(0)("The model was not found, MD2Model Loader finished abnormaly. Update the data-repos\n"); … … 92 118 this->setAnim(STAND); 93 119 94 this->debug();120 //this->debug(); 95 121 96 122 //write the modelinfo information … … 99 125 this->pModelInfo.numNormals = 0; 100 126 this->pModelInfo.numTexCoor = this->data->numTexCoor; 127 101 128 this->pModelInfo.pVertices = (float*)this->data->pVertices; 129 102 130 this->pModelInfo.pNormals = NULL; 131 103 132 this->pModelInfo.pTexCoor = (float*)this->data->pTexCoor; 104 133 105 134 // triangle conversion 106 135 this->pModelInfo.pTriangles = new sTriangleExt[this->data->numTriangles]; … … 357 386 void MD2Model::debug() 358 387 { 359 PRINT(0)("\n==========================| MD2Model::debug() |===\n"); 360 PRINT(0)("= Model FileName:\t%s\n", this->data->fileName.c_str()); 361 PRINT(0)("= Skin FileName:\t%s\n", this->data->skinFileName.c_str()); 362 PRINT(0)("= Size in Memory:\t%i Bytes\n", this->data->header->frameSize * this->data->header->numFrames + 64); // 64bytes is the header size 363 PRINT(0)("= Number of Vertices:\t%i\n", this->data->header->numVertices); 364 PRINT(0)("= Number of Frames: \t%i\n", this->data->header->numFrames); 365 PRINT(0)("= Height, Width:\t%i, %i\n", this->data->header->skinHeight, this->data->header->skinWidth); 366 PRINT(0)("= Pointer to the data object: %p\n", this->data); 367 PRINT(0)("===================================================\n\n"); 388 //PRINTF(0)("\n==========================| MD2Model::debug() |===\n"); 389 PRINTF(0)("= Model FileName:\t%s\n", this->data->fileName.c_str()); 390 PRINTF(0)("= Skin FileName:\t%s\n", 391 this->data->skinFileName.c_str()); 392 PRINTF(0)("= Size in Memory:\t%i Bytes\n", 393 this->data->header->frameSize * this->data->header->numFrames + 64); // 64bytes is the header size 394 PRINTF(0)("= Number of Vertices:\t%i\n", this->data->header->numVertices); 395 PRINTF(0)("= Number of Frames: \t%i\n", this->data->header->numFrames); 396 PRINTF(0)("= Height, Width:\t%i, %i\n", this->data->header->skinHeight, this->data->header->skinWidth); 397 PRINTF(0)("= Pointer to the data object: %p\n", this->data); 398 //PRINTF(0)("===================================================\n\n"); 368 399 } 369 400 … … 442 473 this->header = new MD2Header; 443 474 fread(this->header, 1, sizeof(MD2Header), pFile); 475 BULK_CONV( this->header, sizeof(MD2Header)/4 ); 444 476 /* check for the header version: make sure its a md2 file :) */ 445 if( unlikely( this->header->version != MD2_VERSION) && unlikely(this->header->ident != MD2_IDENT))477 if( unlikely( this->header->version != MD2_VERSION) && unlikely( this->header->ident != MD2_IDENT)) 446 478 { 447 479 PRINTF(1)("Couldn't load file %s: invalid file format: stop loading\n", fileName.c_str()); … … 449 481 } 450 482 451 this->fileName = fileName;483 this->fileName = fileName; 452 484 /* got the data: map it to locals */ 453 485 this->numFrames = this->header->numFrames; … … 468 500 fseek(pFile, this->header->offsetFrames, SEEK_SET); 469 501 fread(buffer, this->header->frameSize, this->numFrames, pFile); 502 //BULK_CONV( buffer, this->header->frameSize*this->numFrames*sizeof(char)/4 ); 470 503 /* read opengl commands */ 471 504 fseek(pFile, this->header->offsetGlCommands, SEEK_SET); 505 472 506 fread(this->pGLCommands, sizeof(int), this->numGLCommands, pFile); 507 BULK_CONV( this->pGLCommands, this->numGLCommands ); 473 508 /* triangle list */ 474 509 fseek(pFile, this->header->offsetTriangles, SEEK_SET); 475 fread(this->pTriangles, sizeof(sTriangle), this->numTriangles, pFile); 510 fread(this->pTriangles, sizeof(sTriangle), this->numTriangles, pFile); 511 BULK_CONV16( this->pTriangles, this->numTriangles*sizeof(sTriangle)/2 ); 512 476 513 /* read in texture coordinates */ 477 514 fseek(pFile, this->header->offsetTexCoords, SEEK_SET); 478 515 fread(this->pTexCoor, sizeof(sTexCoor), this->numTexCoor, pFile); 479 516 BULK_CONV16( this->pTexCoor, this->numTexCoor*sizeof(sTexCoor)/2 ); 480 517 481 518 for(int i = 0; i < this->numFrames; ++i) 482 519 { 483 520 frame = (sFrame*)(buffer + this->header->frameSize * i); 521 //Convert the translate and scale Vec3D if needed. 522 BULK_CONV( frame, 6 ); 523 BULK_CONV( frame->pVertices, 3 ); 484 524 pVertex = this->pVertices + this->numVertices * i; 485 525 pNormals = this->pLightNormals + this->numVertices * i; -
trunk/src/lib/graphics/importer/texture.cc
r8145 r8293 21 21 #include "compiler.h" 22 22 23 // INCLUDING SDL_Image 24 #ifdef HAVE_SDL_IMAGE_H 23 #ifdef HAVE_SDL_SDL_H 24 #include <SDL/SDL_image.h> 25 #include <SDL/SDL_endian.h> 26 #include <SDL/SDL_byteorder.h> 27 #else 28 #include <SDL_endian.h> 25 29 #include <SDL_image.h> 30 #include <SDL_byteorder.h> 31 #endif 32 #if SDL_BYTEORDER == SDL_BIG_ENDIAN 33 /* 34 * On the BIG_ENDIAN architecture, the 24 and 32bit bitmaps have 35 * different masks. If you don't do this distinction properly, 36 * you will get weird-looking textures. 37 */ 38 Uint32 alphaMask[] = { 39 0xFF000000, 40 0x00FF0000, 41 0x0000FF00, 42 0x000000FF, 43 }; 44 45 Uint32 opaqueMask[] = { 46 0x00FF0000, 47 0x0000FF00, 48 0x000000FF, 49 0xFF000000 50 }; 26 51 #else 27 #include <SDL/SDL_image.h> 52 /* 53 * On the LIL_ENDIAN architecture everything is fine and easy. The 24 54 * and 32bit bitmaps have the same masks. 55 */ 56 Uint32 alphaMask[] = { 57 0x000000FF, 58 0x0000FF00, 59 0x00FF0000, 60 0xFF000000, 61 }; 62 63 Uint32 *opaqueMask = alphaMask; 64 28 65 #endif 29 30 66 31 67 TextureData::TextureData() … … 251 287 Uint32 saved_flags; 252 288 Uint8 saved_alpha; 253 254 289 hasAlpha = false; 255 290 int pixelDepth = 24; 256 291 292 Uint32* mask = opaqueMask; 293 257 294 /* Save the alpha blending attributes */ 258 295 saved_flags = surface->flags&(SDL_SRCALPHA | SDL_RLEACCELOK); 259 296 saved_alpha = surface->format->alpha; 260 if ( (saved_flags & SDL_SRCALPHA) ==SDL_SRCALPHA )297 if ( saved_flags & SDL_SRCALPHA ) 261 298 { 262 299 SDL_SetAlpha(surface, 0, 0); 263 300 hasAlpha = true; 264 301 pixelDepth = 32; 265 } 266 302 mask = alphaMask; 303 } 304 267 305 retSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, 268 306 surface->w, surface->h, 269 307 pixelDepth, 270 #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */ 271 0x000000FF, 272 0x0000FF00, 273 0x00FF0000, 274 0xFF000000 275 #else 276 0xFF000000, 277 0x00FF0000, 278 0x0000FF00, 279 0x000000FF 280 #endif 281 ); 308 mask[0], mask[1], mask[2], mask[3] ); 282 309 if ( retSurface == NULL ) 283 310 return NULL; -
trunk/src/lib/graphics/spatial_separation/quadtree.cc
r5430 r8293 25 25 26 26 using namespace std; 27 28 27 #define QUADTREE_MATERIAL_COUNT 4 29 28 -
trunk/src/lib/math/vector.h
r8145 r8293 93 93 Vector getNormalized() const; 94 94 Vector abs(); 95 95 96 /** @param toVec nears this Vector to... @param t how much to advance (0.0: not at all; 1.0: fully) */ 96 97 inline void slerpTo(const Vector& toVec, float t) { *this + (toVec - *this) * t; }; -
trunk/src/lib/sound/ogg_player.cc
r7849 r8293 31 31 32 32 #include "debug.h" 33 34 #ifdef HAVE_SDL_SDL_H 35 36 #include <SDL/SDL.h> 37 #include <SDL/SDL_endian.h> 38 39 #else 40 41 #include <SDL.h> 42 #include <SDL_endian.h> 43 44 #endif 33 45 34 46 namespace OrxSound … … 151 163 bool OggPlayer::play() 152 164 { 153 if (!(this->state & OggPlayer::FileOpened))165 /*if (!(this->state & OggPlayer::FileOpened)) 154 166 return false; 155 167 … … 161 173 if (this->musicThreadID == NULL) 162 174 return ((this->musicThreadID = SDL_CreateThread(OggPlayer::musicThread, (void*)this)) != NULL); 163 return true; 175 return true;*/ 164 176 } 165 177 … … 385 397 if(size == 0) 386 398 return false; 387 399 /*#ifdef SDL_BIG_ENDIAN 400 int cnt = wavLength/2; 401 Uint16* wavBufferAsShorts = ( Uint16* )wavBuffer; 402 for ( int i = 0; i < cnt; ++i, ++wavBufferAsShorts ) 403 *wavBufferAsShorts = SDL_Swap16( *wavBufferAsShorts ); 404 #endif*/ 388 405 alBufferData(buffer, format, pcm, size, vorbisInfo->rate); 389 406 if (DEBUG_LEVEL >= 3) -
trunk/src/lib/sound/sound_buffer.cc
r7460 r8293 22 22 #include "sdlincl.h" 23 23 #include <cassert> 24 24 #ifdef HAVE_SDL_SDL_H 25 #include <SDL/SDL.h> 26 #include <SDL/SDL_endian.h> 27 #else 28 #include <SDL.h> 29 #include <SDL_endian.h> 30 #endif 25 31 namespace OrxSound 26 32 { … … 67 73 return false; 68 74 } 69 70 alBufferData(this->bufferID, SoundBuffer::sdlAudioSpecToAlFormat(&wavSpec), wavBuffer, wavLength, wavSpec.freq); 75 #if SDL_BYTEORDER == SDL_BIG_ENDIAN 76 if ( !( wavSpec.format == AUDIO_U8 || wavSpec.format == AUDIO_S8 ) ) { 77 int cnt = wavLength/2; 78 Uint16* wavBufferAsShorts = ( Uint16* )wavBuffer; 79 for ( int i = 0; i < cnt; ++i, ++wavBufferAsShorts ) 80 *wavBufferAsShorts = SDL_Swap16( *wavBufferAsShorts ); 81 } 82 #endif 83 alBufferData(this->bufferID, SoundBuffer::sdlAudioSpecToAlFormat(&wavSpec), 84 wavBuffer, wavLength, wavSpec.freq); 85 71 86 SDL_FreeWAV(wavBuffer); 72 87 if (SoundEngine::checkError("Could not load Wave file", __LINE__)) -
trunk/src/lib/util/file.cc
r8276 r8293 23 23 #include <fstream> 24 24 25 #ifdef __unix__ 25 #ifdef __unix__ 26 26 #include <unistd.h> 27 27 #elif __WIN32__ || _MS_DOS_ 28 28 #include <dir.h> 29 29 #else 30 #include <direct.h>30 //#include <direct.h> 31 31 #endif 32 32 -
trunk/src/util/signal_handler.cc
r8228 r8293 46 46 void SignalHandler::catchSignal( int sig ) 47 47 { 48 sig handler_t handler = signal( sig, SignalHandler::sigHandler );48 sig_t handler = signal( sig, SignalHandler::sigHandler ); 49 49 50 50 assert( handler != SIG_ERR ); … … 63 63 (*(it->cb))( it->someData ); 64 64 } 65 66 std::string sigName = "UNKNOWN"; 65 67 66 std::string sigName = "UNKNOWN";67 68 68 switch ( sig ) 69 69 { … … 90 90 { 91 91 getInstance()->dontCatch(); 92 93 92 sleep(2); 94 93 -
trunk/src/util/signal_handler.h
r8228 r8293 10 10 #include <string> 11 11 12 12 13 #define GDB_BT_FILE "orxonox.backtrace" 13 14 14 enum GdbRunType{ 15 15 GDB_RUN_WRITE_TO_FILE = 1, … … 25 25 { 26 26 int signal; 27 sig handler_t handler;27 sig_t handler; 28 28 }; 29 29
Note: See TracChangeset
for help on using the changeset viewer.