Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3323


Ignore:
Timestamp:
Jul 19, 2009, 3:11:15 PM (15 years ago)
Author:
rgrieder
Message:

ORXONOX_USE_WINMAIN should now work as expected.

Location:
code/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/cmake/BuildConfig.cmake

    r3196 r3323  
    7474
    7575# Use WinMain() or main()?
    76 OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)
     76IF(WIN32)
     77  OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)
     78ENDIF()
    7779
    7880################# OGRE Plugins ##################
  • code/trunk/src/core/CommandLine.cc

    r3280 r3323  
    332332        Parses only the command line for CommandLineArguments.
    333333    */
    334     void CommandLine::_parseCommandLine(int argc, char** argv)
     334    void CommandLine::_parseCommandLine(const std::string& cmdLine)
    335335    {
    336336        std::vector<std::string> args;
    337         for (int i = 1; i < argc; ++i)
    338             args.push_back(argv[i]);
     337        SubString tokens(cmdLine, " ", " ", false, '\\', true, '"', true, '(', ')', false);
     338        for (unsigned i = 0; i < tokens.size(); ++i)
     339            args.push_back(tokens[i]);
    339340        this->_parse(args, false);
    340341    }
     
    363364                //if (!(line[0] == '#' || line[0] == '%'))
    364365                //{
    365                 SubString tokens(line, " ", " ", false, 92, false, 34, false, 40, 41, false, '#');
     366                SubString tokens(line, " ", " ", false, '\\', true, '"', true, '(', ')', false, '#');
    366367                for (unsigned i = 0; i < tokens.size(); ++i)
    367368                    if (tokens[i][0] != '#')
  • code/trunk/src/core/CommandLine.h

    r3300 r3323  
    142142
    143143        //! Parse redirection to internal member method.
    144         static void parseCommandLine(int argc, char** argv) { _getInstance()._parseCommandLine(argc, argv); }
     144        static void parseCommandLine(const std::string& cmdLine) { _getInstance()._parseCommandLine(cmdLine); }
    145145        static void parseFile() { _getInstance()._parseFile(); }
    146146
     
    174174        static CommandLine& _getInstance();
    175175
    176         void _parseCommandLine(int argc, char** argv);
     176        void _parseCommandLine(const std::string& cmdLine);
    177177        void _parseFile();
    178178        void _parse(const std::vector<std::string>& arguments, bool bParsingFile);
  • code/trunk/src/core/Core.cc

    r3280 r3323  
    229229
    230230
    231     Core::Core(int argc, char** argv)
     231    Core::Core(const std::string& cmdLine)
    232232    {
    233233        if (singletonRef_s != 0)
     
    242242
    243243        // Parse command line arguments first
    244         CommandLine::parseCommandLine(argc, argv);
     244        CommandLine::parseCommandLine(cmdLine);
    245245
    246246        // Determine and set the location of the executable
  • code/trunk/src/core/Core.h

    r3280 r3323  
    6666                GeneralException
    6767            */
    68             Core(int argc, char** argv);
     68            Core(const std::string& cmdLine);
    6969            ~Core();
    7070
  • code/trunk/src/core/Game.cc

    r3318 r3323  
    110110        Non-initialising constructor.
    111111    */
    112     Game::Game(int argc, char** argv)
     112    Game::Game(const std::string& cmdLine)
    113113    {
    114114        if (singletonRef_s != 0)
     
    137137
    138138        // Create the Core
    139         this->core_ = new Core(argc, argv);
     139        this->core_ = new Core(cmdLine);
    140140
    141141        // After the core has been created, we can safely instantiate the GameStates
  • code/trunk/src/core/Game.h

    r3280 r3323  
    6868    {
    6969    public:
    70         Game(int argc, char** argv);
     70        Game(const std::string& cmdLine);
    7171        ~Game();
    7272
  • code/trunk/src/orxonox/GraphicsManager.cc

    r3280 r3323  
    278278        boost::filesystem::path folder(ogrePluginsFolder_);
    279279        // Do some SubString magic to get the comma separated list of plugins
    280         SubString plugins(ogrePlugins_, ",", " ", false, 92, false, 34, false, 40, 41, false, '\0');
     280        SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '(', ')', false, '\0');
    281281        // Use backslash paths on Windows! file_string() already does that though.
    282282        for (unsigned int i = 0; i < plugins.size(); ++i)
  • code/trunk/src/orxonox/Main.cc

    r3280 r3323  
    3535
    3636#include "OrxonoxPrereqs.h"
     37#include "SpecialConfig.h"
     38
     39#ifdef ORXONOX_USE_WINMAIN
     40# ifndef WIN32_LEAN_AND_MEAN
     41#  define WIN32_LEAN_AND_MEAN
     42# endif
     43#include <windows.h>
     44#endif
    3745
    3846#include "util/Debug.h"
     
    5563    try
    5664    {
    57         game = new Game(argc, argv);
     65#ifndef ORXONOX_USE_WINMAIN
     66        std::string strCmdLine;
     67        for (int i = 1; i < argc; ++i)
     68            strCmdLine += argv[i] + std::string(" ");
     69#endif
     70        game = new Game(strCmdLine);
    5871
    5972        game->setStateHierarchy(
Note: See TracChangeset for help on using the changeset viewer.