Commit | Line | Data |
---|---|---|
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 |
31 | void 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 | } |
39 | void 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 | 48 | bool cfg::pause() |
8f8b6693 | 49 | { |
1c880d73 | 50 | return input::wasPressed(key::pause); |
8f8b6693 | 51 | } |
b1d92c2f | 52 | bool cfg::unPause() |
8f8b6693 | 53 | { |
1c880d73 | 54 | return input::wasPressed(key::pause); |
8f8b6693 PG |
55 | } |
56 | ||
b1d92c2f PG |
57 | bool cfg::endGame() |
58 | { | |
1c880d73 | 59 | return input::wasReleased(key::end); |
b1d92c2f PG |
60 | } |
61 | ||
f103ba70 PG |
62 | bool cfg::mouseWellFollow() |
63 | { | |
1c880d73 | 64 | return input::isPressed(key::follow); |
f103ba70 | 65 | } |
a860c0c7 PG |
66 | bool cfg::mouseWellOn() |
67 | { | |
1c880d73 | 68 | return input::wasPressed(key::well); |
f103ba70 PG |
69 | } |
70 | bool cfg::mouseWellOff() | |
71 | { | |
1c880d73 | 72 | return input::wasReleased(key::well); |
a860c0c7 PG |
73 | } |
74 | ||
8f8b6693 | 75 | /// ***** Private Methods ***** |