X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=src%2Fconfig%2Fconfig.cpp;h=519407773e74eee15f0ca64cbae19ef104a53f4c;hb=b85b89ba9a2cb0373209e8117046fd308faf0202;hp=ae569fa3ced4543bede3cec1b1e9be56481db97f;hpb=b1d92c2f86c7da20ef22f9e064ff9b1a2d5ede4e;p=physics.git diff --git a/src/config/config.cpp b/src/config/config.cpp index ae569fa..5194077 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -16,15 +16,37 @@ */ #include "config.h" -#include "../input/inputManager.h" + +#include +using namespace pg; + +#include +#include "keys.h" + +#include "reader.h" +#include "input/inputManager.h" /// ***** Private Method Headers ***** /// ***** Private Variables ***** +bool fPaused = false; + +bool fEndGame = false; + +bool fWellFollow= false; +bool fWellOn = false; +bool fWellOff = false; + +bool fShowFPS = true; +bool fShowUPS = true; + /// ***** Initializers/Cleaners ***** void cfg::init() { + key::init(); + readConfigs(); + // TODO read in config files } void cfg::clean() @@ -34,18 +56,47 @@ void cfg::clean() /// ***** Public Methods ***** -bool cfg::pause() +void cfg::handleInput() { - return input::wasPressed(SDLK_p); + fPaused = input::wasPressed (key::pause) ? !fPaused : fPaused; + + fEndGame = input::wasReleased(key::end); + + fWellFollow = input::isPressed (key::follow); + fWellOn = input::wasPressed (key::well); + fWellOff = input::wasReleased(key::well); } -bool cfg::unPause() + +bool cfg::paused() { - return input::wasPressed(SDLK_p); + return fPaused; } bool cfg::endGame() { - return input::wasReleased(SDLK_ESCAPE); + return fEndGame; +} + +bool cfg::mouseWellFollow() +{ + return fWellFollow; +} +bool cfg::mouseWellOn() +{ + return fWellOn; +} +bool cfg::mouseWellOff() +{ + return fWellOff; +} + +bool cfg::showFPS() +{ + return fShowFPS; +} +bool cfg::showUPS() +{ + return fShowUPS; } /// ***** Private Methods *****