Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7729 in orxonox.OLD


Ignore:
Timestamp:
May 19, 2006, 3:07:09 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: better debug names
As DEBUG and ERROR are already given to windows.h and other files:
DEBUG is renamed to DEBUG_LEVEL
and all
NO, ERR, WARN, INFO, DEBUG, vDEBUG
are renamed to
ORX_NONE, ORX_ERR, ORX_WARN, ORX_INFO, ORX_DEBUG, ORX_vDEBUG

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/config.h.in

    r7661 r7729  
    22
    33/* in which debug mode we are */
    4 #undef DEBUG
     4#undef DEBUG_LEVEL
    55
    66/* Define to 1 if you have the <avcodec.h> header file. */
  • trunk/configure.ac

    r7669 r7729  
    8686# DEBUG-statement #
    8787#-----------------#
    88 DEBUG=no
     88DEBUG_LEVEL=no
    8989AC_MSG_CHECKING([if DEBUG-mode should be enabled])
    9090AC_ARG_ENABLE([debug],
    9191        AS_HELP_STRING(--enable-debug,compiles in debug mode. Lots of debug info about the game.),
    92          DEBUG=$enableval)
    93 
    94 if test x$DEBUG = xno; then
     92         DEBUG_LEVEL=$enableval)
     93
     94if test x$DEBUG_LEVEL = xno; then
    9595        echo "no"
    9696        echo " -> Setting debuglevel to 4. (orxonox is still in Development. It really is needed."
    97         DEBUG=4
    98 elif test x$DEBUG = xyes; then
     97        DEBUG_LEVEL=4
     98elif test x$DEBUG_LEVEL = xyes; then
    9999        echo "yes"
    100100        echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!."
    101         DEBUG=4
     101        DEBUG_LEVEL=4
    102102else
    103   if test x$DEBUG = x0 || test x$DEBUG = x1 || test x$DEBUG = x2 || test x$DEBUG = x3 || test x$DEBUG = x4 || test x$DEBUG = x5 ; then
    104         echo "yes: setting debuglevel to to $DEBUG"
     103  if test x$DEBUG_LEVEL = x0 || test x$DEBUG_LEVEL = x1 || test x$DEBUG_LEVEL = x2 || test x$DEBUG_LEVEL = x3 || test x$DEBUG_LEVEL = x4 || test x$DEBUG_LEVEL = x5 ; then
     104        echo "yes: setting debuglevel to to $DEBUG_LEVEL"
    105105  else
    106         echo "yes: invalid Value for Debug ($DEBUG). setting to 4(DEBUG)"
    107         DEBUG=4
     106        echo "yes: invalid Value for Debug ($DEBUG_LEVEL). setting to 4(DEBUG)"
     107        DEBUG_LEVEL=4
    108108  fi
    109109fi
    110110
    111 if test $DEBUD > 3 ; then
     111if test $DEBUD_LEVEL > 3 ; then
    112112  CPPFLAGS="${CPPFLAGS} -g"
    113113fi
    114 AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are])
    115 AC_SUBST(DEBUG)
     114AC_DEFINE_UNQUOTED(DEBUG_LEVEL, ${DEBUG_LEVEL}, [in which debug mode we are])
     115AC_SUBST(DEBUG_LEVEL)
    116116
    117117#---------------#
  • trunk/src/defs/debug.h

    r7711 r7729  
    3535
    3636// DEFINE ERROR MODES
    37 #define NO              0
    38 #define ERR             1
    39 #define WARN            2
    40 #define INFO            3
    41 #define DEBUG           4
    42 #define vDEBUG          5
     37#define ORX_NONE            0
     38#define ORX_ERR             1
     39#define ORX_WARN            2
     40#define ORX_INFO            3
     41#define ORX_DEBUG           4
     42#define ORX_vDEBUG          5
    4343
    4444extern int verbose;
     
    4646//definitions
    4747#ifndef MODULAR_DEBUG
    48  #define HARD_DEBUG_LEVEL DEBUG
     48 #define HARD_DEBUG_LEVEL ORX_DEBUG
    4949 #define SOFT_DEBUG_LEVEL verbose
    5050#else /* MODULAR_DEBUG */
     
    103103/// PRINTF: prints with filename and linenumber ///
    104104///////////////////////////////////////////////////
    105 #define PRINTFNO      PRINTF0
    106 #define PRINTFERR     PRINTF1
    107 #define PRINTFWARN    PRINTF2
    108 #define PRINTFINFO    PRINTF3
    109 #define PRINTFDEBUG   PRINTF4
    110 #define PRINTFVDEBUG  PRINTF5
    111 
    112 #if DEBUG <= 3
     105#define PRINTFORX_NONE    PRINTF0
     106#define PRINTFORX_ERR     PRINTF1
     107#define PRINTFORX_WARN    PRINTF2
     108#define PRINTFORX_INFO    PRINTF3
     109#define PRINTFORX_DEBUG   PRINTF4
     110#define PRINTFORX_VDEBUG  PRINTF5
     111
     112#if DEBUG_LEVEL <= 3
    113113#define PRINTF(x)        PRINT(x)
    114114#endif
     
    122122
    123123#ifndef PRINTF
    124 #ifdef DEBUG
     124#ifdef ORX_DEBUG
    125125
    126126#define PRINTF(x) \
    127127           PRINTF ## x
    128128
    129 #if HARD_DEBUG_LEVEL >= ERR
     129#if HARD_DEBUG_LEVEL >= ORX_ERR
    130130#define PRINTF1 \
    131     if (SOFT_DEBUG_LEVEL >= ERR) \
     131    if (SOFT_DEBUG_LEVEL >= ORX_ERR) \
    132132      printf("(EE)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    133133#else
    134 #define PRINTF1 if (NO)
    135 #endif
    136 
    137 #if HARD_DEBUG_LEVEL >= WARN
     134#define PRINTF1 if (ORX_NONE)
     135#endif
     136
     137#if HARD_DEBUG_LEVEL >= ORX_WARN
    138138#define PRINTF2 \
    139      if (SOFT_DEBUG_LEVEL >= WARN) \
     139     if (SOFT_DEBUG_LEVEL >= ORX_WARN) \
    140140       printf("(WW)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    141141
    142142#else
    143 #define PRINTF2 if (NO)
    144 #endif
    145 
    146 #if HARD_DEBUG_LEVEL >= INFO
     143#define PRINTF2 if (ORX_NONE)
     144#endif
     145
     146#if HARD_DEBUG_LEVEL >= ORX_INFO
    147147#define PRINTF3 \
    148      if (SOFT_DEBUG_LEVEL >= INFO) \
     148     if (SOFT_DEBUG_LEVEL >= ORX_INFO) \
    149149       printf("(II)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    150150#else
    151 #define PRINTF3 if (NO)
    152 #endif
    153 
    154 #if HARD_DEBUG_LEVEL >= DEBUG
     151#define PRINTF3 if (ORX_NONE)
     152#endif
     153
     154#if HARD_DEBUG_LEVEL >= ORX_DEBUG
    155155#define PRINTF4 \
    156      if (SOFT_DEBUG_LEVEL >= DEBUG) \
     156     if (SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
    157157       printf("(DD)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    158158#else
    159 #define PRINTF4 if (NO)
    160 #endif
    161 
    162 #if HARD_DEBUG_LEVEL >= vDEBUG
     159#define PRINTF4 if (ORX_NONE)
     160#endif
     161
     162#if HARD_DEBUG_LEVEL >= ORX_vDEBUG
    163163#define PRINTF5 \
    164      if (SOFT_DEBUG_LEVEL >= vDEBUG) \
     164     if (SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
    165165       printf("(VD)::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    166166#else
    167 #define PRINTF5 if (NO)
    168 #endif
    169 
    170 #else
    171 #define PRINTF(x) if (NO)
     167#define PRINTF5 if (ORX_NONE)
     168#endif
     169
     170#else
     171#define PRINTF(x) if (ORX_NONE)
    172172#endif
    173173
     
    179179///  PRINT: just prints output as is            ///
    180180///////////////////////////////////////////////////
    181 #define PRINTNO      PRINT0
    182 #define PRINTERR     PRINT1
    183 #define PRINTWARN    PRINT2
    184 #define PRINTINFO    PRINT3
    185 #define PRINTDEBUG   PRINT4
    186 #define PRINTVDEBUG  PRINT5
    187 
    188 #ifdef  DEBUG
     181#define PRINTORX_NONE    PRINT0
     182#define PRINTORX_ERR     PRINT1
     183#define PRINTORX_WARN    PRINT2
     184#define PRINTORX_INFO    PRINT3
     185#define PRINTORX_DEBUG   PRINT4
     186#define PRINTORX_vDEBUG  PRINT5
     187
     188#ifdef  DEBUG_LEVEL
    189189#define PRINT(x) \
    190190  PRINT ## x
    191191
    192 #if HARD_DEBUG_LEVEL >= ERR
     192#if HARD_DEBUG_LEVEL >= ORX_ERR
    193193#define PRINT1  \
    194   if (SOFT_DEBUG_LEVEL >= ERR)  \
     194  if (SOFT_DEBUG_LEVEL >= ORX_ERR)  \
    195195    PRINT_EXEC
    196196#else
    197 #define PRINT1 if (NO)
    198 #endif
    199 
    200 #if HARD_DEBUG_LEVEL >= WARN
     197#define PRINT1 if (ORX_NONE)
     198#endif
     199
     200#if HARD_DEBUG_LEVEL >= ORX_WARN
    201201#define PRINT2 \
    202   if (SOFT_DEBUG_LEVEL >= WARN) \
     202  if (SOFT_DEBUG_LEVEL >= ORX_WARN) \
    203203    PRINT_EXEC
    204204
    205205#else
    206 #define PRINT2 if (NO)
    207 #endif
    208 
    209 #if HARD_DEBUG_LEVEL >= INFO
     206#define PRINT2 if (ORX_NONE)
     207#endif
     208
     209#if HARD_DEBUG_LEVEL >= ORX_INFO
    210210#define PRINT3 \
    211   if (SOFT_DEBUG_LEVEL >= INFO) \
     211  if (SOFT_DEBUG_LEVEL >= ORX_INFO) \
    212212    PRINT_EXEC
    213213#else
    214 #define PRINT3 if (NO)
    215 #endif
    216 
    217 #if HARD_DEBUG_LEVEL >= DEBUG
     214#define PRINT3 if (ORX_NONE)
     215#endif
     216
     217#if HARD_DEBUG_LEVEL >= ORX_DEBUG
    218218#define PRINT4 \
    219   if (SOFT_DEBUG_LEVEL >= DEBUG) \
     219  if (SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
    220220    PRINT_EXEC
    221221#else
    222 #define PRINT4 if (NO)
    223 #endif
    224 
    225 #if HARD_DEBUG_LEVEL >= vDEBUG
     222#define PRINT4 if (ORX_NONE)
     223#endif
     224
     225#if HARD_DEBUG_LEVEL >= ORX_vDEBUG
    226226#define PRINT5 \
    227      if (SOFT_DEBUG_LEVEL >= vDEBUG) \
     227     if (SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
    228228       PRINT_EXEC
    229229#else
    230 #define PRINT5 if (NO)
    231 #endif
    232 
    233 
    234 #else
    235 #define PRINT(x) if (NO)
     230#define PRINT5 if (ORX_NONE)
     231#endif
     232
     233
     234#else
     235#define PRINT(x) if (ORX_NONE)
    236236#endif
    237237
     
    244244///  COUT: just prints output as is with std::cout   ///
    245245////////////////////////////////////////////////////////
    246 #define COUTNO      COUT0
    247 #define COUTERR     COUT1
    248 #define COUTWARN    COUT2
    249 #define COUTINFO    COUT3
    250 #define COUTDEBUG   COUT4
    251 #define COUTVDEBUG  COUT5
    252 
    253 #ifdef  DEBUG
     246#define COUTORX_NONE    COUT0
     247#define COUTORX_ERR     COUT1
     248#define COUTORX_WARN    COUT2
     249#define COUTORX_INFO    COUT3
     250#define COUTORX_DEBUG   COUT4
     251#define COUTORX_vDEBUG  COUT5
     252
     253#ifdef  DEBUG_LEVEL
    254254#define COUT(x) \
    255255  COUT ## x
    256256
    257 #if HARD_DEBUG_LEVEL >= ERR
     257#if HARD_DEBUG_LEVEL >= ORX_ERR
    258258#define COUT1  \
    259   if (SOFT_DEBUG_LEVEL >= ERR)  \
    260     COUT_EXEC
    261 #else
    262 #define COUT1 if (NO)\
    263     COUT_EXEC
    264 #endif
    265 
    266 #if HARD_DEBUG_LEVEL >= WARN
     259  if (SOFT_DEBUG_LEVEL >= ORX_ERR)  \
     260    COUT_EXEC
     261#else
     262#define COUT1 if (ORX_NONE)\
     263    COUT_EXEC
     264#endif
     265
     266#if HARD_DEBUG_LEVEL >= ORX_WARN
    267267#define COUT2 \
    268   if (SOFT_DEBUG_LEVEL >= WARN) \
    269     COUT_EXEC
    270 
    271 #else
    272 #define COUT2 if (NO) \
    273     COUT_EXEC
    274 #endif
    275 
    276 #if HARD_DEBUG_LEVEL >= INFO
     268  if (SOFT_DEBUG_LEVEL >= ORX_WARN) \
     269    COUT_EXEC
     270
     271#else
     272#define COUT2 if (ORX_NONE) \
     273    COUT_EXEC
     274#endif
     275
     276#if HARD_DEBUG_LEVEL >= ORX_INFO
    277277#define COUT3 \
    278   if (SOFT_DEBUG_LEVEL >= INFO) \
    279     COUT_EXEC
    280 #else
    281 #define COUT3 if (NO) \
    282     COUT_EXEC
    283 #endif
    284 
    285 #if HARD_DEBUG_LEVEL >= DEBUG
     278  if (SOFT_DEBUG_LEVEL >= ORX_INFO) \
     279    COUT_EXEC
     280#else
     281#define COUT3 if (ORX_NONE) \
     282    COUT_EXEC
     283#endif
     284
     285#if HARD_DEBUG_LEVEL >= ORX_DEBUG
    286286#define COUT4 \
    287   if (SOFT_DEBUG_LEVEL >= DEBUG) \
    288     COUT_EXEC
    289 #else
    290 #define COUT4 if (NO) \
    291     COUT_EXEC
    292 #endif
    293 
    294 #if HARD_DEBUG_LEVEL >= vDEBUG
     287  if (SOFT_DEBUG_LEVEL >= ORX_DEBUG) \
     288    COUT_EXEC
     289#else
     290#define COUT4 if (ORX_NONE) \
     291    COUT_EXEC
     292#endif
     293
     294#if HARD_DEBUG_LEVEL >= ORX_vDEBUG
    295295#define COUT5 \
    296      if (SOFT_DEBUG_LEVEL >= vDEBUG) \
     296     if (SOFT_DEBUG_LEVEL >= ORX_vDEBUG) \
    297297       COUT_EXEC
    298298#else
    299 #define COUT5 if (NO) \
    300     COUT_EXEC
    301 #endif
    302 
    303 
    304 #else
    305 #define COUT(x) if (NO) \
     299#define COUT5 if (ORX_NONE) \
     300    COUT_EXEC
     301#endif
     302
     303
     304#else
     305#define COUT(x) if (ORX_NONE) \
    306306    COUT_EXEC
    307307#endif
  • trunk/src/lib/graphics/importer/primitive_model.cc

    r6912 r7729  
    3434{
    3535  switch (type)
    36     {
     36  {
    3737    default:
    3838    case PRIM_CUBE:
     
    5151      this->planeModel(size, detail);
    5252      break;
    53     }
     53  }
    5454  this->finalize();
    5555}
     
    7979  // defining the Vertices
    8080  for (float i = 0; i < df *2.0; i+=1.0)
    81     {
    82       float vi = i/df * PI;
    83       for (float j = -df / 2.0 +1.0; j <= df / 2.0; j+=1.0 *df/(df+1.0))
    84         {
    85           float vj = j/df *PI;
    86           this->addVertexNormal(cos(vi) * cos(vj),
    87                                 sin(vj),
    88                                 sin(vi) * cos(vj));
    89 
    90           this->addVertex(size * cos(vi) * cos(vj),
    91                           size * sin(vj),
    92                           size * sin(vi) * cos(vj));
    93 
    94           this->addVertexTexture( i / (df *2.0),
    95                                  (j-1.0)/(df)+.5);
    96         }
    97     }
     81  {
     82    float vi = i/df * PI;
     83    for (float j = -df / 2.0 +1.0; j <= df / 2.0; j+=1.0 *df/(df+1.0))
     84    {
     85      float vj = j/df *PI;
     86      this->addVertexNormal(cos(vi) * cos(vj),
     87                            sin(vj),
     88                            sin(vi) * cos(vj));
     89
     90      this->addVertex(size * cos(vi) * cos(vj),
     91                      size * sin(vj),
     92                      size * sin(vi) * cos(vj));
     93
     94      this->addVertexTexture( i / (df *2.0),
     95                              (j-1.0)/(df)+.5);
     96    }
     97  }
    9898  this->addVertex(0, -size, 0);
    9999  this->addVertexNormal(0, -1, 0);
     
    106106  unsigned int v1, v2, v3, v4;
    107107  for (int i = 0; i <= detail * 2 -1; i++)
    108     {
    109       for (int j = 0; j <= detail; j++)
    110         {
    111 
    112           v1 = i*detail + j-1;
    113           v4 = i*detail + j;
    114 
    115           if (i == detail*2 -1)
    116             {
    117               v2 = j-1;
    118               v3 = j;
    119             }
    120           else
    121             {
    122               v2 = (i+1)*detail + j-1;
    123               v3 = (i+1)*detail + j;
    124             }
    125 
    126           if (j == 0)
    127             {
    128               v1 = this->getVertexCount() - 2;
    129               this->addFace(3, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v3, v3, v3, v4, v4, v4);
    130             }
    131           else if (j == detail)
    132             {
    133               v3 = this->getVertexCount()-1;
    134               this->addFace(3, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v2, v2, v2, v3, v3, v3);
    135             }
    136           else
    137             this->addFace(4, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v2, v2, v2, v3, v3, v3, v4, v4, v4);
    138         }
    139     }
     108  {
     109    for (int j = 0; j <= detail; j++)
     110    {
     111
     112      v1 = i*detail + j-1;
     113      v4 = i*detail + j;
     114
     115      if (i == detail*2 -1)
     116      {
     117        v2 = j-1;
     118        v3 = j;
     119      }
     120      else
     121      {
     122        v2 = (i+1)*detail + j-1;
     123        v3 = (i+1)*detail + j;
     124      }
     125
     126      if (j == 0)
     127      {
     128        v1 = this->getVertexCount() - 2;
     129        this->addFace(3, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v3, v3, v3, v4, v4, v4);
     130      }
     131      else if (j == detail)
     132      {
     133        v3 = this->getVertexCount()-1;
     134        this->addFace(3, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v2, v2, v2, v3, v3, v3);
     135      }
     136      else
     137        this->addFace(4, VERTEX_TEXCOORD_NORMAL, v1, v1, v1, v2, v2, v2, v3, v3, v3, v4, v4, v4);
     138    }
     139  }
    140140}
    141141/**
     
    150150  // defining Points of the Cylinder.
    151151  for (float phi = 0.0; phi < 2.0*PI; phi += 2.0*PI/(float)detail)
    152     {
    153       this->addVertex(size*cos(phi), size*sin(phi), -size);
    154       this->addVertex(size*cos(phi), size*sin(phi), size);
    155       count ++;
    156     }
     152  {
     153    this->addVertex(size*cos(phi), size*sin(phi), -size);
     154    this->addVertex(size*cos(phi), size*sin(phi), size);
     155    count ++;
     156  }
    157157  this->addVertex(0, 0, -size);
    158158  this->addVertex(0, 0, size);
    159159
    160160  if (count != detail)
     161  {
    161162    PRINTF(1)("calculation error, count should be %d but is %d.\n", detail, count);
    162 
     163  }
    163164  // adding Faces
    164165  for (int i = 0; i < detail-1; i++)
    165     {
    166       int p1, p2, p3, p4;
    167       p1 = 2*i;
    168       p2 = 2*i+1;
    169       p3 = 2*i+3;
    170       p4 = 2*i+2;
    171       // something is wrong here
    172       this->addFace(4, VERTEX_ONLY, p1, p2, p3, p4);
    173       this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail);
    174       this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+1);
    175     }
     166  {
     167    int p1, p2, p3, p4;
     168    p1 = 2*i;
     169    p2 = 2*i+1;
     170    p3 = 2*i+3;
     171    p4 = 2*i+2;
     172    // something is wrong here
     173    this->addFace(4, VERTEX_ONLY, p1, p2, p3, p4);
     174    this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail);
     175    this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+1);
     176  }
    176177  // caps
    177178  this->addFace(4, VERTEX_ONLY, 2*detail-2, 2*detail-1, 1, 0);
     
    195196  // defining the Vertices
    196197  for (float i = 0; i < df; i+=1.0)
    197     {
    198       float vi = i/df *2.0*PI;
    199       this->addVertex(size* sin(vi),
    200                       -size,
    201                       size* cos(vi));
    202     }
     198  {
     199    float vi = i/df *2.0*PI;
     200    this->addVertex(size* sin(vi),
     201                    -size,
     202                    size* cos(vi));
     203  }
    203204
    204205  //defining Faces
    205206  for (int i = 0; i < detail; i++)
    206     {
    207       unsigned int v1, v2;
    208       v1 = i+2;
    209       if (i == detail -1)
    210         v2 = 2;
    211       else
    212         v2 = i+3;
    213       this->addFace(3, VERTEX_ONLY, 0, v1, v2);
    214       this->addFace(3, VERTEX_ONLY, 1, v1, v2);
    215     }
     207  {
     208    unsigned int v1, v2;
     209    v1 = i+2;
     210    if (i == detail -1)
     211      v2 = 2;
     212    else
     213      v2 = i+3;
     214    this->addFace(3, VERTEX_ONLY, 0, v1, v2);
     215    this->addFace(3, VERTEX_ONLY, 1, v1, v2);
     216  }
    216217}
    217218
     
    226227  for (int i = 0; i < detail; i++)
    227228    for (int j = 0; j < detail; j++)
    228       {
    229         this->addVertex(((float)i/(float)(detail-1) -.5)*size,
    230                         0,
    231                         ((float)j/(float)(detail-1) -.5)*size);
    232         this->addVertexTexture((float)i/(float)(detail-1),
    233                                (float)j/(float)(detail-1));
    234       }
     229    {
     230      this->addVertex(((float)i/(float)(detail-1) -.5)*size,
     231                      0,
     232                      ((float)j/(float)(detail-1) -.5)*size);
     233      this->addVertexTexture((float)i/(float)(detail-1),
     234                             (float)j/(float)(detail-1));
     235    }
    235236  //defining Faces
    236237  unsigned int v1, v2, v3, v4;
    237238  for (int i = 0; i < detail-1; i++)
    238239    for (int j = 0; j < detail-1; j++)
    239       {
    240         v1 = i*detail + j;
    241         v2 = (i+1)*detail + j;
    242         v3 = (i+1)*detail + (j+1);
    243         v4 = i*detail + (j+1);
    244         this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4);
    245       }
    246 }
     240    {
     241      v1 = i*detail + j;
     242      v2 = (i+1)*detail + j;
     243      v3 = (i+1)*detail + (j+1);
     244      v4 = i*detail + (j+1);
     245      this->addFace(4, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3, v4, v4);
     246    }
     247}
  • trunk/src/lib/gui/gtk_gui/gui_exec.cc

    r7661 r7729  
    7676#ifdef DEBUG
    7777      verboseMode = new Menu(CONFIG_NAME_VERBOSE_MODE, "nothing",
    78 #if DEBUG >=1
     78#if DEBUG_LEVEL >=1
    7979                             "error",
    8080#endif
    81 #if DEBUG >=2
     81#if DEBUG_LEVEL >=2
    8282                             "warning",
    8383#endif
    84 #if DEBUG >=3
     84#if DEBUG_LEVEL >=3
    8585                             "info",
    8686#endif
    87 #if DEBUG >=4
     87#if DEBUG_LEVEL >=4
    8888                             "debug",
    8989#endif
    90 #if DEBUG >=5
     90#if DEBUG_LEVEL >=5
    9191                             "heavydebug",
    9292#endif
     
    9595      verboseMode->setDescription("Sets the Output Mode", "This Enables Outbug messages\n"
    9696                                  "0: nothing will be displayed, but stuff one cannot do without (eg.GUI)\n"
    97 #if DEBUG >=1
     97#if DEBUG_LEVEL >=1
    9898                                  "1: error: outputs all the above and errors"
    9999#endif
    100 #if DEBUG >=2
     100#if DEBUG_LEVEL >=2
    101101                                  "2: warning: outputs all the above plus warnings"
    102102#endif
    103 #if DEBUG >=3
     103#if DEBUG_LEVEL >=3
    104104                                  "3: info: outputs all the above plus Information"
    105105#endif
    106 #if DEBUG >=4
     106#if DEBUG_LEVEL >=4
    107107                                  "4: debug: displays all the above plus debug information"
    108108#endif
    109 #if DEBUG >=5
     109#if DEBUG_LEVEL >=5
    110110                                  "5: heavydebug: displays all the above plus heavy debug information: WARNING: the game will run very slow with this."
    111111#endif
  • trunk/src/lib/parser/ini_parser/ini_parser.cc

    r7676 r7729  
    2828#endif
    2929
    30 #ifdef DEBUG
     30#ifdef DEBUG_LEVEL
    3131 #include "../../../defs/debug.h"
    3232#else
    3333 #define PRINTF(x) printf
     34 #define PRINT(x) printf
    3435#endif
    3536
  • trunk/src/lib/shell/shell_buffer.cc

    r7375 r7729  
    103103
    104104    SDL_mutexP(ShellBuffer::bufferMutex);
    105 #if DEBUG < 3
     105#if DEBUG_LEVEL < 3
    106106    if (ShellBuffer::singletonRef == NULL)
    107107#endif
    108108      vprintf(line, arguments);
    109 #if DEBUG < 3
     109#if DEBUG_LEVEL < 3
    110110    else
    111111#else
     
    180180
    181181  /**
    182    * displays some nice output from the Shell
     182   * @brief displays some nice output from the Shell
    183183   */
    184184  void ShellBuffer::debug() const
  • trunk/src/lib/shell/shell_input.cc

    r7676 r7729  
    4444
    4545    this->inputLine = "";
    46     this->historyIT = this->history.begin();
     46    this->historyIT = ShellInput::history.begin();
    4747    this->setHistoryLength(50);
    4848    this->historyScrolling = false;
     
    6565  }
    6666
     67  std::list<std::string> ShellInput::history;
     68
    6769  /**
    6870   * @brief standard deconstructor
    6971   */
    7072  ShellInput::~ShellInput ()
    71 {}
     73  {}
    7274
    7375  /**
     
    173175
    174176    // adding the new Command to the History
    175     this->history.push_back(this->inputLine);
     177    if (history.back() != this->inputLine)
     178      this->history.push_back(this->inputLine);
    176179    if (this->history.size() > this->historyLength)
    177180    {
  • trunk/src/lib/shell/shell_input.h

    r7458 r7729  
    6969    Uint16                            pressedKey;       //!< the pressed key that will be repeated.
    7070
    71     std::list<std::string>            history;          //!< The history of given commands.
     71    static std::list<std::string>     history;          //!< The history of given commands.
    7272    std::list<std::string>::iterator  historyIT;        //!< The locator that tells us, where we are in the history.
    7373    unsigned int                      historyLength;    //!< The maximum length of the InputHistory.
  • trunk/src/lib/sound/ogg_player.cc

    r7460 r7729  
    290290
    291291    alSourceQueueBuffers(this->source, 2, this->buffers);
    292     if (DEBUG >= 3)
     292    if (DEBUG_LEVEL >= 3)
    293293      SoundEngine::checkError("OggPlayer::playback()::alSourceQueueBuffers", __LINE__);
    294294
    295295    alSourcePlay(this->source);
    296     if (DEBUG >= 3)
     296    if (DEBUG_LEVEL >= 3)
    297297      SoundEngine::checkError("OggPlayer::playback()::alSourcePlay", __LINE__);
    298298    SDL_mutexV(this->musicMutex);
     
    329329
    330330    alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed);
    331     if (DEBUG >= 3)
     331    if (DEBUG_LEVEL >= 3)
    332332      SoundEngine::checkError("OggPlayer::update()::alGetSourceI", __LINE__);
    333333
     
    337337
    338338      alSourceUnqueueBuffers(source, 1, &buffer);
    339       if (DEBUG >= 3)
     339      if (DEBUG_LEVEL >= 3)
    340340        SoundEngine::checkError("OggPlayer::update()::unqueue", __LINE__);
    341341
     
    343343
    344344      alSourceQueueBuffers(source, 1, &buffer);
    345       if (DEBUG >= 3)
     345      if (DEBUG_LEVEL >= 3)
    346346        SoundEngine::checkError("OggPlayer::update()::queue", __LINE__);
    347347    }
     
    380380
    381381    alBufferData(buffer, format, pcm, size, vorbisInfo->rate);
    382     if (DEBUG >= 3)
     382    if (DEBUG_LEVEL >= 3)
    383383      SoundEngine::checkError("OggPlayer::stream()::BUFFER", __LINE__);
    384384
     
    448448
    449449  /////////////////////
    450   // DEBUG FUNCTIONS //
     450  // DEBUG_LEVEL FUNCTIONS //
    451451  /////////////////////
    452452  /**
  • trunk/src/lib/sound/sound_engine.cc

    r7460 r7729  
    223223          int play = 0x000;
    224224          alGetSourcei(source->getID(), AL_SOURCE_STATE, &play);
    225           if (DEBUG > 2)
     225          if (DEBUG_LEVEL > 2)
    226226            SoundEngine::checkError("SoundEngine::update() Play", __LINE__);
    227227          if(play == AL_PLAYING)
     
    233233                         source->getNode()->getAbsCoor().y,
    234234                         source->getNode()->getAbsCoor().z);
    235               if (DEBUG > 2)
     235              if (DEBUG_LEVEL > 2)
    236236                SoundEngine::checkError("SoundEngine::update() Set Source Position", __LINE__);
    237237              alSource3f(source->getID(), AL_VELOCITY,
     
    239239                         source->getNode()->getVelocity().y,
    240240                         source->getNode()->getVelocity().z);
    241               if (DEBUG > 2)
     241              if (DEBUG_LEVEL > 2)
    242242                SoundEngine::checkError("SoundEngine::update() Set Source Velocity", __LINE__);
    243243            }
  • trunk/src/lib/sound/sound_source.cc

    r7460 r7729  
    124124      alSourcePlay(this->sourceID);
    125125
    126       if (DEBUG >= 3)
     126      if (DEBUG_LEVEL >= 3)
    127127        SoundEngine::checkError("Play Source", __LINE__);
    128128      this->bPlay = true;
     
    151151    this->bPlay = true;
    152152
    153     if (DEBUG >= 3)
     153    if (DEBUG_LEVEL >= 3)
    154154      SoundEngine::checkError("Play Source", __LINE__);
    155155  }
     
    165165    {
    166166      alSourceStop(this->sourceID);
    167       if (DEBUG >= 3)
     167      if (DEBUG_LEVEL >= 3)
    168168        SoundEngine::checkError("StopSource", __LINE__);
    169169      alSourcei(this->sourceID, AL_BUFFER, 0);
     
    181181  {
    182182    alSourcePause(this->sourceID);
    183     if (DEBUG >= 3)
     183    if (DEBUG_LEVEL >= 3)
    184184      SoundEngine::checkError("Pause Source", __LINE__);
    185185  }
     
    193193    alSourceRewind(this->sourceID);
    194194
    195     if (DEBUG >= 3)
     195    if (DEBUG_LEVEL >= 3)
    196196      SoundEngine::checkError("Rewind Source", __LINE__);
    197197  }
     
    208208    alSourcef(this->sourceID, AL_ROLLOFF_FACTOR, rolloffFactor);
    209209
    210     if (DEBUG >= 3)
     210    if (DEBUG_LEVEL >= 3)
    211211      SoundEngine::checkError("Set Source Rolloff-factor", __LINE__);
    212212  }
  • trunk/src/orxonox.cc

    r7721 r7729  
    507507  if (showGui || (!File("./orxonox.conf").isFile() &&
    508508                  !File(DEFAULT_CONFIG_FILE).isFile())
    509 #if DEBUG < 3 // developers do not need to see the GUI, when orxonox fails
     509#if DEBUG_LEVEL <= 3 // developers do not need to see the GUI, when orxonox fails
    510510      || ResourceManager::isFile(DEFAULT_LOCK_FILE)
    511511#endif
  • trunk/src/world_entities/weapons/weapon.cc

    r7460 r7729  
    396396bool Weapon::execute()
    397397{
    398 #if DEBUG > 4
     398#if DEBUG_LEVEL > 4
    399399  PRINTF(4)("trying to execute action %s\n", actionToChar(this->requestedAction));
    400400  this->debug();
Note: See TracChangeset for help on using the changeset viewer.