reworked ups/fps/paused logic
[physics.git] / src / config / config.cpp
index 7d71e8a..69406bc 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include "config.h"
+#include "../debug.h"
 
 #include <SDL/SDL.h>
 #include "keys.h"
 /// ***** Private Method Headers *****
 /// ***** Private Variables *****
 
+bool fPaused = false;
+
 /// ***** 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()
-{
-    return input::wasPressed(SDLK_p);
-}
-bool cfg::unPause()
+bool cfg::paused()
 {
-    return input::wasPressed(SDLK_p);
+    fPaused = input::wasPressed(key::pause) ? !fPaused : fPaused;
+    return fPaused;
 }
 
 bool cfg::endGame()
 {
-    return input::wasReleased(SDLK_ESCAPE);
+    return input::wasReleased(key::end);
 }
 
 bool cfg::mouseWellFollow()
 {
-    return input::isPressed(SDLK_f);
+    return input::isPressed(key::follow);
 }
 bool cfg::mouseWellOn()
 {
-    return input::wasPressed(SDLK_SPACE);
+    return input::wasPressed(key::well);
 }
 bool cfg::mouseWellOff()
 {
-    return input::wasReleased(SDLK_SPACE);
+    return input::wasReleased(key::well);
+}
+
+bool cfg::showFPS()
+{
+    return true;
+}
+bool cfg::showUPS()
+{
+    return true;
 }
 
 /// ***** Private Methods *****