Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 10, 2008, 1:37:36 AM (16 years ago)
Author:
rgrieder
Message:

merged gui back to trunk.
update the media repository!

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/Main.cc

    r1747 r1755  
    2222 *   Author:
    2323 *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
     24 *      Reto Grieder
    2425 *   Co-authors:
    2526 *      ...
     
    3536
    3637#include <exception>
     38#include <cassert>
    3739
    3840#include "util/OrxonoxPlatform.h"
    3941#include "SignalHandler.h"
    40 #include "Orxonox.h"
     42#include "util/Debug.h"
     43
     44#include "gamestates/GSRoot.h"
     45#include "gamestates/GSGraphics.h"
     46#include "gamestates/GSStandalone.h"
     47#include "gamestates/GSServer.h"
     48#include "gamestates/GSClient.h"
     49#include "gamestates/GSDedicated.h"
     50#include "gamestates/GSGUI.h"
     51#include "gamestates/GSIOConsole.h"
    4152
    4253using namespace orxonox;
     54
    4355#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
    4456#include <CoreFoundation/CoreFoundation.h>
     
    4961             std::string macBundlePath()
    5062{
    51   char path[1024];
    52   CFBundleRef mainBundle = CFBundleGetMainBundle();
    53   assert(mainBundle);
     63    char path[1024];
     64    CFBundleRef mainBundle = CFBundleGetMainBundle();
     65    assert(mainBundle);
    5466
    55   CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
    56   assert(mainBundleURL);
     67    CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
     68    assert(mainBundleURL);
    5769
    58   CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
    59   assert(cfStringRef);
     70    CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
     71    assert(cfStringRef);
    6072
    61   CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
     73    CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
    6274
    63   CFRelease(mainBundleURL);
    64   CFRelease(cfStringRef);
     75    CFRelease(mainBundleURL);
     76    CFRelease(cfStringRef);
    6577
    66   return std::string(path);
     78    return std::string(path);
    6779}
    6880#endif
    6981
    70 #ifdef __cplusplus
    71 extern "C" {
    72 #endif
    7382
    74 int main(int argc, char **argv)
     83//#ifdef __cplusplus
     84//extern "C" {
     85//#endif
     86
     87int main(int argc, char** argv)
    7588{
    76   //try {
     89    // create a signal handler (only works for linux)
    7790    SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log");
    78     Orxonox* orx = Orxonox::getSingleton();
    7991
    80     bool res = false;
    81 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
    82     res = orx->init(argc, argv, macBundlePath());
    83 #else
    84     res = orx->init(argc, argv);
    85 #endif
     92    GSRoot root;
     93    GSGraphics graphics;
     94    GSStandalone standalone;
     95    GSServer server;
     96    GSClient client;
     97    GSDedicated dedicated;
     98    GSGUI gui;
     99    GSIOConsole ioConsole;
    86100
    87     if (res)
    88       orx->start();
    89     orx->destroySingleton();
    90   /*}
    91   catch (std::exception &ex)
    92   {
    93     std::cerr << "Exception:\n";
    94     std::cerr << ex.what() << "\n";
    95     return 1;
    96   }*/
     101    root.addChild(&graphics);
     102    graphics.addChild(&standalone);
     103    graphics.addChild(&server);
     104    graphics.addChild(&client);
     105    graphics.addChild(&gui);
    97106
    98   return 0;
     107    root.addChild(&ioConsole);
     108    root.addChild(&dedicated);
     109
     110    root.start(argc, argv);
     111
     112    return 0;
    99113}
    100114
    101 #ifdef __cplusplus
    102 }
    103 #endif
     115//#ifdef __cplusplus
     116//}
     117//#endif
Note: See TracChangeset for help on using the changeset viewer.