projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changes to how configs react to input
[physics.git]
/
src
/
config
/
config.cpp
diff --git
a/src/config/config.cpp
b/src/config/config.cpp
index
7d71e8a
..
bb7ea7a
100644
(file)
--- a/
src/config/config.cpp
+++ b/
src/config/config.cpp
@@
-16,6
+16,7
@@
*/
#include "config.h"
*/
#include "config.h"
+#include "../debug.h"
#include <SDL/SDL.h>
#include "keys.h"
#include <SDL/SDL.h>
#include "keys.h"
@@
-26,50
+27,74
@@
/// ***** Private Method Headers *****
/// ***** Private Variables *****
/// ***** 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()
{
/// ***** Initializers/Cleaners *****
void cfg::init()
{
- readConfigs(NULL);
+ key::init();
+ readConfigs();
// TODO read in config files
// TODO read in config files
-
- key::init();
}
void cfg::clean()
{
// TODO save to config files?
}
void cfg::clean()
{
// TODO save to config files?
-
- key::clean();
}
/// ***** Public Methods *****
}
/// ***** 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()
{
}
bool cfg::endGame()
{
- return
input::wasReleased(SDLK_ESCAPE)
;
+ return
fEndGame
;
}
bool cfg::mouseWellFollow()
{
}
bool cfg::mouseWellFollow()
{
- return
input::isPressed(SDLK_f)
;
+ return
fWellFollow
;
}
bool cfg::mouseWellOn()
{
}
bool cfg::mouseWellOn()
{
- return
input::wasPressed(SDLK_SPACE)
;
+ return
fWellOn
;
}
bool cfg::mouseWellOff()
{
}
bool cfg::mouseWellOff()
{
- return input::wasReleased(SDLK_SPACE);
+ return fWellOff;
+}
+
+bool cfg::showFPS()
+{
+ return fShowFPS;
+}
+bool cfg::showUPS()
+{
+ return fShowUPS;
}
/// ***** Private Methods *****
}
/// ***** Private Methods *****