Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 2, 2008, 12:09:55 AM (16 years ago)
Author:
rgrieder
Message:

Finally managed to have a master InputState which enables:

  • Console always opens
  • Debug overlay toggles visibility in gui mode too

Had to change several other code:

  • ConfigFileManager uses special class instead of enum for ConfigFileType
  • You can add an arbitrary config file and get the ConfigFileType
  • ConfigFileManager is an Ogre singleton too. Created in Main.cc
  • CommandLineArgument "optionsFile" specifies another file for command line arguments
  • CommandLineArgument "settingsFile" declares the file used for settings (orxonox.ini)
  • changed all fileNames to filenames
  • "Loaded config file blah" now uses COUT(3) instead of COUT(0)
  • fixed a bug in ConfigFileManager::load() that cause orxonox.ini to double its size after every call
Location:
code/branches/objecthierarchy/src/util
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/util/Exception.cc

    r1810 r2101  
    3838{
    3939    Exception::Exception(const std::string& description, int lineNumber,
    40                          const char* fileName, const char* functionName)
     40                         const char* filename, const char* functionName)
    4141        : description_(description)
    4242        , lineNumber_(lineNumber)
    4343        , functionName_(functionName)
    44         , fileName_(fileName)
     44        , filename_(filename)
    4545    { }
    4646
     
    4949        , lineNumber_(0)
    5050        , functionName_("")
    51         , fileName_("")
     51        , filename_("")
    5252    { }
    5353
     
    6060            fullDesc << this->getTypeName() << "_EXCEPTION";
    6161
    62             if (this->fileName_ != "")
     62            if (this->filename_ != "")
    6363            {
    64                 fullDesc << " in " << this->fileName_;
     64                fullDesc << " in " << this->filename_;
    6565                if (this->lineNumber_)
    6666                    fullDesc << "(" << this->lineNumber_ << ")";
  • code/branches/objecthierarchy/src/util/Exception.h

    r1810 r2101  
    6767
    6868        Exception(const std::string& description, int lineNumber,
    69                   const char* fileName, const char* functionName);
     69                  const char* filename, const char* functionName);
    7070        Exception(const std::string& description);
    7171
     
    8787        int lineNumber_;
    8888        std::string functionName_;
    89         std::string fileName_;
     89        std::string filename_;
    9090        // mutable because "what()" is a const method
    9191        mutable std::string fullDescription_;
     
    9898    public:
    9999        SpecificException(const std::string& description, int lineNumber,
    100                   const char* fileName, const char* functionName)
    101                   : Exception(description, lineNumber, fileName, functionName)
     100                  const char* filename, const char* functionName)
     101                  : Exception(description, lineNumber, filename, functionName)
    102102        {
    103103            // let the catcher decide whether to display the message below level 4
  • code/branches/objecthierarchy/src/util/SignalHandler.cc

    r2030 r2101  
    5858 * register signal handlers for SIGSEGV and SIGABRT
    5959 * @param appName path to executable eg argv[0]
    60  * @param fileName filename to append backtrace to
    61  */
    62 void SignalHandler::doCatch( const std::string & appName, const std::string & fileName )
     60 * @param filename filename to append backtrace to
     61 */
     62void SignalHandler::doCatch( const std::string & appName, const std::string & filename )
    6363{
    6464  this->appName = appName;
    65   this->fileName = fileName;
     65  this->filename = filename;
    6666
    6767  // prepare for restoring XAutoKeyRepeat
     
    326326  bt.insert(0, timeString);
    327327
    328   FILE * f = fopen( getInstance()->fileName.c_str(), "a" );
     328  FILE * f = fopen( getInstance()->filename.c_str(), "a" );
    329329
    330330  if ( !f )
    331331  {
    332     perror( ( std::string( "could not append to " ) + getInstance()->fileName ).c_str() );
     332    perror( ( std::string( "could not append to " ) + getInstance()->filename ).c_str() );
    333333    exit(EXIT_FAILURE);
    334334  }
     
    336336  if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() )
    337337  {
    338     COUT(0) << "could not write " << bt.length() << " byte to " << getInstance()->fileName << std::endl;
     338    COUT(0) << "could not write " << bt.length() << " byte to " << getInstance()->filename << std::endl;
    339339    exit(EXIT_FAILURE);
    340340  }
  • code/branches/objecthierarchy/src/util/SignalHandler.h

    r2030 r2101  
    7171    void registerCallback( SignalCallback cb, void * someData );
    7272
    73     void doCatch( const std::string & appName, const std::string & fileName );
     73    void doCatch( const std::string & appName, const std::string & filename );
    7474    void dontCatch();
    7575
     
    8585
    8686    std::string appName;
    87     std::string fileName;
     87    std::string filename;
    8888
    8989    // used to turn on KeyAutoRepeat if OIS crashes
     
    9797  public:
    9898    inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; };
    99     void doCatch( const std::string & appName, const std::string & fileName ) {};
     99    void doCatch( const std::string & appName, const std::string & filename ) {};
    100100    void dontCatch() {};
    101101    void registerCallback( SignalCallback cb, void * someData ) {};
Note: See TracChangeset for help on using the changeset viewer.