Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2007, 10:19:03 PM (17 years ago)
Author:
bknecht
Message:

suggestion for solution of WinMain problem

Location:
code/branches/FICN/src/orxonox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/graphicsEngine.cc

    r473 r546  
    113113      for (i = settings->begin(); i != settings->end(); ++i)
    114114      {
    115         typeName = i->first;
    116         archName = i->second;
     115        typeName = i->first; // for instance "FileSystem" or "Zip"
     116        archName = i->second; // name (and location) of archive
    117117
    118118        ResourceGroupManager::getSingleton().addResourceLocation(
    119119                                           String(dataPath + archName),
    120             typeName, secName);
     120                                           typeName, secName);
    121121      }
    122122    }
  • code/branches/FICN/src/orxonox/main.cc

    r544 r546  
    7171#endif
    7272
    73 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 
    74 #define WIN32_LEAN_AND_MEAN 
    75 #include "windows.h" 
     73#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
     74#define WIN32_LEAN_AND_MEAN
     75#include "windows.h"
    7676  INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
    7777  {
     78    // something like this would be less hacky
     79    // maybe one can work with trailing '\0'
     80    // or maybe use string based functions
     81    // I was unable to test it without working windows version
     82    /*char* cmd = strCmdLine;
     83    int argc = 1;
     84    for(int i = 0; cmd[i] != NULL; i++)
     85    {
     86      if(cmd[i] == ' ') argc++;
     87    }
     88    char* argv[argc];
     89    int j = 0;
     90    int k = 0;
     91    for(int i = 0; cmd[i] != NULL; i++)
     92    {
     93      if(cmd[i] != ' ') {
     94        argv[j][k];
     95        k++;
     96      }
     97      else {
     98        k = 0;
     99        j++;
     100      }
     101    }*/
    78102    char *argv[2];
    79     argv[0] = "asdfprogramName";
     103    argv[0] = "asdfProgram";
    80104    argv[1] =  strCmdLine;
    81105    int argc = 2;
    82 #else 
    83   int main(int argc, char **argv) 
     106#else
     107  int main(int argc, char **argv)
    84108  {
    85 #endif 
     109#endif
    86110    try {
    87111      SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log");
     
    96120    }
    97121    catch (Ogre::Exception& e) {
    98 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 
     122#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    99123      MessageBoxA(NULL, e.getFullDescription().c_str(),
    100124            "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
  • code/branches/FICN/src/orxonox/orxonox.cc

    r545 r546  
    193193  {
    194194    ogre_ = new GraphicsEngine();
     195    dataPath_ = "";
    195196  }
    196197
     
    217218    ArgReader ar = ArgReader(argc, argv);
    218219    ar.checkArgument("mode", mode, false);
    219 //     ar.checkArgument("data-path", path, true);
     220    ar.checkArgument("data", this->dataPath_, false);
    220221    if(ar.errorHandling()) die();
    221222
     
    354355    cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
    355356#else
    356     cf.load("resources.cfg");
     357    cf.load(dataPath_ + "resources.cfg");
    357358#endif
    358359
     
    378379  void Orxonox::setupRenderSystem()
    379380  {
    380     if (!root_->restoreConfig() && !root_->showConfigDialog())
     381    if (/*!root_->restoreConfig() &&*/ !root_->showConfigDialog())
    381382      throw Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
    382383  }
Note: See TracChangeset for help on using the changeset viewer.