Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 17, 2008, 7:27:36 PM (16 years ago)
Author:
rgrieder
Message:

GameState class added. Tested and working, but now comes the hard part: Implementing the actual states…

Location:
code/branches/gui/src/core
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/core/CMakeLists.txt

    r1645 r1660  
    55  Error.cc
    66  Exception.cc
     7  GameState.cc
    78  Language.cc
    89  OrxonoxClass.cc
  • code/branches/gui/src/core/Exception.h

    r1652 r1660  
    4343#include "core/Debug.h"
    4444
     45// Define some ugly macros to make things more clear
     46#define CREATE_ORXONOX_EXCEPTION(name) typedef SpecificException<Exception::name> name##Exception;
     47#define RETURN_EXCEPTION_CODE(name) \
     48    case Exception::name:           \
     49        return #name;
     50
     51
    4552namespace orxonox
    4653{
     
    5461            PluginsNotFound,
    5562            InitialisationFailed,
    56             NotImplemented
     63            NotImplemented,
     64            GameState
    5765        };
    5866
     
    106114        std::string getTypeName() const
    107115        {
    108             // note: break is not necessary due to the return. Keep in mind!
     116            // note: break is not necessary due to the return in the macros.
    109117            switch (Type)
    110118            {
    111             case Exception::General:
    112                 return "General";
    113             case Exception::FileNotFound:
    114                 return "FileNotFound";
    115             case Exception::PluginsNotFound:
    116                 return "PluginsNotFound";
    117             case Exception::InitialisationFailed:
    118                 return "InitialisationFailed";
    119             case Exception::NotImplemented:
    120                 return "NotImplemented";
     119            RETURN_EXCEPTION_CODE(General)
     120            RETURN_EXCEPTION_CODE(FileNotFound);
     121            RETURN_EXCEPTION_CODE(PluginsNotFound);
     122            RETURN_EXCEPTION_CODE(InitialisationFailed);
     123            RETURN_EXCEPTION_CODE(NotImplemented);
     124            RETURN_EXCEPTION_CODE(GameState);
    121125            default:
    122126                return "";
     
    125129    };
    126130
    127     typedef SpecificException<Exception::General> GeneralException;
    128     typedef SpecificException<Exception::FileNotFound> FileNotFoundException;
    129     typedef SpecificException<Exception::PluginsNotFound> PluginsNotFoundException;
    130     typedef SpecificException<Exception::InitialisationFailed> InitialisationFailedException;
    131     typedef SpecificException<Exception::NotImplemented> NotImplementedException;
     131    // define the template spcialisations
     132    CREATE_ORXONOX_EXCEPTION(General);
     133    CREATE_ORXONOX_EXCEPTION(FileNotFound);
     134    CREATE_ORXONOX_EXCEPTION(PluginsNotFound);
     135    CREATE_ORXONOX_EXCEPTION(InitialisationFailed);
     136    CREATE_ORXONOX_EXCEPTION(NotImplemented);
     137    CREATE_ORXONOX_EXCEPTION(GameState);
    132138
    133139#define ThrowException(type, description) \
  • code/branches/gui/src/core/input/InputManager.cc

    r1659 r1660  
    498498
    499499            joySticks_.clear();
    500             _redimensionLists();
     500            // don't use _redimensionLists(), might mess with registered handler if
     501            // downgrading from 2 to 1 joystick
     502            //_redimensionLists();
     503            joySticksSize_ = 0;
    501504        }
    502505        CCOUT(4) << "Joy sticks destroyed." << std::endl;
Note: See TracChangeset for help on using the changeset viewer.