X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=src%2Fconfig%2Fconfig.cpp;h=88768f32e14bd22244dc7fa1593d400b95059389;hb=f32a9b7c8eab3536ad354f85ee65c41d5b5da006;hp=7d71e8a9651d19f5aa2b2c5c78be63e69c91a2dd;hpb=b552aa3b48a0b2a3e77523dfa0454265748bcf94;p=physics.git diff --git a/src/config/config.cpp b/src/config/config.cpp index 7d71e8a..88768f3 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -17,59 +17,85 @@ #include "config.h" +#include + #include #include "keys.h" #include "reader.h" -#include "../input/inputManager.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() { - readConfigs(NULL); + key::init(); + readConfigs(); // TODO read in config files - - key::init(); } void cfg::clean() { // TODO save to config files? - - key::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 input::isPressed(SDLK_f); + return fWellFollow; } bool cfg::mouseWellOn() { - return input::wasPressed(SDLK_SPACE); + return fWellOn; } bool cfg::mouseWellOff() { - return input::wasReleased(SDLK_SPACE); + return fWellOff; +} + +bool cfg::showFPS() +{ + return fShowFPS; +} +bool cfg::showUPS() +{ + return fShowUPS; } /// ***** Private Methods *****