added using namespace pg to relavent files ... will remove at some point
[physics.git] / src / config / config.cpp
... / ...
CommitLineData
1/*
2 * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "config.h"
19
20#include <pg/debug.h>
21using namespace pg;
22
23#include <SDL/SDL.h>
24#include "keys.h"
25
26#include "reader.h"
27#include "input/inputManager.h"
28
29/// ***** Private Method Headers *****
30/// ***** Private Variables *****
31
32bool fPaused = false;
33
34bool fEndGame = false;
35
36bool fWellFollow= false;
37bool fWellOn = false;
38bool fWellOff = false;
39
40bool fShowFPS = true;
41bool fShowUPS = true;
42
43/// ***** Initializers/Cleaners *****
44
45void cfg::init()
46{
47 key::init();
48 readConfigs();
49
50 // TODO read in config files
51}
52void cfg::clean()
53{
54 // TODO save to config files?
55}
56
57/// ***** Public Methods *****
58
59void cfg::handleInput()
60{
61 fPaused = input::wasPressed (key::pause) ? !fPaused : fPaused;
62
63 fEndGame = input::wasReleased(key::end);
64
65 fWellFollow = input::isPressed (key::follow);
66 fWellOn = input::wasPressed (key::well);
67 fWellOff = input::wasReleased(key::well);
68}
69
70bool cfg::paused()
71{
72 return fPaused;
73}
74
75bool cfg::endGame()
76{
77 return fEndGame;
78}
79
80bool cfg::mouseWellFollow()
81{
82 return fWellFollow;
83}
84bool cfg::mouseWellOn()
85{
86 return fWellOn;
87}
88bool cfg::mouseWellOff()
89{
90 return fWellOff;
91}
92
93bool cfg::showFPS()
94{
95 return fShowFPS;
96}
97bool cfg::showUPS()
98{
99 return fShowUPS;
100}
101
102/// ***** Private Methods *****