OSDN Git Service

README-jp.txtのBOMを削除した
[starfighter-jp/starfighter-jp.git] / src / engine.h
1 /*
2 Copyright (C) 2003 Parallel Realities
3 Copyright (C) 2011 Guus Sliepen
4 Copyright (C) 2015, 2016 onpon4 <onpon4@riseup.net>
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 3
9 of the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef GLOBALS_H
21 #define GLOBALS_H
22
23 #include "SDL.h"
24
25 #include "defs.h"
26 #include "structs.h"
27
28
29 typedef struct Engine_ {
30
31         SDL_Event event;
32         int done;
33
34         SDL_RWops *sdlrw;
35
36         float musicVolume;
37
38         int maxAliens;
39
40         float ssx;
41         float ssy;
42         float smx;
43         float smy;
44
45         object *bulletHead;
46         object *bulletTail;
47         object *explosionHead;
48         object *explosionTail;
49         collectables *collectableHead;
50         collectables *collectableTail;
51         object *debrisHead;
52         object *debrisTail;
53
54         int cursor_x, cursor_y;
55
56         int commsSection;
57
58         int eventTimer;
59
60         int lowShield;
61         int averageShield;
62
63         float targetShield;
64         int targetIndex;
65
66         // Mission completion timer (allows for 4 seconds before leaving sector)
67         Uint32 missionCompleteTimer;
68
69         // Times the mission normally
70         Uint32 counter2;
71         long timeTaken; // In seconds
72
73         // For missions with a time limit
74         int timeMission;
75         Uint32 counter;
76         int seconds;
77         int minutes;
78
79         // Mission Related stuff
80         int allAliensDead;
81         int addAliens;
82
83         bool paused;
84         int gameSection;
85
86         bool useAudio;
87         bool useSound;
88         bool useMusic;
89         bool fullScreen;
90         bool autoPause;
91
92         char configDirectory[1024];
93         
94         char keyState[KEY_LAST];
95
96         bool cheat; // overall cheat
97         bool cheatShield;
98         bool cheatCash;
99         bool cheatAmmo;
100         bool cheatTime;
101         bool cheatCredits;
102
103 } Engine;
104
105
106 extern Engine engine;
107
108 void engine_init();
109 void engine_showError(int errorId, const char *name);
110 void engine_setupConfigDirectory();
111 void engine_setMode();
112 void engine_cleanup();
113
114 #endif