created key system, not yet used as there's a static bug
[physics.git] / src / config / config.cpp
CommitLineData
8f8b6693
PG
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
b1d92c2f 18#include "config.h"
87c9b12f 19
b552aa3b
PG
20#include <SDL/SDL.h>
21#include "keys.h"
22
87c9b12f 23#include "reader.h"
8f8b6693
PG
24#include "../input/inputManager.h"
25
26/// ***** Private Method Headers *****
27/// ***** Private Variables *****
28
29/// ***** Initializers/Cleaners *****
30
b1d92c2f
PG
31void cfg::init()
32{
87c9b12f 33 readConfigs(NULL);
b552aa3b 34
b1d92c2f 35 // TODO read in config files
b552aa3b
PG
36
37 key::init();
b1d92c2f
PG
38}
39void cfg::clean()
40{
41 // TODO save to config files?
b552aa3b
PG
42
43 key::clean();
b1d92c2f
PG
44}
45
8f8b6693
PG
46/// ***** Public Methods *****
47
b1d92c2f 48bool cfg::pause()
8f8b6693
PG
49{
50 return input::wasPressed(SDLK_p);
51}
b1d92c2f 52bool cfg::unPause()
8f8b6693
PG
53{
54 return input::wasPressed(SDLK_p);
55}
56
b1d92c2f
PG
57bool cfg::endGame()
58{
59 return input::wasReleased(SDLK_ESCAPE);
60}
61
f103ba70
PG
62bool cfg::mouseWellFollow()
63{
64 return input::isPressed(SDLK_f);
65}
a860c0c7
PG
66bool cfg::mouseWellOn()
67{
f103ba70
PG
68 return input::wasPressed(SDLK_SPACE);
69}
70bool cfg::mouseWellOff()
71{
72 return input::wasReleased(SDLK_SPACE);
a860c0c7
PG
73}
74
8f8b6693 75/// ***** Private Methods *****