Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 12, 2010, 2:48:11 PM (14 years ago)
Author:
rgrieder
Message:

Added CommandlineParser again and adjusted it to work with QVariant instead of MultiType.
Also removed obsolete Game class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox_qt/src/libraries/core/Core.cc

    r7421 r7424  
    5353#include "util/Exception.h"
    5454#include "PathConfig.h"
     55#include "CommandLineParser.h"
    5556
    5657namespace orxonox
     
    5960    Core* Core::singletonPtr_s  = 0;
    6061
     62    SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
     63
     64#ifdef ORXONOX_PLATFORM_WINDOWS
     65    SetCommandLineArgument(limitToCPU, 1).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is the first core (faster than off)");
     66#endif
     67
    6168    Core::Core(const std::string& cmdLine)
    6269    {
    6370        // Set the hard coded fixed paths
    6471        this->pathConfig_.reset(new PathConfig());
     72
     73        // Parse command line arguments
     74        CommandLineParser::parseCommandLine(cmdLine);
    6575
    6676        // Set configurable paths like log, config and media
     
    7080        OutputHandler::getInstance().setLogPath(PathConfig::getLogPathString());
    7181
     82        // Parse additional options file now that we know its path
     83        CommandLineParser::parseFile();
     84
    7285#ifdef ORXONOX_PLATFORM_WINDOWS
    7386        // limit the main thread to the first core so that QueryPerformanceCounter doesn't jump
    74         int limitToCPU = 0;//CommandLineParser::getValue("limitToCPU");
     87        int limitToCPU = CommandLineParser::getValue("limitToCPU").toInt();
    7588        if (limitToCPU > 0)
    7689            setThreadAffinity(static_cast<unsigned int>(limitToCPU));
     
    7891
    7992        // Generate documentation instead of normal run?
    80         std::string docFilename;
    81         //CommandLineParser::getValue("generateDoc", &docFilename);
     93        std::string docFilename = CommandLineParser::getValue("generateDoc").toString().toStdString();
    8294        if (!docFilename.empty())
    8395        {
     
    8597            if (docFile.is_open())
    8698            {
    87                 //CommandLineParser::generateDoc(docFile);
     99                CommandLineParser::generateDoc(docFile);
    88100                docFile.close();
    89101            }
Note: See TracChangeset for help on using the changeset viewer.