Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3605 in orxonox.OLD for orxonox/branches/levelloader/src/defs


Ignore:
Timestamp:
Mar 18, 2005, 11:52:15 AM (20 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/defs/debug.h

    r3542 r3605  
    1717    \file debug.h
    1818    \brief Handles output to console for different Verbose-Modes.
     19
     20    There are two main modes HARD and SOFT. HARD is precessed during compileTime where SOFT is for runtime.
     21    \li HARD: One can choose between different modes. see: // DEFINE_MODULES \\
     22    \li SOFT: If you want each module can have its own variable for processing. just pass it to DEBUG_MODULE_SOFT
    1923*/
    2024
     
    2832#include <stdio.h>
    2933
    30 #ifndef DEBUG
    31 #define DEBUG 4
    32 #endif
    33 
     34// DEFINE ERROR MODES
    3435#define NO              0
    3536#define ERR             1
     
    3738#define INFO            3
    3839#define DEBUGING        4
    39 
     40#define vDEBUGING       5
     41
     42extern int verbose;
     43
     44//definitions
     45#ifndef MODULAR_DEBUG
     46#define HARD_DEBUG_LEVEL DEBUG
     47#define SOFT_DEBUG_LEVEL verbose
     48#else /* MODULAR_DEBUG */
     49#ifndef DEBUG_MODULE_SOFT
     50#define SOFT_DEBUG_LEVEL verbose
     51#else /* DEBUG_MODULE_SOFT */
     52#define SOFT_DEBUG_LEVEL DEBUG_MODULE_SOFT
     53#endif /* DEBUG_MODULE_SOFT */
     54
     55#ifndef DEBUG_SPECIAL_MODULE
     56#define HARD_DEBUG_LEVEL DEBUG
     57#else /* DEBUG_SPECIAL_MODULE */
     58// DEFINE MODULES \\
     59#define DEBUG_MODULE_ORXONOX            0
     60#define DEBUG_MODULE_WORLD              0
     61#define DEBUG_MODULE_PNODE              2
     62#define DEBUG_MODULE_WORLD_ENTITY       0
     63#define DEBUG_MODULE_COMMAND_NODE       0
     64
     65#define DEBUG_MODULE_IMPORTER           0
     66#define DEBUG_MODULE_TRACK_MANAGER      0
     67#define DEBUG_MODULE_LIGHT              3
     68#define DEBUG_MODULE_PLAYER             0
     69#define DEBUG_MODULE_MATH               0
     70
     71#define DEBUG_MODULE_NULL_PARENT        0
     72
     73
     74#define HARD_DEBUG_LEVEL DEBUG_SPECIAL_MODULE
     75#endif /* DEBUG_SPECIAL_MODULE */
     76#endif /* MODULAR_DEBUG */
    4077///////////////////////////////////////////////////
    4178/// PRINTF: prints with filename and linenumber ///
    4279///////////////////////////////////////////////////
     80
    4381#ifdef DEBUG
    44 extern int verbose;
     82
    4583#define PRINTF(x) \
    4684           PRINTF ## x
    47            
    48 #if DEBUG >= ERR
     85
     86#if HARD_DEBUG_LEVEL >= ERR
    4987#define PRINTF1 \
    50     if (verbose >= ERR) \
    51       printf("%s:%d::ERROR:", __FILE__, __LINE__) && printf
     88    if (SOFT_DEBUG_LEVEL >= ERR) \
     89      printf("ERROR::%s:%d:", __FILE__, __LINE__) && printf
    5290#else
    5391#define PRINTF1 if (NO)
    5492#endif
    5593     
    56 #if DEBUG >= WARN
     94#if HARD_DEBUG_LEVEL >= WARN
    5795#define PRINTF2 \
    58      if (verbose >= WARN) \
    59        printf("%s:%d::WARNING:", __FILE__, __LINE__) && printf
     96     if (SOFT_DEBUG_LEVEL >= WARN) \
     97       printf("WARNING::%s:%d:", __FILE__, __LINE__) && printf
    6098         
    6199#else
     
    63101#endif
    64102     
    65 #if DEBUG >= INFO
     103#if HARD_DEBUG_LEVEL >= INFO
    66104#define PRINTF3 \
    67      if (verbose >= INFO) \
    68        printf("%s:%d::INFO:", __FILE__, __LINE__) && printf
     105     if (SOFT_DEBUG_LEVEL >= INFO) \
     106       printf("INFO::%s:%d:", __FILE__, __LINE__) && printf
    69107#else
    70108#define PRINTF3 if (NO)
    71109#endif
    72110     
    73 #if DEBUG >= DEBUGING
     111#if HARD_DEBUG_LEVEL >= DEBUGING
    74112#define PRINTF4 \
    75      if (verbose >= DEBUGING) \
    76        printf("%s:%d::DEBUG:", __FILE__, __LINE__) && printf
     113     if (SOFT_DEBUG_LEVEL >= DEBUGING) \
     114       printf("DEBUG::%s:%d:", __FILE__, __LINE__) && printf
    77115#else
    78116#define PRINTF4 if (NO)
    79117#endif
    80118     
    81      
     119#if HARD_DEBUG_LEVEL >= vDEBUGING
     120#define PRINTF5 \
     121     if (SOFT_DEBUG_LEVEL >= vDEBUGING) \
     122       printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
     123#else
     124#define PRINTF5 if (NO)
     125#endif
     126   
    82127#else 
    83128#define PRINTF(x) if (NO)
     
    92137///////////////////////////////////////////////////
    93138#ifdef  DEBUG
    94 extern int verbose;
    95139#define PRINT(x) \
    96140  PRINT ## x
    97  
    98 #if DEBUG >= ERR
     141
     142#if HARD_DEBUG_LEVEL >= ERR
    99143#define PRINT1  \
    100   if (verbose >= ERR)   \
     144  if (SOFT_DEBUG_LEVEL >= ERR)  \
    101145    printf
    102146#else
     
    104148#endif
    105149
    106 #if DEBUG >= WARN
     150#if HARD_DEBUG_LEVEL >= WARN
    107151#define PRINT2 \
    108   if (verbose >= WARN) \
     152  if (SOFT_DEBUG_LEVEL >= WARN) \
    109153    printf
    110154
     
    113157#endif
    114158
    115 #if DEBUG >= INFO
     159#if HARD_DEBUG_LEVEL >= INFO
    116160#define PRINT3 \
    117   if (verbose >= INFO) \
     161  if (SOFT_DEBUG_LEVEL >= INFO) \
    118162    printf
    119163#else
     
    121165#endif
    122166
    123 #if DEBUG >= DEBUGING
     167#if HARD_DEBUG_LEVEL >= DEBUGING
    124168#define PRINT4 \
    125   if (verbose >= DEBUGING) \
     169  if (SOFT_DEBUG_LEVEL >= DEBUGING) \
    126170    printf
    127171#else
    128172#define PRINT4 if (NO)
     173#endif
     174
     175#if HARD_DEBUG_LEVEL >= vDEBUGING
     176#define PRINT5 \
     177     if (SOFT_DEBUG_LEVEL >= vDEBUGING) \
     178       printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
     179#else
     180#define PRINT5 if (NO)
    129181#endif
    130182
     
    144196           COUT ## x
    145197
    146 #if DEBUG >= 1
     198#if HARD_DEBUG_LEVEL >= 1
    147199#define COUT1 \
    148     if (verbose >= 1 ) \
     200    if (SOFT_DEBUG_LEVEL >= 1 ) \
    149201      cout
    150202#else
     
    152204#endif
    153205     
    154 #if DEBUG >= 2
     206#if HARD_DEBUG_LEVEL >= 2
    155207#define COUT2 \
    156      if (verbose >= 2 ) \
     208     if (SOFT_DEBUG_LEVEL >= 2 ) \
    157209       cout
    158210
     
    161213#endif
    162214     
    163 #if DEBUG >= 3
     215#if HARD_DEBUG_LEVEL >= 3
    164216#define COUT3 \
    165      if (verbose >= 3 ) \
     217     if (SOFT_DEBUG_LEVEL >= 3 ) \
    166218       cout
    167219#else
     
    169221#endif
    170222     
    171 #if DEBUG >= 4
     223#if HARD_DEBUG_LEVEL >= 4
    172224#define COUT4 \
    173      if (verbose >= 4 ) \
     225     if (SOFT_DEBUG_LEVEL >= 4 ) \
    174226       cout
    175227#else
Note: See TracChangeset for help on using the changeset viewer.