Debian Codegraph @

src/snipe2d.h

raw symbols SCIP
1 ///////////////////////////////////////////////cxx . . $ `<file>/src/snipe2d.h`/
2 //
3 // Snipe2d ludum dare 48h compo entry
4 //
5 // Jari Komppa aka Sol
6 // http://iki.fi/sol
7 //
8 ///////////////////////////////////////////////
9 // License
10 ///////////////////////////////////////////////
11 //
12 // This software is provided 'as-is', without any express or implied
13 // warranty. In no event will the authors be held liable for any damages
14 // arising from the use of this software.
15 //
16 // Permission is granted to anyone to use this software for any purpose,
17 // including commercial applications, and to alter it and redistribute it
18 // freely, subject to the following restrictions:
19 //
20 // 1. The origin of this software must not be misrepresented; you must not
21 // claim that you wrote the original software. If you use this software
22 // in a product, an acknowledgment in the product documentation would be
23 // appreciated but is not required.
24 // 2. Altered source versions must be plainly marked as such, and must not be
25 // misrepresented as being the original software.
26 // 3. This notice may not be removed or altered from any source distribution.
27 //
28 // (eg. same as ZLIB license)
29 //
30 ///////////////////////////////////////////////
31 //
32 // Houses are taken from a satellite picture of glasgow.
33 //
34 // The sources are a mess, as I didn't even try to do anything
35 // really organized here.. and hey, it's a 48h compo =)
36 //
37 //#include <windows.h>
38 #include <iostream>
39 #include <stdlib.h>
40 #include <limits.h>
41 #include <math.h>
42 #include <string.h>
43 #include <libgen.h>
44 #include <SDL/SDL.h>
45 #include <SDL/SDL_image.h>
46 #include <SDL/SDL_mixer.h>
47 #include <sys/types.h>
48 #include <sys/stat.h>
49 #include <fcntl.h>
50 #include <unistd.h>
51 #include <stdio.h>
52 #include <string.h>
53 #include <stdarg.h>
54 #include "petopt.h"cxx . . $ `<file>/src/petopt.h`/
55
56 #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:481:9`!
57 # include "config.h"cxx . . $ `<file>/config.h`/
58 #endif
59
60 // When trying to debug a segfault, you REALLY, REALLY need to be able to
61 // switch windows. :(
62 #ifdef DEBUG_MODE
63 #undef SDL_GRAB_ON
64 #define SDL_GRAB_ON SDL_GRAB_OFF
65 #endif
66 // Config:
67
68 #define SHIFT_AMOUNTcxx . . $ `src/snipe2d.h:68:9`! 12
69 #define CAMERA_STEPScxx . . $ `src/snipe2d.h:69:9`!
70 #define UNREAL_DITHERcxx . . $ `src/snipe2d.h:70:9`!
71 #define WOBBLEcxx . . $ `src/snipe2d.h:71:9`! 2
72 #define DISPLAY_LOGO_SCREENcxx . . $ `src/snipe2d.h:72:9`!
73 #define DISPLAY_GAMEOVER_SCREENcxx . . $ `src/snipe2d.h:73:9`!
74 //#define CAMERA_RECOIL
75 //#define RECYCLE_PEDESTRIANS
76 #define PLAY_AUDIOcxx . . $ `src/snipe2d.h:76:9`!
77
78 enum COLORSETcxx . . $ COLORSET# {
79 COLOR_BLACKcxx . . $ COLOR_BLACK. = 0,
80 COLOR_WHITEcxx . . $ COLOR_WHITE.,
81 COLOR_GREENcxx . . $ COLOR_GREEN.,
82 COLOR_YELLOWcxx . . $ COLOR_YELLOW.,
83 COLOR_REDcxx . . $ COLOR_RED.
84 };
85
86 enum CHARTYPEScxx . . $ CHARTYPES#
87 {
88 CHAR_BADGUYcxx . . $ CHAR_BADGUY. = 0,
89 CHAR_VIPcxx . . $ CHAR_VIP. = 1,
90 CHAR_PEDESTRIANcxx . . $ CHAR_PEDESTRIAN. = 2
91 };
92
93 enum SOUNDCHANcxx . . $ SOUNDCHAN# {
94 SOUNDCHAN_EFFECTcxx . . $ SOUNDCHAN_EFFECT. = 0,
95 SOUNDCHAN_MUSICcxx . . $ SOUNDCHAN_MUSIC. = 1,
96 };
97
98
99 /* Reason for game over */
100 typedef enum OES_ENDREASONcxx . . $ OES_ENDREASON# {
101 OESREASON_NONEcxx . . $ OESREASON_NONE. = 0, /* game in progress */
102 OESREASON_NEGLIGENTcxx . . $ OESREASON_NEGLIGENT., /* let a VIP die. */
103 OESREASON_AWOLcxx . . $ OESREASON_AWOL., /* left post (voluntary game end). */
104 OESREASON_FRAGcxx . . $ OESREASON_FRAG., /* hit VIP. */
105 OESREASON_QUITcxx . . $ OESREASON_QUIT., /* forceful quit. */
106 } OES_ENDREASONcxx . . $ OES_ENDREASON#;
107
108
109 /* Game states */
110 typedef enum OES_GAMESTATEcxx . . $ OES_GAMESTATE# {
111 OESGAME_CHAOScxx . . $ OESGAME_CHAOS. = 0, /* uninitialized. */
112 OESGAME_PLAYcxx . . $ OESGAME_PLAY., /* initialized and in play. */
113 OESGAME_PAUSEDcxx . . $ OESGAME_PAUSED., /* paused. */
114 OESGAME_UNPAUSEDcxx . . $ OESGAME_UNPAUSED., /* un-paused, reinitalize system resources (devices). */
115 } OES_GAMESTATEcxx . . $ OES_GAMESTATE#;
116
117
118 /* data types go here. */
119
120 typedef struct character_cxx . . $ character_#
121 {
122 float mXcxx . . $ character_#mX., mYcxx . . $ character_#mY.; // position
123 float mXicxx . . $ character_#mXi., mYicxx . . $ character_#mYi.; // direction
124 float mSpeedcxx . . $ character_#mSpeed.; // speed of this AI
125 int mTypecxx . . $ character_#mType.; // AI type
126 int mTTLcxx . . $ character_#mTTL.; // time to live, for normal pedestrians
127 int mTargetcxx . . $ character_#mTarget.; // target exit point or target character
128 int mNextWaypointcxx . . $ character_#mNextWaypoint.; // waypoint towards which this AI is walking
129 int mLastWaypointscxx . . $ character_#mLastWaypoints.[7]; // last 7 waypoints to kill loops
130 int mLastWaypointcxx . . $ character_#mLastWaypoint.; // counter for above array
131 } CHARACTERcxx . . $ CHARACTER#;
132
133 typedef struct waypointstruccxx . . $ waypointstruc#
134 {
135 int mXcxx . . $ waypointstruc#mX.,mYcxx . . $ waypointstruc#mY.;
136 int *mConnectioncxx . . $ waypointstruc#mConnection.;
137 int mConnectionscxx . . $ waypointstruc#mConnections.;
138 } WAYPOINTcxx . . $ WAYPOINT#;
139
140 typedef struct spawnpointstruccxx . . $ spawnpointstruc#
141 {
142 int mXcxx . . $ spawnpointstruc#mX., mYcxx . . $ spawnpointstruc#mY.;
143 int mClosestWaypointcxx . . $ spawnpointstruc#mClosestWaypoint.;
144 int mTypecxx . . $ spawnpointstruc#mType.;
145 } SPAWNPOINTcxx . . $ SPAWNPOINT#;
146
147 typedef struct prefs_cxx . . $ prefs_#
148 {
149 char *homedircxx . . $ prefs_#homedir.;
150 char *datadircxx . . $ prefs_#datadir.;
151 char *cfgpathcxx . . $ prefs_#cfgpath.;
152 char *scorepathcxx . . $ prefs_#scorepath.;
153 char *bindpathcxx . . $ prefs_#bindpath.;
154 char *keyspathcxx . . $ prefs_#keyspath.;
155 FILEcxx . . $ FILE# *fcxx . . $ prefs_#f.;
156 char verbosecxx . . $ prefs_#verbose.;
157 char fullscreencxx . . $ prefs_#fullscreen.;
158 char audiocxx . . $ prefs_#audio.;
159 char difficultycxx . . $ prefs_#difficulty.;
160 char joystickcxx . . $ prefs_#joystick.;
161 char *wwwbrowsercxx . . $ prefs_#wwwbrowser.;
162 } PREFScxx . . $ PREFS#;
163
164 typedef struct scores_cxx . . $ scores_#
165 {
166 char easy_ncxx . . $ scores_#easy_n.[10][9];
167 int easy_scxx . . $ scores_#easy_s.[10];
168 char medium_ncxx . . $ scores_#medium_n.[10][9];
169 int medium_scxx . . $ scores_#medium_s.[10];
170 char hard_ncxx . . $ scores_#hard_n.[10][9];
171 int hard_scxx . . $ scores_#hard_s.[10];
172 } SCOREScxx . . $ SCORES#;
173
174 typedef struct BUTTONScxx . . $ BUTTONS# {
175 SDL_Surface *startgamecxx . . $ BUTTONS#startgame.;
176 SDL_Surface *startgamehcxx . . $ BUTTONS#startgameh.;
177 SDL_Surface *fullscreencxx . . $ BUTTONS#fullscreen.;
178 SDL_Surface *fullscreenhcxx . . $ BUTTONS#fullscreenh.;
179 SDL_Surface *windowcxx . . $ BUTTONS#window.;
180 SDL_Surface *windowhcxx . . $ BUTTONS#windowh.;
181 SDL_Surface *audiooncxx . . $ BUTTONS#audioon.;
182 SDL_Surface *audiooffcxx . . $ BUTTONS#audiooff.;
183 SDL_Surface *audioonhcxx . . $ BUTTONS#audioonh.;
184 SDL_Surface *audiooffhcxx . . $ BUTTONS#audiooffh.;
185 SDL_Surface *easycxx . . $ BUTTONS#easy.;
186 SDL_Surface *easyhcxx . . $ BUTTONS#easyh.;
187 SDL_Surface *mediumcxx . . $ BUTTONS#medium.;
188 SDL_Surface *mediumhcxx . . $ BUTTONS#mediumh.;
189 SDL_Surface *hardcxx . . $ BUTTONS#hard.;
190 SDL_Surface *hardhcxx . . $ BUTTONS#hardh.;
191 SDL_Surface *hiscorescxx . . $ BUTTONS#hiscores.;
192 SDL_Surface *hiscoreshcxx . . $ BUTTONS#hiscoresh.;
193 SDL_Surface *prefscxx . . $ BUTTONS#prefs.;
194 SDL_Surface *prefshcxx . . $ BUTTONS#prefsh.;
195 SDL_Surface *quitcxx . . $ BUTTONS#quit.;
196 SDL_Surface *quithcxx . . $ BUTTONS#quith.;
197 SDL_Surface *resumecxx . . $ BUTTONS#resume.;
198 SDL_Surface *resumehcxx . . $ BUTTONS#resumeh.;
199 } BUTTONScxx . . $ BUTTONS#;
200
201 #if 0
202 class SniperBGM {
203 Mix_Music *BGM;
204 int playp;
205 int pausep;
206 int startTime, stopTime;
207 float bookmark;
208 static const int FadeInTime = 3000;
209 static const int FadeOutTime = 1000;
210 static const float RepeatJumpPos = 0.0;
211 public:
212 SniperBGM();
213 SniperBGM(Mix_Music *m);
214 ~SniperBGM();
215 const SniperBGM & operator=(Mix_Music *m);
216 operator Mix_Music*() const;
217 void use(Mix_Music *m);
218 void start();
219 void stimulate();
220 void depress();
221 void stop();
222 void pause();
223 void pause(int newstate);
224 void jumpto(float pos);
225 void rewind();
226 void loop();
227 void release();
228 void grab();
229 };
230 #endif /* 0 */
231
232 /* Phasing out class SniperBGM */
233 typedef struct sniperbgm_tcxx . . $ sniperbgm_t# {
234 Mix_Music *BGMcxx . . $ sniperbgm_t#BGM.;
235 int playpcxx . . $ sniperbgm_t#playp.;
236 int pausepcxx . . $ sniperbgm_t#pausep.;
237 int time_startcxx . . $ sniperbgm_t#time_start.;
238 int time_stopcxx . . $ sniperbgm_t#time_stop.;
239 float bookmarkcxx . . $ sniperbgm_t#bookmark.;
240 } sniperbgm_tcxx . . $ sniperbgm_t#;
241
242 #define sniperbgm_FadeInTimecxx . . $ `src/snipe2d.h:242:9`! 3000
243 #define sniperbgm_FadeOutTimecxx . . $ `src/snipe2d.h:243:9`! 1000
244 #define sniperbgm_RepeatJumpPoscxx . . $ `src/snipe2d.h:244:9`! 0.0
245
246 sniperbgm_tcxx . . $ sniperbgm_t# * sniperbgm_initcxx . . $ sniperbgm_init(74624cd5faa1f97e). (sniperbgm_tcxx . . $ sniperbgm_t# *);
247 sniperbgm_tcxx . . $ sniperbgm_t# * sniperbgm_init_musiccxx . . $ sniperbgm_init_music(26a9d92e68a31028). (sniperbgm_tcxx . . $ sniperbgm_t# *, Mix_Music *);
248 sniperbgm_tcxx . . $ sniperbgm_t# * sniperbgm_destroycxx . . $ sniperbgm_destroy(74624cd5faa1f97e). (sniperbgm_tcxx . . $ sniperbgm_t# *);
249 void sniperbgm_deletecxx . . $ sniperbgm_delete(4db74b65ed7f6c67). (sniperbgm_tcxx . . $ sniperbgm_t# *);
250 Mix_Music * sniperbgm_musiccxx . . $ sniperbgm_music(2094606d626ac5db). (sniperbgm_tcxx . . $ sniperbgm_t# *);
251 int sniperbgm_usecxx . . $ sniperbgm_use(f56ea5b978ff069f). (sniperbgm_tcxx . . $ sniperbgm_t# *, Mix_Music *);
252 void sniperbgm_startcxx . . $ sniperbgm_start(4db74b65ed7f6c67). (sniperbgm_tcxx . . $ sniperbgm_t# *);
253 void sniperbgm_stimulatecxx . . $ sniperbgm_stimulate(4db74b65ed7f6c67). (sniperbgm_tcxx . . $ sniperbgm_t# *);
254 void sniperbgm_depresscxx . . $ sniperbgm_depress(4db74b65ed7f6c67). (sniperbgm_tcxx . . $ sniperbgm_t# *);
255 void sniperbgm_stopcxx . . $ sniperbgm_stop(4db74b65ed7f6c67). (sniperbgm_tcxx . . $ sniperbgm_t# *);
256 void sniperbgm_pausecxx . . $ sniperbgm_pause(98d8e6f92d821ace). (sniperbgm_tcxx . . $ sniperbgm_t# *, int);
257 void sniperbgm_jumptocxx . . $ sniperbgm_jumpto(356a4784eba0f491). (sniperbgm_tcxx . . $ sniperbgm_t# *, float);
258 void sniperbgm_rewindcxx . . $ sniperbgm_rewind(4db74b65ed7f6c67). (sniperbgm_tcxx . . $ sniperbgm_t# *);
259 void sniperbgm_loopcxx . . $ sniperbgm_loop(4db74b65ed7f6c67). (sniperbgm_tcxx . . $ sniperbgm_t# *);
260 void sniperbgm_releasecxx . . $ sniperbgm_release(4db74b65ed7f6c67). (sniperbgm_tcxx . . $ sniperbgm_t# *);
261 void sniperbgm_grabcxx . . $ sniperbgm_grab(4db74b65ed7f6c67). (sniperbgm_tcxx . . $ sniperbgm_t# *);
262
263
264
265 /* character counter/generator state */
266 typedef struct charcount_tcxx . . $ charcount_t# {
267 int spawncxx . . $ charcount_t#spawn.; /* SpawnCount */
268 int countcxx . . $ charcount_t#count.; /* Count */
269 int deadcxx . . $ charcount_t#dead.; /* Killed */
270 int goalcxx . . $ charcount_t#goal.; /* GottenToSafety */
271 float timecxx . . $ charcount_t#time.; /* SpawnTime */
272 float periodcxx . . $ charcount_t#period.; /* SpawnTimePeriod */
273 } charcount_tcxx . . $ charcount_t#;
274
275 #if 0
276 typedef struct soundeffect_t {
277 Mix_Chunk *data;
278 int len;
279 int ofs;
280 } soundeffect_t;
281 #endif /* 0 */
282
283 /* game state */
284 typedef struct orbitalsniper_tcxx . . $ orbitalsniper_t# {
285 SDL_Surface *Screencxx . . $ orbitalsniper_t#Screen.;
286 SDL_Surface *Mapcxx . . $ orbitalsniper_t#Map.;
287 SDL_Surface *AIMapcxx . . $ orbitalsniper_t#AIMap.;
288 SDL_Surface *Fontcxx . . $ orbitalsniper_t#Font.[5];
289 SDL_Surface *CharSpritecxx . . $ orbitalsniper_t#CharSprite.;
290
291 int ControlStatecxx . . $ orbitalsniper_t#ControlState.;
292 float MouseXcxx . . $ orbitalsniper_t#MouseX.;
293 float MouseYcxx . . $ orbitalsniper_t#MouseY.;
294 float MouseZcxx . . $ orbitalsniper_t#MouseZ.;
295 float CoordScalecxx . . $ orbitalsniper_t#CoordScale.;
296
297 int WobbleIndexcxx . . $ orbitalsniper_t#WobbleIndex.;
298 float WobbleXcxx . . $ orbitalsniper_t#WobbleX.;
299 float WobbleYcxx . . $ orbitalsniper_t#WobbleY.;
300 float CenterXcxx . . $ orbitalsniper_t#CenterX.;
301 float CenterYcxx . . $ orbitalsniper_t#CenterY.;
302
303 int verbositycxx . . $ orbitalsniper_t#verbosity.;
304 int Reloadingcxx . . $ orbitalsniper_t#Reloading.;
305 int ReloadTimecxx . . $ orbitalsniper_t#ReloadTime.;
306 int StartTickcxx . . $ orbitalsniper_t#StartTick.;
307 int GameStartTickcxx . . $ orbitalsniper_t#GameStartTick.;
308 int GameOverTickscxx . . $ orbitalsniper_t#GameOverTicks.;
309 OES_ENDREASONcxx . . $ OES_ENDREASON# GameOverReasoncxx . . $ orbitalsniper_t#GameOverReason.;
310 int FrameCountcxx . . $ orbitalsniper_t#FrameCount.;
311 int LastTickcxx . . $ orbitalsniper_t#LastTick.;
312 int Scorecxx . . $ orbitalsniper_t#Score.;
313 float ScoreModcxx . . $ orbitalsniper_t#ScoreMod.; /* score modifier. */
314
315 charcount_tcxx . . $ charcount_t# vipcxx . . $ orbitalsniper_t#vip.; /* keep alive at all costs. */
316 charcount_tcxx . . $ charcount_t# baddycxx . . $ orbitalsniper_t#baddy.; /* BadGuys */
317 charcount_tcxx . . $ charcount_t# pedestriancxx . . $ orbitalsniper_t#pedestrian.; /* collateral damage. */
318
319 int num_characterscxx . . $ orbitalsniper_t#num_characters.;
320 CHARACTERcxx . . $ CHARACTER# *characterscxx . . $ orbitalsniper_t#characters.; /* List of all characters in game */
321 int num_spawnpointscxx . . $ orbitalsniper_t#num_spawnpoints.;
322 SPAWNPOINTcxx . . $ SPAWNPOINT# *spawnpointscxx . . $ orbitalsniper_t#spawnpoints.; /* List of spawnpoints */
323 int num_waypointscxx . . $ orbitalsniper_t#num_waypoints.;
324 WAYPOINTcxx . . $ WAYPOINT# *waypointscxx . . $ orbitalsniper_t#waypoints.; /* List of waypoints */
325 CHARACTERcxx . . $ CHARACTER# * SightedCharactercxx . . $ orbitalsniper_t#SightedCharacter.;
326 SCOREScxx . . $ SCORES# HiScorecxx . . $ orbitalsniper_t#HiScore.; /* high scores list */
327
328 // soundeffect_t AudioZoomSample;
329 // soundeffect_t AudioFireSample;
330 Mix_Chunk *AudioZoomOutcxx . . $ orbitalsniper_t#AudioZoomOut.;
331 Mix_Chunk *AudioZoomIncxx . . $ orbitalsniper_t#AudioZoomIn.;
332 Mix_Chunk *AudioFirecxx . . $ orbitalsniper_t#AudioFire.;
333
334 int GameStatecxx . . $ orbitalsniper_t#GameState.;
335 SDL_AudioSpec *sdlaudiocxx . . $ orbitalsniper_t#sdlaudio.;
336 // SniperBGM BGM;
337 sniperbgm_tcxx . . $ sniperbgm_t# *BGMcxx . . $ orbitalsniper_t#BGM.;
338 int GrabPcxx . . $ orbitalsniper_t#GrabP.; /* mouse grab */
339 int BeforePauseTickcxx . . $ orbitalsniper_t#BeforePauseTick.; /* keep spawn-timing across pauses. */
340 int AfterPauseTickcxx . . $ orbitalsniper_t#AfterPauseTick.;
341 int SemiPausecxx . . $ orbitalsniper_t#SemiPause.; /* double-click timer. */
342
343 char *mediaPathcxx . . $ orbitalsniper_t#mediaPath.;
344 // int unreal_dither[];
345 } ORBITALSNIPERcxx . . $ ORBITALSNIPER#;
346
347
348 /* globals. */
349
350 extern BUTTONScxx . . $ BUTTONS# gButtoncxx . . $ gButton.;
351 extern int unreal_dithercxx . . $ unreal_dither.[];
352 extern char *mediaPathcxx . . $ mediaPath.;
353
354 extern ORBITALSNIPERcxx . . $ ORBITALSNIPER# Gamecxx . . $ Game.;
355
356
357 /* function prototypes. */
358 extern float distancecxx . . $ distance(95d5df56d1097f86).(float aX1, float aY1, float aX2, float aY2);
359 extern float distance_wpcxx . . $ distance_wp(862d6589e008f424).(int aWaypoint, float aX, float aY);
360 extern float distance_wpwpcxx . . $ distance_wpwp(ac70f22789a9917c).(int aWaypoint1, int aWaypoint2);
361 extern void handle_aicxx . . $ handle_ai(538e78ad5df5d635).(CHARACTERcxx . . $ CHARACTER# &c);
362 extern int spawn_aicxx . . $ spawn_ai(7864480464b09eea).(int aType);
363
364 extern void printcxx . . $ print(e6b86272566182ce).(int aXofs, int aYofs, int aColor, const char *aString, ...);
365 extern void printShadowcxx . . $ printShadow(9514e36549094170).(int aXofs, int aYofs, const char *aString, ...);
366 extern void zoomcxx . . $ zoom(c450de46b9b492d1).(SDL_Surface * src, float ofsx, float ofsy, float scale);
367 extern void zoom_unrealcxx . . $ zoom_unreal(c450de46b9b492d1).(SDL_Surface * src, float ofsx, float ofsy, float scale);
368 extern void drawLinecxx . . $ drawLine(fa5faf37b232239e).(SDL_Surface * aTarget, int x1,int y1,int x2, int y2, int clr);
369 extern void targetcxx . . $ target(49f6e7a06ebc5aa8).();
370 extern void initcxx . . $ init(49f6e7a06ebc5aa8).();
371 extern void init_logoscreencxx . . $ init_logoscreen(49f6e7a06ebc5aa8).();
372 extern void logoscreencxx . . $ logoscreen(49f6e7a06ebc5aa8).();
373 extern void precalc_aicxx . . $ precalc_ai(49f6e7a06ebc5aa8).();
374 extern void shootcxx . . $ shoot(49f6e7a06ebc5aa8).();
375 extern void gameoverscreencxx . . $ gameoverscreen(d4f767463ce0a6b3).(int aReason);
376
377 extern void drawCharactercxx . . $ drawCharacter(538e78ad5df5d635).(CHARACTERcxx . . $ CHARACTER# &c);
378
379 extern void configure_difficultycxx . . $ configure_difficulty(49f6e7a06ebc5aa8).();
380
381 /* setup and teardown */
382 int oes_setupcxx . . $ oes_setup(b126dc7c1de90089). ();
383 void oes_teardowncxx . . $ oes_teardown(49f6e7a06ebc5aa8). ();
384 int oes_suspendcxx . . $ oes_suspend(b126dc7c1de90089).();
385 int oes_resumecxx . . $ oes_resume(b126dc7c1de90089).();
386
387 /* Preferences */
388 PREFScxx . . $ PREFS# *prefs_initcxx . . $ prefs_init(fac825aec9ca7bcf). (PREFScxx . . $ PREFS# *);
389 PREFScxx . . $ PREFS# *prefs_destroycxx . . $ prefs_destroy(fac825aec9ca7bcf). (PREFScxx . . $ PREFS# *);
390 void prefs_deletecxx . . $ prefs_delete(524415c8f49fd7f5). (PREFScxx . . $ PREFS# *);
391 PREFScxx . . $ PREFS# *prefs_loadcxx . . $ prefs_load(fac825aec9ca7bcf). (PREFScxx . . $ PREFS# *);
392 PREFScxx . . $ PREFS# *prefs_savecxx . . $ prefs_save(fac825aec9ca7bcf). (PREFScxx . . $ PREFS# *);
393 PREFScxx . . $ PREFS# *prefs_createcxx . . $ prefs_create(fac825aec9ca7bcf). (PREFScxx . . $ PREFS# *);
394
395 extern void show_hiscorescxx . . $ show_hiscores(49f6e7a06ebc5aa8).();
396 extern void init_hiscorescxx . . $ init_hiscores(49f6e7a06ebc5aa8).();
397 extern void process_hiscorecxx . . $ process_hiscore(49f6e7a06ebc5aa8).();
398 extern void save_hiscorescxx . . $ save_hiscores(49f6e7a06ebc5aa8).();
399
400 extern void prefscxx . . $ prefs(49f6e7a06ebc5aa8).();
401
402
403 void draw_buttoncxx . . $ draw_button(7bfbf473ac25ecb8). (SDL_Surface *b, int x, int y);
404
405 // FIXME: everybody should use this.
406 SDL_Surface *oes_load_imgcxx . . $ oes_load_img(998637ddb3131754). (const char *path);
407
408 bool hoveringcxx . . $ hovering(a1642a0ee405ca20). (int x, int y, int w, int h);
409
410
411 /* drawing */
412 void oes_fillrectcxx . . $ oes_fillrect(fa5faf37b232239e). (SDL_Surface *, int x0, int y0, int x1, int y1, int color);
413
414 int draw_gameovercxx . . $ draw_gameover(715989be3a25e77e). (SDL_Surface *, const SDL_Rect *);
415 int draw_hiscorescxx . . $ draw_hiscores(715989be3a25e77e). (SDL_Surface *, const SDL_Rect *);
416
417
418 /* S-Expressions (libsexpr) */
419
420 #define PAIRPcxx . . $ `src/snipe2d.h:420:9`!(se) ((se)->ty == SEXP_LIST)
421 #define ATOMPcxx . . $ `src/snipe2d.h:421:9`!(se) ((se)->ty == SEXP_VALUE)
422 #define CARcxx . . $ `src/snipe2d.h:422:9`!(se) (ATOMP(se) ? se : hd_sexp(se))
423 #define CDRcxx . . $ `src/snipe2d.h:423:9`!(se) (ATOMP(se) ? next_sexp(se) : tl_sexp(se))
424
425 int prefs_loadcxx . . $ prefs_load(b126dc7c1de90089). ();
426 int prefs_savecxx . . $ prefs_save(b126dc7c1de90089). ();
427 int prefs_initcxx . . $ prefs_init(b126dc7c1de90089). ();
428
429
430 int oes_gamecxx . . $ oes_game(b126dc7c1de90089). (); /* main game loop */
431
432 #include "ui.h"cxx . . $ `<file>/src/ui.h`/
433
434
435