Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4650 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 17, 2005, 11:07:59 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Now the Subprojects get the DataDirectory from the ~/orxonox/orxonox.conf file

Location:
orxonox/trunk/src/subprojects
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/subprojects/framework.cc

    r4647 r4650  
    2525#include "resource_manager.h"
    2626#include "camera.h"
     27#include "ini_parser.h"
    2728
    2829
    2930int verbose;
     31
     32void Framework::init(void)
     33{
     34  // create parser
     35  IniParser parser (DEFAULT_CONFIG_FILE);
     36  if( parser.getSection (CONFIG_SECTION_DATA) == -1)
     37  {
     38    PRINTF(1)("Could not find Section %s in %s\n", CONFIG_SECTION_DATA, DEFAULT_CONFIG_FILE);
     39  }
     40  char namebuf[256];
     41  char valuebuf[256];
     42  memset (namebuf, 0, 256);
     43  memset (valuebuf, 0, 256);
     44
     45  while( parser.nextVar (namebuf, valuebuf) != -1)
     46  {
     47    if (!strcmp(namebuf, CONFIG_NAME_DATADIR))
     48    {
     49          //  printf("Not yet implemented\n");
     50      if (!ResourceManager::getInstance()->setDataDir(valuebuf))
     51      {
     52        PRINTF(1)("Data Could not be located\n");
     53      }
     54    }
     55
     56    memset (namebuf, 0, 256);
     57    memset (valuebuf, 0, 256);
     58  }
     59
     60  if (!ResourceManager::getInstance()->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
     61  {
     62    PRINTF(1)("The DataDirectory %s could not be verified\nPlease Change in File %s Section %s Entry %s to a suitable value\n",
     63    ResourceManager::getInstance()->getDataDir(),
     64    DEFAULT_CONFIG_FILE,
     65    CONFIG_SECTION_DATA,
     66    CONFIG_NAME_DATADIR);
     67    exit(-1);
     68  }
     69}
     70
    3071
    3172void* Framework::mainLoop(void* tmp)
     
    238279Framework::Framework()
    239280{
     281  this->init();
     282
    240283  this->isFinished = false;
    241284
     
    256299  for (int i = 0; i < 4; i++)
    257300    backgroundColor[i] = 0;
    258 
    259   ResourceManager::getInstance()->setDataDir(DATA_DIRECTORY);
    260301
    261302  camera = new Camera();
  • orxonox/trunk/src/subprojects/framework.h

    r4554 r4650  
    1111#endif
    1212
    13 #define DATA_DIRECTORY "~/orxonox/repos/trunk/data/"
    14 #define MOUSE_BUTTON_COUNT 8
     13#define MOUSE_BUTTON_COUNT 3
    1514
    1615class Camera;
     
    5251
    5352
    54 
     53  void init(void);
    5554  static void* mainLoop(void* tmp);
    5655  bool draw(float dt);
  • orxonox/trunk/src/subprojects/particles/Makefile.am

    r4649 r4650  
    88                  $(MAINSRCDIR)/lib/event/libORXevent.a \
    99                  $(MAINSRCDIR)/lib/particles/libORXparticles.a \
     10                  $(MAINSRCDIR)/lib/sound/libORXsound.a \
    1011                  $(MAINSRCDIR)/lib/graphics/importer/libORXimporter.a \
    1112                  $(MAINSRCDIR)/lib/physics/libORXphysics.a \
     
    1314                  $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
    1415
    15 particles_CPPFLAGS =  -DGUI_MODULE  -DNO_AUDIO \
     16particles_CPPFLAGS =  -DGUI_MODULE  \
    1617                      $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
    1718
  • orxonox/trunk/src/subprojects/particles/Makefile.in

    r4649 r4650  
    6868        $(MAINSRCDIR)/lib/event/libORXevent.a \
    6969        $(MAINSRCDIR)/lib/particles/libORXparticles.a \
     70        $(MAINSRCDIR)/lib/sound/libORXsound.a \
    7071        $(MAINSRCDIR)/lib/graphics/importer/libORXimporter.a \
    7172        $(MAINSRCDIR)/lib/physics/libORXphysics.a \
     
    216217                  $(MAINSRCDIR)/lib/event/libORXevent.a \
    217218                  $(MAINSRCDIR)/lib/particles/libORXparticles.a \
     219                  $(MAINSRCDIR)/lib/sound/libORXsound.a \
    218220                  $(MAINSRCDIR)/lib/graphics/importer/libORXimporter.a \
    219221                  $(MAINSRCDIR)/lib/physics/libORXphysics.a \
     
    221223                  $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
    222224
    223 particles_CPPFLAGS = -DGUI_MODULE  -DNO_AUDIO \
     225particles_CPPFLAGS = -DGUI_MODULE  \
    224226                      $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
    225227
Note: See TracChangeset for help on using the changeset viewer.