Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4139 in orxonox.OLD for orxonox/branches/md2_loader


Ignore:
Timestamp:
May 10, 2005, 10:39:01 AM (20 years ago)
Author:
patrick
Message:

orxonox/branches/md2_loader: merged trunk into branche using: svn merge ../trunk/ md2_loader -r 4063:HEAD

Location:
orxonox/branches/md2_loader/src
Files:
1 deleted
64 edited
3 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/md2_loader/src/Makefile.am

    r4127 r4139  
    2222AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/animation
    2323AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/common
     24AM_CXXFLAGS+=-I$(MAINSRCDIR)/subprojects
    2425
    2526
     
    9091                 lib/xmlparser/tinystr.cc \
    9192                 lib/xmlparser/tinyxmlerror.cc \
    92                  lib/xmlparser/tinyxmlparser.cc
     93                 lib/xmlparser/tinyxmlparser.cc \
     94                 subprojects/benchmark.cc
    9395
    9496noinst_HEADERS = orxonox.h \
     
    134136                 defs/error.h \
    135137                 defs/debug.h \
     138                 defs/globals.h \
    136139                 lib/coord/p_node.h \
    137140                 lib/coord/null_parent.h \
     
    170173                 lib/gui/gui/gui_banner.h \
    171174                 lib/gui/gui/gui_keys.h \
    172                  lib/gui/gui/gui_update.h
     175                 lib/gui/gui/gui_update.h \
     176                 subprojects/benchmark.h
    173177
    174178libORXgui_a_CPPFLAGS=$(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
  • orxonox/branches/md2_loader/src/Makefile.in

    r4138 r4139  
    9191        vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
    9292        tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
    93         tinyxmlparser.$(OBJEXT)
     93        tinyxmlparser.$(OBJEXT) benchmark.$(OBJEXT)
    9494orxonox_OBJECTS = $(am_orxonox_OBJECTS)
    9595DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
     
    100100@AMDEP_TRUE@    ./$(DEPDIR)/animation_player.Po \
    101101@AMDEP_TRUE@    ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_entity.Po \
    102 @AMDEP_TRUE@    ./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \
     102@AMDEP_TRUE@    ./$(DEPDIR)/base_object.Po \
     103@AMDEP_TRUE@    ./$(DEPDIR)/benchmark.Po ./$(DEPDIR)/camera.Po \
    103104@AMDEP_TRUE@    ./$(DEPDIR)/campaign.Po \
    104105@AMDEP_TRUE@    ./$(DEPDIR)/character_attributes.Po \
     
    222223PACKAGE_VERSION = @PACKAGE_VERSION@
    223224PATH_SEPARATOR = @PATH_SEPARATOR@
     225PKG_CONFIG = @PKG_CONFIG@
    224226RANLIB = @RANLIB@
    225227SET_MAKE = @SET_MAKE@
     
    273275target_vendor = @target_vendor@
    274276MAINSRCDIR = .
    275 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common
     277AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common -I$(MAINSRCDIR)/subprojects
    276278noinst_LIBRARIES = libORXgui.a
    277279orxonox_DEPENDENCIES = libORXgui.a
     
    334336                 lib/xmlparser/tinystr.cc \
    335337                 lib/xmlparser/tinyxmlerror.cc \
    336                  lib/xmlparser/tinyxmlparser.cc
     338                 lib/xmlparser/tinyxmlparser.cc \
     339                 subprojects/benchmark.cc
    337340
    338341noinst_HEADERS = orxonox.h \
     
    378381                 defs/error.h \
    379382                 defs/debug.h \
     383                 defs/globals.h \
    380384                 lib/coord/p_node.h \
    381385                 lib/coord/null_parent.h \
     
    414418                 lib/gui/gui/gui_banner.h \
    415419                 lib/gui/gui/gui_keys.h \
    416                  lib/gui/gui/gui_update.h
     420                 lib/gui/gui/gui_update.h \
     421                 subprojects/benchmark.h
    417422
    418423libORXgui_a_CPPFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
     
    522527@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@
    523528@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@
     529@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmark.Po@am__quote@
    524530@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camera.Po@am__quote@
    525531@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/campaign.Po@am__quote@
     
    15591565@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    15601566@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlparser.obj `if test -f 'lib/xmlparser/tinyxmlparser.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinyxmlparser.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinyxmlparser.cc'; fi`
     1567
     1568benchmark.o: subprojects/benchmark.cc
     1569@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT benchmark.o -MD -MP -MF "$(DEPDIR)/benchmark.Tpo" -c -o benchmark.o `test -f 'subprojects/benchmark.cc' || echo '$(srcdir)/'`subprojects/benchmark.cc; \
     1570@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/benchmark.Tpo" "$(DEPDIR)/benchmark.Po"; else rm -f "$(DEPDIR)/benchmark.Tpo"; exit 1; fi
     1571@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='subprojects/benchmark.cc' object='benchmark.o' libtool=no @AMDEPBACKSLASH@
     1572@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/benchmark.Po' tmpdepfile='$(DEPDIR)/benchmark.TPo' @AMDEPBACKSLASH@
     1573@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1574@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o benchmark.o `test -f 'subprojects/benchmark.cc' || echo '$(srcdir)/'`subprojects/benchmark.cc
     1575
     1576benchmark.obj: subprojects/benchmark.cc
     1577@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT benchmark.obj -MD -MP -MF "$(DEPDIR)/benchmark.Tpo" -c -o benchmark.obj `if test -f 'subprojects/benchmark.cc'; then $(CYGPATH_W) 'subprojects/benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/subprojects/benchmark.cc'; fi`; \
     1578@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/benchmark.Tpo" "$(DEPDIR)/benchmark.Po"; else rm -f "$(DEPDIR)/benchmark.Tpo"; exit 1; fi
     1579@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='subprojects/benchmark.cc' object='benchmark.obj' libtool=no @AMDEPBACKSLASH@
     1580@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/benchmark.Po' tmpdepfile='$(DEPDIR)/benchmark.TPo' @AMDEPBACKSLASH@
     1581@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1582@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o benchmark.obj `if test -f 'subprojects/benchmark.cc'; then $(CYGPATH_W) 'subprojects/benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/subprojects/benchmark.cc'; fi`
    15611583uninstall-info-am:
    15621584
     
    16821704
    16831705distdir: $(DISTFILES)
    1684         $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/importer $(distdir)/lib/graphics/particles $(distdir)/lib/gui/gui $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities
     1706        $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/importer $(distdir)/lib/graphics/particles $(distdir)/lib/gui/gui $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/subprojects $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities
    16851707        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
    16861708        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  • orxonox/branches/md2_loader/src/command_node.cc

    r3654 r4139  
    5757  this->bEnabled = true;
    5858  this->world = NULL;
    59   this->loadBindings (filename);
     59  this->loadBindings(filename);
    6060}
    6161
     
    111111   \param filename: The path and name of the file to load the bindings from
    112112*/
    113 void CommandNode::loadBindings (char* filename)
     113void CommandNode::loadBindings (char* filename = DEFAULT_KEYBIND_FILE)
    114114{
    115115  FILE* stream;
    116116 
    117117  PRINTF(4)("Loading key bindings from %s\n", filename);
    118  
    119   if( filename == NULL) filename = DEFAULT_KEYBIND_FILE;
    120118 
    121119  // remove old bindings if present
     
    128126  // create parser
    129127  IniParser parser (filename);
    130   if( parser.getSection ("Bindings") == -1)
    131     {
    132       PRINTF(1)("Could not find key bindings in %s\n", filename);
     128  if( parser.getSection (CONFIG_SECTION_PLAYER "1") == -1)
     129    {
     130      PRINTF(1)("Could not find key bindings " CONFIG_SECTION_PLAYER"1 in %s\n", filename);
    133131      return;
    134132    }
     
    144142  while( parser.nextVar (namebuf, valuebuf) != -1)
    145143    {
    146       index = nameToIndex (namebuf);
     144      index = nameToIndex (valuebuf);
    147145      switch( index[0])
    148146        {
    149147        case 0:
    150           PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), valuebuf);
    151           strcpy (aliases->keys[index[1]], valuebuf);
     148          PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), namebuf);
     149          strcpy (aliases->keys[index[1]], namebuf);
    152150          break;
    153151        case 1:
    154           PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), valuebuf);
    155           strcpy (aliases->buttons[index[1]], valuebuf);
     152          PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), namebuf);
     153          strcpy (aliases->buttons[index[1]], namebuf);
    156154          break;
    157155        default:
     
    161159      memset (valuebuf, 0, 256);
    162160    }
     161
     162
     163  // PARSE MISC SECTION
     164  if( parser.getSection (CONFIG_SECTION_MISC_KEYS) == -1)
     165    {
     166      PRINTF(1)("Could not find key bindings in %s\n", filename);
     167      return;
     168    }
     169
     170  while( parser.nextVar (namebuf, valuebuf) != -1)
     171    {
     172      index = nameToIndex (valuebuf);
     173      switch( index[0])
     174        {
     175        case 0:
     176          PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), namebuf);
     177          strcpy (aliases->keys[index[1]], namebuf);
     178          break;
     179        case 1:
     180          PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), namebuf);
     181          strcpy (aliases->buttons[index[1]], namebuf);
     182          break;
     183        default:
     184          break;
     185        }
     186      memset (namebuf, 0, 256);
     187      memset (valuebuf, 0, 256);
     188    }
     189
    163190}
    164191
  • orxonox/branches/md2_loader/src/command_node.h

    r3608 r4139  
    1818#define N_STD_KEYS SDLK_LAST
    1919#define N_BUTTONS 6
    20 #define DEFAULT_KEYBIND_FILE "default.ini"
     20#define DEFAULT_KEYBIND_FILE "~/.orxonox/orxonox.conf"
    2121
    2222//! Key aliasing structure
  • orxonox/branches/md2_loader/src/defs/debug.h

    r4072 r4139  
    5959#define DEBUG_MODULE_PNODE              0
    6060#define DEBUG_MODULE_WORLD_ENTITY       0
    61 #define DEBUG_MODULE_COMMAND_NODE       0
     61#define DEBUG_MODULE_COMMAND_NODE       4
    6262#define DEBUG_MODULE_GRAPHICS           0
    63 #define DEBUG_MODULE_LOAD               0
     63#define DEBUG_MODULE_LOAD               2
    6464
    6565#define DEBUG_MODULE_IMPORTER           2
  • orxonox/branches/md2_loader/src/defs/stdincl.h

    r4010 r4139  
    2525#include "error.h"
    2626#include "debug.h"
     27#include "globals.h"
    2728
    2829#include "compiler.h"
  • orxonox/branches/md2_loader/src/factory.h

    r4020 r4139  
    5757tFactory<T>::tFactory(const char* name) : Factory(name)
    5858{
    59   printf("fileName: %s\n", name);
     59  PRINTF(5)("fileName: %s\n", name);
    6060}
    6161 
     
    8080const char* grabParameter( TiXmlElement* root, const char* name);
    8181
    82 
    83 
    84 
    8582#endif /* _FACTORY_H */
    8683
  • orxonox/branches/md2_loader/src/game_loader.cc

    r4020 r4139  
    2525#include "command_node.h"
    2626#include "vector.h"
     27#include "resource_manager.h"
    2728#include "factory.h"
    2829
     
    7677{
    7778  ErrorMessage errorCode;
    78  
    79   this->currentCampaign = this->fileToCampaign(name);
     79  char* campaignName;
     80  if (ResourceManager::isFile(name))
     81    {
     82      this->currentCampaign = this->fileToCampaign(name);
     83    }
     84  else
     85    {
     86      campaignName = new char[strlen(ResourceManager::getInstance()->getDataDir())+strlen(name)];
     87      sprintf(campaignName, "%s%s", ResourceManager::getInstance()->getDataDir(), name);
     88      this->currentCampaign = this->fileToCampaign(campaignName);
     89      delete campaignName;
     90    }
    8091}
    8192
     
    162173   this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
    163174*/
    164 Campaign* GameLoader::fileToCampaign(char *name)
     175Campaign* GameLoader::fileToCampaign(const char *name)
    165176{
    166177  /* do not entirely load the campaign. just the current world
     
    171182  if( name == NULL)
    172183    {
    173       PRINTF0("No filename specified for loading");
     184      PRINTF(2)("No filename specified for loading");
    174185      return NULL;
    175186    }
     
    180191    {
    181192      // report an error
    182       PRINTF0("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     193      PRINTF(1)("Could not load XML File %s: %s @ %d:%d\n", name, XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
    183194      delete XMLDoc;
    184195      return NULL;
     
    192203    {
    193204      // report an error
    194       PRINTF(0)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
     205      PRINTF(2)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
    195206      delete XMLDoc;
    196207      return NULL;
     
    214225bool GameLoader::worldCommand (Command* cmd)
    215226{
    216   if( !strcmp( cmd->cmd, "up_world"))
     227  if( !strcmp( cmd->cmd, CONFIG_NAME_NEXT_WORLD))
    217228    {
    218229      if( !cmd->bUp)
     
    222233      return true;
    223234    }
    224   else if( !strcmp( cmd->cmd, "down_world"))
     235  else if( !strcmp( cmd->cmd, CONFIG_NAME_PREV_WORLD))
    225236    {
    226237      if( !cmd->bUp)
     
    230241      return true;
    231242    }
    232   else if( !strcmp( cmd->cmd, "pause"))
     243  else if( !strcmp( cmd->cmd, CONFIG_NAME_PAUSE))
    233244    {
    234245      if( !cmd->bUp)
     
    241252      return true;
    242253    }
    243   else if( !strcmp( cmd->cmd, "quit"))
     254  else if( !strcmp( cmd->cmd, CONFIG_NAME_QUIT))
    244255    {
    245256      if( !cmd->bUp) this->stop();
     
    279290        assert( factory != NULL);
    280291       
    281         PRINTF0("Registered factory for '%s'\n", factory->getFactoryName());
     292        PRINTF(4)("Registered factory for '%s'\n", factory->getFactoryName());
    282293       
    283294        if( first == NULL) first = factory;
     
    291302BaseObject* GameLoader::fabricate( TiXmlElement* element)
    292303{
    293         assert( element != NULL);
    294        
    295         if( first == NULL)
    296         {
    297                 PRINTF0("GameLoader does not know any factories, fabricate() failed\n");
    298                 return NULL;
    299         }
    300        
    301         if( element->Value() != NULL)
    302         {
    303                 PRINTF0("Attempting fabrication of a '%s'\n", element->Value());
    304                 BaseObject* b = first->fabricate( element);
    305                 if( b == NULL) PRINTF0("Failed to fabricate a '%s'\n", element->Value());
    306                 else PRINTF0("Successfully fabricated a '%s'\n", element->Value());
    307                 return b;
    308         }
    309        
    310         PRINTF0("Fabricate failed, TiXmlElement did not contain a value\n");
    311        
    312         return NULL;
    313 }
     304  assert( element != NULL);
     305       
     306  if( first == NULL)
     307    {
     308      PRINTF(1)("GameLoader does not know any factories, fabricate() failed\n");
     309      return NULL;
     310    }
     311       
     312  if( element->Value() != NULL)
     313    {
     314      PRINTF(4)("Attempting fabrication of a '%s'\n", element->Value());
     315      BaseObject* b = first->fabricate( element);
     316      if( b == NULL)
     317        PRINTF(2)("Failed to fabricate a '%s'\n", element->Value());
     318      else
     319        PRINTF(4)("Successfully fabricated a '%s'\n", element->Value());
     320      return b;
     321    }
     322       
     323  PRINTF(2)("Fabricate failed, TiXmlElement did not contain a value\n");
     324       
     325  return NULL;
     326}
  • orxonox/branches/md2_loader/src/game_loader.h

    r4010 r4139  
    6464  Campaign* currentCampaign; //!> the current campaign playing
    6565 
    66   Campaign* fileToCampaign(char* name);
     66  Campaign* fileToCampaign(const char* name);
    6767
    6868  Factory* first;
  • orxonox/branches/md2_loader/src/glmenu/glmenu_imagescreen.cc

    r3729 r4139  
    2020
    2121#include "stdincl.h"
     22#include "graphics_engine.h"
    2223#include "material.h"
    2324
     25CREATE_FACTORY(GLMenuImageScreen);
     26
     27
    2428using namespace std;
    25 
    26 GLMenuImageScreen* GLMenuImageScreen::singletonRef = 0;
    27 
    28 GLMenuImageScreen* GLMenuImageScreen::getInstance()
    29 {
    30   if(!singletonRef)
    31     singletonRef = new GLMenuImageScreen ();
    32   return singletonRef;
    33 }
    34 
    3529/**
    3630   \brief standard constructor
    37 
    38    \todo this constructor is not jet implemented - do it
    3931*/
    4032GLMenuImageScreen::GLMenuImageScreen ()
    4133{
    42    this->setClassName ("GLMenuImageScreen");
    4334   this->init();
    4435}
    4536
     37/**
     38   \param root The Element to load the GLMenu from
     39*/
     40GLMenuImageScreen::GLMenuImageScreen (TiXmlElement* root)
     41{
     42  this->init();
     43  this->load(root);
     44
     45}
     46
     47/**
     48   \brief Loads a GLMenu from an inputElement
     49   \param root The Element to load the GLMenu from
     50
     51   Tags are:
     52   \li BackgroundImage STRING: the background Image
     53   \li BarImage: STRING: the Image on the Bar
     54   \li BackgroundPS: FLOAT FLOAT FLOAT FLOAT: posX posY scaleX scaleY
     55   \li BarPS: FLOAT FLOAT FLOAT FLOAT: posX posY scaleX scaleY
     56   \li ElementCount: INT: how many elements will be loaded
     57*/
     58void GLMenuImageScreen::load(TiXmlElement* root)
     59{
     60  const char* string;
     61
     62  // Model Loading     
     63  string = grabParameter( root, "BackgroundImage");
     64  if( string != NULL)
     65    this->setBackgroundImage(string);
     66
     67  string = grabParameter(root, "BackgroundPS");
     68  if (string != NULL)
     69    {
     70      float f1, f2, f3, f4;
     71      sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4);
     72      this->setPosition(f1,f2);
     73      this->setScale(f3,f4);
     74    }
     75
     76  string = grabParameter( root, "BarImage");
     77  if (string != NULL)
     78    this->setBarImage(string);
     79  string = grabParameter(root, "BarPS");
     80  if (string != NULL)
     81    {
     82      float f1, f2, f3, f4;
     83      sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4);
     84      this->setBarPosScale(f1,f2,f3,f4);
     85    }
     86
     87  string = grabParameter( root, "ElementCount");
     88  if (string != NULL)
     89    this->setMaximum(atoi(string));
     90}
    4691
    4792/**
     
    5196GLMenuImageScreen::~GLMenuImageScreen()
    5297{
    53   if (this->backMat)
    54     delete this->backMat;
     98  delete this->backMat;
     99  delete this->barMat;
    55100}
    56101
     
    60105void GLMenuImageScreen::init ()
    61106{
    62   /*
    63   int w = 680;
    64   int h = 480;
    65 
    66   glViewport(0,0,w,h);
    67  
    68   glMatrixMode(GL_PROJECTION);
    69   glLoadIdentity();
    70   gluPerspective(45.0f,(GLfloat)w/(GLfloat)h, .5f ,150.0f);
    71   glMatrixMode(GL_MODELVIEW);
    72 
    73   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    74   glLoadIdentity();
    75   gluLookAt(0, 0, 6,     0, 0, 0,     0, 1, 0);
    76 
    77   // Bind the texture stored at the zero index of g_Texture[]
    78   //glBindTexture(GL_TEXTURE_2D, g_Texture[0]);
    79   */
    80 
    81  
     107  this->setClassName ("GLMenuImageScreen");
     108
    82109  // Select Our VU Meter Background Texture
    83110  this->backMat = new Material("load_screen");
    84   this->backMat->setDiffuseMap("pictures/load_screen.jpg");
     111  this->barMat = new Material("bar");
    85112  this->maxValue = 10;
    86113  this->currentValue = 0;
    87 
     114  this->setPosition(0,0);
     115  this->setScale(1,1);
     116  this->setBarPosScale( .6, .75, .3, .1);
    88117  // End of Background image code.
    89118}
    90 
    91 
    92 /**
    93    \brief function to innit screen with all attributes set
    94    \param name of the background-image file
    95    \param height of the ImageScreen
    96    \param width of the Image Screen
    97    \param x offset from (0, 0)
    98    \param y offset from (0, 0)
    99 
    100    GLMenu uses its own coordinating system: upper left corner is (0, 0). x-axis is down=height,
    101    right axis is right direction (=width)
    102 */
    103 void GLMenuImageScreen::init (char* backImageName, float height, float width,
    104                               float offsetX, float offsetY)
    105 {}
    106 
    107 
    108 /**
    109    \brief draws the ImageScreen to the screenbuffer
    110 */
    111 void GLMenuImageScreen::draw ()
    112 {
    113 
    114   glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    115 
    116   PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n",
    117          this->currentValue, this->maxValue);
    118 
    119   /* screen size */
    120   int screenWidth = 640;
    121   int screenHeight = 480;
    122  
    123   /* set image size */
    124   int imageWidth = 640;
    125   int imageHeight = 480;
    126  
    127   /* start pos of image */
    128   int offsetX = (screenWidth - imageWidth)/2;
    129   int offsetY = (screenHeight - imageHeight)/2;
    130  
    131   /* loadbar pos */
    132   int barX = 390;
    133   int barY = 50;
    134   int barWidth = 230;
    135   int barHeight = 30;
    136  
    137   float val = ((float)this->currentValue/(float)this->maxValue) * barWidth;
    138   if( val > (float)barWidth)
    139     val = (float)barWidth;
    140 
    141   glMatrixMode(GL_PROJECTION);
    142   glPushMatrix();
    143   glLoadIdentity();
    144   /* set up an ortho screen */
    145   glOrtho(0, screenWidth, 0, screenHeight, -1, 1);
    146   glMatrixMode(GL_MODELVIEW);
    147   glLoadIdentity();
    148   glPushMatrix();
    149 
    150   glEnable(GL_BLEND);
    151   glPushAttrib(GL_LIGHTING_BIT | GL_TRANSFORM_BIT);
    152   glDisable(GL_LIGHTING);
    153 
    154   /* draw the progress bar */
    155   glBegin(GL_QUADS);
    156   glColor3f(0.96, 0.84, 0.34);
    157   glVertex2i(barX, barY);
    158   glVertex2i(barX + (int)val, barY);
    159   glVertex2i(barX + (int)val, barY + barHeight);
    160   glVertex2i(barX, barY + barHeight);
    161   glColor3f(1.0, 1.0, 1.0);
    162   glEnd();
    163 
    164   glBegin(GL_QUADS);
    165   glColor3f(0.0, 0.0, 0.0);
    166   glVertex2i(barX, barY);
    167   glVertex2i(barX + barWidth, barY);
    168   glVertex2i(barX + barWidth, barY + barHeight);
    169   glVertex2i(barX, barY + barHeight);
    170   glColor3f(1.0, 1.0, 1.0);
    171   glEnd();
    172 
    173   /* draw black border */
    174   glBegin(GL_QUADS);
    175   glColor3f(0.0, 0.0, 0.0);
    176   glVertex2i(barX-1, barY-1);
    177   glVertex2i(barX + barWidth +1, barY-1);
    178   glVertex2i(barX + barWidth+1, barY + barHeight+1);
    179   glVertex2i(barX - 1, barY + barHeight +1);
    180   glColor3f(1.0, 1.0, 1.0);
    181   glEnd();
    182 
    183   /* draw white border */
    184   glBegin(GL_QUADS);
    185   glColor3f(1.0, 1.0, 1.0);
    186   glVertex2i(barX-2, barY-2);
    187   glVertex2i(barX + barWidth +2, barY-2);
    188   glVertex2i(barX + barWidth+2, barY + barHeight+2);
    189   glVertex2i(barX - 2, barY + barHeight +2);
    190   glColor3f(1.0, 1.0, 1.0);
    191   glEnd();
    192 
    193   backMat->select();
    194   glBegin(GL_QUADS);
    195   glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY);
    196   glTexCoord2i(1, 0); glVertex2i(offsetX + imageWidth, offsetY);
    197   glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY + imageHeight);
    198   glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY + imageHeight);
    199   glEnd();
    200   glDisable(GL_TEXTURE_2D);
    201 
    202   glDisable(GL_BLEND);
    203   glPopMatrix();
    204   glMatrixMode(GL_PROJECTION);
    205   glPopMatrix();
    206   glPopAttrib();
    207 
    208   SDL_GL_SwapBuffers();             
    209 }
    210  
    211119
    212120/**
     
    214122    \param file name of the backgroun-image
    215123 */
    216 void GLMenuImageScreen::setBackImageName (char* backImageName)
    217 {}
     124void GLMenuImageScreen::setBackgroundImage (const char* backImageName)
     125{
     126  this->backMat->setDiffuseMap(backImageName);
     127}
    218128
    219129
    220130/**
    221131   \brief sets position of the ImageScreen
    222    \param x offset from (0, 0)
    223    \param y offset from (0, 0)
     132   \param x offset from the top left corner in percent(0-1) of the screensize
     133   \param y offset from the top left corner in percent(0-1) of the screensize
    224134*/
    225135void GLMenuImageScreen::setPosition(float offsetX, float offsetY)
    226 {}
     136{
     137  this->offsetX = offsetX;
     138  this->offsetY = offsetY;
     139}
    227140
    228141
    229142/*
    230143  \brief sets size of the ImageScreen
    231   \param height of the ImageScreen
    232   \param width of the Image Screen
    233 */
    234 void GLMenuImageScreen::setSize(float height, float width)
    235 {}
     144  \param scaleX the scaleing of the image into the x-direction (in percent (0-1))
     145  \param scaleY the scaleing of the image into the y-direction (in percent (0-1))
     146*/
     147void GLMenuImageScreen::setScale(float scaleX, float scaleY)
     148{
     149  this->scaleX = scaleX;
     150  this->scaleY = scaleY;
     151}
     152
     153/**
     154   \param barImage An image for the Bar
     155*/
     156void GLMenuImageScreen::setBarImage(const char* barImage)
     157{
     158  this->barMat->setDiffuseMap(barImage);
     159}
     160
     161/**
     162   \brief sets the Position and the Size of the bar
     163   \param barX The Position in the x-direction in percent of the screen (0-1)
     164   \param barY The Position in the y-direction in percent of the screen (0-1)
     165   \param barW The Size in the x-direction in percent of the screen (0-1)
     166   \param barH The Size in the y-direction in percent of the screen (0-1)
     167*/
     168void GLMenuImageScreen::setBarPosScale(float barX, float barY, float barW, float barH)
     169{
     170  this->barX = barX;
     171  this->barY = barY;
     172  this->barW = barW;
     173  this->barH = barH;
     174}
    236175
    237176
     
    285224  this->draw();
    286225}
     226
     227
     228
     229/**
     230   \brief draws the ImageScreen to the screenbuffer
     231*/
     232void GLMenuImageScreen::draw ()
     233{
     234  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
     235
     236  PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n",
     237            this->currentValue, this->maxValue);
     238
     239  /* screen size */
     240  int screenWidth = GraphicsEngine::getInstance()->getResolutionX();
     241  int screenHeight = GraphicsEngine::getInstance()->getResolutionY();
     242 
     243  int imageWidth = (int)(screenWidth * this->scaleX);
     244  int imageHeight = (int)(screenHeight * this->scaleY);
     245
     246  int offsetX = (int)(this->offsetX * screenWidth);
     247  int offsetY = (int)(this->offsetY * screenHeight);
     248
     249  /* loadbar pos */
     250  int barX = (int)(this->barX *screenWidth);
     251  int barY = (int)(this->barY *screenHeight);
     252  int barW = (int)(this->barW *screenWidth);
     253  int barH = (int)(this->barH *screenHeight);
     254 
     255  float val = (float)this->currentValue/(float)this->maxValue;
     256                 
     257  if( val > barW)
     258    val = barW;
     259
     260  GraphicsEngine::enter2DMode();
     261
     262  /* draw the BackGround */
     263  backMat->select();
     264  glBegin(GL_TRIANGLE_STRIP);
     265  glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY + imageHeight);
     266  glTexCoord2i(1, 0); glVertex2i(offsetX +imageWidth, offsetY + imageHeight);
     267  glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY);
     268  glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY);
     269  glEnd();
     270 
     271  glDisable(GL_TEXTURE_2D);
     272  /* draw white border */
     273  glBegin(GL_LINE_LOOP);
     274  glColor3f(1.0, 1.0, 1.0);
     275  glVertex2i(barX - 2, barY - 2);
     276  glVertex2i(barX + barW + 2, barY - 2);
     277  glVertex2i(barX + barW + 2, barY + barH + 2);
     278  glVertex2i(barX - 2, barY + barH + 2);
     279  glColor3f(1.0, 1.0, 1.0);
     280  glEnd();
     281 
     282  /* draw the progress bar */
     283  barMat->select();
     284  glBegin(GL_TRIANGLE_STRIP);
     285  glTexCoord2f(0, 0); glVertex2i(barX, barY + barH);
     286  glTexCoord2f(val, 0); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY + barH);
     287  glTexCoord2f(0, 1); glVertex2i(barX, barY);
     288  glTexCoord2f(val, 1); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY);
     289  glEnd();
     290
     291  /*
     292    glBegin(GL_QUADS);
     293    glColor3f(0.0, 0.0, 0.0);
     294    glVertex2i(barX, barY);
     295    glVertex2i(barX + barWidth, barY);
     296    glVertex2i(barX + barWidth, barY + barHeight);
     297    glVertex2i(barX, barY + barHeight);
     298    glColor3f(1.0, 1.0, 1.0);
     299    glEnd();
     300   
     301    /* draw black border
     302    glBegin(GL_QUADS);
     303    glColor3f(0.0, 0.0, 0.0);
     304    glVertex2i(barX-1, barY-1);
     305    glVertex2i(barX + barWidth +1, barY-1);
     306    glVertex2i(barX + barWidth+1, barY + barHeight+1);
     307    glVertex2i(barX - 1, barY + barHeight +1);
     308    glColor3f(1.0, 1.0, 1.0);
     309    glEnd();
     310   
     311  */
     312
     313  GraphicsEngine::leave2DMode();
     314
     315  SDL_GL_SwapBuffers();             
     316}
     317 
     318
  • orxonox/branches/md2_loader/src/glmenu/glmenu_imagescreen.h

    r3675 r4139  
    1111
    1212class Material;
     13class TiXmlElement;
    1314
    1415class GLMenuImageScreen : public BaseObject {
    1516
    16  private:
     17 public:
    1718  GLMenuImageScreen ();
    18 
    19  public:
     19  GLMenuImageScreen (TiXmlElement* root);
     20  void load(TiXmlElement* root);
    2021  virtual ~GLMenuImageScreen ();
    21  
    22   static GLMenuImageScreen* getInstance();
    23 
    24   static GLMenuImageScreen* singletonRef;
    2522
    2623  void init ();
    27   void init (char* backImageName, float height, float width,
    28              float offsetX, float offsetY);
    2924
    3025  void draw ();
    3126 
    32   void setBackImageName (char* backImageName);
    33   void setPosition (float offsetX, float offsetY);
    34   void setSize (float height, float width);
    35  
     27  void setBackgroundImage(const char* backImageName);
     28  void setPosition(float offsetX, float offsetY);
     29  void setScale (float scaleX, float scaleY);
     30
     31  void setBarImage(const char* barImage);
     32  void setBarPosScale(float barX, float barY, float barW, float barH);
     33
    3634  void setMaximum (int maxValue);
    3735  int getMaximum ();
     
    4240 private:
    4341  char* backImageName;       //!< the name of the file of the background image
    44   float height, width;       //!< hight and width of the image
     42  float scaleX, scaleY;      //!< hight and width of the image
    4543  float offsetX, offsetY;    //!< offset of the image from left and up
    4644  Material* backMat;         //!< Background Material.
     45  float barX, barY, barW, barH; //!< Position and Scale of the bar.
     46  Material* barMat;          //!< A Material for the Loading-Bar
    4747
    4848  /* progress bar values */
  • orxonox/branches/md2_loader/src/lib/Makefile.in

    r4063 r4139  
    113113PACKAGE_VERSION = @PACKAGE_VERSION@
    114114PATH_SEPARATOR = @PATH_SEPARATOR@
     115PKG_CONFIG = @PKG_CONFIG@
    115116RANLIB = @RANLIB@
    116117SET_MAKE = @SET_MAKE@
  • orxonox/branches/md2_loader/src/lib/graphics/Makefile.in

    r4063 r4139  
    113113PACKAGE_VERSION = @PACKAGE_VERSION@
    114114PATH_SEPARATOR = @PATH_SEPARATOR@
     115PKG_CONFIG = @PKG_CONFIG@
    115116RANLIB = @RANLIB@
    116117SET_MAKE = @SET_MAKE@
  • orxonox/branches/md2_loader/src/lib/graphics/graphics_engine.cc

    r4126 r4139  
    1717
    1818#include "graphics_engine.h"
     19#include "resource_manager.h"
    1920
    2021#include "debug.h"
     
    3435  this->maxFPS = 0;
    3536  this->setClassName ("GraphicsEngine");
     37
     38  this->fullscreen = false;
     39
    3640  this->initVideo();
    3741
     
    105109 
    106110  // TO DO: Create a cool icon and use it here
    107   SDL_WM_SetIcon(SDL_LoadBMP("../data/pictures/orxonox-icon32x32.bmp"), NULL); 
    108 
     111  char* loadPic = new char[strlen(ResourceManager::getInstance()->getDataDir())+ 100];
     112  sprintf(loadPic, "%s%s", ResourceManager::getInstance()->getDataDir(),  "pictures/orxonox-icon32x32.bmp");
     113  SDL_WM_SetIcon(SDL_LoadBMP(loadPic), NULL); 
     114  delete loadPic;
    109115  // Enable default GL stuff
    110116  glEnable(GL_DEPTH_TEST);
     
    141147int GraphicsEngine::setResolution(int width, int height, int bpp)
    142148{
     149  Uint32 fullscreenFlag;
    143150  this->resolutionX = width;
    144151  this->resolutionY = height;
    145152  this->bitsPerPixel = bpp;
     153  if (this->fullscreen)
     154    fullscreenFlag = SDL_FULLSCREEN;
     155  else
     156    fullscreenFlag = 0;
    146157 
    147158  printf ("ok\n");
    148   if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags)) == NULL)
     159  if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | fullscreenFlag)) == NULL)
    149160    {
    150161      PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
     
    152163      //    return -1;
    153164    }
    154 
     165}
     166
     167void GraphicsEngine::setFullscreen(bool fullscreen)
     168{
     169  this->fullscreen = fullscreen;
     170  this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel);
    155171}
    156172
     
    258274  /* Check if our resolution is restricted */
    259275  if(this->videoModes == (SDL_Rect **)-1){
    260     PRINTF(1)("All resolutions available.\n");
     276    PRINTF(2)("All resolutions available.\n");
    261277  }
    262278  else{
     
    264280    PRINT(0)("Available Resoulution Modes are\n");
    265281    for(int i = 0; this->videoModes[i]; ++i)
    266       PRINT(0)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
     282      PRINT(4)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
    267283  }
    268284}
  • orxonox/branches/md2_loader/src/lib/graphics/graphics_engine.h

    r4070 r4139  
    2626  int setGLattribs(void);
    2727  int setResolution(int width, int height, int bpp);
     28  void setFullscreen(bool fullscreen = false);
    2829  /** \returns the x resolution */
    2930  inline int getResolutionX(void) {return this->resolutionX;}
  • orxonox/branches/md2_loader/src/lib/graphics/importer/Makefile.in

    r4078 r4139  
    4242subdir = src/lib/graphics/importer
    4343DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
    44         $(srcdir)/Makefile.in TODO
     44        $(srcdir)/Makefile.in
    4545ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    4646am__aclocal_m4_deps = $(top_srcdir)/configure.ac
     
    144144PACKAGE_VERSION = @PACKAGE_VERSION@
    145145PATH_SEPARATOR = @PATH_SEPARATOR@
     146PKG_CONFIG = @PKG_CONFIG@
    146147RANLIB = @RANLIB@
    147148SET_MAKE = @SET_MAKE@
  • orxonox/branches/md2_loader/src/lib/graphics/importer/array.cc

    r3590 r4139  
    112112 
    113113/**
    114    \brief Gives back the array !! MUST be executed AFTER finalize.
    115    \returns The created array.
    116 */
    117 GLfloat* Array::getArray ()
    118 {
    119   return this->array;
    120 }
    121 
    122 /**
    123    \returns The Count of entries in the Array
    124 */
    125 int Array::getCount()
    126 {
    127   return this->entryCount;
    128 }
    129 
    130 /**
    131114   \brief Simple debug info about the Array
    132115*/
    133 void Array::debug ()
     116void Array::debug (void) const
    134117{
    135118  PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);
  • orxonox/branches/md2_loader/src/lib/graphics/importer/array.h

    r3590 r4139  
    2323  void addEntry(GLfloat entry0, GLfloat entry1, GLfloat entry2);
    2424 
    25   GLfloat* getArray ();
    26   int getCount();
    27   void debug(void);
     25  /** \returns The array */
     26  inline const GLfloat* getArray () const {return this->array;}
     27  /**   \returns The Count of entries in the Array*/
     28  inline int getCount(void)const {return this->entryCount;}
     29  void debug(void) const ;
    2830 private:
    2931  //! One entry of the Array
  • orxonox/branches/md2_loader/src/lib/graphics/importer/framework.cc

    r3910 r4139  
    7979    obj = new OBJModel(argv[1]);
    8080  else
    81     obj = new PrimitiveModel(SPHERE);
     81    obj = new PrimitiveModel(CYLINDER);
    8282
    8383  M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0);
  • orxonox/branches/md2_loader/src/lib/graphics/importer/material.cc

    r3966 r4139  
    4545  this->setTransparency(1.0);
    4646
    47 
    4847  this->diffuseTexture = NULL;
    4948  this->ambientTexture = NULL;
    5049  this->specularTexture = NULL;
    51 
    52   this->diffuseTextureSet = false;
    53   this->ambientTextureSet = false;
    54   this->specularTextureSet = false;
    5550
    5651  this->setName(mtlName);
     
    107102    glShadeModel(GL_SMOOTH);
    108103
    109   if (this->diffuseTextureSet)
     104  if (this->diffuseTexture)
    110105    {
    111106      glEnable(GL_TEXTURE_2D);
     
    300295{
    301296  PRINTF(4)("setting Diffuse Map %s\n", dMap);
    302   //    diffuseTexture = new Texture();
    303   //    this->diffuseTextureSet = diffuseTexture->loadImage(dMap);
    304297
    305298  //! \todo check if RESOURCE MANAGER is availiable
    306299  //! \todo Textures from .mtl-file need special care.
    307   this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);
     300  this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);
    308301}
    309302
  • orxonox/branches/md2_loader/src/lib/graphics/importer/material.h

    r3914 r4139  
    6767  Texture* ambientTexture; //!< The ambient texture of the Material.
    6868  Texture* specularTexture;//!< The specular texture of the Material.
    69  
    70   bool diffuseTextureSet; //!< Chekcs if the diffuse texture is Set.
    71   bool ambientTextureSet; //!< Chekcs if the ambient texture is Set.
    72   bool specularTextureSet;//!< Chekcs if the specular texture is Set.
    73 
    7469};
    7570#endif
  • orxonox/branches/md2_loader/src/lib/graphics/importer/model.cc

    r4063 r4139  
    3636ModelFaceElement::ModelFaceElement()
    3737{
     38  this->vertexNumber = -1;
     39  this->normalNumber = -1;
     40  this->texCoordNumber = -1;   
     41
    3842  this->next = NULL;
    3943}
     
    140144  this->currentGroup = this->firstGroup = new ModelGroup;
    141145  this->groupCount = 0;
     146  this->vertexCount = 0;
     147  this->normalCount = 0;
     148  this->texCoordCount = 0;
    142149 
    143150  this->scaleFactor = 1;
     
    355362Material* Model::addMaterial(const char* materialName)
    356363{
    357  
    358364  Material* newMat = new Material();
    359365  newMat->setName(materialName);
     
    424430  PRINTF(5)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);
    425431  this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor);
     432  this->vertexCount++;
    426433  return true;
    427434}
     
    438445  PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z);
    439446  this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor);
     447  this->vertexCount++;
    440448  return true;
    441449}
     
    455463  PRINTF(5)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);
    456464  this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3);
     465  this->normalCount++;
    457466  return true;
    458467}
     
    470479  PRINTF(5)("found vertex-Normal %f, %f, %f\n", x, y, z);
    471480  this->normals->addEntry(x, y, z);
     481  this->normalCount++;
     482  return true;
    472483}
    473484
     
    487498  this->vTexture->addEntry(subbuffer1);
    488499  this->vTexture->addEntry(subbuffer2);
     500  this->texCoordCount++;
    489501  return true;
    490502}
     
    502514  this->vTexture->addEntry(u);
    503515  this->vTexture->addEntry(v);
     516  this->texCoordCount++;
     517  return true;
    504518}
    505519
     
    509523
    510524   If a face line is found this function will add it to the glList.
     525
     526   String is different from the argument addFace, in this that the first Vertex/Normal/Texcoord is 1 instead of 0
    511527*/
    512528bool Model::addFace (const char* faceString)
     
    546562      if (vertex)
    547563        tmpElem->vertexNumber = atoi(vertex)-1;
    548       else
    549         tmpElem->vertexNumber = -1;
    550564      if (texture)
    551565        tmpElem->texCoordNumber = atoi(texture)-1;
    552       else
    553         tmpElem->texCoordNumber = -1;
    554566      if (normal)
    555567        tmpElem->normalNumber = atoi(normal)-1;
    556       else
    557         tmpElem->normalNumber = -1;
    558568
    559569      faceString += tmpLen;
     
    569579   \brief adds a new Face
    570580   \param faceElemCount the number of Vertices to add to the Face.
    571    \param type 0: vertex only, 1: vertex and normal, 2: vertex and Texture, 3 vertex, normal and texture
     581   \param type The information Passed with each Vertex
    572582*/
    573583bool Model::addFace(int faceElemCount, VERTEX_FORMAT type, ...)
     
    583593  for (int i = 0; i < faceElemCount; i++)
    584594    {
    585       if (this->currentGroup->currentFace->vertexCount>0)
     595      if (this->currentGroup->currentFace->vertexCount > 0)
    586596        tmpElem = tmpElem->next = new ModelFaceElement;
    587597
    588       tmpElem->vertexNumber = va_arg (itemlist, int) -1;
     598      tmpElem->vertexNumber = va_arg (itemlist, int);
    589599      if (type & TEXCOORD)
    590         tmpElem->texCoordNumber = va_arg (itemlist, int) -1;
     600        tmpElem->texCoordNumber = va_arg (itemlist, int);
    591601      if (type & NORMAL)
    592         tmpElem->normalNumber = va_arg(itemlist, int) -1;
     602        tmpElem->normalNumber = va_arg(itemlist, int);
    593603      this->currentGroup->currentFace->vertexCount++;
    594604    }
     
    693703    }
    694704
    695   for (int i=0; i<vertices->getCount()/3;i++)
     705  for (int i=0; i < vertices->getCount()/3;i++)
    696706    {
    697707      normArray[i].normalize();
    698708      PRINTF(5)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
    699709     
    700       this->normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);
     710      this->addVertexNormal(normArray[i].x, normArray[i].y, normArray[i].z);
    701711
    702712    }
     
    834844
    835845  if (elem->texCoordNumber != -1)
    836     glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2);
     846    {
     847      if (likely(elem->texCoordNumber < this->texCoordCount))
     848        glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2);
     849      else
     850        PRINTF(2)("TextureCoordinate %d is not in the List (max: %d)\nThe Model might be incomplete\n",
     851                  elem->texCoordNumber, this->texCoordCount);
     852    }
    837853  if (elem->normalNumber != -1)
    838     glNormal3fv(this->normals->getArray() + elem->normalNumber * 3);
     854    {
     855    if (likely(elem->normalNumber < this->normalCount))
     856      glNormal3fv(this->normals->getArray() + elem->normalNumber * 3);
     857    else
     858        PRINTF(2)("Normal %d is not in the List (max: %d)\nThe Model might be incomplete",
     859                  elem->normalNumber, this->normalCount);     
     860    }
    839861  if (elem->vertexNumber != -1)
    840     glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3);
     862    {
     863      if (likely(elem->vertexNumber < this->vertexCount))
     864          glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3);
     865      else
     866        PRINTF(2)("Vertex %d is not in the List (max: %d)\nThe Model might be incomplete",
     867                  elem->vertexNumber, this->vertexCount);     
     868    }   
     869
    841870}
    842871
     
    897926  this->addVertexNormal (-1.0, 0.0, 0.0);
    898927
    899   /* normaleLess-testingMode
    900   this->addFace ("1 2 4 3");
    901   this->addFace ("3 4 6 5");
    902   this->addFace ("5 6 8 7");
    903   this->addFace ("7 8 2 1");
    904   this->addFace ("2 8 6 4");
    905   this->addFace ("7 1 3 5");
    906   */
    907 
    908   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,1, 2,2,2, 4,4,3, 3,3,4);
    909   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 3,3,5, 4,4,6, 6,6,7, 5,5,8);
    910   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 5,5,9, 6,6,10, 8,8,11, 7,7,12);
    911   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,7,13, 8,8,14, 2,10,15, 1,9,16);
    912   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,2,17, 8,11,18, 6,12,19, 4,4,20);
    913   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,13,21, 1,1,22, 3,3,23, 5,14,24);
    914 
    915 }
     928  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,1, 3,3,2, 2,2,3);
     929  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,2,4, 3,3,5, 5,5,6, 4,4,7);
     930  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,4,8, 5,5,9, 7,7,10, 6,6,11);
     931  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,6,12, 7,7,13, 1,9,14, 0,8,15);
     932  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,16, 7,10,17, 5,11,18, 3,3,19);
     933  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,12,20, 0,0,21, 2,2,22, 4,13,23);
     934
     935}
  • orxonox/branches/md2_loader/src/lib/graphics/importer/model.h

    r4065 r4139  
    100100  bool finalized;             //!< Sets the Object to be finalized.
    101101
     102  int vertexCount;            //!< A modelwide Counter for vertices.
     103  int normalCount;            //!< A modelwide Counter for the normals.
     104  int texCoordCount;          //!< A modelwide Counter for the texCoord.
    102105  Array* vertices;            //!< The Array that handles the Vertices.
    103   int verticesCount;          //!< A global Counter for vertices.
    104106  Array* normals;             //!< The Array that handles the Normals.
    105107  Array* vTexture;            //!< The Array that handles the VertexTextureCoordinates.
     
    159161  bool setMaterial(Material* mtl);
    160162  void finalize(void);
     163
     164  /** \returns The number of Vertices of the Model */
     165  inline int getVertexCount(void) const {return this->vertexCount;}
     166  /** \returns The number of Normals of the Model */
     167  inline int getNormalCount(void) const {return this->normalCount;}
     168  /** \returns The number of Texture Coordinates of the Model*/
     169  inline int getTexCoordCount(void) const {return this->texCoordCount;}
    161170};
    162171
  • orxonox/branches/md2_loader/src/lib/graphics/importer/objModel.cc

    r4063 r4139  
    3434OBJModel::OBJModel(const char* fileName, float scaling) : Model(fileName)
    3535{
    36   this->initializeOBJ();
     36  this->objPath = "./";
     37
    3738  this->scaleFactor = scaling;
    3839
     
    5253  if (this->objPath)
    5354    delete []this->objPath;
    54   if (this->objFileName)
    55     delete []this->objFileName;
    56   if (this->mtlFileName)
    57     delete []this->mtlFileName;
    58 }
    59 
    60 /**
    61    \brief Initializes an obj-model
    62 */
    63 void OBJModel::initializeOBJ(void)
    64 {
    65   this->objPath = NULL;
    66   this->objFileName = NULL;
    67   this->mtlFileName = NULL;
    6855}
    6956
     
    7158   \brief Imports a obj file and handles the the relative location
    7259   \param fileName The file to import
     60
     61   Splits the FileName from the DirectoryName
    7362*/
    7463bool OBJModel::importFile (const char* fileName)
    7564{
    7665  PRINTF(4)("preparing to read in file: %s\n", fileName);
    77 
    78 
    79 #ifdef __WIN32__
    80   // win32 path reading
    81   char pathSplitter= '\\';
    82 #else /* __WIN32__ */
    83   // unix path reading
    84   char pathSplitter='/';
    85 #endif /* __WIN32__ */
    86   char* tmpName;
    87   strcpy(tmpName, fileName);
    88   if (tmpName[0] == pathSplitter)
    89     tmpName++;
    90   char* name = tmpName;
    91   while (( tmpName = strchr (tmpName+1, pathSplitter)))
    92     {
    93       name = tmpName+1;
    94     }
    95   this->objPath = new char[name-fileName+1];
    96   strncpy(this->objPath, fileName, name-fileName);
    97   this->objPath[name-fileName] = '\0';
    98   if (strlen(objPath)> 0)
    99     PRINTF(5)("Resolved file %s to folder: %s.\n", name, objPath);
    100   else
    101     PRINTF(5)("Resolved file %s.\n", name);
    102  
    103   this->setName(name);
    104 
    105   this->objFileName = new char[strlen(name)+1];
    106   strcpy (this->objFileName, name);
    107   this->readFromObjFile ();
     66  // splitting the
     67  char* split = NULL;
     68
     69  if (!(split = strrchr(fileName, '/')))
     70    split = strrchr(fileName, '\\'); // windows Case
     71  if (split)
     72    {
     73      int len = split - fileName+1;
     74      this->objPath = new char[len +2];
     75      strncpy(this->objPath, fileName, len);
     76      this->objPath[len] = '\0';
     77      PRINTF(1)("Resolved file %s to Path %s.\n", fileName, this->objPath);
     78    }
     79  this->readFromObjFile (fileName);
    10880  return true;
    10981}
     
    11385   This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks
    11486*/
    115 bool OBJModel::readFromObjFile (void)
    116 {
    117   char* fileName = new char [strlen(objPath)+strlen(objFileName)+1];
    118   if (this->objFileName != NULL && !strcmp(this->objFileName, ""))
    119     return false;
    120   strcpy(fileName, this->objPath);
    121   strcat(fileName, this->objFileName);
    122 
     87bool OBJModel::readFromObjFile(const char* fileName)
     88{
    12389  FILE* stream;
    12490  if( (stream = fopen (fileName, "r")) == NULL)
    12591    {
    126       printf("IniParser could not open %s\n", fileName);
     92      printf("Object File Could not be Opened %s\n", fileName);
    12793      return false;
    12894    }
     
    179145    }
    180146  fclose (stream);
    181   delete []fileName;
    182147  return true;
    183148}
     
    194159bool OBJModel::readMtlLib (const char* mtlFile)
    195160{
    196   this->mtlFileName = new char [strlen(mtlFile)+1];
    197   strcpy(this->mtlFileName, mtlFile);
    198   char* fileName = new char [strlen(this->objPath) + strlen(this->mtlFileName)+1];
    199   sprintf(fileName, "%s%s", this->objPath, this->mtlFileName);
    200  
     161  char* fileName = new char [strlen(this->objPath) + strlen(mtlFile)+1];
     162  sprintf(fileName, "%s%s", this->objPath, mtlFile);
    201163
    202164  FILE* stream;
    203165  if( (stream = fopen (fileName, "r")) == NULL)
    204166    {
    205       printf("IniParser could not open %s\n", fileName);
     167      PRINTF(2)("MaterialLibrary could not be opened %s\n", fileName);
     168      delete []fileName;
    206169      return false;
    207170    }
  • orxonox/branches/md2_loader/src/lib/graphics/importer/objModel.h

    r3916 r4139  
    1515  OBJModel(const char* fileName, float scaling = 1.0);
    1616  virtual ~OBJModel();
    17   void initializeOBJ(void);
    1817
    1918 private:
    2019  // Variables
    2120  char* objPath;        //!< The Path where the obj and mtl-file are located.
    22   char* objFileName;    //!< The Name of the obj-file.
    23   char* mtlFileName;    //!< The Name of the mtl-file (parsed out of the obj-file)
    2421
    2522  ///// readin /////
    2623  bool importFile (const char* fileName);
    27   bool readFromObjFile (void);
     24  bool readFromObjFile (const char* fileName);
    2825  bool readMtlLib (const char* matFile);
    2926};
  • orxonox/branches/md2_loader/src/lib/graphics/importer/primitive_model.cc

    r3911 r4139  
    7171void PrimitiveModel::sphereModel(float size, unsigned int detail)
    7272{
    73   int vertexCount = 0;
    7473  if (detail <= 0)
    7574    detail = 1;
     
    8988                          size * sin(vi) * cos(vj));
    9089          this->addVertexTexture(i / (df *2.0), (j-1.0)/(df)+.5);
    91           vertexCount++;
    9290        }
    9391    }
    9492  this->addVertex(0, -size, 0);
     93  this->addVertexTexture(0,0);
    9594  this->addVertex(0, size, 0);
     95  this->addVertexTexture(0 ,1);
    9696
    9797  // defining the binding Faces.
     
    102102        {
    103103         
    104           v1 = i*detail + j;
    105           v4 = i*detail + (j+1);
     104          v1 = i*detail + j-1;
     105          v4 = i*detail + j;
    106106         
    107107          if (i == detail*2 -1)
    108108            {
    109               v2 = j;
    110               v3 = j+1;
     109              v2 = j-1;
     110              v3 = j;
    111111            }
    112112          else
    113113            {
    114               v2 = (i+1)*detail + j;
    115               v3 = (i+1)*detail + (j+1);
    116             }
    117          
     114              v2 = (i+1)*detail + j-1;
     115              v3 = (i+1)*detail + j;
     116            }
     117
    118118          if (j == 0)
    119119            {
    120               v1 = vertexCount+1;
     120              v1 = this->getVertexCount()-2;
    121121              this->addFace(3, VERTEX_TEXCOORD, v1, v1, v3, v3, v4, v4);
    122122            }
    123123          else if (j == detail)
    124124            {
    125               v3 = vertexCount+2;
     125              v3 = this->getVertexCount()-1;
    126126              this->addFace(3, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3);
    127127            }
     
    157157    {
    158158      int p1, p2, p3, p4;
    159       p1 = 2*i+1;
    160       p2 = 2*i+2;
    161       p3 = 2*i+4;
    162       p4 = 2*i+3;
     159      p1 = 2*i;
     160      p2 = 2*i+1;
     161      p3 = 2*i+3;
     162      p4 = 2*i+2;
    163163      // something is wrong here
    164164      this->addFace(4, VERTEX_ONLY, p1, p2, p3, p4);
    165       this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail+1);
    166       this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+2);
     165      this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail);
     166      this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+1);
    167167    }
    168168  // caps
    169   this->addFace(4, VERTEX_ONLY, 2*detail-1, 2*detail, 2, 1);
    170   this->addFace(3, VERTEX_ONLY, 1, 2*detail-1, 2*detail+1);
    171   this->addFace(3, VERTEX_ONLY, 2*detail, 2, 2*detail+2);
     169  this->addFace(4, VERTEX_ONLY, 2*detail-2, 2*detail-1, 1, 0);
     170  this->addFace(3, VERTEX_ONLY, 0, 2*detail-2, 2*detail);
     171  this->addFace(3, VERTEX_ONLY, 2*detail-1, 1, 2*detail+1);
    172172}
    173173
     
    198198    {
    199199      unsigned int v1, v2;
    200       v1 = i+3;
     200      v1 = i+2;
    201201      if (i == detail -1)
    202         v2 = 3;
     202        v2 = 2;
    203203      else
    204         v2 = i+4;
    205       this->addFace(3, VERTEX_ONLY, 1, v1, v2);
    206       this->addFace(3, VERTEX_ONLY, 2, v1, v2);
     204        v2 = i+3;
     205      this->addFace(3, VERTEX_ONLY, 0, v1, v2);
     206      this->addFace(3, VERTEX_ONLY, 1, v1, v2);
    207207    }
    208208}
     
    228228  unsigned int v1, v2, v3, v4;
    229229  for (int i = 0; i < detail-1; i++)
    230     for (int j = 1; j < detail; j++)
     230    for (int j = 0; j < detail-1; j++)
    231231      {
    232232        v1 = i*detail + j;
  • orxonox/branches/md2_loader/src/lib/graphics/particles/particle_system.cc

    r4017 r4139  
    4040   this->particleType = type;
    4141   this->particles = NULL;
     42   this->deadList = NULL;
    4243   this->setConserve(.8);
    4344   this->setLifeSpan(.1);
     
    5758  // delete what has to be deleted here
    5859   ParticleEngine::getInstance()->removeSystem(this);
     60
     61   // deleting all the living Particles
     62   while (this->particles)
     63     {
     64       Particle* tmpDelPart = this->particles;
     65       this->particles = this->particles->next;
     66       delete tmpDelPart;
     67     }
     68
     69   // deleting all the dead particles
     70   while (this->deadList)
     71     {
     72       Particle* tmpDelPart = this->deadList;
     73       this->deadList = this->deadList->next;
     74       delete tmpDelPart;
     75     }
    5976}
    6077
     
    199216            {
    200217              prevPart->next = tickPart->next;
    201               delete tickPart;
     218              tickPart->next = this->deadList;
     219              this->deadList = tickPart;
    202220              tickPart = prevPart->next;
    203221            }
     
    206224              prevPart = NULL;
    207225              this->particles = tickPart->next;
    208               delete tickPart;
     226              tickPart->next = this->deadList;
     227              this->deadList = tickPart;
    209228              tickPart = this->particles;
    210229            }
     
    266285      if (unlikely(particles == NULL))
    267286        {
    268           this->particles = new Particle;
     287          if (likely(deadList != NULL))
     288            {
     289              this->particles = this->deadList;
     290              deadList = deadList->next;
     291            }
     292          else
     293            this->particles = new Particle;
    269294          this->particles->next = NULL;
    270295        }
     
    272297      else
    273298        {
    274           Particle* tmpPart = new Particle;
     299          Particle* tmpPart;
     300          if (likely(deadList != NULL))
     301            {
     302              tmpPart = this->deadList;
     303              deadList = deadList->next;
     304            }
     305          else
     306            tmpPart = new Particle;
    275307          tmpPart->next = this->particles;
    276308          this->particles = tmpPart;
     
    300332  PRINT(0)("  ParticleSystem %s\n", this->name);
    301333  PRINT(0)("  ParticleCount: %d, maximumCount: %d :: filled %d%%\n", this->count, this->maxCount, 100*this->count/this->maxCount);
    302 }
     334  if (deadList)
     335    {
     336      PRINT(0)("  - ParticleDeadList is used: ");
     337      int i = 1;
     338      Particle* tmpPart = this->deadList;
     339      while (tmpPart = tmpPart->next) ++i;
     340      PRINT(0)("count: %d\n", i);
     341    }
     342}
  • orxonox/branches/md2_loader/src/lib/graphics/particles/particle_system.h

    r4017 r4139  
    9292  Material* material;        //!< A Material for all the Particles.
    9393  Particle* particles;       //!< A list of particles of this System.
     94  Particle* deadList;        //!< A list of dead Particles in the System.
    9495
    9596  GLuint* glID;              //!< A List of different gl-List-ID's
  • orxonox/branches/md2_loader/src/lib/gui/Makefile.in

    r4063 r4139  
    113113PACKAGE_VERSION = @PACKAGE_VERSION@
    114114PATH_SEPARATOR = @PATH_SEPARATOR@
     115PKG_CONFIG = @PKG_CONFIG@
    115116RANLIB = @RANLIB@
    116117SET_MAKE = @SET_MAKE@
  • orxonox/branches/md2_loader/src/lib/gui/console/Makefile.in

    r4063 r4139  
    132132PACKAGE_VERSION = @PACKAGE_VERSION@
    133133PATH_SEPARATOR = @PATH_SEPARATOR@
     134PKG_CONFIG = @PKG_CONFIG@
    134135RANLIB = @RANLIB@
    135136SET_MAKE = @SET_MAKE@
  • orxonox/branches/md2_loader/src/lib/gui/gui/Makefile.am

    r4063 r4139  
    77AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/coord
    88AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data
    9 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gaphics
    10 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/font
     9AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics
    1110AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer
    1211AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui
    13 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui/gui
    1412AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/lang
    1513AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/util
     
    2018AM_CXXFLAGS+=-I$(MAINSRCDIR)/glmenu
    2119AM_CXXFLAGS+=-I$(MAINSRCDIR)/ai
     20AM_CXXFLAGS+=-I$(MAINSRCDIR)/util
     21AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/animation
     22AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/common
    2223
    2324#AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
     
    3536            gui_banner.cc \
    3637            gui_keys.cc \
    37             gui_update.cc
     38            gui_update.cc \
     39                  $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \
     40                  $(MAINSRCDIR)/lib/lang/base_object.cc \
     41                  $(MAINSRCDIR)/lib/math/vector.cc \
     42                  $(MAINSRCDIR)/util/resource_manager.cc \
     43                  $(MAINSRCDIR)/lib/graphics/text_engine.cc \
     44                  $(MAINSRCDIR)/lib/coord/p_node.cc \
     45                  $(MAINSRCDIR)/lib/coord/null_parent.cc \
     46                  $(MAINSRCDIR)/lib/graphics/importer/array.cc \
     47                  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
     48                  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
     49                  $(MAINSRCDIR)/lib/graphics/importer/material.cc \
     50                  $(MAINSRCDIR)/lib/graphics/importer/texture.cc \
     51                  $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
    3852
    3953noinst_HEADERS=gui.h \
  • orxonox/branches/md2_loader/src/lib/gui/gui/Makefile.in

    r4063 r4139  
    5656        gui_element.$(OBJEXT) gui_video.$(OBJEXT) gui_audio.$(OBJEXT) \
    5757        gui_exec.$(OBJEXT) gui_flags.$(OBJEXT) gui_banner.$(OBJEXT) \
    58         gui_keys.$(OBJEXT) gui_update.$(OBJEXT)
     58        gui_keys.$(OBJEXT) gui_update.$(OBJEXT) \
     59        graphics_engine.$(OBJEXT) base_object.$(OBJEXT) \
     60        vector.$(OBJEXT) resource_manager.$(OBJEXT) \
     61        text_engine.$(OBJEXT) p_node.$(OBJEXT) null_parent.$(OBJEXT) \
     62        array.$(OBJEXT) model.$(OBJEXT) objModel.$(OBJEXT) \
     63        material.$(OBJEXT) texture.$(OBJEXT) primitive_model.$(OBJEXT)
    5964gui_OBJECTS = $(am_gui_OBJECTS)
    6065gui_LDADD = $(LDADD)
     
    6267depcomp = $(SHELL) $(top_srcdir)/depcomp
    6368am__depfiles_maybe = depfiles
    64 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gui.Po ./$(DEPDIR)/gui_audio.Po \
    65 @AMDEP_TRUE@    ./$(DEPDIR)/gui_banner.Po \
     69@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po \
     70@AMDEP_TRUE@    ./$(DEPDIR)/base_object.Po \
     71@AMDEP_TRUE@    ./$(DEPDIR)/graphics_engine.Po ./$(DEPDIR)/gui.Po \
     72@AMDEP_TRUE@    ./$(DEPDIR)/gui_audio.Po ./$(DEPDIR)/gui_banner.Po \
    6673@AMDEP_TRUE@    ./$(DEPDIR)/gui_element.Po ./$(DEPDIR)/gui_exec.Po \
    6774@AMDEP_TRUE@    ./$(DEPDIR)/gui_flags.Po ./$(DEPDIR)/gui_gtk.Po \
    6875@AMDEP_TRUE@    ./$(DEPDIR)/gui_keys.Po ./$(DEPDIR)/gui_main.Po \
    69 @AMDEP_TRUE@    ./$(DEPDIR)/gui_update.Po ./$(DEPDIR)/gui_video.Po
     76@AMDEP_TRUE@    ./$(DEPDIR)/gui_update.Po ./$(DEPDIR)/gui_video.Po \
     77@AMDEP_TRUE@    ./$(DEPDIR)/material.Po ./$(DEPDIR)/model.Po \
     78@AMDEP_TRUE@    ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
     79@AMDEP_TRUE@    ./$(DEPDIR)/p_node.Po \
     80@AMDEP_TRUE@    ./$(DEPDIR)/primitive_model.Po \
     81@AMDEP_TRUE@    ./$(DEPDIR)/resource_manager.Po \
     82@AMDEP_TRUE@    ./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \
     83@AMDEP_TRUE@    ./$(DEPDIR)/vector.Po
    7084CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    7185        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    136150PACKAGE_VERSION = @PACKAGE_VERSION@
    137151PATH_SEPARATOR = @PATH_SEPARATOR@
     152PKG_CONFIG = @PKG_CONFIG@
    138153RANLIB = @RANLIB@
    139154SET_MAKE = @SET_MAKE@
     
    187202target_vendor = @target_vendor@
    188203MAINSRCDIR = ../../..
    189 AM_CXXFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/gaphics -I$(MAINSRCDIR)/lib/graphics/font -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai
     204AM_CXXFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common
    190205
    191206#AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
     
    201216            gui_banner.cc \
    202217            gui_keys.cc \
    203             gui_update.cc
     218            gui_update.cc \
     219                  $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \
     220                  $(MAINSRCDIR)/lib/lang/base_object.cc \
     221                  $(MAINSRCDIR)/lib/math/vector.cc \
     222                  $(MAINSRCDIR)/util/resource_manager.cc \
     223                  $(MAINSRCDIR)/lib/graphics/text_engine.cc \
     224                  $(MAINSRCDIR)/lib/coord/p_node.cc \
     225                  $(MAINSRCDIR)/lib/coord/null_parent.cc \
     226                  $(MAINSRCDIR)/lib/graphics/importer/array.cc \
     227                  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
     228                  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
     229                  $(MAINSRCDIR)/lib/graphics/importer/material.cc \
     230                  $(MAINSRCDIR)/lib/graphics/importer/texture.cc \
     231                  $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
    204232
    205233noinst_HEADERS = gui.h \
     
    290318        -rm -f *.tab.c
    291319
     320@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
     321@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@
     322@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics_engine.Po@am__quote@
    292323@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui.Po@am__quote@
    293324@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_audio.Po@am__quote@
     
    301332@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_update.Po@am__quote@
    302333@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_video.Po@am__quote@
     334@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
     335@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
     336@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null_parent.Po@am__quote@
     337@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@
     338@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@
     339@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@
     340@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource_manager.Po@am__quote@
     341@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text_engine.Po@am__quote@
     342@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
     343@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
    303344
    304345.cc.o:
     
    317358@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    318359@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     360
     361graphics_engine.o: $(MAINSRCDIR)/lib/graphics/graphics_engine.cc
     362@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.o -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/graphics_engine.cc; \
     363@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/graphics_engine.Tpo" "$(DEPDIR)/graphics_engine.Po"; else rm -f "$(DEPDIR)/graphics_engine.Tpo"; exit 1; fi
     364@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' object='graphics_engine.o' libtool=no @AMDEPBACKSLASH@
     365@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/graphics_engine.Po' tmpdepfile='$(DEPDIR)/graphics_engine.TPo' @AMDEPBACKSLASH@
     366@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     367@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o graphics_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/graphics_engine.cc
     368
     369graphics_engine.obj: $(MAINSRCDIR)/lib/graphics/graphics_engine.cc
     370@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.obj -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; fi`; \
     371@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/graphics_engine.Tpo" "$(DEPDIR)/graphics_engine.Po"; else rm -f "$(DEPDIR)/graphics_engine.Tpo"; exit 1; fi
     372@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' object='graphics_engine.obj' libtool=no @AMDEPBACKSLASH@
     373@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/graphics_engine.Po' tmpdepfile='$(DEPDIR)/graphics_engine.TPo' @AMDEPBACKSLASH@
     374@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     375@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o graphics_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; fi`
     376
     377base_object.o: $(MAINSRCDIR)/lib/lang/base_object.cc
     378@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_object.o -MD -MP -MF "$(DEPDIR)/base_object.Tpo" -c -o base_object.o `test -f '$(MAINSRCDIR)/lib/lang/base_object.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/lang/base_object.cc; \
     379@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/base_object.Tpo" "$(DEPDIR)/base_object.Po"; else rm -f "$(DEPDIR)/base_object.Tpo"; exit 1; fi
     380@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/lang/base_object.cc' object='base_object.o' libtool=no @AMDEPBACKSLASH@
     381@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/base_object.Po' tmpdepfile='$(DEPDIR)/base_object.TPo' @AMDEPBACKSLASH@
     382@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     383@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_object.o `test -f '$(MAINSRCDIR)/lib/lang/base_object.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/lang/base_object.cc
     384
     385base_object.obj: $(MAINSRCDIR)/lib/lang/base_object.cc
     386@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_object.obj -MD -MP -MF "$(DEPDIR)/base_object.Tpo" -c -o base_object.obj `if test -f '$(MAINSRCDIR)/lib/lang/base_object.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/lang/base_object.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/lang/base_object.cc'; fi`; \
     387@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/base_object.Tpo" "$(DEPDIR)/base_object.Po"; else rm -f "$(DEPDIR)/base_object.Tpo"; exit 1; fi
     388@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/lang/base_object.cc' object='base_object.obj' libtool=no @AMDEPBACKSLASH@
     389@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/base_object.Po' tmpdepfile='$(DEPDIR)/base_object.TPo' @AMDEPBACKSLASH@
     390@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     391@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_object.obj `if test -f '$(MAINSRCDIR)/lib/lang/base_object.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/lang/base_object.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/lang/base_object.cc'; fi`
     392
     393vector.o: $(MAINSRCDIR)/lib/math/vector.cc
     394@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vector.o -MD -MP -MF "$(DEPDIR)/vector.Tpo" -c -o vector.o `test -f '$(MAINSRCDIR)/lib/math/vector.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/math/vector.cc; \
     395@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/vector.Tpo" "$(DEPDIR)/vector.Po"; else rm -f "$(DEPDIR)/vector.Tpo"; exit 1; fi
     396@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/math/vector.cc' object='vector.o' libtool=no @AMDEPBACKSLASH@
     397@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/vector.Po' tmpdepfile='$(DEPDIR)/vector.TPo' @AMDEPBACKSLASH@
     398@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     399@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.o `test -f '$(MAINSRCDIR)/lib/math/vector.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/math/vector.cc
     400
     401vector.obj: $(MAINSRCDIR)/lib/math/vector.cc
     402@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vector.obj -MD -MP -MF "$(DEPDIR)/vector.Tpo" -c -o vector.obj `if test -f '$(MAINSRCDIR)/lib/math/vector.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/math/vector.cc'; fi`; \
     403@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/vector.Tpo" "$(DEPDIR)/vector.Po"; else rm -f "$(DEPDIR)/vector.Tpo"; exit 1; fi
     404@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/math/vector.cc' object='vector.obj' libtool=no @AMDEPBACKSLASH@
     405@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/vector.Po' tmpdepfile='$(DEPDIR)/vector.TPo' @AMDEPBACKSLASH@
     406@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     407@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.obj `if test -f '$(MAINSRCDIR)/lib/math/vector.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/math/vector.cc'; fi`
     408
     409resource_manager.o: $(MAINSRCDIR)/util/resource_manager.cc
     410@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.o -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.o `test -f '$(MAINSRCDIR)/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/resource_manager.cc; \
     411@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi
     412@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/util/resource_manager.cc' object='resource_manager.o' libtool=no @AMDEPBACKSLASH@
     413@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@
     414@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     415@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.o `test -f '$(MAINSRCDIR)/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/resource_manager.cc
     416
     417resource_manager.obj: $(MAINSRCDIR)/util/resource_manager.cc
     418@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.obj -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/resource_manager.cc'; fi`; \
     419@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi
     420@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/util/resource_manager.cc' object='resource_manager.obj' libtool=no @AMDEPBACKSLASH@
     421@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@
     422@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     423@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/resource_manager.cc'; fi`
     424
     425text_engine.o: $(MAINSRCDIR)/lib/graphics/text_engine.cc
     426@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.o -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/text_engine.cc; \
     427@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi
     428@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/text_engine.cc' object='text_engine.o' libtool=no @AMDEPBACKSLASH@
     429@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.TPo' @AMDEPBACKSLASH@
     430@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     431@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o text_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/text_engine.cc
     432
     433text_engine.obj: $(MAINSRCDIR)/lib/graphics/text_engine.cc
     434@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.obj -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/text_engine.cc'; fi`; \
     435@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi
     436@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/text_engine.cc' object='text_engine.obj' libtool=no @AMDEPBACKSLASH@
     437@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.TPo' @AMDEPBACKSLASH@
     438@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     439@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o text_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/text_engine.cc'; fi`
     440
     441p_node.o: $(MAINSRCDIR)/lib/coord/p_node.cc
     442@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT p_node.o -MD -MP -MF "$(DEPDIR)/p_node.Tpo" -c -o p_node.o `test -f '$(MAINSRCDIR)/lib/coord/p_node.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/p_node.cc; \
     443@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/p_node.Tpo" "$(DEPDIR)/p_node.Po"; else rm -f "$(DEPDIR)/p_node.Tpo"; exit 1; fi
     444@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/coord/p_node.cc' object='p_node.o' libtool=no @AMDEPBACKSLASH@
     445@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/p_node.Po' tmpdepfile='$(DEPDIR)/p_node.TPo' @AMDEPBACKSLASH@
     446@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     447@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o p_node.o `test -f '$(MAINSRCDIR)/lib/coord/p_node.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/p_node.cc
     448
     449p_node.obj: $(MAINSRCDIR)/lib/coord/p_node.cc
     450@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT p_node.obj -MD -MP -MF "$(DEPDIR)/p_node.Tpo" -c -o p_node.obj `if test -f '$(MAINSRCDIR)/lib/coord/p_node.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/p_node.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/p_node.cc'; fi`; \
     451@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/p_node.Tpo" "$(DEPDIR)/p_node.Po"; else rm -f "$(DEPDIR)/p_node.Tpo"; exit 1; fi
     452@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/coord/p_node.cc' object='p_node.obj' libtool=no @AMDEPBACKSLASH@
     453@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/p_node.Po' tmpdepfile='$(DEPDIR)/p_node.TPo' @AMDEPBACKSLASH@
     454@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     455@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o p_node.obj `if test -f '$(MAINSRCDIR)/lib/coord/p_node.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/p_node.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/p_node.cc'; fi`
     456
     457null_parent.o: $(MAINSRCDIR)/lib/coord/null_parent.cc
     458@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT null_parent.o -MD -MP -MF "$(DEPDIR)/null_parent.Tpo" -c -o null_parent.o `test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/null_parent.cc; \
     459@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/null_parent.Tpo" "$(DEPDIR)/null_parent.Po"; else rm -f "$(DEPDIR)/null_parent.Tpo"; exit 1; fi
     460@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/coord/null_parent.cc' object='null_parent.o' libtool=no @AMDEPBACKSLASH@
     461@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/null_parent.Po' tmpdepfile='$(DEPDIR)/null_parent.TPo' @AMDEPBACKSLASH@
     462@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     463@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o null_parent.o `test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/null_parent.cc
     464
     465null_parent.obj: $(MAINSRCDIR)/lib/coord/null_parent.cc
     466@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT null_parent.obj -MD -MP -MF "$(DEPDIR)/null_parent.Tpo" -c -o null_parent.obj `if test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/null_parent.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/null_parent.cc'; fi`; \
     467@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/null_parent.Tpo" "$(DEPDIR)/null_parent.Po"; else rm -f "$(DEPDIR)/null_parent.Tpo"; exit 1; fi
     468@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/coord/null_parent.cc' object='null_parent.obj' libtool=no @AMDEPBACKSLASH@
     469@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/null_parent.Po' tmpdepfile='$(DEPDIR)/null_parent.TPo' @AMDEPBACKSLASH@
     470@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     471@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o null_parent.obj `if test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/null_parent.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/null_parent.cc'; fi`
     472
     473array.o: $(MAINSRCDIR)/lib/graphics/importer/array.cc
     474@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT array.o -MD -MP -MF "$(DEPDIR)/array.Tpo" -c -o array.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/array.cc; \
     475@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/array.Tpo" "$(DEPDIR)/array.Po"; else rm -f "$(DEPDIR)/array.Tpo"; exit 1; fi
     476@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/array.cc' object='array.o' libtool=no @AMDEPBACKSLASH@
     477@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/array.Po' tmpdepfile='$(DEPDIR)/array.TPo' @AMDEPBACKSLASH@
     478@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     479@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o array.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/array.cc
     480
     481array.obj: $(MAINSRCDIR)/lib/graphics/importer/array.cc
     482@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT array.obj -MD -MP -MF "$(DEPDIR)/array.Tpo" -c -o array.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/array.cc'; fi`; \
     483@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/array.Tpo" "$(DEPDIR)/array.Po"; else rm -f "$(DEPDIR)/array.Tpo"; exit 1; fi
     484@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/array.cc' object='array.obj' libtool=no @AMDEPBACKSLASH@
     485@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/array.Po' tmpdepfile='$(DEPDIR)/array.TPo' @AMDEPBACKSLASH@
     486@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     487@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o array.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/array.cc'; fi`
     488
     489model.o: $(MAINSRCDIR)/lib/graphics/importer/model.cc
     490@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT model.o -MD -MP -MF "$(DEPDIR)/model.Tpo" -c -o model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/model.cc; \
     491@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/model.Tpo" "$(DEPDIR)/model.Po"; else rm -f "$(DEPDIR)/model.Tpo"; exit 1; fi
     492@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/model.cc' object='model.o' libtool=no @AMDEPBACKSLASH@
     493@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/model.Po' tmpdepfile='$(DEPDIR)/model.TPo' @AMDEPBACKSLASH@
     494@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     495@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/model.cc
     496
     497model.obj: $(MAINSRCDIR)/lib/graphics/importer/model.cc
     498@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT model.obj -MD -MP -MF "$(DEPDIR)/model.Tpo" -c -o model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/model.cc'; fi`; \
     499@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/model.Tpo" "$(DEPDIR)/model.Po"; else rm -f "$(DEPDIR)/model.Tpo"; exit 1; fi
     500@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/model.cc' object='model.obj' libtool=no @AMDEPBACKSLASH@
     501@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/model.Po' tmpdepfile='$(DEPDIR)/model.TPo' @AMDEPBACKSLASH@
     502@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     503@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/model.cc'; fi`
     504
     505objModel.o: $(MAINSRCDIR)/lib/graphics/importer/objModel.cc
     506@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.o -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/objModel.cc; \
     507@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi
     508@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' object='objModel.o' libtool=no @AMDEPBACKSLASH@
     509@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@
     510@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     511@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/objModel.cc
     512
     513objModel.obj: $(MAINSRCDIR)/lib/graphics/importer/objModel.cc
     514@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.obj -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; fi`; \
     515@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi
     516@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' object='objModel.obj' libtool=no @AMDEPBACKSLASH@
     517@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@
     518@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     519@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; fi`
     520
     521material.o: $(MAINSRCDIR)/lib/graphics/importer/material.cc
     522@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT material.o -MD -MP -MF "$(DEPDIR)/material.Tpo" -c -o material.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/material.cc; \
     523@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/material.Tpo" "$(DEPDIR)/material.Po"; else rm -f "$(DEPDIR)/material.Tpo"; exit 1; fi
     524@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/material.cc' object='material.o' libtool=no @AMDEPBACKSLASH@
     525@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/material.Po' tmpdepfile='$(DEPDIR)/material.TPo' @AMDEPBACKSLASH@
     526@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     527@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o material.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/material.cc
     528
     529material.obj: $(MAINSRCDIR)/lib/graphics/importer/material.cc
     530@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT material.obj -MD -MP -MF "$(DEPDIR)/material.Tpo" -c -o material.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/material.cc'; fi`; \
     531@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/material.Tpo" "$(DEPDIR)/material.Po"; else rm -f "$(DEPDIR)/material.Tpo"; exit 1; fi
     532@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/material.cc' object='material.obj' libtool=no @AMDEPBACKSLASH@
     533@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/material.Po' tmpdepfile='$(DEPDIR)/material.TPo' @AMDEPBACKSLASH@
     534@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     535@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o material.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/material.cc'; fi`
     536
     537texture.o: $(MAINSRCDIR)/lib/graphics/importer/texture.cc
     538@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT texture.o -MD -MP -MF "$(DEPDIR)/texture.Tpo" -c -o texture.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/texture.cc; \
     539@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/texture.Tpo" "$(DEPDIR)/texture.Po"; else rm -f "$(DEPDIR)/texture.Tpo"; exit 1; fi
     540@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/texture.cc' object='texture.o' libtool=no @AMDEPBACKSLASH@
     541@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/texture.Po' tmpdepfile='$(DEPDIR)/texture.TPo' @AMDEPBACKSLASH@
     542@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     543@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o texture.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/texture.cc
     544
     545texture.obj: $(MAINSRCDIR)/lib/graphics/importer/texture.cc
     546@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT texture.obj -MD -MP -MF "$(DEPDIR)/texture.Tpo" -c -o texture.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; fi`; \
     547@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/texture.Tpo" "$(DEPDIR)/texture.Po"; else rm -f "$(DEPDIR)/texture.Tpo"; exit 1; fi
     548@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/texture.cc' object='texture.obj' libtool=no @AMDEPBACKSLASH@
     549@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/texture.Po' tmpdepfile='$(DEPDIR)/texture.TPo' @AMDEPBACKSLASH@
     550@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     551@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o texture.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; fi`
     552
     553primitive_model.o: $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
     554@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive_model.o -MD -MP -MF "$(DEPDIR)/primitive_model.Tpo" -c -o primitive_model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc; \
     555@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/primitive_model.Tpo" "$(DEPDIR)/primitive_model.Po"; else rm -f "$(DEPDIR)/primitive_model.Tpo"; exit 1; fi
     556@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' object='primitive_model.o' libtool=no @AMDEPBACKSLASH@
     557@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/primitive_model.Po' tmpdepfile='$(DEPDIR)/primitive_model.TPo' @AMDEPBACKSLASH@
     558@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     559@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive_model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
     560
     561primitive_model.obj: $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
     562@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive_model.obj -MD -MP -MF "$(DEPDIR)/primitive_model.Tpo" -c -o primitive_model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; fi`; \
     563@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/primitive_model.Tpo" "$(DEPDIR)/primitive_model.Po"; else rm -f "$(DEPDIR)/primitive_model.Tpo"; exit 1; fi
     564@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' object='primitive_model.obj' libtool=no @AMDEPBACKSLASH@
     565@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/primitive_model.Po' tmpdepfile='$(DEPDIR)/primitive_model.TPo' @AMDEPBACKSLASH@
     566@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     567@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive_model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; fi`
    319568uninstall-info-am:
    320569
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui.cc

    r4063 r4139  
    5353{
    5454  Window* orxonoxGUI = NULL;
    55 
     55  executable = NULL;
     56 
    5657  initGUI(argc, argv);
    5758
     
    9495    orxonoxGUI->fill(windowBox);
    9596  }
     97
     98
    9699  // Reading Values from File
    97100  exec->setConfDir(GUI_DEFAULT_CONF_DIR);
     
    111114  // case update //
    112115#ifdef HAVE_CURL
    113   if (static_cast<Option*>(Window::mainWindow->findWidgetByName("auto update", 0))->value == 1)
     116  if (static_cast<Option*>(Window::mainWindow->findWidgetByName(CONFIG_NAME_AUTO_UPDATE, 0))->value == 1)
    114117    {
    115118      update->checkForUpdates();
    116119    }
    117120#endif /* HAVE_CURL */
     121}
    118122
     123/**
     124   \brief starts the OrxonoxGUI
     125*/
     126void Gui::startGui(void)
     127{
    119128  mainloopGUI();
     129 
    120130#ifndef HAVE_GTK2
    121131  GuiExec::startOrxonox(NULL, exec);
     
    123133}
    124134
     135void Gui::printHelp()
     136{
     137  Window::mainWindow->walkThrough(Widget::printHelp, 1);
     138}
     139
     140/**
     141   \brief a bool that knows if orxonox should be started
     142*/
    125143bool Gui::startOrxonox = false;
    126144
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui.h

    r4063 r4139  
    2626  ~Gui(void);
    2727
     28  void startGui(void);
     29  void printHelp(void);
     30
    2831  static bool startOrxonox;
    2932};
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_audio.cc

    r4063 r4139  
    3636
    3737  audioFrame = new Frame("Audio-Options:");
    38   audioFrame->setGroupName("audio");
     38  audioFrame->setGroupName(CONFIG_SECTION_AUDIO);
    3939  {
    4040    Box* audioBox;            //!< The Box that holds the audio Options.
     
    4545      Slider* effectsVolume;    //!< A Slider for effects volume.
    4646     
    47       enableSound = new CheckButton("Disable Sound");
     47      enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO);
    4848      enableSound->setFlagName ("no-sound", 0);
     49      enableSound->setDescription("Disables Sound", "Check this to disable Sound in Orxonox");
     50      enableSound->setDefaultValue(0);
    4951      enableSound->saveability();
    5052      audioBox->fill(enableSound);
    51       Label* musicVolumeLabel = new Label("Music Volume");
     53      Label* musicVolumeLabel = new Label(CONFIG_NAME_MUSIC_VOLUME);
    5254      audioBox->fill(musicVolumeLabel);
    5355      musicVolume = new Slider("Music Volume", 0, 100);
    5456      musicVolume->setFlagName("music-volume", "m", 80);
     57      musicVolume->setDescription("Sets the volume of the ingame music");
    5558      musicVolume->saveability();
    5659      audioBox->fill (musicVolume);
    57       Label* effectsVolumeLabel = new Label ("Effects Volume");
     60      Label* effectsVolumeLabel = new Label (CONFIG_NAME_EFFECTS_VOLUME);
    5861      audioBox->fill (effectsVolumeLabel);
    5962      effectsVolume = new Slider ("Effects Volume", 0, 100);
    6063      effectsVolume->setFlagName ("effects-volume", "e", 80);
     64      effectsVolume->setDescription("Sets the volune of the ingame SoundEffects");
    6165      effectsVolume->saveability();
    6266      audioBox->fill (effectsVolume);
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_banner.cc

    r4063 r4139  
    7676
    7777    //! \todo add the names of all the guys working on orxonox
    78     orxIsLabel = new Label(PACKAGE_NAME " is:\nPatrick Boenzli - main Developer\nBenjamin Grauer - right Hand\n....");
     78    orxIsLabel = new Label("           " PACKAGE_NAME " is:\n" ORXONOX_STAFF);
    7979    logoBox->fill(orxIsLabel);
    8080    logoEventBox->fill(logoBox);
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_exec.cc

    r4063 r4139  
    5353
    5454    execBox = new Box('v');
    55     execFrame->setGroupName("misc");
     55    execFrame->setGroupName(CONFIG_SECTION_MISC);
    5656    {
    5757      Button* start;               //!< The start Button of orxonox.
     
    6565#endif /* HAVE_GTK2 */
    6666      execBox->fill(start);
    67       this->saveSettings = new CheckButton("Save Settings");
     67      this->saveSettings = new CheckButton(CONFIG_NAME_SAVE_SETTINGS);
    6868      this->saveSettings->value = 1;
    6969      this->saveSettings->saveability();
    7070      execBox->fill(this->saveSettings);
    71       verboseMode = new Menu("verbose mode", "nothing", "error", "warning", "info", "lastItem");
     71
     72#ifdef DEBUG
     73      verboseMode = new Menu(CONFIG_NAME_VERBOSE_MODE, "nothing",
     74#if DEBUG >=1
     75                             "error",
     76#endif
     77#if DEBUG >=2
     78                             "warning",
     79#endif
     80#if DEBUG >=3
     81                             "info",
     82#endif
     83#if DEBUG >=4
     84                             "debug",
     85#endif
     86#if DEBUG >=5
     87                             "heavydebug",
     88#endif
     89                             "lastItem");
    7290      verboseMode->setFlagName("verbose", "v", 2);
     91      verboseMode->setDescription("Sets the Output Mode", "This Enables Outbug messages\n"
     92                                  "0: nothing will be displayed, but stuff one cannot do without (eg.GUI)\n"
     93#if DEBUG >=1
     94                                  "1: error: outputs all the above and errors"
     95#endif
     96#if DEBUG >=2
     97                                  "2: warning: outputs all the above plus warnings"
     98#endif
     99#if DEBUG >=3
     100                                  "3: info: outputs all the above plus Information"
     101#endif
     102#if DEBUG >=4
     103                                  "4: debug: displays all the above plus debug information"
     104#endif
     105#if DEBUG >=5
     106                                  "5: heavydebug: displays all the above plus heavy debug information: WARNING: the game will run very slow with this."
     107#endif
     108                                  );
    73109      verboseMode->saveability();
    74110      execBox->fill(verboseMode);
    75       alwaysShow = new CheckButton("Always Show this Menu");
     111#endif
     112
     113      alwaysShow = new CheckButton(CONFIG_NAME_ALWAYS_SHOW_GUI);
    76114      alwaysShow->setFlagName("gui", "g", 0);
     115      alwaysShow->setDescription("shows the gui when starting orxonox");
    77116      alwaysShow->saveability();
    78117      execBox->fill(alwaysShow);
     118
    79119      quit = new Button("Quit");
    80120#ifdef HAVE_GTK2
     
    111151  this->confDir = ResourceManager::homeDirCheck(confDir);
    112152
    113   PRINTF(3)("Config Directory is: %s.\n", this->confDir);
     153  PRINTF(5)("Config Directory is: %s.\n", this->confDir);
    114154  //! \todo F** Windows-support
    115155#ifndef __WIN32__
     
    132172  this->confFile = new char[strlen(this->confDir)+strlen(fileName)+2];
    133173  sprintf(this->confFile, "%s/%s", this->confDir, fileName);
    134   PRINTF(3)("ConfigurationFile is %s.\n", this->confFile);
     174  PRINTF(5)("ConfigurationFile is %s.\n", this->confFile);
    135175}
    136176
     
    174214{
    175215  int counter = 0;
    176   while(counter < depth &&((widget->isOption>0
     216  while(counter < depth &&((widget->optionType > GUI_NOTHING
    177217                              &&(static_cast<Option*>(widget)->isSaveable()))
    178                              ||(widget->isOption<0
     218                             ||(widget->optionType < GUI_NOTHING
    179219                                && static_cast<Packer*>(widget)->getGroupName())))
    180220    {
     
    184224 
    185225  // check if it is a Packer, and if it is, check if it has a name and if there is something in it.
    186   if(widget->isOption <0)
     226  if(widget->optionType < GUI_NOTHING)
    187227    {
    188228      if(static_cast<Packer*>(widget)->getGroupName())
     
    197237        }
    198238    }
    199   //  if(widget->isOption == 0)
    200   //    printf("%s\n",widget->title);
    201   if(widget->isOption >= 1)
     239
     240  if(widget->optionType > GUI_NOTHING)
    202241    if (static_cast<Option*>(widget)->isSaveable())
    203242      {
     
    277316    {
    278317      PRINT(5)("Located Option %s.\n", widget->title);
    279       if(widget->isOption >= 1)
     318      if(widget->optionType > GUI_NOTHING)
    280319        static_cast<Option*>(widget)->load(info->variableValue);
    281320    }
     
    302341    }
    303342
    304   if(widget->isOption < 0)
     343  if(widget->optionType < GUI_NOTHING)
    305344    {
    306345      if(static_cast<Packer*>(widget)->getGroupName() &&
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_flags.cc

    r4063 r4139  
    3838  this->flagsBox->fill(flagsLabel);
    3939  this->shortFlags = new CheckButton("shortFlags");
     40  this->shortFlags->setDefaultValue(0);
    4041  this->flagsBox->fill(shortFlags);
    4142
     
    7677{
    7778  FlagInfo* info =(FlagInfo*)flagInfo;
    78   if(widget->isOption >= 1)
     79  if(widget->optionType > GUI_NOTHING)
    7980    if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue )
    8081      {
     
    9091          }
    9192
    92         if(static_cast<Option*>(widget)->isOption == 2)
     93        if(static_cast<Option*>(widget)->optionType > GUI_BOOL)
    9394          {
    9495            info->flagsLabel->appendText("=");
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_gtk.cc

    r4063 r4139  
    222222    return this;
    223223
    224   if (this->isOption < 0 && static_cast<Packer*>(this)->down)
     224  if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down)
    225225    {
    226226      Widget* tmp = static_cast<Packer*>(this)->down->findWidgetByName(name, depth+1);
     
    243243{
    244244  function(this);
    245   if (this->isOption < 0)
     245  if (this->optionType < GUI_NOTHING)
    246246    {
    247247      static_cast<Packer*>(this)->down->walkThrough(function, depth+1);
     
    261261{
    262262  function(this, data);
    263   if (this->isOption < 0)
     263  if (this->optionType < GUI_NOTHING)
    264264    {
    265265      static_cast<Packer*>(this)->down->walkThrough(function, data, depth+1);
     
    275275void Widget::listOptionsAndGroups(Widget* widget)
    276276{
    277   if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
     277  if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName)
    278278    PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName);
    279   if (widget->isOption >= 1)
     279  if (widget->optionType > GUI_NOTHING)
    280280    {
    281281      Widget::listOptions(widget);
     
    289289void Widget::listOptions(Widget* widget)
    290290{
    291   if(widget->isOption >= 1)
     291  if(widget->optionType > GUI_NOTHING)
    292292    PRINT(0)("  %s is %s\n", static_cast<Option*>(widget)->title, static_cast<Option*>(widget)->save());
    293293}
     
    301301{
    302302 
    303   if (widget->isOption >= 1)
     303  if (widget->optionType > GUI_NOTHING)
    304304    {
    305305      int* count =(int*)data;
     
    308308               static_cast<Option*>(widget)->title,
    309309               static_cast<Option*>(widget)->save());
     310    }
     311}
     312
     313/**
     314    \brief This is for listing the options of "widget"
     315    \param widget specifies the widget that should be listed
     316    \param data A Counter, that always knows how many Options have been found yet.
     317*/
     318void Widget::printHelp(Widget* widget)
     319{
     320  int helpLen=0;
     321
     322  if (widget->optionType > GUI_NOTHING)
     323    {
     324      Option* option = (Option*)widget;
     325      if (option->flagName || option->flagNameShort)
     326        {
     327          PRINT(0)("  ");
     328          if (option->flagNameShort)
     329            {
     330              PRINT(0)("-%s", option->flagNameShort);
     331              helpLen += strlen(option->flagNameShort)+1;
     332            }
     333          if (option->flagName)
     334            {
     335              if (helpLen > 0)
     336                {
     337                  PRINT(0)("|");
     338                  helpLen++;
     339                }
     340              PRINT(0)("--%s:", option->flagName);
     341              helpLen += strlen(option->flagName)+2;
     342            }
     343          while ((helpLen ++) < 29)
     344            PRINT(0)(" ");
     345          if (option->shortDescription)
     346            PRINT(0)("%s\n", option->shortDescription);
     347          else
     348            PRINT(0)("\n");
     349        }
    310350    }
    311351}
     
    320360Widget* Widget::findOptionByNumber(int* number, unsigned int depth)
    321361{
    322   if (isOption > 0)
     362  if (optionType > GUI_NOTHING)
    323363    {
    324364      --*number;
     
    328368        }
    329369    }
    330   if (this->isOption < 0 && static_cast<Packer*>(this)->down)
     370  if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down)
    331371    {
    332372      Widget* tmp = static_cast<Packer*>(this)->down->findOptionByNumber(number, depth+1);
     
    346386void Widget::listGroups(Widget* widget)
    347387{
    348   if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
     388  if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName)
    349389    PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName);
    350390}
     
    358398{
    359399  int* count = (int*)data;
    360   if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
     400  if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName)
    361401    PRINT(0)("%d: [%s]\n", ++*count, static_cast<Packer*>(widget)->groupName);
    362402}
     
    369409Widget* Widget::findGroupByNumber(int* number, unsigned int depth)
    370410{
    371   if (isOption < 0 && static_cast<Packer*>(this)->groupName)
     411  if (optionType < GUI_NOTHING && static_cast<Packer*>(this)->groupName)
    372412    {
    373413      --*number;
     
    377417        }
    378418    }
    379   if (this->isOption < 0 && static_cast<Packer*>(this)->down)
     419  if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down)
    380420    {
    381421      Widget* tmp = static_cast<Packer*>(this)->down->findGroupByNumber(number, depth+1);
     
    395435void Widget::setOptions(Widget* widget)
    396436{
    397   if (widget->isOption >= 1)
     437  if (widget->optionType > GUI_NOTHING)
    398438    static_cast<Option*>(widget)->redraw();
    399439}
     
    406446void Widget::redrawOptions(Widget* widget)
    407447{
    408   if (widget->isOption >= 1)
     448  if (widget->optionType > GUI_NOTHING)
    409449    static_cast<Option*>(widget)->redraw();
    410450}
     
    415455void Widget::flagCheck(Widget* widget, void* flagName)
    416456{
    417   if (widget->isOption>=1)
     457  if (widget->optionType > GUI_NOTHING)
    418458    {     
    419459      Option* option =(Option*)widget;
     
    567607Container::Container(void)
    568608{
    569   this->isOption = -1;
     609  this->optionType = GUI_CONTAINER;
    570610}
    571611
     
    595635    }
    596636  else
    597     PRINTF(1)("You tried to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n");
     637    PRINTF(2)("You tried to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n");
    598638}
    599639
     
    772812   \brief Creates a new Frame with name title
    773813*/
    774 Frame::Frame(char* frameName)
     814Frame::Frame(const char* frameName)
    775815{
    776816#ifdef HAVE_GTK2
     
    778818  gtk_container_set_border_width(GTK_CONTAINER(this->widget), 3);
    779819#endif /* HAVE_GTK2 */
    780   if (title)
     820  if (frameName)
    781821    this->setTitle(frameName);
    782822}
     
    801841  strcpy(this->title, title);
    802842#ifdef HAVE_GTK2
    803   gtk_frame_set_label(GTK_FRAME(widget), title);
     843  gtk_frame_set_label(GTK_FRAME(widget), this->title);
    804844#endif /* HAVE_GTK2 */
    805845}
     
    814854EventBox::EventBox(const char* eventBoxName)
    815855{
    816   this->isOption = -1;
    817 
    818856#ifdef HAVE_GTK2
    819857  this->widget = gtk_event_box_new();
     
    842880Box::Box(char boxtype)
    843881{
    844   this->isOption = -2;
     882  this->optionType = GUI_BOX;
    845883
    846884#ifdef HAVE_GTK2
     
    10531091   \param buttonName sets the Name of the Button
    10541092*/
    1055 Button::Button(char* buttonName)
    1056 {
    1057   isOption = 0;
     1093Button::Button(const char* buttonName)
     1094{
     1095  this->optionType = GUI_NOTHING;
    10581096
    10591097#ifdef HAVE_GTK2
     
    11151153CheckButton::CheckButton(const char* buttonName)
    11161154{
    1117   this->isOption = 1;
     1155  this->optionType = GUI_BOOL;
    11181156
    11191157#ifdef HAVE_GTK2
     
    11791217  if ((this->value = atoi(tmpChar))=!0)
    11801218    this->value = 1;
    1181 #endif /* HAVE_GTK2 */
     1219
    11821220  PRINT(0)("%s set to: %d\n", this->title, this->value);
     1221#endif /* HAVE_GTK2 */
    11831222}
    11841223
     
    12051244Slider::Slider(const char* slidername, int start, int end)
    12061245{
    1207   this->isOption = 2;
     1246  this->optionType = GUI_INT;
    12081247
    12091248  this->start = start;
     
    12641303  if (this->value <= this->start)
    12651304    this->value = this->start;
    1266 #endif /* HAVE_GTK2 */
     1305
    12671306  PRINT(0)("%s set to: %d\n",this->title, this->value);
     1307#endif /* HAVE_GTK2 */
    12681308}
    12691309
     
    13291369void Menu::init(void)
    13301370{
    1331   this->isOption = 2;
     1371  this->optionType = GUI_INT;
    13321372  this->firstItem = NULL;
    13331373
     
    13721412    {
    13731413      this->value = 0;
    1374       PRINTF(2)("Sorry, but %s has not been found in the Itemlist of %s\n", loadString, this->title);
    1375     }
    1376   PRINTF(4)( "Loading %s: setting to %d\n", this->title, this->value);
     1414      PRINTF(2)("%s has not been found in the Itemlist of %s\n", loadString, this->title);
     1415    }
     1416  PRINTF(5)( "Loading %s: setting to %d\n", this->title, this->value);
    13771417  this->redraw();
    13781418}
     
    14311471
    14321472#endif /* HAVE_GTK2 */
    1433   PRINT(4)("%s set to: %d\n", this->title, this->value);
     1473  PRINT(5)("%s set to: %d\n", this->title, this->value);
    14341474}
    14351475
     
    14431483OptionLabel::OptionLabel(const char* label, const char* value)
    14441484{
    1445   this->isOption = 5;
     1485  this->optionType = GUI_CHAR_ARRAY;
    14461486  cValue = NULL;
    14471487
     
    14741514  this->cValue = new char [strlen(newValue)+1];
    14751515  strcpy(this->cValue, newValue);
    1476 #ifdef HAVE_GTK2
    1477   gtk_label_set_text(GTK_LABEL(this->widget), this->cValue);
    1478 #endif /* HAVE_GTK2 */
     1516
     1517  this->redraw();
    14791518}
    14801519
     
    14851524{
    14861525#ifdef HAVE_GTK2
    1487   gtk_label_set_text(GTK_LABEL(widget), title);
     1526  gtk_label_set_text(GTK_LABEL(widget), cValue);
    14881527#endif /* HAVE_GTK2 */
    14891528}
     
    14951534{
    14961535#ifdef HAVE_GTK2
    1497   this->cValue =(char*)gtk_label_get_text(GTK_LABEL(this->widget));
     1536  this->cValue = (char*)gtk_label_get_text(GTK_LABEL(this->widget));
    14981537#else /* HAVE_GTK2 */
    14991538  PRINT(0)("\nPlease give me a new input for %s: ", this->title);
     
    15211560void OptionLabel::load(char* loadString)
    15221561{
    1523   PRINTF(4)("Loading %s: setting to %s\n", this->title, loadString);
     1562  PRINTF(5)("Loading %s: setting to %s\n", this->title, loadString);
    15241563  this->setValue(loadString);
    15251564}
     
    15341573Label:: Label(const char* text)
    15351574{
    1536   this->isOption = 0;
     1575  this->optionType = GUI_NOTHING;
    15371576 
    15381577#ifdef HAVE_GTK2
     
    16301669ProgressBar::ProgressBar(const char* label)
    16311670{
    1632   this->isOption = 0;
     1671  this->optionType = GUI_NOTHING;
    16331672  this->progress = 0.0;
    16341673  this->totalSize = 0.0;
     
    16711710#ifdef HAVE_GTK2
    16721711  gtk_progress_set_value(GTK_PROGRESS(widget), this->progress*100.0/this->totalSize);
    1673   PRINTF(4)("Progress: %f%%\n", this->progress*100.0/this->totalSize);
     1712  PRINTF(5)("Progress: %f%%\n", this->progress*100.0/this->totalSize);
    16741713#else /* HVE_GTK2 */
    16751714  PRINT(0)("Progress: %f%%\n", this->progress*100.0/this->totalSize);
     
    17291768void Image::init(const char* name)
    17301769{
    1731   isOption = 0;
     1770  optionType = GUI_NOTHING;
    17321771
    17331772  if (this->title)
     
    17361775  strcpy(this->title, name);
    17371776}
     1777
     1778
     1779/////////////////
     1780/* FILE DIALOG */
     1781/////////////////
     1782/**
     1783   \brief Creates a new FileDialog
     1784   \param fileDialogName a Name for the Dialog
     1785*/
     1786FileDialog::FileDialog(const char* fileDialogName)
     1787{
     1788  this->optionType = GUI_NOTHING;
     1789  this->isOpen = false;
     1790  this->changeOption = NULL;
     1791  this->openUpButton = NULL;
     1792  this->okObject = NULL;
     1793  this->okFunc = NULL;
     1794
     1795#ifdef HAVE_GTK2
     1796  this->widget = gtk_file_selection_new(fileDialogName);
     1797
     1798  gtk_file_selection_set_select_multiple(GTK_FILE_SELECTION (this->widget), FALSE);
     1799
     1800  g_signal_connect(GTK_FILE_SELECTION (this->widget)->cancel_button,
     1801                     "button_release_event",
     1802                     G_CALLBACK (FileDialog::dialogClose),
     1803                     this);
     1804  g_signal_connect(GTK_FILE_SELECTION (this->widget),
     1805                     "delete_event",
     1806                     G_CALLBACK (FileDialog::dialogClose),
     1807                     this);
     1808  g_signal_connect(GTK_FILE_SELECTION (this->widget)->ok_button,
     1809                     "button_release_event",
     1810                     G_CALLBACK (FileDialog::dialogOK),
     1811                     this);
     1812#endif /* HAVE_GTK2 */
     1813  if (fileDialogName)
     1814    this->setTitle(fileDialogName);
     1815}
     1816
     1817/**
     1818   \brief destructs a FileDialog
     1819*/
     1820FileDialog::~FileDialog(void)
     1821{
     1822  PRINTF(5)("deleting FileDialog %s\n", this->title);
     1823}
     1824
     1825void FileDialog::setChangeOption(OptionLabel* changeOption)
     1826{
     1827  this->changeOption = changeOption;
     1828}
     1829
     1830void FileDialog::setOKFunc(void* okObject, bool(*function)(const char* , void*))
     1831{
     1832  this->okObject = okObject;
     1833  this->okFunc = function;
     1834}
     1835
     1836
     1837void FileDialog::setOpenUpButton(Button* openUpButton)
     1838{
     1839  this->openUpButton = openUpButton;
     1840
     1841  openUpButton->connectSignal("button_release_event", this, FileDialog::dialogOpen);
     1842}
     1843
     1844
     1845void FileDialog::setDefaultFileName(const char* defaultFileName)
     1846{
     1847#ifdef HAVE_GTK2
     1848  gtk_file_selection_set_filename (GTK_FILE_SELECTION(this->widget), defaultFileName);
     1849#endif /* HAVE_GTK2 */
     1850}
     1851
     1852void FileDialog::setMask(const char* mask)
     1853{
     1854#ifdef HAVE_GTK2
     1855  gtk_file_selection_complete(GTK_FILE_SELECTION(this->widget), mask);
     1856#endif /* HAVE_GTK2 */
     1857}
     1858
     1859/**
     1860   \brief disables the File Operator Buttons
     1861*/
     1862void FileDialog::disableFileOpts(void)
     1863{
     1864#ifdef HAVE_GTK2
     1865  gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(this->widget));
     1866#endif /* HAVE_GTK2 */
     1867}
     1868
     1869/**
     1870   \brief The ok-button has been pressed
     1871*/
     1872void FileDialog::okEvent(void)
     1873{
     1874  if (this->okFunc)
     1875    {
     1876#ifdef HAVE_GTK2
     1877      if(this->okFunc((const char*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(this->widget)), this->okObject))
     1878         this->close();
     1879#endif /* HAVE_GTK2 */
     1880    }
     1881  else if (this->changeOption)
     1882    {
     1883#ifdef HAVE_GTK2
     1884      changeOption->setValue(gtk_file_selection_get_filename(GTK_FILE_SELECTION(this->widget)));
     1885#endif /* HAVE_GTK2 */
     1886      this->close();
     1887    }
     1888  else
     1889    this->close();
     1890}
     1891
     1892/**
     1893   \biref opens up the FileDialog-Window
     1894*/
     1895void FileDialog::open(void)
     1896{
     1897  isOpen = true;
     1898#ifdef HAVE_GTK2
     1899  gtk_widget_show_all(this->widget);
     1900  gtk_grab_add(this->widget);
     1901#endif /* HAVE_GTK2 */
     1902}
     1903
     1904/**
     1905   \closes the FileDialog-Window
     1906*/
     1907void FileDialog::close(void)
     1908{
     1909  this->isOpen = false;
     1910#ifdef HAVE_GTK2
     1911  gtk_grab_remove(this->widget);
     1912  gtk_widget_hide(this->widget);
     1913#endif /* HAVE_GTK2 */
     1914}
     1915
     1916#ifdef HAVE_GTK2
     1917gint FileDialog::dialogOK(GtkWidget* widget, GdkEvent* event, void* dialog)
     1918{
     1919  static_cast<FileDialog*>(dialog)->okEvent();
     1920}
     1921#else /* HAVE_GTK2 */
     1922int FileDialog::dialogOK(void* widget, void* event, void* dialog){}
     1923#endif /* HAVE_GTK2 */
     1924
     1925#ifdef HAVE_GTK2
     1926gint FileDialog::dialogOpen(GtkWidget* widget, GdkEvent* event, void* dialog)
     1927{
     1928  static_cast<FileDialog*>(dialog)->open();
     1929}
     1930#else /* HAVE_GTK2 */
     1931int FileDialog::dialogOpen(void* widget, void* event, void* dialog){}
     1932#endif /* HAVE_GTK2 */
     1933
     1934#ifdef HAVE_GTK2
     1935gint FileDialog::dialogClose(GtkWidget* widget, GdkEvent* event, void* dialog)
     1936{
     1937  static_cast<FileDialog*>(dialog)->close();
     1938}
     1939#else /* HAVE_GTK2 */
     1940int FileDialog::dialogClose(void* widget, void* event, void* dialog){}
     1941#endif /* HAVE_GTK2 */
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_gtk.h

    r4063 r4139  
    1111
    1212#include "debug.h"
     13#include "globals.h"
    1314
    1415#ifdef HAVE_GTK2
     
    2829#include <gtk/gtkeventbox.h>
    2930#include <gtk/gtkprogressbar.h>
     31#include <gtk/gtkfilesel.h>
    3032#endif /* HAVE_GTK2 */
    3133
    3234// enumerator for different GuiOption-Types
    33 enum GUI_OPTION {GUI_CONTAINER = -2,
    34                  GUI_BOX = -1,
     35enum GUI_OPTION {GUI_BOX = -2,
     36                 GUI_CONTAINER = -1,
    3537                 GUI_NOTHING = 0,
    3638                 GUI_BOOL = 1,
     
    6365  void walkThrough(void(*function)(Widget*), unsigned int depth);
    6466  void walkThrough(void(*function)(Widget*, void*), void* data, unsigned int depth);
    65   static void listOptionsAndGroups(Widget* widget);
    66   static void listOptions(Widget* widget);
    67   static void listOptions(Widget* widget, void* data);
    68   Widget* findOptionByNumber(int* number, unsigned int depth);
    69   static void listGroups(Widget* widget);
    70   static void listGroups(Widget* widget, void* data);
    71   Widget* findGroupByNumber(int* number, unsigned int depth);
    72   static void setOptions(Widget* widget);
    73   static void redrawOptions(Widget* widget);
    74   static void flagCheck(Widget* widget, void* flagName);
     67   static void listOptionsAndGroups(Widget* widget);
     68   static void listOptions(Widget* widget);
     69   static void listOptions(Widget* widget, void* data);
     70   Widget* findOptionByNumber(int* number, unsigned int depth);
     71   static void listGroups(Widget* widget);
     72   static void listGroups(Widget* widget, void* data);
     73   static void printHelp(Widget* widget);
     74   Widget* findGroupByNumber(int* number, unsigned int depth);
     75   static void setOptions(Widget* widget);
     76   static void redrawOptions(Widget* widget);
     77   static void flagCheck(Widget* widget, void* flagName);
    7578 
    7679#ifdef HAVE_GTK2
     
    103106#endif /* HAVE_GTK2 */
    104107
    105   int isOption;                     //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3: float option, 4:char option, 5: char* option
    106  
     108  GUI_OPTION optionType;            //!< The Type of the Widget.
    107109  char* title;                      //!< The name of the Widget. Some do display it, Options need it to save;
    108110};
     
    141143  Container(void);
    142144  virtual ~Container(void);
     145
    143146  void setBorderWidth(int borderwidth);
    144147  void fill(Widget* lowerWidget);
     
    184187{
    185188 public:
    186   Frame(char* frameName = NULL);
     189  Frame(const char* frameName = NULL);
    187190  virtual ~Frame(void);
    188191
     
    262265{
    263266 public:
    264   Button(char* buttonName = NULL);
     267  Button(const char* buttonName = NULL);
    265268  virtual ~Button(void);
    266269
     
    358361};
    359362
     363//! A EntryField is a TextEntry field, for putting some text into.
     364class EntryField : public Option
     365{
     366 public:
     367  EntryField(const char* name = NULL);
     368  virtual ~EntryField(void);
     369 
     370  void setValue(const char* newValue);
     371  virtual char* save(void);
     372  virtual void load(char* loadString);
     373 
     374  virtual void redraw(void);
     375  virtual void changeOption(void);
     376};
     377
    360378//! A label is a Widget, that displays a text
    361379class Label : public Widget
     
    405423};
    406424
    407 //gint orxonox_gui_quit(GtkWidget* widget, GdkEvent* event, gpointer data);
     425//! A FileDialog is a window with wich one can select a File
     426class FileDialog : public Widget
     427{
     428 private:
     429  OptionLabel* changeOption;
     430  Button* openUpButton;
     431  bool isOpen;
     432  bool (*okFunc)(const char* , void*);
     433  void* okObject;
     434
     435 public:
     436  FileDialog(const char* fileDialogName);
     437  virtual ~FileDialog(void);
     438
     439  void setChangeOption(OptionLabel* changeOption);
     440  void setOKFunc(void* okObject, bool(*function)(const char* , void*));
     441  void setOpenUpButton(Button* openUpButton);
     442  void setDefaultFileName(const char* defaultFileName);
     443  void setMask(const char* mask);
     444  void disableFileOpts(void);
     445
     446  void okEvent();
     447  void open();
     448  void close();
     449
     450#ifdef HAVE_GTK2
     451  static gint dialogOK(GtkWidget* widget, GdkEvent* event, void* dialog);
     452  static gint dialogOpen(GtkWidget* widget, GdkEvent* event, void* dialog);
     453  static gint dialogClose(GtkWidget* widget, GdkEvent* event, void* dialog);
     454#else /* HAVE_GTK2 */
     455  static int dialogOK(void* widget, void* event, void* dialog);
     456  static int dialogOpen(void* widget, void* event, void* dialog);
     457  static int dialogClose(void* widget, void* event, void* dialog);
     458#endif /* HAVE_GTK2 */
     459};
    408460
    409461#endif /* _GUI_GTK_H */
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_keys.cc

    r4063 r4139  
    3333GuiKeys::GuiKeys(void)
    3434{
    35   this->keysFrame = new Frame("Keyboard-Options:");
    36   //  keysFrame->setGroupName("Keyboard");
    37   this->keysBox = new Box('h');
    38   this->player1 = new Player("player1");
    39   this->player2 = new Player("player2");
    40 
    41   this->keysBox->fill(this->player1->getOpenButton());
    42   this->keysBox->fill(this->player2->getOpenButton());
    43 
    44   this->keysFrame->fill(this->keysBox);
     35  Frame* keysFrame;      //!< The Frame that holds the keyOptions.
     36
     37  keysFrame = new Frame("Keyboard-Options:");
     38  {
     39    Box* keysBox0;          //!< The Frame that holds the keyOptions.
     40   
     41    //  keysFrame->setGroupName("Keyboard");
     42    keysBox0 = new Box('v');
     43    {
     44      Box* keysBox1;
     45      MiscKeys* misc;            //!< The Misc Keys
     46
     47      keysBox1 = new Box('h');
     48      {
     49        PlayerKeys* player1;       //!< The first Player's keys.
     50        PlayerKeys* player2;       //!< The seconds Player's keys.
     51       
     52        player1 = new PlayerKeys(CONFIG_SECTION_PLAYER "1");
     53        player2 = new PlayerKeys(CONFIG_SECTION_PLAYER "2");
     54       
     55        keysBox1->fill(player1->getOpenButton());
     56        keysBox1->fill(player2->getOpenButton());
     57      }
     58      keysBox0->fill(keysBox1);
     59
     60      misc = new MiscKeys();
     61      keysBox0->fill(misc->getOpenButton());
     62    }
     63    keysFrame->fill(keysBox0);
     64  }
     65 
     66  // setting up the Input Windows that receives keystrokes.
     67  this->inputWindow = new Window("inputWindow");
     68  this->inputButton = new Button("test");
     69#ifdef HAVE_GTK2
     70  this->inputWindow->connectSignal("destroy",  Widget::doNothingSignal);
     71  this->inputWindow->connectSignal("delete_event", Widget::doNothingSignal);
     72#endif /* HAVE_GTK2 */
     73  this->inputWindow->fill(inputButton);
     74 
    4575  this->setMainWidget(keysFrame);
    4676}
     
    5484}
    5585
     86
     87Window* GuiKeys::inputWindow = NULL;
     88Button* GuiKeys::inputButton = NULL;
     89long GuiKeys::keySignal = 0;
     90
     91////////////
    5692/* PLAYER */
    57 
     93////////////
    5894/**
    5995   \brief Creates new inputs for a player
    6096   \param player the name of the Player
    6197*/
    62 Player::Player(char* player)
    63 {
    64   char* windowName = new char[strlen(player)+25];
    65   strcpy(windowName, "Keyboard settings of ");
     98PlayerKeys::PlayerKeys(char* player)
     99{
     100  Window* pKeyWindow;     //!< The Window for a new Key-setting.
     101
     102  char* windowName = new char[strlen(player)+12];
     103  strcpy(windowName, "KeySets: ");
    66104  strcat(windowName, player);
    67   this->pKeyWindow = new Window(windowName);
    68   this->pKeyFrame = new Frame(windowName);
    69    this->pKeysBox = new Box('v');
    70    this->pKeysBox->setGroupName(player);
    71     this->pKeysBox->fill(addKey(UP, "up"));
    72     this->pKeysBox->fill(addKey(DOWN, "down"));
    73     this->pKeysBox->fill(addKey(LEFT, "left"));
    74     this->pKeysBox->fill(addKey(RIGHT, "right"));
    75     this->pKeysBox->fill(addKey(SHOOT, "shoot"));
    76     delete windowName;
    77     closeButton = new Button("close");
    78 #ifdef HAVE_GTK2
    79     this->closeButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowClose);
    80 #endif /* HAVE_GTK2 */
    81 
    82     this->pKeysBox->fill(this->closeButton);
    83     this->pKeyFrame->fill(this->pKeysBox);
    84    this->pKeyWindow->fill(this->pKeyFrame);
    85    Window::addWindow(this->pKeyWindow);
    86 #ifdef HAVE_GTK2
    87    this->pKeyWindow->connectSignal("destroy", this->pKeyWindow, Window::windowClose);
    88    this->pKeyWindow->connectSignal("delete_event", this->pKeyWindow, Window::windowClose);
    89 #endif /* HAVE_GTK2 */
    90 
     105  pKeyWindow = new Window(windowName);
     106  {
     107    Frame* pKeyFrame;       //!< The Frame for a new Key-setting.
     108
     109    pKeyFrame = new Frame(windowName);
     110    {
     111      Box* pKeysBox;          //!< The Box that holds the Key-settings.
     112      pKeysBox = new Box('v');
     113      {
     114        Button* closeButton;    //!< The CloseButton for this key-settings.
     115
     116        pKeysBox->setGroupName(player);
     117        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_UP, "UP"));
     118        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_DOWN, "DOWN"));
     119        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_LEFT, "LEFT"));
     120        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_RIGHT, "RIGHT"));
     121        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_FIRE, "SPACE"));
     122        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_NEXT_WEAPON, "m"));
     123        pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_PREV_WEAPON, "n"));
     124        closeButton = new Button("close");
     125#ifdef HAVE_GTK2
     126        closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose);
     127#endif /* HAVE_GTK2 */
     128
     129        pKeysBox->fill(closeButton);
     130      }
     131      pKeyFrame->fill(pKeysBox);
     132    }
     133    pKeyWindow->fill(pKeyFrame);
     134  }
     135  delete windowName;
     136  Window::addWindow(pKeyWindow);
     137#ifdef HAVE_GTK2
     138  pKeyWindow->connectSignal("destroy", pKeyWindow, Window::windowClose);
     139  pKeyWindow->connectSignal("delete_event", pKeyWindow, Window::windowClose);
     140#endif /* HAVE_GTK2 */
     141 
    91142  this->openButton = new Button(player);
    92143#ifdef HAVE_GTK2
    93   this->openButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowOpen);
    94 #endif /* HAVE_GTK2 */
    95 
    96   this->inputWindow = new Window("inputWindow");
    97 
    98   this->inputButton = new Button("test");
    99   this->inputWindow->fill(inputButton);
    100 #ifdef HAVE_GTK2
    101   this->inputWindow->connectSignal("destroy",  Widget::doNothingSignal);
    102   this->inputWindow->connectSignal("delete_event", Widget::doNothingSignal);
    103 #endif /* HAVE_GTK2 */
    104 
    105 }
     144  this->openButton->connectSignal("button_press_event", pKeyWindow, Window::windowOpen);
     145#endif /* HAVE_GTK2 */
     146}
     147
     148/**
     149   \returns the OpenButton of a Player
     150*/
     151Button* PlayerKeys::getOpenButton(void)
     152{
     153  return this->openButton;
     154}
     155
     156//////////////////
     157/* MISC_OPTIONS */
     158//////////////////
     159/**
     160   \brief Creates new inputs for a misc
     161   \param player the name of the Misc
     162*/
     163MiscKeys::MiscKeys()
     164{
     165  Window* keyWindow;     //!< The Window for a new Key-setting.
     166
     167  keyWindow = new Window("misc Keys");
     168  {
     169    Frame* keyFrame;       //!< The Frame for a new Key-setting.
     170
     171    keyFrame = new Frame("misc Keys:");
     172    {
     173      Box* keysBox;          //!< The Box that holds the Key-settings.
     174      keysBox = new Box('v');
     175      {
     176        Button* closeButton;    //!< The CloseButton for this key-settings.
     177
     178        keysBox->setGroupName(CONFIG_SECTION_MISC_KEYS);
     179        keysBox->fill(addKey(CONFIG_NAME_QUIT , "ESCAPE"));
     180        keysBox->fill(addKey(CONFIG_NAME_PAUSE, "PAUSE"));
     181        keysBox->fill(addKey(CONFIG_NAME_NEXT_WORLD, "x"));
     182        keysBox->fill(addKey(CONFIG_NAME_PREV_WORLD, "z"));
     183        keysBox->fill(addKey(CONFIG_NAME_VIEW0, "1"));
     184        keysBox->fill(addKey(CONFIG_NAME_VIEW1, "2"));
     185        keysBox->fill(addKey(CONFIG_NAME_VIEW2, "3"));
     186        keysBox->fill(addKey(CONFIG_NAME_VIEW3, "4"));
     187        keysBox->fill(addKey(CONFIG_NAME_VIEW4, "5"));
     188        keysBox->fill(addKey(CONFIG_NAME_VIEW5, "6"));
     189
     190        closeButton = new Button("close");
     191#ifdef HAVE_GTK2
     192        closeButton->connectSignal("button_press_event", keyWindow, Window::windowClose);
     193#endif /* HAVE_GTK2 */
     194
     195        keysBox->fill(closeButton);
     196      }
     197      keyFrame->fill(keysBox);
     198    }
     199    keyWindow->fill(keyFrame);
     200  }
     201  Window::addWindow(keyWindow);
     202#ifdef HAVE_GTK2
     203  keyWindow->connectSignal("destroy", keyWindow, Window::windowClose);
     204  keyWindow->connectSignal("delete_event", keyWindow, Window::windowClose);
     205#endif /* HAVE_GTK2 */
     206 
     207  this->openButton = new Button("misc");
     208#ifdef HAVE_GTK2
     209  this->openButton->connectSignal("button_press_event", keyWindow, Window::windowOpen);
     210#endif /* HAVE_GTK2 */
     211}
     212
     213/**
     214   \returns the OpenButton of a Misc
     215*/
     216Button* MiscKeys::getOpenButton(void)
     217{
     218  return this->openButton;
     219}
     220
    106221
    107222/**
     
    111226   \returns A widget that has the Key-Box
    112227*/
    113 Widget* Player::addKey(KEYS key, char* name)
    114 {
    115   this->inputKey[key] = new InputKey;
    116   this->inputKey[key]->pKeyBox = new Box();
    117   this->inputKey[key]->pKeyButton = new Button(name);
    118   this->inputKey[key]->pKeyOLabel = new OptionLabel(name, name);
    119   this->inputKey[key]->pKeyOLabel->saveability();
    120 
    121 #ifdef HAVE_GTK2
    122   //inputKey[key]->pKeyButton->connectSignal("key_press_event", inputKey[key]->pKeyButton, key_cb);
    123   this->inputKey[key]->pKeyButton->connectSignal("button_press_event", this->inputKey[key], inputWindowEvent);
    124 #endif /* HAVE_GTK2 */
    125   this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyButton);
    126   this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyOLabel);
    127   return this->inputKey[key]->pKeyBox;
    128 }
    129 
    130 /**
    131    \returns the OpenButton of a Player
    132 */
    133 Button* Player::getOpenButton(void)
    134 {
    135   return this->openButton;
    136 }
    137 
    138 /**
    139    \brief sets a new Key(only output)
    140    \param key the new Key.
    141 */
    142 void Player::setkey(KEYS key)
    143 {
    144   PRINT(4)("setting up Key: %d\n", key);
    145 }
    146 
    147 Window* Player::inputWindow = NULL;
    148 Button* Player::inputButton = NULL;
    149 long Player::keySignal = 0;
    150 
    151 #ifdef HAVE_GTK2
    152 gint Player::inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* inputKey)
    153 {
    154   inputButton->setTitle("press a Key");
    155   keySignal = inputButton->connectSignal("key_press_event", inputKey, key_cb);
    156   inputWindow->open();
     228Widget* addKey(const char* name, const char* defaultVal)
     229{
     230  InputKey* inputKey = new InputKey;
     231  inputKey->keyBox = new Box();
     232  inputKey->keyButton = new Button(name);
     233  if (defaultVal)
     234    inputKey->keyOLabel = new OptionLabel(name, defaultVal);
     235  else
     236    inputKey->keyOLabel = new OptionLabel(name, name);
     237  inputKey->keyOLabel->saveability();
     238
     239#ifdef HAVE_GTK2
     240  //inputKey->keyButton->connectSignal("key_press_event", inputKey->keyButton, key_cb);
     241  inputKey->keyButton->connectSignal("button_press_event", inputKey, inputWindowEvent);
     242#endif /* HAVE_GTK2 */
     243  inputKey->keyBox->fill(inputKey->keyButton);
     244  inputKey->keyBox->fill(inputKey->keyOLabel);
     245  return inputKey->keyBox;
     246}
     247
     248
     249#ifdef HAVE_GTK2
     250gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* inputKey)
     251{
     252  GuiKeys::inputButton->setTitle("press a Key");
     253  GuiKeys::keySignal = GuiKeys::inputButton->connectSignal("key_press_event", inputKey, key_cb);
     254  GuiKeys::inputWindow->open();
    157255}
    158256 
     
    164262   \returns Nothing
    165263*/
    166 gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey)
     264gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey)
    167265{
    168266  InputKey* inputkey =(InputKey*) inputKey;
    169   char title [20];
    170 
    171   switch(event->keyval) 
     267  char title [50];
     268
     269  switch(event->keyval)
    172270    {
    173271    case GDK_Up:
    174       strcpy(title, "up");
     272      strcpy(title, "UP");
    175273      break;
    176274    case GDK_Down:
    177       strcpy(title, "down");
     275      strcpy(title, "DOWN");
    178276      break;
    179277    case GDK_Left:
    180       strcpy(title, "left");
     278      strcpy(title, "LEFT");
    181279      break;
    182280    case GDK_Right:
    183       strcpy(title, "right");
     281      strcpy(title, "RIGHT");
    184282      break;
    185283     
    186284    case GDK_space:
    187       strcpy(title, "space");
    188       break;
    189      
    190     case 65293:
    191       strcpy(title, "enter");
     285      strcpy(title, "SPACE");
     286      break;
     287     
     288    case GDK_Return:
     289      strcpy(title, "RETURN");
    192290      break;
    193291     
    194292      // Special Keys //
     293    case GDK_BackSpace:
     294      strcpy(title, "BACKSPACE");
     295      break;
     296    case GDK_Scroll_Lock:
     297      strcpy(title, "SCROLLOCK");
     298      break;
     299    case GDK_minus:
     300      strcpy(title, "MINUS");
     301      break;
     302    case GDK_plus:
     303      strcpy(title, "PLUS");
     304      break;
     305    case GDK_slash:
     306      strcpy(title, "SLASH");
     307      break;
     308    case GDK_period:
     309      strcpy(title, "PERIOD");
     310      break;
     311    case GDK_comma:
     312      strcpy(title, "COMMA");
     313      break;
     314    case GDK_colon:
     315      strcpy(title, "COLON");
     316      break;
     317    case GDK_semicolon:
     318      strcpy(title, "SEMICOLON");
     319      break;
     320    case GDK_less:
     321      strcpy(title, "LESS");
     322      break;
     323    case GDK_equal:
     324      strcpy(title, "EQUALS");
     325      break;
     326    case GDK_greater:
     327      strcpy(title, "GREATER");
     328      break;
     329    case GDK_question:
     330      strcpy(title, "QUESTION");
     331      break;
     332    case GDK_at:
     333      strcpy(title, "AT");
     334      break;
     335    case GDK_bracketleft:
     336      strcpy(title, "LEFTBRACKET");
     337      break;
     338    case GDK_bracketright:
     339      strcpy(title, "RIGHTBRACKET");
     340      break;
     341    case GDK_backslash:
     342      strcpy(title, "BACKSLASH");
     343      break;
     344    case GDK_underscore:
     345      strcpy(title, "UNDERSCORE");
     346      break;
     347    case GDK_quoteleft:
     348      strcpy(title, "BACKQUOTE");
     349      break;
     350
     351    case GDK_Page_Up:
     352      strcpy(title, "PAGEUP");
     353      break;
     354    case GDK_Page_Down:
     355      strcpy(title, "PAGEDOWN");
     356      break;
     357    case GDK_Home:
     358      strcpy(title, "HOME");
     359      break;
     360    case GDK_Insert:
     361      strcpy(title, "INSERT");
     362      break;
     363     
    195364    case GDK_Escape:
    196       strcpy(title, "esc");
     365      strcpy(title, "ESCAPE");
    197366      break;
    198367    case GDK_Tab:
    199       strcpy(title, "tab");
     368      strcpy(title, "TAB");
    200369      break;
    201370    case GDK_Shift_L:
    202       strcpy(title, "l_shift");
     371      strcpy(title, "LSHIFT");
    203372      break;
    204373    case GDK_Shift_R:
    205       strcpy(title, "r_shift");
     374      strcpy(title, "R_SHIFT");
    206375      break;
    207376    case GDK_Control_L:
    208       strcpy(title, "l_ctrl");
     377      strcpy(title, "LCTRL");
    209378      break;
    210379    case GDK_Control_R:
    211       strcpy(title, "r_ctrl");
     380      strcpy(title, "RCTRL");
    212381      break;
    213382    case GDK_Alt_L:
    214       strcpy(title, "l_alt");
     383      strcpy(title, "LALT");
    215384      break;
    216385    case GDK_Alt_R:
    217       strcpy(title, "r_alt");
     386      strcpy(title, "RALT");
    218387      break;
    219388      // FXX KEYS //
    220389    case GDK_F1:
    221       strcpy(title, "f1");
     390      strcpy(title, "F1");
    222391      break;
    223392    case GDK_F2:
    224       strcpy(title, "f2");
     393      strcpy(title, "F2");
    225394      break;
    226395    case GDK_F3:
    227       strcpy(title, "f3");
     396      strcpy(title, "F3");
    228397      break;
    229398    case GDK_F4:
    230       strcpy(title, "f4");
     399      strcpy(title, "F4");
    231400      break;
    232401    case GDK_F5:
    233       strcpy(title, "f5");
     402      strcpy(title, "F5");
    234403      break;
    235404    case GDK_F6:
    236       strcpy(title, "f6");
     405      strcpy(title, "F6");
    237406      break;
    238407    case GDK_F7:
    239       strcpy(title, "f7");
     408      strcpy(title, "F7");
    240409      break;
    241410    case GDK_F8:
    242       strcpy(title, "f8");
     411      strcpy(title, "F8");
    243412      break;
    244413    case GDK_F9:
    245       strcpy(title, "f9");
     414      strcpy(title, "F9");
    246415      break;
    247416    case GDK_F10:
    248       strcpy(title, "f10");
     417      strcpy(title, "F10");
    249418      break;
    250419    case GDK_F11:
    251       strcpy(title, "f11");
     420      strcpy(title, "F11");
    252421      break;
    253422    case GDK_F12:
    254       strcpy(title, "f12");
     423      strcpy(title, "F12");
    255424      break;
    256425     
     
    264433    }
    265434
    266   inputkey->pKeyOLabel->setValue(title);
    267   inputButton->disconnectSignal(keySignal);
    268   inputWindow->close();
    269 }
    270 #endif /* HAVE_GTK2 */
     435  inputkey->keyOLabel->setValue(title);
     436  GuiKeys::inputButton->disconnectSignal(GuiKeys::keySignal);
     437  GuiKeys::inputWindow->close();
     438}
     439#endif /* HAVE_GTK2 */
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_keys.h

    r4063 r4139  
    1515#endif /* HAVE_GTK2 */
    1616
    17 /**
    18    \brief defines the Possible Player Keys
    19 */
    20 enum KEYS {UP, DOWN, LEFT, RIGHT, SHOOT};
     17//! One KeyOption has one InputKey
     18struct InputKey
     19{
     20  Box* keyBox;           //!< One Box that holds the Keys
     21  Button* keyButton;     //!< The Button for changing the Key.
     22  OptionLabel* keyOLabel;//!< The Label for displaying the Key-setting.
     23};
    2124
    22 class Player;
    2325//! Class that creates the Keys-Options.
    2426class GuiKeys : public GuiElement
    2527{
    26  private:
    27   Frame* keysFrame;      //!< The Frame that holds the keyOptions.
    28   Box* keysBox;          //!< The Frame that holds the keyOptions.
    29   Player* player1;       //!< The first Player's keys.
    30   Player* player2;       //!< The seconds Player's keys.
    31   Button* misc;          //!< Other keyboeard options come here. \todo include some like pause, quit and so on.
    32 
    3328 public:
    3429  GuiKeys(void);
    3530  ~GuiKeys(void);
    36 };
    37 
    38 //! Class to hold infos about a Player
    39 /**
    40    \todo split into subclass and superclass ButtonConfigurator
    41 */
    42 class Player
    43 {
    44  private:
    45   Window* pKeyWindow;     //!< The Window for a new Key-setting.
    46   Frame* pKeyFrame;       //!< The Frame for a new Key-setting.
    47   Button* openButton;     //!< The OpenButton for this key-settings.
    48   Button* closeButton;    //!< The CloseButton for this key-settings.
    49   Box* pKeysBox;          //!< The Box that holds the Key-settings.
    50  
    51   //! One KeyOption has one InputKey
    52   struct InputKey
    53   {
    54     Box* pKeyBox;           //!< One Box that holds the Keys
    55     Button* pKeyButton;     //!< The Button for changing the Key.
    56     OptionLabel* pKeyOLabel;//!< The Label for displaying the Key-setting.
    57   };
    58 
    59   InputKey* inputKey[10];     //!< Buttons-array. \todo make it dynamic.
    6031
    6132  static Window* inputWindow; //!< A Window that gets keyboard clicks. Static, because only one needed.
    6233  static Button* inputButton; //!< A Button that gets keyboard clicks. Static, because only one needed.
    6334  static long keySignal;      //!< A keySignal that handles keyboard clicks. Static, because only one needed.
     35};
     36
     37//! Class to hold infos about a Player
     38class PlayerKeys
     39{
     40 private:
     41  Button* openButton;     //!< The OpenButton for this key-settings.
     42
    6443 public:
    65   Player(char* player);
    66 
    67   Widget* addKey(KEYS key, char* name);
     44  PlayerKeys(char* player);
    6845
    6946  Button* getOpenButton(void);
    70 
    71 #ifdef HAVE_GTK2
    72   static gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget);
    73   static gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey);
    74 #endif /* HAVE_GTK2 */
    75   void setkey(KEYS key);
    76  
    7747};
    7848
     49class MiscKeys
     50{
     51 private:
     52  Button* openButton;     //!< The OpenButton for this key-settings.
     53
     54 public:
     55  MiscKeys();
     56
     57  Button* getOpenButton(void); 
     58};
     59
     60Widget* addKey(const char* name, const char* defaultValue = NULL);
     61#ifdef HAVE_GTK2
     62gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget);
     63gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey);
     64#endif /* HAVE_GTK2 */
    7965
    8066
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_update.cc

    r4063 r4139  
    3737GuiUpdate::GuiUpdate(void)
    3838{
     39  FileDialog* dataDirDialog;   //!< A FileDialog for the selection of the DataRepos
     40  Button* dataDirButton;       //!< A Button for the selection of the DataRepos
     41  OptionLabel* dataDirLabel;   //!< A Label fot the selection of the DataRepos
     42 
     43
    3944  this->tmpDir = NULL;
    4045  this->homeDir = NULL;
     
    4550
    4651  this->updateFrame = new Frame("Update-Options:");
    47   this->updateFrame->setGroupName("update");
     52  this->updateFrame->setGroupName(CONFIG_SECTION_DATA);
    4853  this->updateBox = new Box('v');
     54
     55  dataDirButton = new Button(CONFIG_NAME_DATADIR);
     56  dataDirLabel = new OptionLabel(CONFIG_NAME_DATADIR, "unknown");
     57  dataDirLabel->setFlagName("data-dir", "d", 0);
     58  dataDirLabel->setDescription("Sets the location of the orxonox' Data-Directory");
     59  dataDirLabel->saveability();
     60  dataDirDialog = new FileDialog("data-Repos-location");
     61  dataDirDialog->setDefaultFileName("data");
     62  dataDirDialog->setMask(DATA_IDENTIFIER);
     63  this->checkDataDir("../data/" DATA_IDENTIFIER, dataDirLabel);
     64  dataDirDialog->disableFileOpts();
     65  dataDirDialog->setOpenUpButton(dataDirButton);
     66  //dataDirDialog->setChangeOption(dataDirLabel);
     67  dataDirDialog->setOKFunc(dataDirLabel, GuiUpdate::checkDataDir);
     68  updateBox->fill(dataDirButton);
     69  updateBox->fill(dataDirLabel);
     70
    4971#ifdef HAVE_CURL
    5072
    5173  // the Button for autoUpdating
    52   this->autoUpdate = new CheckButton("auto update");
     74  this->autoUpdate = new CheckButton(CONFIG_NAME_AUTO_UPDATE);
    5375  this->updateBox->fill(this->autoUpdate);
    5476  this->autoUpdate->setFlagName("update", "u", 0);
     77  this->autoUpdate->setDescription("Updates orxonox", "When this option is selected orxonox automatically searches for updates, and if found installs them");
    5578  this->autoUpdate->saveability();
     79
     80 
     81
    5682
    5783  this->updateSourceWindowCreate();
     
    6288
    6389#else /* HAVE_CURL */
    64   Label* noCurlLabel = new Label("since you do not have cURL,\nthis option is not availible");
     90  Label* noCurlLabel = new Label("since you do not have cURL-support,\nupdate options are not availible");
    6591  this->updateBox->fill(noCurlLabel); 
    6692#endif /* HAVE_CURL */
    6793  this->updateFrame->fill(this->updateBox);
    6894  this->setMainWidget(this->updateFrame);
     95
     96
    6997}
    7098
     
    76104
    77105}
     106
     107/**
     108   \brief checks if the Folder containing selected File is data.oxd, and if so sets it.
     109   \param
     110*/
     111bool GuiUpdate::checkDataDir(const char* fileName, void* object)
     112{
     113  if (!strcmp(fileName+(strlen(fileName)-strlen(DATA_IDENTIFIER)), DATA_IDENTIFIER))
     114    {
     115      char* tmpName = new char[strlen(fileName)-strlen(DATA_IDENTIFIER)+1];
     116      strncpy(tmpName, fileName, strlen(fileName)-strlen(DATA_IDENTIFIER));
     117      tmpName[strlen(fileName)-strlen(DATA_IDENTIFIER)] = '\0';
     118      static_cast<OptionLabel*>(object)->setValue(tmpName);
     119      delete tmpName;
     120      return true;
     121    }
     122  else
     123    return false;
     124}
     125
    78126
    79127/**
     
    82130bool GuiUpdate::getSystemInfo(void)
    83131{
    84   PRINTF(3)("Grabbing system information\n");
     132  PRINTF(5)("Grabbing system information\n");
    85133  this->tmpDir = getenv("TMPDIR");
    86134  if(!tmpDir)
    87135    this->tmpDir = "/tmp";
    88   PRINTF(4)("Temporary directory is: %s\n", this->tmpDir);
     136  PRINTF(5)("Temporary directory is: %s\n", this->tmpDir);
    89137
    90138#ifdef __WIN32__
     
    93141  this->homeDir = getenv("HOME");
    94142#endif
    95   PRINTF(4)("Home directory is %s\n", homeDir);
    96 
    97   this->installDataDir = "/usr/share/games/orxonox";
    98   PRINTF(4)("Installation of orxonox-data will go to this directory: %s\n", this->installDataDir);
     143  PRINTF(5)("Home directory is %s\n", homeDir);
     144
     145
     146  this->installDataDir = DEFAULT_DATA_DIR;
     147  PRINTF(5)("Installation of orxonox-data will go to this directory: %s\n", this->installDataDir);
    99148
    100149  this->installSourceDir = "/usr/games/bin";
    101   PRINTF(4)("Installation of orxonox-source will go to this directory: %s\n", this->installSourceDir);
     150  PRINTF(5)("Installation of orxonox-source will go to this directory: %s\n", this->installSourceDir);
    102151
    103152  this->userName = getenv("USER");
    104   PRINTF(4)("Logged in username is: %s\n", this->userName);
     153  PRINTF(5)("Logged in username is: %s\n", this->userName);
    105154}
    106155
     
    108157bool* GuiUpdate::checkForUpdates(void)
    109158{
    110   PRINTF(3)("checking for new version of orxonox\n");
     159  PRINTF(4)("checking for new version of orxonox\n");
    111160  FileInfo updateFileInfo;
    112161  updateFileInfo.fileName = "update_info";
     
    218267  dataInfo->webRoot  = "http://www.orxonox.ethz.ch/files/";
    219268  dataInfo->localRoot = "./";
    220   PRINTF(3)("Preparing to download file %s.\n", dataInfo->fileName);
     269  PRINTF(4)("Preparing to download file %s.\n", dataInfo->fileName);
    221270  downloadWithStyle(dataInfo);
    222271}
     
    284333CURL* GuiUpdate::curlHandle = NULL;
    285334
    286 /**
    287    \brief A bool parameter that shows if we are downloading.
    288 */
     335//! A bool parameter that shows if we are downloading.
    289336bool GuiUpdate::isDownloading = false;
    290337
     338//! A parameter to see, if downloading has been canceled
     339bool GuiUpdate::downloadCanceled = false;
    291340
    292341/**
     
    303352      return false;
    304353    }
    305   PRINTF(3)("Downloading.\n");
     354  PRINTF(4)("Downloading.\n");
    306355  FileInfo* info =(FileInfo*)fileInfo;
    307356  CURLcode res;
     
    351400      return false;
    352401    }
    353   PRINTF(3)("Downloading.\n");
     402  PRINTF(4)("Downloading.\n");
    354403  FileInfo* info =(FileInfo*)fileInfo;
    355404  CURLcode res;
     
    419468    curl_easy_cleanup(curlHandle);
    420469 
    421   PRINTF(3)("Closing the downloaded file.\n");
     470  PRINTF(4)("Closing the downloaded file.\n");
    422471  fclose(info->fileHandle);
    423472
     
    445494gint GuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar)
    446495{
    447   PRINTF(4)("Cannot cancle the Downloading process until after this File\n");
     496  PRINTF(3)("Cannot cancle the Downloading process until after this File\n");
    448497}
    449498#endif /* HAVE_GTK2 */
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_update.h

    r4063 r4139  
    1010#include "gui_element.h"
    1111#include "gui_gtk.h"
     12
     13
     14#define DATA_IDENTIFIER "data.oxd"
    1215
    1316#include <stdio.h>
     
    5962  static gint updateSourceFunc(GtkWidget* w, GdkEventKey* event, void* info);
    6063#endif /* HAVE_GTK2 */
     64
     65  static bool checkDataDir(const char* fileName, void* object);
    6166
    6267#ifdef HAVE_CURL
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_video.cc

    r4063 r4139  
    2727#include "gui_video.h"
    2828
     29#include "gui_gtk.h"
    2930#include "glincl.h"
    3031#include <stdlib.h>
     
    3536GuiVideo::GuiVideo(void)
    3637{
    37   this->videoFrame = new Frame("Video-Options:");
    38   this->videoBox = new Box('v');
    39   this->videoFrame->setGroupName("video");
    40  
    41   this->fullscreen = new CheckButton("Fullscreen-mode");
    42   this->fullscreen->setFlagName("windowed", "q", 1);
    43   this->fullscreen->saveability();
    44   this->videoBox->fill(this->fullscreen);
    45   this->resolution = new Menu("Resolution");
    46   this->getResolutions(this->resolution);
    47   this->resolution->saveability();
    48   this->resolution->setFlagName("resolution", "r", 0);
    49   this->videoBox->fill(this->resolution);
    50   this->wireframe = new CheckButton("WireFrame-mode");
    51   this->wireframe->setFlagName("wireframe", "w", 0);
    52   this->wireframe->saveability();
    53   this->videoBox->fill(this->wireframe);
    54 
    55   this->advancedWindowCreate();
    56   this->videoBox->fill(this->advancedWindowGetButton());
    57 
    58   this->videoFrame->fill(videoBox);
    59   this->setMainWidget(this->videoFrame);
     38  Frame* videoFrame;        //!< The Frame that holds the video options.
     39
     40  videoFrame = new Frame("Video-Options:");
     41  videoFrame->setGroupName("video");
     42  {
     43    Box* videoBox;            //!< The Box that holds the video options.
     44
     45    videoBox = new Box('v');
     46    {
     47      CheckButton* fullscreen;  //!< CheckButton for fullscreen-mode
     48      Menu* resolution;         //!< Menu for the resolution
     49      CheckButton* wireframe;   //!< CheckButton for wireframe Mode.
     50
     51      fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN);
     52      fullscreen->setFlagName("windowed", "q", 1);
     53      fullscreen->setDescription("Starts orxonox in windowed mode");
     54      fullscreen->saveability();
     55      videoBox->fill(fullscreen);
     56      resolution = new Menu(CONFIG_NAME_RESOLUTION);
     57      getResolutions(resolution);
     58      resolution->saveability();
     59      resolution->setFlagName("resolution", "r", 0);
     60      resolution->setDescription("Sets the resolution of orxonox");
     61      videoBox->fill(resolution);
     62      wireframe = new CheckButton(CONFIG_NAME_WIREFRAME);
     63      wireframe->setFlagName("wireframe", "w", 0);
     64      wireframe->setDescription("Starts orxonox in wireframe mode");
     65      wireframe->saveability();
     66      videoBox->fill(wireframe);
     67
     68      videoBox->fill(advancedWindowCreate());
     69    }
     70    videoFrame->fill(videoBox);
     71  }
     72  setMainWidget(videoFrame);
    6073}
    6174
     
    7184   \brief Creates a window, and all it contains for the Source-update.
    7285*/
    73 void GuiVideo::advancedWindowCreate(void)
    74 {
     86Widget* GuiVideo::advancedWindowCreate(void)
     87{
     88  // advanced-Performance-Options
     89  Window* advancedWindow;   //!< A Window to display advanced options.
     90  Button* advancedButton;   //!< A Button to open the Advanced Video Performance Window.
    7591  // the button, that opens this Window.
    76   this->advancedButton = new Button("advanced");
     92  advancedButton = new Button("advanced");
    7793
    7894  // the Window itself
    79   this->advancedWindow = new Window("Advanced Video Options");
    80   this->advancedWindow->setGroupName("advancedVideoOptions");
    81 
    82   this->advancedBox = new Box('v');
    83 
    84   // Advanced Performance Options
    85   this->shadows = new CheckButton("Shadows");
    86   this->shadows->saveability();
    87   this->advancedBox->fill(this->shadows);
    88 
    89   this->fog = new CheckButton("Fog");
    90   this->fog->saveability();
    91   this->advancedBox->fill(this->fog);
    92 
    93   this->reflections = new CheckButton("Reflections");
    94   this->reflections->saveability();
    95   this->advancedBox->fill(this->reflections);
    96 
    97   this->textures = new CheckButton("Textures");
    98   this->textures->saveability();
    99   this->advancedBox->fill(this->textures);
    100 
    101   this->textureDetail = new Menu("Texture Detail", "low", "medium", "high", "lastItem");
    102   this->textureDetail->setDefaultValue(1);
    103   this->textureDetail->saveability();
    104   this->advancedBox->fill(this->textureDetail);
    105 
    106   this->modelDetailLabel = new Label("Model Detail");
    107   this->advancedBox->fill(this->modelDetailLabel);
    108   this->modelDetail = new Menu("Model Detail", "low", "high", "lastItem");
    109   this->modelDetail->setDefaultValue(1);
    110   this->modelDetail->saveability();
    111   this->advancedBox->fill(this->modelDetail);
    112 
    113   this->antiAliasingLabel = new Label("Anti-Aliasing-depth:");
    114   this->advancedBox->fill(this->antiAliasingLabel);
    115   this->antiAliasing = new Menu("Anti Aliasing", "0", "1", "2", "4", "8",  "lastItem");
    116   this->antiAliasing->setDefaultValue(2);
    117   this->antiAliasing->saveability();
    118   this->advancedBox->fill(this->antiAliasing);
    119 
    120   this->filterMethodLabel = new Label("Filtering Method:");
    121   this->advancedBox->fill(this->filterMethodLabel);
    122   this->filterMethod = new Menu("Filtering Method", "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem");
    123   this->filterMethod->setDefaultValue(1);
    124   this->filterMethod->saveability();
    125   this->advancedBox->fill(this->filterMethod);
    126  
    127   this->closeButton = new Button("close");
    128   this->advancedBox->fill(this->closeButton);
    129 
    130   this->advancedWindow->fill(advancedBox);
    131 #ifdef HAVE_GTK2
    132   this->advancedButton->connectSignal("button_press_event", this->advancedWindow, Window::windowOpen);
    133   this->closeButton->connectSignal("button_press_event", this->advancedWindow, Window::windowClose);
    134   this->advancedWindow->connectSignal("destroy", this->advancedWindow, Window::windowClose);
    135   this->advancedWindow->connectSignal("delete_event", this->advancedWindow, Window::windowClose);
     95  advancedWindow = new Window("Advanced Video Options");
     96  advancedWindow->setGroupName(CONFIG_SECTION_VIDEO_ADVANCED);
     97  {
     98    Box* advancedBox;         //!< A Box to pack the options into.
     99
     100    advancedBox = new Box('v');
     101    {
     102      CheckButton* shadows;     //!< CheckButton for shadows
     103      CheckButton* fog;         //!< CheckButton for fog.
     104      CheckButton* reflections; //!< CheckButton for reflections
     105      CheckButton* textures;    //!< CheckButton for textures
     106      Menu* textureDetail;      //!< Menu for the Texture-Detail.
     107      Label* modelDetailLabel;  //!< Label for model-detail.
     108      Menu* modelDetail;        //!< model-detail.
     109      Label* antiAliasingLabel; //!< Label for the anti-aliasing mode.
     110      Menu* antiAliasing;       //!< Menu for the Antialiasing-mode.
     111      Label* filterMethodLabel; //!< Label for filtering-Method.
     112      Menu* filterMethod;       //!< Menu for filtering Method.
     113      Button* closeButton;      //!< A Button to close the Advanced-settingsWindow.
     114
     115      // Advanced Performance Options
     116      shadows = new CheckButton(CONFIG_NAME_SHADOWS);
     117      shadows->saveability();
     118      advancedBox->fill(shadows);
     119     
     120      fog = new CheckButton(CONFIG_NAME_FOG);
     121      fog->saveability();
     122      advancedBox->fill(fog);
     123     
     124      reflections = new CheckButton(CONFIG_NAME_REFLECTIONS);
     125      reflections->saveability();
     126      advancedBox->fill(reflections);
     127     
     128      textures = new CheckButton(CONFIG_NAME_TEXTURES);
     129      textures->saveability();
     130      advancedBox->fill(textures);
     131     
     132      textureDetail = new Menu(CONFIG_NAME_TEXTURE_DETAIL, "low", "medium", "high", "lastItem");
     133      textureDetail->setDefaultValue(1);
     134      textureDetail->saveability();
     135      advancedBox->fill(textureDetail);
     136     
     137      modelDetailLabel = new Label(CONFIG_NAME_MODEL_DETAIL);
     138      advancedBox->fill(modelDetailLabel);
     139      modelDetail = new Menu(CONFIG_NAME_MODEL_DETAIL, "low", "high", "lastItem");
     140      modelDetail->setDefaultValue(1);
     141      modelDetail->saveability();
     142      advancedBox->fill(modelDetail);
     143     
     144      antiAliasingLabel = new Label("Anti-Aliasing-depth:");
     145      advancedBox->fill(antiAliasingLabel);
     146      antiAliasing = new Menu(CONFIG_NAME_ANTI_ALIASING, "0", "1", "2", "4", "8",  "lastItem");
     147      antiAliasing->setDefaultValue(2);
     148      antiAliasing->saveability();
     149      advancedBox->fill(antiAliasing);
     150     
     151      filterMethodLabel = new Label("Filtering Method:");
     152      advancedBox->fill(filterMethodLabel);
     153      filterMethod = new Menu(CONFIG_NAME_FILTER_METHOD, "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem");
     154      filterMethod->setDefaultValue(1);
     155      filterMethod->saveability();
     156      advancedBox->fill(filterMethod);
     157 
     158      closeButton = new Button("close");
     159#ifdef HAVE_GTK2
     160      closeButton->connectSignal("button_press_event", advancedWindow, Window::windowClose);
    136161#endif /* HAVE_GTK2 */
    137    Window::addWindow(this->advancedWindow);
    138 
    139 }
    140 
    141 /**
    142    \returns A Pointer to the Button of the UpdaterSourceWindow
    143 */
    144 Button* GuiVideo::advancedWindowGetButton(void)
    145 {
    146   return this->advancedButton;
    147 }
    148 
     162
     163      advancedBox->fill(closeButton);
     164    }
     165    advancedWindow->fill(advancedBox);
     166  }
     167#ifdef HAVE_GTK2
     168  advancedButton->connectSignal("button_press_event", advancedWindow, Window::windowOpen);
     169  advancedWindow->connectSignal("destroy", advancedWindow, Window::windowClose);
     170  advancedWindow->connectSignal("delete_event", advancedWindow, Window::windowClose);
     171#endif /* HAVE_GTK2 */
     172  Window::addWindow(advancedWindow);
     173
     174  return advancedButton;
     175}
     176
     177/**
     178   \brief sets all resolutions to the menu
     179   \param menu the Menu to set The resolutions to.
     180*/
    149181void GuiVideo::getResolutions(Menu* menu)
    150182{
     
    170202  else{
    171203    /* Print valid modes */
    172     PRINT(4)("Available Modes\n");
     204    PRINT(5)("Available Modes\n");
    173205    for(i = 0; modes[i] ;++i)
    174206      {
    175207        if (x != modes[i]->w || y != modes[i]->h)
    176208          {
    177             PRINT(4)("  %d x %d\n", modes[i]->w, modes[i]->h);
     209            PRINTF(5)("  %d x %d\n", modes[i]->w, modes[i]->h);
    178210            sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h);
    179211            menu->addItem(tmpChar);
  • orxonox/branches/md2_loader/src/lib/gui/gui/gui_video.h

    r4063 r4139  
    88#include "gui.h"
    99#include "gui_element.h"
    10 #include "gui_gtk.h"
     10
     11// FORWARD DECLARATIONS
     12class Widget;
     13class Menu;
    1114
    1215//! Class that creates the Video-Options.
     
    1417{
    1518 private:
    16   Frame* videoFrame;        //!< The Frame that holds the video options.
    17   Box* videoBox;            //!< The Box that holds the video options.
    18   CheckButton* fullscreen;  //!< CheckButton for fullscreen-mode
    19   Menu* resolution;         //!< Menu for the resolution
    20   CheckButton* wireframe;   //!< CheckButton for wireframe Mode.
    21 
    22   // advanced-Performance-Options
    23   Window* advancedWindow;   //!< A Window to display advanced options.
    24   Button* advancedButton;   //!< A Button to open the Advanced Video Performance Window.
    25   Box* advancedBox;         //!< A Box to pack the options into.
    26   CheckButton* shadows;     //!< CheckButton for shadows
    27   CheckButton* fog;         //!< CheckButton for fog.
    28   CheckButton* reflections; //!< CheckButton for reflections
    29   CheckButton* textures;    //!< CheckButton for textures
    30   Menu* textureDetail;      //!< Menu for the Texture-Detail.
    31  
    32   Label* modelDetailLabel;  //!< Label for model-detail.
    33   Menu* modelDetail;        //!< model-detail.
    34  
    35   Label* antiAliasingLabel; //!< Label for the anti-aliasing mode.
    36   Menu* antiAliasing;       //!< Menu for the Antialiasing-mode.
    37 
    38   Label* filterMethodLabel; //!< Label for filtering-Method.
    39   Menu* filterMethod;       //!< Menu for filtering Method.
    40 
    41   Button* closeButton;      //!< A Button to close the Advanced-settingsWindow.
    42 
    43   Button* advancedWindowGetButton(void);
    44   void advancedWindowCreate(void);
     19  //  Button* advancedWindowGetButton(void);
    4520 
    4621 public:
     
    4823  ~GuiVideo(void);
    4924
     25 private:
    5026  void getResolutions(Menu* menu);
    51  
    52 
     27  Widget* advancedWindowCreate(void);
    5328};
    5429#endif /* _GUI_VIDEO_H */
  • orxonox/branches/md2_loader/src/lib/gui/gui/rc

    r4063 r4139  
     1/*
     2 * style <name> [= <name>]
     3 * {
     4 *   <option>
     5 * }
     6 *
     7 * widget <widget_set> style <style_name>
     8 * widget_class <widget_class_set> style <style_name>
     9 *
     10 * Here is a list of all the possible states.  Note that some do not apply to
     11 * certain widgets.
     12 *
     13 * NORMAL - The normal state of a widget, without the mouse over top of
     14 * it, and not being pressed, etc.
     15 *
     16 * PRELIGHT - When the mouse is over top of the widget, colors defined
     17 * using this state will be in effect.
     18 *
     19 * ACTIVE - When the widget is pressed or clicked it will be active, and
     20 * the attributes assigned by this tag will be in effect.
     21 *
     22 * INSENSITIVE - When a widget is set insensitive, and cannot be
     23 * activated, it will take these attributes.
     24 *
     25 * SELECTED - When an object is selected, it takes these attributes.
     26 *
     27 * Given these states, we can set the attributes of the widgets in each of
     28 * these states using the following directives.
     29 *
     30 * fg - Sets the foreground color of a widget.
     31 * bg - Sets the background color of a widget.
     32 * bg_pixmap - Sets the background of a widget to a tiled pixmap.
     33 * base - Sets the base of Widgets
     34 * font - Sets the font to be used with the given widget.
     35*/
     36
     37
     38
    139static const gchar* rc_string =
    2 (       
     40(
     41"style'orxonox'"
     42"{"
     43"fg[NORMAL]      = { 0.0, 1.0, 0.0 }"
     44"fg[PRELIGHT]    = { 0.0, 1.0, 0.0 }"
     45"fg[ACTIVE]      = { 0.0, 1.0, 0.0 }"
     46"fg[INSENSITIVE] = { 0.0, 0.8, 0.0 }"
     47"fg[SELECTED]    = { 0.0, 1.0, 0.0 }"
     48
     49"bg[NORMAL]      = { 0.0, 0.0, 0.0 }"
     50"bg[PRELIGHT]    = { 0.0, 1.0, 0.0 }"
     51"bg[ACTIVE]      = { 0.0, 0.3, 0.0 }"
     52"bg[INSENSITIVE] = { 0.0, 0.1, 0.0 }"
     53"bg[SELECTED]    = { 0.0, 0.1, 0.0 }"
     54
     55"base[NORMAL]      = { 0.0, 1.0, 0.0 }"
     56"base[PRELIGHT]    = { 0.0, 1.0, 0.0 }"
     57"base[ACTIVE]      = { 0.0, 1.0, 0.0 }"
     58"base[INSENSITIVE] = { 0.0, 1.0, 0.0 }"
     59"base[SELECTED]    = { 0.0, 1.0, 0.0 }"
     60
     61"font              = '-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*'"
     62"}"
     63
    364"style'window'"
    465"{"                     
     
    768"base[NORMAL] = { 0, 0, 0 }"
    869"base[INSENSITIVE] = { 0, 0, 0 }"
     70"}"
     71
     72"style'frame'"
     73"{"
     74"bg[NORMAL]  = { 0.0, 0.4, 0.0 }"
    975"}"
    1076
     
    2692"bg[NORMAL] = { 0, 0, 0 }"
    2793"fg[NORMAL] = { 0, 1.0, 0 }"
    28 "bg[INSENSITIVE] = { 1.0, 0, 1.0 }"
    29 "fg[INSENSITIVE] = { 1.0, 0, 1.0 }"
     94"bg[INSENSITIVE] = { 0.0, 0.2, 0.0 }"
     95"fg[INSENSITIVE] = { 0.0, 0.8, 0.0 }"
    3096"base[NORMAL] = { 0, 1.0, 0 }"
    3197"base[PRELIGHT] = { 0, 1.0, 0 }"
     
    55121"}"
    56122
     123"widget'Gtk*'                   style'orxonox'"
     124"widget'*Gtk*Frame*'              style'frame'"
    57125"widget'GtkWindow'              style'window'"
    58 "widget'GtkFrame'               style'window'"
    59 "widget'Gtk*EventBox'           style'window'"
    60 "widget'GtkDialog'              style'window'"
    61126"widget'GtkFileSelection'       style'window'"
    62127"widget'*Gtk*Scale'             style'scale'"
  • orxonox/branches/md2_loader/src/lib/util/ini_parser.cc

    r4063 r4139  
    1616
    1717#include "ini_parser.h"
     18#include "resource_manager.h"
    1819
    1920using namespace std;
    2021
    2122/**
    22         \brief constructs an IniParser using a file
    23         \param filename: the path and name of the file to parse
     23   \brief constructs an IniParser using a file
     24   \param filename: the path and name of the file to parse
    2425*/
    2526IniParser::IniParser (const char* filename)
     
    2728  stream = NULL;
    2829  bInSection = false;
    29   openFile(filename);
     30  this->openFile(filename);
    3031}
    3132
    3233/**
    33         \brief removes the IniParser from memory
     34   \brief removes the IniParser from memory
    3435*/
    3536IniParser::~IniParser ()
     
    4546int IniParser::openFile(const char* filename)
    4647{
     48  char* tmpName = ResourceManager::homeDirCheck(filename);
    4749  if( filename == NULL) return -1;
    4850  if( stream != NULL)   fclose (stream);
    49   if( (stream = fopen (filename, "r")) == NULL)
     51  if( (stream = fopen (tmpName, "r")) == NULL)
    5052    {
    51       printf("IniParser could not open %s\n", filename);
     53      PRINTF(1)("IniParser could not open %s\n", filename);
     54      delete tmpName;
    5255      return -1;
    5356    }
    5457  bInSection = false;
     58  delete tmpName;
    5559  return 0;
    5660}
     
    123127          return -1;
    124128        }
    125       if( (ptr = strchr( linebuffer, '=')) != NULL)
     129      sscanf(linebuffer, "%s = %s", name, value);
     130      return 0;
     131      /*
     132        if( (ptr = strchr( tmpBuffer, '=')) != NULL)
    126133        {
    127           if( ptr == linebuffer) continue;
    128           strcpy (value, &ptr[1]);
    129           strncpy (name, linebuffer, strlen (linebuffer) - strlen (value) - 1);
    130           return 0;
     134        if( ptr == linebuffer) continue;
     135        strcpy (value, &ptr[1]);
     136        strncpy (name, linebuffer, strlen (linebuffer) - strlen (value) - 1);
     137        printf ("%s, %s\n", value, name);
     138        return 0;
    131139        }
     140      */
    132141    }
    133142  return -1;   
  • orxonox/branches/md2_loader/src/orxonox.cc

    r4072 r4139  
    3232#include "data_tank.h"
    3333#include "command_node.h"
     34#include "ini_parser.h"
    3435#include "game_loader.h"
    3536#include "graphics_engine.h"
     
    3738#include "text_engine.h"
    3839#include "factory.h"
     40#include "benchmark.h"
    3941
    4042#include <string.h>
     
    4648/**
    4749   \brief create a new Orxonox
     50
     51   In this funcitons only global values are set. The game will not be started here.
    4852*/
    4953Orxonox::Orxonox ()
     
    5458  this->resources = NULL;
    5559  this->localinput = NULL;
     60
     61  this->argc = 0;
     62  this->argv = NULL;
    5663}
    5764
     
    93100void Orxonox::getConfigFile (int argc, char** argv)
    94101{
    95   strcpy (configfilename, "orxonox.conf");
     102  strcpy (configfilename, "~/.orxonox/orxonox.conf");
    96103}
    97104
     
    101108int Orxonox::init (int argc, char** argv)
    102109{
     110  this->argc = argc;
     111  this->argv = argv;
    103112  // parse command line
    104113  // config file
     
    107116  SDL_Init (SDL_INIT_TIMER);
    108117  // initialize everything
     118  printf("> Initializing resources\n");
     119  if( initResources () == -1) return -1;
     120
    109121  if( initVideo() == -1) return -1;
    110122  if( initSound() == -1) return -1;
     
    113125  printf("> Initializing networking\n");
    114126  if( initNetworking () == -1) return -1;
    115   printf("> Initializing resources\n");
    116   if( initResources () == -1) return -1;
    117127  //printf("> Initializing world\n");
    118128  //if( init_world () == -1) return -1; PB: world will be initialized when started
     
    129139 
    130140  GraphicsEngine::getInstance();
    131  
     141   
    132142  return 0;
    133143}
     
    152162{
    153163  // create localinput
    154   localinput = new CommandNode( configfilename);
     164  localinput = new CommandNode(configfilename);
    155165 
    156166  return 0;
     
    173183int Orxonox::initResources()
    174184{
    175   //  printf("Not yet implemented\n");
    176185  PRINT(3)("initializing ResourceManager\n");
    177186  resourceManager = ResourceManager::getInstance();
    178   if (!resourceManager->setDataDir("../data/"))
    179     {
    180       PRINTF(1)("Data Could not be located\n");
     187
     188  // create parser
     189  IniParser parser (DEFAULT_CONFIG_FILE);
     190  if( parser.getSection (CONFIG_SECTION_DATA) == -1)
     191    {
     192      PRINTF(1)("Could not find Section %s in %s\n", CONFIG_SECTION_DATA, DEFAULT_CONFIG_FILE);
     193      return -1;
     194    }
     195  char namebuf[256];
     196  char valuebuf[256];
     197  memset (namebuf, 0, 256);
     198  memset (valuebuf, 0, 256);
     199 
     200  while( parser.nextVar (namebuf, valuebuf) != -1)
     201    {
     202      if (!strcmp(namebuf, CONFIG_NAME_DATADIR))
     203        {
     204          //  printf("Not yet implemented\n");
     205          if (!resourceManager->setDataDir(valuebuf))
     206            {
     207              PRINTF(1)("Data Could not be located\n");
     208              exit(-1);
     209            }
     210        }
     211     
     212      memset (namebuf, 0, 256);
     213      memset (valuebuf, 0, 256);
     214    }
     215 
     216  if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
     217    {
     218      PRINTF(1)("The DataDirectory %s could not be verified\nPlease Change in File %s Section %s Entry %s to a suitable value\n",
     219                resourceManager->getDataDir(),
     220                DEFAULT_CONFIG_FILE,
     221                CONFIG_SECTION_DATA,
     222                CONFIG_NAME_DATADIR);
    181223      exit(-1);
    182224    }
     225
    183226
    184227  PRINT(3)("initializing TextEngine\n");
    185228  TextEngine::getInstance();
     229
     230  return 0;
    186231}
    187232
     
    213258 
    214259  this->gameLoader = GameLoader::getInstance();
    215   this->gameLoader->loadCampaign("../data/worlds/DefaultCampaign.oxc");
     260  this->gameLoader->loadCampaign("worlds/DefaultCampaign.oxc");
    216261  //  this->gameLoader->loadDebugCampaign(DEBUG_CAMPAIGN_0);
    217262  this->gameLoader->init();
     
    301346*/
    302347int main(int argc, char** argv)
    303 
    304  
    305   /* reading arguments
    306      
    307      currently supported arguments are:
    308      <no args>                   ::    just starts orxonox
    309      --benchmark                 ::    start the benchmark without starting orxonox
    310      
    311      this is a preselection: it matches to one of the start* functions, the
    312      finetuning is made in those functions.
    313   */
    314 
    315   printf("++INFO++++++++++++++++++++++++++++++++++++++++++++++++\n");
     348{
     349
    316350  printf("+ This version of orxonox is for testing purposes    +\n");
    317351  printf("+ In order to run it, you will need some files for   +\n");
     
    326360  for(i = 1; i < argc; ++i)
    327361    {
    328       if(! strcmp( "--help", argv[i])) return startHelp();
    329       else if(! strcmp( "--benchmark", argv[i])) return startBenchmarks();
    330       else if(! strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) showGui = true;
    331       else PRINTF(2)("Orxonox does not understand the arguments %s\n", argv[i]);
     362      if(! strcmp( "--help", argv[i]) || !strcmp("-h", argv[i])) return startHelp(argc, argv);
     363      else if(!strcmp( "--benchmark", argv[i]) || !strcmp("-b", argv[i])) return startBenchmarks();
     364      else if(!strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) showGui = true;
     365      //      else PRINTF(2)("Orxonox does not understand the arguments %s\n", argv[i]);
    332366    }
    333367
     
    337371
    338372
    339 int startHelp()
     373int startHelp(int argc, char** argv)
    340374{
    341375  PRINT(0)("orxonox: starts the orxonox game - rules\n");
    342   PRINT(0)("usage: orxonox [arg]\n\n");
     376  PRINT(0)("usage: orxonox [arg [arg...]]\n\n");
    343377  PRINT(0)("valid options:\n");
    344   PRINT(0)(" --benchmark\tstarts the orxonox benchmark\n");
    345   PRINT(0)(" --help \tshows this menu\n");
    346   PRINT(0)(" --gui/-g \tDisplays the Gui on startup\n");
     378  {
     379    Gui* gui = new Gui(argc, argv);
     380    gui->printHelp();
     381    delete gui;
     382  }
     383  PRINT(0)(" -b|--benchmark:\t\tstarts the orxonox benchmark\n");
     384  PRINT(0)(" -h|--help:\t\t\tshows this help\n");
    347385}
    348386
     
    357395      if (ResourceManager::isFile("~/.orxonox/orxonox.lock"))
    358396        ResourceManager::deleteFile("~/.orxonox/orxonox.lock");
    359       //      char* guiExec = new char[strlen(argv[0])+20];
    360       //      sprintf(guiExec,"%sGui --gui", argv[0]);
     397     
     398      // starting the GUI
    361399      Gui* gui = new Gui(argc, argv);
     400      gui->startGui();
     401
    362402      if (! gui->startOrxonox)
    363403        return 0;
     
    384424 
    385425}
    386 
    387 #if defined __linux__
    388 
    389 #include "list.h"
    390 #include "world_entity.h"
    391 #include "vector.h"
    392 #include "player.h"
    393 #include "base_object.h"
    394 
    395 #include <asm/msr.h>
    396 #include <linux/timex.h>
    397 
    398 
    399 #define LIST_MAX 1000
    400 #define VECTOR_MAX 1000000
    401 #define ITERATIONS 10000
    402 
    403 
    404 int startBenchmarks()
    405 {
    406 
    407   printf("===========================================================\n");
    408   printf("=                      BENCHMARKS                         =\n");
    409   printf("===========================================================\n");
    410   printf(" the author is not paying any attention to cacheing effects\n");
    411   printf(" of the CPU.\n\n");
    412   printf("[title]\t\t\t\t\t     [cycles]\t[loops]\n\n");
    413   //  printf("------------------------------------------------------------\n\n");
    414 
    415   // first measure the time overhead:
    416   unsigned long ini, end, dt, tmp;
    417   rdtscl(ini); rdtscl(end);
    418   dt = end - ini;
    419 
    420   int type = -1;
    421   /* type   -1 == all
    422      type    0 == framework
    423      type    1 == vector
    424      type    2 == quaternion
    425      type    3 == lists
    426   */
    427   if(type == 0 || type == -1)
    428     {
    429       /* framework test*/
    430      
    431       printf("Generating Objects:\t\t\t\t\t%i\n", ITERATIONS);
    432       /* ************WorldEntity class test************** */
    433       WorldEntity* w = NULL;
    434       int i = 0;
    435       unsigned long mittel = 0;
    436      
    437       for(i = 0; i < ITERATIONS; ++i)
    438         {
    439           rdtscl(ini);
    440          
    441           WorldEntity* w = new WorldEntity();
    442          
    443           rdtscl(end);
    444           delete w;
    445           mittel += (end - ini - dt);
    446         }
    447       float mi = mittel / (float)ITERATIONS;
    448       printf(" Generate a WorldEntity object:\t\t%11.2f\n", mi);
    449      
    450       /*
    451         mittel = 0;
    452         for(i = 0; i < ITERATIONS; ++i)
    453         {
    454         rdtscl(ini);
    455        
    456         WorldEntity* w = new Primitive(P_SPHERE);
    457        
    458         rdtscl(end);
    459         delete w;
    460         mittel += (end - ini - dt);
    461         }
    462         mi = mittel / (float)ITERATIONS;
    463         printf(" Generate a Primitive  object:\t\t%11.2f\n", mi);
    464       */
    465 
    466       mittel = 0;
    467       for(i = 0; i < ITERATIONS; ++i)
    468         {
    469           rdtscl(ini);
    470          
    471           Vector* v = new Vector();
    472          
    473           rdtscl(end);
    474           delete v;
    475           mittel += (end - ini - dt);
    476         }
    477       mi = mittel / (float)ITERATIONS;
    478       printf(" Generate a Vector object:\t\t%11.2f\n", mi);
    479 
    480 
    481      mittel = 0;
    482       for(i = 0; i < ITERATIONS; ++i)
    483         {
    484           rdtscl(ini);
    485          
    486           Quaternion* q = new Quaternion();
    487          
    488           rdtscl(end);
    489           delete q;
    490           mittel += (end - ini - dt);
    491         }
    492       mi = mittel / (float)ITERATIONS;
    493       printf(" Generate a Quaternion object:\t\t%11.2f\n", mi);
    494 
    495 
    496 
    497 
    498       printf("\nCalling function inline &| virtual, \t\t\t%i\n", ITERATIONS);
    499       mittel = 0;
    500       w = new WorldEntity();
    501       for(i = 0; i < ITERATIONS; ++i)
    502         {
    503           rdtscl(ini);
    504          
    505           w->tick(0.0f);
    506 
    507           rdtscl(end);
    508           mittel += (end - ini - dt);
    509           }
    510       //delete w;
    511       mi = mittel / (float)ITERATIONS;
    512       printf(" Virt funct tick() of WE: \t\t%11.2f\n", mi);
    513 
    514 
    515       mittel = 0;
    516       WorldEntity wo;
    517       for(i = 0; i < ITERATIONS; ++i)
    518         {
    519           rdtscl(ini);
    520          
    521           wo.tick(0.0f);
    522            
    523           rdtscl(end);
    524           mittel += (end - ini - dt);
    525           }
    526       //delete w;
    527       mi = mittel / (float)ITERATIONS;
    528       printf(" Inl virt funct tick() of WE v2: \t%11.2f\n", mi);
    529 
    530      
    531       mittel = 0;
    532       BaseObject* bo = new BaseObject();
    533       for(i = 0; i < ITERATIONS; ++i)
    534         {
    535           rdtscl(ini);
    536          
    537           bo->isFinalized();
    538            
    539           rdtscl(end);
    540           mittel += (end - ini - dt);
    541           }
    542       //delete w;
    543       mi = mittel / (float)ITERATIONS;
    544       printf(" Inl funct BaseObject::isFinazlized(): \t%11.2f\n", mi);
    545 
    546      
    547       tList<WorldEntity>* list = new tList<WorldEntity>();
    548 
    549      
    550       /* ************Primitvie class test************** */
    551       list = new tList<WorldEntity>();
    552  
    553      
    554       /*
    555         mittel = 0;
    556         w = new Primitive(P_SPHERE);
    557         for(i = 0; i < ITERATIONS; ++i)
    558         {
    559         rdtscl(ini);
    560        
    561         w->tick(0.0f);
    562        
    563         rdtscl(end);
    564         mittel += (end - ini - dt);
    565         }
    566         mi = mittel / (float)ITERATIONS;
    567         printf(" Call function tick() of Prim:\t\t%11.2f\n", mi);
    568       */
    569      
    570     }
    571  
    572   if(type == 1 || type == -1)
    573     {
    574       printf("\nDoing some simple vector operations: \t\t\t%i\n", VECTOR_MAX);
    575       /* vector test */
    576       Vector* a = new Vector(1.3, 5.3, 4.1);
    577       Vector* b = new Vector(0.4, 2.5, 6.2);
    578       Vector* c = new Vector();
    579      
    580       unsigned long mittel, ini, end;
    581       float mi;
    582       int i = 0;
    583       // addition
    584       mittel = 0;
    585       for(i = 0; i < VECTOR_MAX; ++i)
    586         {
    587           rdtscl(ini);
    588          
    589           *c = *a + *b;
    590            
    591           rdtscl(end);
    592           mittel += (end - ini - dt);
    593         }
    594       mi = mittel / (float)VECTOR_MAX;
    595       printf(" Addition of two vectors:\t\t%11.2f\n", mi);
    596      
    597       // multiplikation
    598 
    599       mittel = 0;
    600       for(i = 0; i < VECTOR_MAX; ++i)
    601         {
    602           rdtscl(ini);
    603          
    604           *c = a->cross( *b);
    605            
    606           rdtscl(end);
    607           mittel += (end - ini - dt);
    608         }
    609       mi = mittel / (float)VECTOR_MAX;
    610       printf(" CrossMult of two vectors:\t\t%11.2f\n", mi);
    611 
    612     }
    613   if( type == 2 || type == -1)
    614     {
    615       /* quaternion test */
    616       printf("\nDoing some simple quaternion operations: \t\t%i\n", VECTOR_MAX);
    617       /* vector test */
    618       Quaternion* a = new Quaternion();
    619       Quaternion* b = new Quaternion();
    620       Quaternion* c = new Quaternion();
    621      
    622       unsigned long mittel, ini, end;
    623       float mi;
    624       int i = 0;
    625       // quaternion generieren mit spez konstruktor
    626       mittel = 0;
    627       Vector* qa = new Vector(4.6, 9.3, 0.4);
    628       Vector* qb = new Vector(3.5, 6.1, 4.3);
    629       for(i = 0; i < VECTOR_MAX; ++i)
    630         {
    631           rdtscl(ini);
    632          
    633           Quaternion* qu = new Quaternion(*qa, *qb);
    634          
    635           rdtscl(end);
    636           delete qu;
    637           mittel += (end - ini - dt);
    638         }
    639       delete a;
    640       delete b;
    641       mi = mittel / (float)VECTOR_MAX;
    642       printf(" Gen. quatern. betw. two vectors:\t%11.2f\n", mi);
    643      
    644      
    645       // multiplication
    646       mittel = 0;
    647       for(i = 0; i < VECTOR_MAX; ++i)
    648         {
    649           rdtscl(ini);
    650          
    651           *c = *a * *b;
    652          
    653           rdtscl(end);
    654           mittel += (end - ini - dt);
    655         }
    656       mi = mittel / (float)VECTOR_MAX;
    657       printf(" Multiplying two quat.(=rot): a * b\t%11.2f\n", mi);
    658      
    659      
    660      
    661       // rotating a vector by a quaternion
    662       mittel = 0;
    663       for(i = 0; i < VECTOR_MAX; ++i)
    664         {
    665           rdtscl(ini);
    666          
    667           *qa = a->apply(*qb);
    668          
    669           rdtscl(end);
    670           mittel += (end - ini - dt);
    671         }
    672       mi = mittel / (float)VECTOR_MAX;
    673       printf(" Rot a vec by a quat: q->apply(v)\t%11.2f\n", mi);
    674      
    675      
    676      
    677       // generate rotation matrix
    678       mittel = 0;
    679       float matrix[4][4];
    680       for(i = 0; i < VECTOR_MAX; ++i)
    681         {
    682           rdtscl(ini);
    683          
    684           a->matrix(matrix);
    685          
    686           rdtscl(end);
    687           mittel += (end - ini - dt);
    688         }
    689       mi = mittel / (float)VECTOR_MAX;
    690       printf(" Generate rot matrix: q->matrix(m)\t%11.2f\n", mi);
    691     }
    692   if( type == 3 || type == -1)
    693     {
    694       /* list tests*/
    695       printf("\nList operations tests: \t\t\t\t\t%i\n", LIST_MAX);
    696       tList<char>* list = new tList<char>();
    697       char* name;
    698      
    699       printf(" Adding[1..10] elements to list, found:\n");
    700       list->add("1");
    701       list->add("2");
    702       list->add("3");
    703       list->add("4");
    704       list->add("5");
    705       list->add("6");
    706       list->add("7");
    707       list->add("8");
    708       list->add("9");
    709       list->add("10");
    710      
    711       /*give list out */
    712       tIterator<char>* iterator = list->getIterator();
    713       name = iterator->nextElement();
    714       printf("  List Elements: \t\t");
    715       while( name != NULL)
    716         {
    717           printf("%s,", name);
    718           name = iterator->nextElement();
    719         }
    720       delete iterator;
    721       printf("\n");
    722      
    723      
    724       /*removing some elements from the list*/
    725       printf(" Removing elements [2,3,6,8,10], adding [11] now found:\n");
    726       list->remove("2");
    727       list->remove("3");
    728       list->remove("6");
    729       list->remove("8");
    730       list->remove("10");
    731       list->add("11");
    732       /*give list out */
    733       iterator = list->getIterator();
    734       name = iterator->nextElement();
    735       printf("  List Elements: \t\t");
    736       while( name != NULL)
    737         {
    738           printf("%s,", name);
    739           name = iterator->nextElement();
    740         }
    741       delete iterator;
    742       printf("\n");
    743      
    744       delete list;
    745       printf("\nChecking list performance:\t\t\t\t%i\n", LIST_MAX);
    746      
    747       tList<int>* plist = new tList<int>();
    748       unsigned long mittel, ini, end;
    749       float mi;
    750       int i = 0;
    751       mittel = 0;
    752       for(i = 0; i < LIST_MAX; ++i)
    753         {
    754           rdtscl(ini);
    755          
    756           plist->add(&i);
    757          
    758           rdtscl(end);
    759           mittel += (end - ini - dt);
    760         }
    761       mi = mittel / (float)LIST_MAX;
    762       printf(" Adding reference to list:\t\t%11.2f\n", mi);
    763      
    764       mittel = 0;
    765       for(i = 0; i < LIST_MAX; ++i)
    766         {
    767           rdtscl(ini);
    768          
    769           plist->remove(&i);
    770          
    771           rdtscl(end);
    772           mittel += (end - ini - dt);
    773         }
    774       mi = mittel / (float)LIST_MAX;
    775       printf(" Removing 1st reference from list:\t%11.2f\n", mi);
    776      
    777 
    778       printf("\nList operations tests: \t\t\t\t\t%i\n", LIST_MAX);
    779       list = new tList<char>();
    780       printf(" Adding[1..10] elements to list, found:\n");
    781       list->add("1");
    782       list->add("2");
    783       list->add("3");
    784       list->add("4");
    785       list->add("5");
    786       list->add("6");
    787       list->add("7");
    788       list->add("8");
    789       list->add("9");
    790       list->add("10");
    791      
    792       /*give list out */
    793       iterator = list->getIterator();
    794       name = iterator->nextElement();
    795       printf("  List Elements: \t\t");
    796       while( name != NULL)
    797         {
    798           printf("%s,", name);
    799           name = iterator->nextElement();
    800         }
    801       delete iterator;
    802       printf("\n");
    803      
    804      
    805       int c = 0;
    806       printf(" Going trough list with nextElement(el) func: ");
    807       name = list->firstElement();
    808       while(c < 20)
    809         {
    810           printf("%s,", name);
    811           name = list->nextElement(name);
    812           c++;
    813         }
    814       printf("\n");
    815      
    816 
    817      
    818     }
    819  
    820 }
    821 
    822 #else
    823 
    824 int startBenchmarks()
    825 {
    826   PRINTF(1)("Benchmark is not implemented in this system\n");
    827 }
    828 
    829 #endif
  • orxonox/branches/md2_loader/src/orxonox.h

    r3660 r4139  
    3939  Uint32 lastframe;           //!< Time of the last Frame
    4040 
     41  unsigned int argc;          //!< Count of Arguments of orxonox
     42  char** argv;                //!< Values of th Arguments of orxonox.
     43 
    4144  void getConfigFile (int argc, char** argv);
    4245 
    43   // main loop functions
    44   //  void synchronize ();
    45   //void handle_input ();
    46   //void time_slice ();
    47   //void collision ();
    48   //void display ();
    49  
    50         // subsystem initialization
     46  // subsystem initialization
    5147  int initVideo ();
    5248  int initSound ();
     
    7571};
    7672
    77 int startHelp(void);
     73int startHelp(int argc, char** argv);
    7874int startOrxonox(int argc, char** argv);
    79 int startBenchmarks(void);
    8075
    8176#endif /* _ORXONOX_H */
  • orxonox/branches/md2_loader/src/story_entities/campaign.cc

    r4010 r4139  
    4141  int id;
    4242 
    43   PRINTF0("Loading Campaign...\n");
     43  PRINTF(3)("Loading Campaign...\n");
    4444 
    4545  assert( root != NULL);
     
    5353  if( string == NULL || sscanf(string, "%d", &id) != 1)
    5454    {
    55       PRINTF0("Campaign is missing a proper 'identifier'\n");
     55      PRINTF(2)("Campaign is missing a proper 'identifier'\n");
    5656      this->setStoryID( -1);
    5757    }
     
    6262  if( element == NULL)
    6363    {
    64       PRINTF0("Campaign is missing a proper 'WorldList'\n");
     64      PRINTF(2)("Campaign is missing a proper 'WorldList'\n");
    6565    }
    6666  else
  • orxonox/branches/md2_loader/src/story_entities/world.cc

    r4138 r4139  
    124124{
    125125  this->constuctorInit("", -1);
    126 
     126  this->path = NULL;
    127127  const char *string;
    128128  char *name;
     
    172172World::World (char* name)
    173173{
     174  this->path = NULL;
    174175  this->constuctorInit(name, -1);
    175176  //NullParent* np = NullParent::getInstance();
     
    182183World::World (int worldID)
    183184{
     185  this->path = NULL;
    184186  this->constuctorInit(NULL, worldID);
    185187}
     
    198200  cn->reset();
    199201
    200   //ResourceManager::getInstance()->debug();
    201202  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
    202   //ResourceManager::getInstance()->debug();
    203 
    204203  delete WorldInterface::getInstance();
    205 
    206204  delete this->nullParent;
    207205  delete this->entities;
     
    209207  delete this->trackManager;
    210208  TextEngine::getInstance()->flush();
    211 
    212   //AnimationPlayer::getInstance()->debug();
    213209  delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence.
    214   //delete garbagecollecor
    215   //delete animator
    216 
    217 
     210  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
    218211}
    219212
     
    271264ErrorMessage World::load()
    272265{       
    273   PRINTF0("> Loading world: '%s'\n", getPath());
    274  
     266  PRINTF(3)("> Loading world: '%s'\n", getPath());
     267  TiXmlElement* element;
    275268  GameLoader* loader = GameLoader::getInstance();
    276269 
    277270  if( getPath() == NULL)
    278271    {
    279       PRINTF0("World has no path specified for loading");
     272      PRINTF(1)("World has no path specified for loading");
    280273      return (ErrorMessage){213,"Path not specified","World::load()"};
    281274    }
     
    283276  TiXmlDocument* XMLDoc = new TiXmlDocument( path);
    284277  // load the campaign document
    285   if( !XMLDoc->LoadFile())
    286     //this->glmis->step();
    287  
     278  if( !XMLDoc->LoadFile()) 
    288279  {
    289280    // report an error
    290     PRINTF0("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     281    PRINTF(1)("loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
    291282    delete XMLDoc;
    292283    return (ErrorMessage){213,"XML File parsing error","World::load()"};
     
    300291    {
    301292      // report an error
    302       PRINTF0("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
     293      PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
    303294      delete XMLDoc;
    304295      return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"};
     
    311302  if( string == NULL)
    312303    {
    313       PRINTF0("World is missing a proper 'name'\n");
     304      PRINTF(2)("World is missing a proper 'name'\n");
    314305      string = "Unknown";
    315306      temp = new char[strlen(string + 2)];
     
    323314      this->worldName = temp;
    324315    }
    325  
    326  
     316  ////////////////
     317  // LOADSCREEN //
     318  ////////////////
     319  element = root->FirstChildElement("LoadScreen");
     320  if (element == NULL)
     321    {
     322      PRINTF(2)("no LoadScreen specified, loading default\n");
     323
     324      glmis->setBackgroundImage("pictures/load_screen.jpg");
     325      this->glmis->setMaximum(8);
     326      this->glmis->draw();
     327    }
     328  else
     329    {
     330      this->glmis->load(element);
     331      this->glmis->draw();
     332    }
     333  this->glmis->draw();
    327334  // find WorldEntities
    328   TiXmlElement* element = root->FirstChildElement( "WorldEntities");
     335  element = root->FirstChildElement("WorldEntities");
    329336 
    330337  if( element == NULL)
    331338    {
    332       PRINTF0("World is missing 'WorldEntities'\n");
     339      PRINTF(1)("World is missing 'WorldEntities'\n");
    333340    }
    334341  else
     
    336343      element = element->FirstChildElement();
    337344      // load Players/Objects/Whatever
    338       PRINTF0("Loading WorldEntities\n");
     345      PRINTF(4)("Loading WorldEntities\n");
    339346      while( element != NULL)
    340347        {
     
    346353          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created;
    347354          element = element->NextSiblingElement();
     355          glmis->step(); //! \todo temporary
    348356        }
    349       PRINTF0("Done loading WorldEntities\n");
     357      PRINTF(4)("Done loading WorldEntities\n");
    350358    }
    351359 
     
    458466  tn->addChild(this->localCamera);
    459467  localCamera->lookAt(tn);
     468  localCamera->setMode(PNODE_MOVEMENT);
    460469  this->localPlayer->setMode(PNODE_ALL);
    461470  Vector* cameraOffset = new Vector (0, 5, -10);
     
    472481  glEndList();
    473482
    474   terrain = new Terrain("../data/worlds/newGround.obj");
     483  terrain = new Terrain("worlds/newGround.obj");
    475484  terrain->setRelCoor(Vector(0,-10,0));
    476485  this->spawn(terrain);
     
    604613
    605614        // Create SkySphere
    606         sky = new Skysphere("../data/pictures/sky-replace.jpg");
     615        sky = new Skysphere("pictures/sky-replace.jpg");
    607616        this->localPlayer->addChild(this->sky);
    608617        this->spawn(this->sky);
     
    649658
    650659        // Create SkySphere
    651         this->sky = new Skysphere("../data/pictures/sky-replace.jpg");
     660        this->sky = new Skysphere("pictures/sky-replace.jpg");
    652661        this->sky->setName("SkySphere");
    653662        this->spawn(this->sky);
     
    838847 
    839848  //GLMenuImageScreen*
    840   this->glmis = GLMenuImageScreen::getInstance();
     849  this->glmis = new GLMenuImageScreen();
    841850  this->glmis->init();
    842851  this->glmis->setMaximum(8);
    843   this->glmis->draw();
     852  //  this->glmis->draw();
    844853 
    845854  PRINTF(3)("World::displayLoadScreen - end\n");
     
    855864  PRINTF(3)("World::releaseLoadScreen - start\n");
    856865  this->glmis->setValue(this->glmis->getMaximum());
    857   //SDL_Delay(500);
    858866  PRINTF(3)("World::releaseLoadScreen - end\n");
     867  delete this->glmis;
    859868}
    860869
     
    12421251bool World::command(Command* cmd)
    12431252{
    1244   if( !strcmp( cmd->cmd, "view0")) this->localCamera->setViewMode(VIEW_NORMAL);
    1245   else if( !strcmp( cmd->cmd, "view1")) this->localCamera->setViewMode(VIEW_BEHIND);
    1246   else if( !strcmp( cmd->cmd, "view2")) this->localCamera->setViewMode(VIEW_FRONT);
    1247   else if( !strcmp( cmd->cmd, "view3")) this->localCamera->setViewMode(VIEW_LEFT);
    1248   else if( !strcmp( cmd->cmd, "view4")) this->localCamera->setViewMode(VIEW_RIGHT);
    1249   else if( !strcmp( cmd->cmd, "view5")) this->localCamera->setViewMode(VIEW_TOP);
     1253  if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW0)) this->localCamera->setViewMode(VIEW_NORMAL);
     1254  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW1)) this->localCamera->setViewMode(VIEW_BEHIND);
     1255  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW2)) this->localCamera->setViewMode(VIEW_FRONT);
     1256  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW3)) this->localCamera->setViewMode(VIEW_LEFT);
     1257  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW4)) this->localCamera->setViewMode(VIEW_RIGHT);
     1258  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW5)) this->localCamera->setViewMode(VIEW_TOP);
    12501259
    12511260  return false;
     
    12541263void World::setPath( const char* name)
    12551264{
    1256   this->path = new char[strlen(name)+1];
    1257   strcpy(this->path, name);
     1265  if (this->path)
     1266    delete this->path;
     1267  if (ResourceManager::isFile(name))
     1268  {
     1269    this->path = new char[strlen(name)+1];
     1270    strcpy(this->path, name);
     1271  }
     1272  else
     1273    {
     1274      this->path = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(name) +1];
     1275      sprintf(this->path, "%s%s", ResourceManager::getInstance()->getDataDir(), name);
     1276    }
    12581277}
    12591278
  • orxonox/branches/md2_loader/src/subprojects/Makefile.in

    r4063 r4139  
    113113PACKAGE_VERSION = @PACKAGE_VERSION@
    114114PATH_SEPARATOR = @PATH_SEPARATOR@
     115PKG_CONFIG = @PKG_CONFIG@
    115116RANLIB = @RANLIB@
    116117SET_MAKE = @SET_MAKE@
  • orxonox/branches/md2_loader/src/subprojects/testmain/Makefile.in

    r4063 r4139  
    128128PACKAGE_VERSION = @PACKAGE_VERSION@
    129129PATH_SEPARATOR = @PATH_SEPARATOR@
     130PKG_CONFIG = @PKG_CONFIG@
    130131RANLIB = @RANLIB@
    131132SET_MAKE = @SET_MAKE@
  • orxonox/branches/md2_loader/src/util/object_manager.h

    r4127 r4139  
    1616#include "base_object.h"
    1717
     18#define OM_
     19
     20class WorldEntity;
     21
     22
     23template<class T> class tList;
    1824
    1925//! the object manager itself
     
    2430  virtual ~ObjectManager(void);
    2531
     32  void preLoad();
     33
    2634 private:
    2735  ObjectManager(void);
    2836  static ObjectManager* singletonRef;
     37
     38  tList<WorldEntity>* projectileBuffer;            //!< a list of projectiles that is generated at the beginning to make orx faster
     39
     40
    2941};
    3042
  • orxonox/branches/md2_loader/src/util/resource_manager.cc

    r4065 r4139  
    100100      return false;
    101101    }
     102}
     103
     104/**
     105   \brief checks for the DataDirectory, by looking if
     106   \param fileInside is inisde??
     107*/
     108bool ResourceManager::checkDataDir(const char* fileInside)
     109{
     110  bool retVal;
     111  if (!isDir(this->dataDir))
     112    {
     113      PRINTF(1)("%s is not a directory\n", this->dataDir);
     114      return false;
     115    }
     116 
     117  char* testFile = new char[strlen(this->dataDir)+strlen(fileInside)+1];
     118  sprintf(testFile, "%s%s", this->dataDir, fileInside);
     119  retVal = isFile(testFile);
     120  delete testFile;
     121  return retVal;
    102122}
    103123
     
    183203  // searching if the resource was loaded before.
    184204  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3);
    185   if (tmpResource) // if the resource was not loaded before.
     205  if (tmpResource) // if the resource was loaded before.
    186206    {
    187207      PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
     
    202222
    203223      // creating the full name. (directoryName + FileName)
    204       char* fullName = new char[strlen(dataDir)+strlen(fileName)+1];
    205       sprintf(fullName, "%s%s", this->dataDir, fileName);
    206      
     224      char* fullName = new char[strlen(this->getDataDir())+strlen(fileName)+1];
     225      sprintf(fullName, "%s%s", this->getDataDir(), fileName);
    207226      // Checking for the type of resource \see ResourceType
    208227      switch(type)
     
    214233            tmpResource->modelSize = 1.0;
    215234
    216           if(isFile(fullName))
     235          if(ResourceManager::isFile(fullName))
    217236            tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
    218237          else
  • orxonox/branches/md2_loader/src/util/resource_manager.h

    r4063 r4139  
    6565
    6666  bool setDataDir(const char* dataDir);
     67  /** \returns the Name of the data directory */
     68  inline const char*  getDataDir(void) {return this->dataDir;}
     69  bool checkDataDir(const char* fileInside);
    6770  bool addImageDir(char* imageDir);
    6871  void* load(const char* fileName, ResourcePriority prio = RP_NO,
  • orxonox/branches/md2_loader/src/world_entities/environment.cc

    r3986 r4139  
    3030{
    3131  this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL);
    32   //  this->model = new OBJModel("../data/models/fighter.obj");
    3332}
    3433
  • orxonox/branches/md2_loader/src/world_entities/player.cc

    r4010 r4139  
    8282Player::Player(TiXmlElement* root) : WorldEntity(root)
    8383{
    84   /*
    85     char* temp;
    86     const char* string;
    87     string = grabParameter( root, "name");
    88     if( string == NULL)
    89     {
    90     PRINTF0("Player is missing a proper 'name'\n");
    91     string = "Unknown";
    92     temp = new char[strlen(string + 2)];
    93     strcpy( temp, string);
    94     this->setName( temp);
    95     }
    96     else
    97     {
    98     temp = new char[strlen(string + 2)];
    99     strcpy( temp, string);
    100     this->setName( temp);
    101     }
    102    
    103     this->model = NULL;
    104     string = grabParameter( root, "model");
    105     if( string != NULL)
    106     this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);
    107     else
    108     {
    109     PRINTF0("Player is missing a proper 'model'\n");
    110     this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
    111     }
    112     if( this->model == NULL)
    113     {
    114     PRINTF0("Player model '%s' could not be loaded\n", string);
    115     }
    116   */
    11784  this->weapons = new tList<Weapon>();
    11885  this->activeWeapon = NULL;
     
    294261{
    295262  PRINTF(3)("recieved command [%s]\n", cmd->cmd);
    296   if( !strcmp( cmd->cmd, "up")) this->bUp = !cmd->bUp;
    297   if( !strcmp( cmd->cmd, "down")) this->bDown = !cmd->bUp;
    298   if( !strcmp( cmd->cmd, "left")) this->bLeft = !cmd->bUp;
    299   if( !strcmp( cmd->cmd, "right")) this->bRight = !cmd->bUp;
    300   if( !strcmp( cmd->cmd, "fire")) this->bFire = !cmd->bUp;
    301   if( !strcmp( cmd->cmd, "mode")) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;
    302 }
     263  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_UP)) this->bUp = !cmd->bUp;
     264  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_DOWN)) this->bDown = !cmd->bUp;
     265  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_LEFT)) this->bLeft = !cmd->bUp;
     266  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_RIGHT)) this->bRight = !cmd->bUp;
     267  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_FIRE)) this->bFire = !cmd->bUp;
     268  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_NEXT_WEAPON)) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;
     269}
  • orxonox/branches/md2_loader/src/world_entities/skybox.cc

    r4012 r4139  
    6666      PRINTF(0)("SkyBox is missing a proper 'MaterialSet'\n");
    6767    }
    68   if( this->model == NULL)
     68  if( this->skyModel == NULL)
    6969    {
    7070      PRINTF(0)("SkyBox model '%s' could not be loaded\n", string);
     
    7676{
    7777  this->setClassName("SkyBox");
     78  this->skyModel = NULL;
    7879  this->material = new Material*[6];
    79   for (int i = 0; i <6; i++)
     80  for (int i = 0; i < 6; i++)
    8081    {
    8182      this->material[i] = new Material();
     
    100101SkyBox::~SkyBox()
    101102{
    102   PRINTF(5)("Deleting the SkyBox\n");
     103  PRINTF(5)("Deleting SkyBox\n");
    103104  for (int i = 0; i < 6; i++)
    104105    delete this->material[i];
     
    179180  glTranslatef(r.x, r.y, r.z);
    180181
    181   this->model->draw();
     182  this->skyModel->draw();
    182183
    183184  glPopMatrix();
     
    192193void SkyBox::rebuild()
    193194{
    194   if (this->model)
    195     delete model;
    196   model = new Model();
    197 
    198   model->addVertex (-0.5*size, -0.5*size, 0.5*size); 
    199   model->addVertex (0.5*size, -0.5*size, 0.5*size);
    200   model->addVertex (-0.5*size, 0.5*size, 0.5*size);
    201   model->addVertex (0.5*size, 0.5*size, 0.5*size);
    202   model->addVertex (-0.5*size, 0.5*size, -0.5*size);
    203   model->addVertex (0.5*size, 0.5*size, -0.5*size);
    204   model->addVertex (-0.5*size, -0.5*size, -0.5*size);
    205   model->addVertex (0.5*size, -0.5*size, -0.5*size);
    206 
    207   model->addVertexTexture (0.0, 0.0);
    208   model->addVertexTexture (1.0, 0.0);
    209   model->addVertexTexture (1.0, 1.0);
    210   model->addVertexTexture (0.0, 1.0);
    211 
    212   model->addVertexNormal (0.0, 0.0, 1.0);
    213   model->addVertexNormal (0.0, 1.0, 0.0);
    214   model->addVertexNormal (0.0, 0.0, -1.0);
    215   model->addVertexNormal (0.0, -1.0, 0.0);
    216   model->addVertexNormal (1.0, 0.0, 0.0);
    217   model->addVertexNormal (-1.0, 0.0, 0.0);
    218 
    219   model->setMaterial(material[0]);
    220   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 3,2,4, 4,3,4, 6,4,4, 5,1,4); // top
    221   model->setMaterial(material[1]);
    222   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,4,2, 8,1,2, 2,2,2, 1,3,2); // bottom
    223   model->setMaterial(material[2]);
    224   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,3, 2,2,3, 4,3,3, 3,4,3); // left
    225   model->setMaterial(material[3]);
    226   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 5,3,1, 6,4,1, 8,1,1, 7,2,1); // right
    227   model->setMaterial(material[4]);
    228   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,1,6, 8,2,6, 6,3,6, 4,4,6); // front
    229   model->setMaterial(material[5]);
    230   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,1,5, 1,2,5, 3,3,5, 5,4,5); // back
     195  if (this->skyModel)
     196    delete skyModel;
     197  skyModel = new Model();
     198
     199  this->skyModel->addVertex (-0.5*size, -0.5*size, 0.5*size); 
     200  this->skyModel->addVertex (0.5*size, -0.5*size, 0.5*size);
     201  this->skyModel->addVertex (-0.5*size, 0.5*size, 0.5*size);
     202  this->skyModel->addVertex (0.5*size, 0.5*size, 0.5*size);
     203  this->skyModel->addVertex (-0.5*size, 0.5*size, -0.5*size);
     204  this->skyModel->addVertex (0.5*size, 0.5*size, -0.5*size);
     205  this->skyModel->addVertex (-0.5*size, -0.5*size, -0.5*size);
     206  this->skyModel->addVertex (0.5*size, -0.5*size, -0.5*size);
     207
     208  this->skyModel->addVertexTexture (0.0, 0.0);
     209  this->skyModel->addVertexTexture (1.0, 0.0);
     210  this->skyModel->addVertexTexture (1.0, 1.0);
     211  this->skyModel->addVertexTexture (0.0, 1.0);
     212
     213  this->skyModel->addVertexNormal (0.0, 0.0, 1.0);
     214  this->skyModel->addVertexNormal (0.0, 1.0, 0.0);
     215  this->skyModel->addVertexNormal (0.0, 0.0, -1.0);
     216  this->skyModel->addVertexNormal (0.0, -1.0, 0.0);
     217  this->skyModel->addVertexNormal (1.0, 0.0, 0.0);
     218  this->skyModel->addVertexNormal (-1.0, 0.0, 0.0);
     219
     220  this->skyModel->setMaterial(material[0]);
     221  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,1,3, 3,2,3, 5,3,3, 4,0,3); // top
     222  this->skyModel->setMaterial(material[1]);
     223  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,3,1, 7,0,1, 1,1,1, 0,2,1); // bottom
     224  this->skyModel->setMaterial(material[2]);
     225  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,2, 1,1,2, 3,2,2, 2,3,2); // left
     226  this->skyModel->setMaterial(material[3]);
     227  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,0, 5,3,0, 7,0,0, 6,1,0); // right
     228  this->skyModel->setMaterial(material[4]);
     229  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,6); // front
     230  this->skyModel->setMaterial(material[5]);
     231  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
    231232 
    232   model->finalize();
    233 }
     233  this->skyModel->finalize();
     234}
  • orxonox/branches/md2_loader/src/world_entities/skybox.h

    r4012 r4139  
    3939  void rebuild();
    4040
     41  Model* skyModel;        //!< A Model for the Sky. This must not be the same as the Model from WorldEntity, because it is not alocated through the ResourceManager.
    4142  Material **material;    //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
    4243  float size;             //!< Size of the SkyBox. This should match the frustum maximum range.
  • orxonox/branches/md2_loader/src/world_entities/skysphere.cc

    r3763 r4139  
    4444{
    4545  if (fileName == NULL)
    46     this->initialize("../data/pictures/sky-replace.jpg");
     46    this->initialize("pictures/sky-replace.jpg");
    4747  else
    4848    this->initialize(fileName);
  • orxonox/branches/md2_loader/src/world_entities/terrain.cc

    r3677 r4139  
    7777void Terrain::init(void)
    7878{
    79    this->setClassName ("Terrain");
    80 
    81    this->objectList = 0;
     79  this->setClassName ("Terrain");
     80 
     81  this->objectList = 0;
    8282}
    8383
     
    9898  glMultMatrixf((float*)matrix);
    9999
    100   if (objectList)
    101     glCallList(objectList);
    102   else if (model)
    103     model->draw();
    104   //  this->model->draw();
     100  if (this->objectList)
     101    glCallList(this->objectList);
     102  else if (this->model)
     103    this->model->draw();
    105104  glPopMatrix();
    106105}
  • orxonox/branches/md2_loader/src/world_entities/world_entity.cc

    r4013 r4139  
    3030/**
    3131   \brief standard constructor
    32    
    33    Every derived contructor HAS to call the previous one supplying the isFree parameter. This is necessary to distunguish
    34    between free and bound entities. The difference between them is simply the fact that the movement of a free entity is
    35    not bound to the track of a world. Use this to implement projectile or effect classes that do not have to travel along the track.
    36    To specify an entity to be free or bound set the default parameter in the declaration of the constructor.
    37    Theoretically you should never have to call the constructor of an Entity directly, for it is called by the spawn() function of the World
    38    class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.
    3932*/
    4033WorldEntity::WorldEntity ()
     
    4639}
    4740
     41/**
     42   \brief Loads the WordEntity-specific Part of any derived Class
     43*/
    4844WorldEntity::WorldEntity(TiXmlElement* root)
    4945{
     
    5450  if( string == NULL)
    5551    {
    56       PRINTF(0)("WorldEntity is missing a proper 'name'\n");
     52      PRINTF(2)("WorldEntity is missing a proper 'name'\n");
    5753      string = "Unknown";
    5854      temp = new char[strlen(string + 2)];
     
    7369  else
    7470    {
    75       PRINTF(0)("WorldEntity is missing a proper 'model'\n");
     71      PRINTF(2)("WorldEntity is missing a proper 'model'\n");
    7672      this->model = NULL;
    7773    }
    7874  if( this->model == NULL)
    7975    {
    80       PRINTF(0)("WorldEntity model '%s' could not be loaded\n", string);
    81     }
    82 
     76      PRINTF(2)("WorldEntity model '%s' could not be loaded\n", string);
     77    }
    8378  this->bDraw = true;
    8479}
Note: See TracChangeset for help on using the changeset viewer.