Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5075 in orxonox.OLD


Ignore:
Timestamp:
Aug 19, 2005, 3:21:27 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: redirected all printf-output to the shell
This is just for testing purposes, and will be changed again in the future (perhaps)

Location:
trunk/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r5068 r5075  
    3333
    3434orxonox_SOURCES = orxonox.cc \
     35                  util/shell.cc \
    3536                  util/loading/game_loader.cc \
    3637                  util/track/track_manager.cc \
     
    4647                  util/loading/load_param.cc \
    4748                  util/state.cc \
    48                   util/shell.cc \
    4949                  util/user_control.cc \
    5050                  story_entities/story_entity.cc \
  • trunk/src/Makefile.in

    r5068 r5075  
    5353binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    5454PROGRAMS = $(bin_PROGRAMS)
    55 am_orxonox_OBJECTS = orxonox-orxonox.$(OBJEXT) \
     55am_orxonox_OBJECTS = orxonox-orxonox.$(OBJEXT) orxonox-shell.$(OBJEXT) \
    5656        orxonox-game_loader.$(OBJEXT) orxonox-track_manager.$(OBJEXT) \
    5757        orxonox-track_node.$(OBJEXT) orxonox-pilot_node.$(OBJEXT) \
     
    6262        orxonox-resource_manager.$(OBJEXT) orxonox-factory.$(OBJEXT) \
    6363        orxonox-load_param.$(OBJEXT) orxonox-state.$(OBJEXT) \
    64         orxonox-shell.$(OBJEXT) orxonox-user_control.$(OBJEXT) \
    65         orxonox-story_entity.$(OBJEXT) orxonox-campaign.$(OBJEXT) \
    66         orxonox-world.$(OBJEXT) orxonox-world_entity.$(OBJEXT) \
    67         orxonox-camera.$(OBJEXT) orxonox-player.$(OBJEXT) \
    68         orxonox-npc.$(OBJEXT) orxonox-environment.$(OBJEXT) \
    69         orxonox-skysphere.$(OBJEXT) orxonox-skybox.$(OBJEXT) \
    70         orxonox-terrain.$(OBJEXT) orxonox-satellite.$(OBJEXT) \
     64        orxonox-user_control.$(OBJEXT) orxonox-story_entity.$(OBJEXT) \
     65        orxonox-campaign.$(OBJEXT) orxonox-world.$(OBJEXT) \
     66        orxonox-world_entity.$(OBJEXT) orxonox-camera.$(OBJEXT) \
     67        orxonox-player.$(OBJEXT) orxonox-npc.$(OBJEXT) \
     68        orxonox-environment.$(OBJEXT) orxonox-skysphere.$(OBJEXT) \
     69        orxonox-skybox.$(OBJEXT) orxonox-terrain.$(OBJEXT) \
     70        orxonox-satellite.$(OBJEXT) \
    7171        orxonox-character_attributes.$(OBJEXT) \
    7272        orxonox-test_entity.$(OBJEXT) orxonox-weapon_manager.$(OBJEXT) \
     
    291291
    292292orxonox_SOURCES = orxonox.cc \
     293                  util/shell.cc \
    293294                  util/loading/game_loader.cc \
    294295                  util/track/track_manager.cc \
     
    304305                  util/loading/load_param.cc \
    305306                  util/state.cc \
    306                   util/shell.cc \
    307307                  util/user_control.cc \
    308308                  story_entities/story_entity.cc \
     
    579579@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-orxonox.obj `if test -f 'orxonox.cc'; then $(CYGPATH_W) 'orxonox.cc'; else $(CYGPATH_W) '$(srcdir)/orxonox.cc'; fi`
    580580
     581orxonox-shell.o: util/shell.cc
     582@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell.o -MD -MP -MF "$(DEPDIR)/orxonox-shell.Tpo" -c -o orxonox-shell.o `test -f 'util/shell.cc' || echo '$(srcdir)/'`util/shell.cc; \
     583@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-shell.Tpo" "$(DEPDIR)/orxonox-shell.Po"; else rm -f "$(DEPDIR)/orxonox-shell.Tpo"; exit 1; fi
     584@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/shell.cc' object='orxonox-shell.o' libtool=no @AMDEPBACKSLASH@
     585@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-shell.Po' tmpdepfile='$(DEPDIR)/orxonox-shell.TPo' @AMDEPBACKSLASH@
     586@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     587@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shell.o `test -f 'util/shell.cc' || echo '$(srcdir)/'`util/shell.cc
     588
     589orxonox-shell.obj: util/shell.cc
     590@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell.obj -MD -MP -MF "$(DEPDIR)/orxonox-shell.Tpo" -c -o orxonox-shell.obj `if test -f 'util/shell.cc'; then $(CYGPATH_W) 'util/shell.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell.cc'; fi`; \
     591@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-shell.Tpo" "$(DEPDIR)/orxonox-shell.Po"; else rm -f "$(DEPDIR)/orxonox-shell.Tpo"; exit 1; fi
     592@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/shell.cc' object='orxonox-shell.obj' libtool=no @AMDEPBACKSLASH@
     593@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-shell.Po' tmpdepfile='$(DEPDIR)/orxonox-shell.TPo' @AMDEPBACKSLASH@
     594@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     595@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shell.obj `if test -f 'util/shell.cc'; then $(CYGPATH_W) 'util/shell.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell.cc'; fi`
     596
    581597orxonox-game_loader.o: util/loading/game_loader.cc
    582598@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-game_loader.o -MD -MP -MF "$(DEPDIR)/orxonox-game_loader.Tpo" -c -o orxonox-game_loader.o `test -f 'util/loading/game_loader.cc' || echo '$(srcdir)/'`util/loading/game_loader.cc; \
     
    786802@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    787803@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-state.obj `if test -f 'util/state.cc'; then $(CYGPATH_W) 'util/state.cc'; else $(CYGPATH_W) '$(srcdir)/util/state.cc'; fi`
    788 
    789 orxonox-shell.o: util/shell.cc
    790 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell.o -MD -MP -MF "$(DEPDIR)/orxonox-shell.Tpo" -c -o orxonox-shell.o `test -f 'util/shell.cc' || echo '$(srcdir)/'`util/shell.cc; \
    791 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-shell.Tpo" "$(DEPDIR)/orxonox-shell.Po"; else rm -f "$(DEPDIR)/orxonox-shell.Tpo"; exit 1; fi
    792 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/shell.cc' object='orxonox-shell.o' libtool=no @AMDEPBACKSLASH@
    793 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-shell.Po' tmpdepfile='$(DEPDIR)/orxonox-shell.TPo' @AMDEPBACKSLASH@
    794 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    795 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shell.o `test -f 'util/shell.cc' || echo '$(srcdir)/'`util/shell.cc
    796 
    797 orxonox-shell.obj: util/shell.cc
    798 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell.obj -MD -MP -MF "$(DEPDIR)/orxonox-shell.Tpo" -c -o orxonox-shell.obj `if test -f 'util/shell.cc'; then $(CYGPATH_W) 'util/shell.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell.cc'; fi`; \
    799 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-shell.Tpo" "$(DEPDIR)/orxonox-shell.Po"; else rm -f "$(DEPDIR)/orxonox-shell.Tpo"; exit 1; fi
    800 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/shell.cc' object='orxonox-shell.obj' libtool=no @AMDEPBACKSLASH@
    801 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-shell.Po' tmpdepfile='$(DEPDIR)/orxonox-shell.TPo' @AMDEPBACKSLASH@
    802 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    803 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shell.obj `if test -f 'util/shell.cc'; then $(CYGPATH_W) 'util/shell.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell.cc'; fi`
    804804
    805805orxonox-user_control.o: util/user_control.cc
  • trunk/src/defs/debug.h

    r5048 r5075  
    2727
    2828#include "confincl.h"
     29#include "shell.h"
    2930
    3031#include <stdio.h>
     
    9798#define PRINTFVDEBUG  PRINTF5
    9899
     100//#ifdef
     101//#define PRINTF(x)        PRINT(x)
     102#define PRINT_EXEC       Shell::addBufferLineStatic
     103
    99104#ifdef DEBUG
    100105
     
    105110#define PRINTF1 \
    106111    if (SOFT_DEBUG_LEVEL >= ERR) \
    107       printf("ERROR::%s:%d:", __FILE__, __LINE__) && printf
     112      printf("ERROR::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    108113#else
    109114#define PRINTF1 if (NO)
     
    113118#define PRINTF2 \
    114119     if (SOFT_DEBUG_LEVEL >= WARN) \
    115        printf("WARNING::%s:%d:", __FILE__, __LINE__) && printf
     120       printf("WARNING::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    116121
    117122#else
     
    122127#define PRINTF3 \
    123128     if (SOFT_DEBUG_LEVEL >= INFO) \
    124        printf("INFO::%s:%d:", __FILE__, __LINE__) && printf
     129       printf("INFO::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    125130#else
    126131#define PRINTF3 if (NO)
     
    130135#define PRINTF4 \
    131136     if (SOFT_DEBUG_LEVEL >= DEBUG) \
    132        printf("DEBUG::%s:%d:", __FILE__, __LINE__) && printf
     137       printf("DEBUG::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    133138#else
    134139#define PRINTF4 if (NO)
     
    138143#define PRINTF5 \
    139144     if (SOFT_DEBUG_LEVEL >= vDEBUG) \
    140        printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
     145       printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    141146#else
    142147#define PRINTF5 if (NO)
     
    148153
    149154#define PRINTF0 \
    150     printf("%s:%d::", __FILE__, __LINE__) && printf
     155    printf("%s:%d::", __FILE__, __LINE__) && PRINT_EXEC
    151156
    152157
     
    168173#define PRINT1  \
    169174  if (SOFT_DEBUG_LEVEL >= ERR)  \
    170     printf
     175    PRINT_EXEC
    171176#else
    172177#define PRINT1 if (NO)
     
    176181#define PRINT2 \
    177182  if (SOFT_DEBUG_LEVEL >= WARN) \
    178     printf
     183    PRINT_EXEC
    179184
    180185#else
     
    185190#define PRINT3 \
    186191  if (SOFT_DEBUG_LEVEL >= INFO) \
    187     printf
     192    PRINT_EXEC
    188193#else
    189194#define PRINT3 if (NO)
     
    193198#define PRINT4 \
    194199  if (SOFT_DEBUG_LEVEL >= DEBUG) \
    195     printf
     200    PRINT_EXEC
    196201#else
    197202#define PRINT4 if (NO)
     
    201206#define PRINT5 \
    202207     if (SOFT_DEBUG_LEVEL >= vDEBUG) \
    203        printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
     208       PRINT_EXEC("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
    204209#else
    205210#define PRINT5 if (NO)
     
    212217
    213218#define PRINT0 \
    214   printf
     219  PRINT_EXEC
    215220
    216221#endif /* _DEBUG_H */
  • trunk/src/defs/stdincl.h

    r4697 r5075  
    22  \file stdincl.h
    33  \brief This file includes default headers that nearly every Class needs.
    4  
     4
    55  no Class is defined here, but many headers to classes, and more general Headers like the openGL-header.
    66*/
     
    2323
    2424#include "error.h"
    25 #include "debug.h"
    2625#include "globals.h"
    2726
  • trunk/src/lib/event/key_mapper.cc

    r5015 r5075  
    2424#include "ini_parser.h"
    2525#include "key_names.h"
     26#include "debug.h"
    2627
    2728using namespace std;
  • trunk/src/lib/graphics/importer/md2Model.cc

    r4836 r5075  
    1818#include "material.h"
    1919
     20#include "debug.h"
    2021#include "resource_manager.h"
    2122
     
    8485  if( unlikely(this->data == NULL))
    8586    PRINTF(0)("The model was not found, MD2Model Loader finished abnormaly. Update the data-repos\n");
    86  
     87
    8788  this->scaleFactor = this->data->scaleFactor;
    8889  this->setAnim(BOOM);
     
    381382  */
    382383
    383  
     384
    384385
    385386
  • trunk/src/lib/graphics/spatial_separation/quadtree.cc

    r4968 r5075  
    2222
    2323#include "material.h"
    24 
     24#include "debug.h"
    2525
    2626using namespace std;
  • trunk/src/lib/graphics/spatial_separation/quadtree_node.cc

    r4968 r5075  
    2323#include "list.h"
    2424#include "vector.h"
     25#include "debug.h"
    2526
    2627using namespace std;
  • trunk/src/lib/graphics/spatial_separation/spatial_separation.cc

    r4968 r5075  
    1717
    1818#include "spatial_separation.h"
     19
    1920#include "abstract_model.h"
    2021#include "quadtree.h"
     22#include "debug.h"
    2123
    2224using namespace std;
  • trunk/src/lib/graphics/text_engine.cc

    r5072 r5075  
    103103  {
    104104    this->text = new char[1];
    105     strcpy(this->text, "");
     105    *this->text = '\0';
    106106  }
    107107
    108108
    109109  // setting up the Text-Width if DYNAMIC
    110   if (this->type == TEXT_DYNAMIC)
     110  if (this->type == TEXT_DYNAMIC && this->alignment != TEXT_ALIGN_LEFT)
    111111    {
    112112      Glyph** glyphArray = this->font->getGlyphArray();
  • trunk/src/util/shell.cc

    r5074 r5075  
    2121#include "list.h"
    2222
     23#include <stdarg.h>
     24#include <stdio.h>
     25
    2326using namespace std;
    2427
     
    4144
    4245
    43   this->addBufferLine("asjflksjdvklasmv", NULL);
    44   TextEngine::getInstance()->debug();
     46  //this->addBufferLineStatic("asjflksjdvklasmv %s", "doom");
     47  //TextEngine::getInstance()->debug();
    4548  //exit(-1);
    4649}
     
    7376  while(bufferDisplaySize > this->bufferText->getSize())
    7477  {
    75     Text* newText = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);
     78    Text* newText = TextEngine::getInstance()->createText("fonts/earth.ttf", 10, TEXT_DYNAMIC, 0, 255, 0);
    7679    newText->setAlignment(TEXT_ALIGN_LEFT);
    7780    newText->setPosition2D(5, 5);
     
    120123 * @todo optimize
    121124 */
    122 void Shell::addBufferLine(const char* line, va_list args)
    123 {
    124   char tmp[1024];// = new char*
    125   vsprintf(tmp, line, args);
    126 
    127   char* newLine = new char[strlen(tmp)+1];
    128   strcpy(newLine, tmp);
    129 
    130   this->buffer->addAtBeginning(newLine);
    131 
    132   if (this->buffer->getSize() > this->bufferSize)
    133   {
    134     delete this->buffer->firstElement();
    135     this->buffer->remove(this->buffer->firstElement());
    136   }
     125bool Shell::addBufferLineStatic(const char* line, ...)
     126{
     127  va_list arguments;
     128  va_start(arguments, line);
     129
     130  if (Shell::singletonRef == NULL)
     131   vprintf(line, arguments);
     132  else
     133    Shell::singletonRef->addBufferLine(line, arguments);
     134  return true;
     135}
     136
     137void Shell::addBufferLine(const char* line, va_list arguments)
     138{
     139  vsprintf(this->bufferArray, line, arguments);
     140
     141  char* newLine = new char[strlen(this->bufferArray)+1];
     142  strcpy(newLine, this->bufferArray);
     143
     144//  this->buffer->add(newLine);
     145
     146//    if (this->buffer->getSize() > this->bufferSize)
     147//    {
     148//      delete this->buffer->firstElement();
     149//      this->buffer->remove(this->buffer->firstElement());
     150//    }
    137151
    138152  this->bufferText->firstElement()->setText(newLine);
    139 
    140153}
    141154
  • trunk/src/util/shell.h

    r5074 r5075  
    1010#include "event_listener.h"
    1111
    12 #include <stdio.h>
    1312#include <stdarg.h>
    14 
    1513
    1614// FORWARD DECLARATION
     
    4442    // BUFFER //
    4543    void flushBuffers();
    46     void addBufferLine(const char* Line, va_list args);
     44    static bool addBufferLineStatic(const char* line, ...);
     45    void addBufferLine(const char* line, va_list arg);
    4746    void moveBuffer(int lineCount);
    4847    const char* getBufferLine(unsigned int lineNumber);
     
    8180    tList<Text>*           bufferText;             //!< A list of stored bufferTexts for the display of the buffer
    8281    Text*                  inputLineText;          //!< The inputLine of the Shell
     82
     83    char                   bufferArray[10000];     //!< a BUFFER for fast writing
     84
    8385};
    8486
Note: See TracChangeset for help on using the changeset viewer.