X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=src%2Fconfig%2Fconfig.cpp;h=6c46bf095d4550721cff8cd672059381a02ab97b;hb=5e0713e5967be038b1b0cc5f0ffbd0180e3f7099;hp=9aa6f862bce9cc18bb7e584f25297ace6083e3e3;hpb=87c9b12ffbcb8458c7e031045d34d2a1de5ea78a;p=physics.git diff --git a/src/config/config.cpp b/src/config/config.cpp index 9aa6f86..6c46bf0 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -17,17 +17,36 @@ #include "config.h" +#include +using namespace bear; + +#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 } void cfg::clean() @@ -37,31 +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 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 *****