X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=src%2Fconfig%2Fconfig.cpp;h=709c5ffb2ebeff17a464c276b7759d841289b88d;hb=3d1f081343dc603a3292538eeb9bd794b255deb6;hp=9aa6f862bce9cc18bb7e584f25297ace6083e3e3;hpb=87c9b12ffbcb8458c7e031045d34d2a1de5ea78a;p=physics.git diff --git a/src/config/config.cpp b/src/config/config.cpp index 9aa6f86..709c5ff 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -16,18 +16,35 @@ */ #include "config.h" +#include "debug.h" + +#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 +54,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 *****