summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/nullgame.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/puzzles/src/nullgame.c')
-rw-r--r--apps/plugins/puzzles/src/nullgame.c80
1 files changed, 15 insertions, 65 deletions
diff --git a/apps/plugins/puzzles/src/nullgame.c b/apps/plugins/puzzles/src/nullgame.c
index d923bc8710..c1c2ed18fd 100644
--- a/apps/plugins/puzzles/src/nullgame.c
+++ b/apps/plugins/puzzles/src/nullgame.c
@@ -16,7 +16,11 @@
16#include <string.h> 16#include <string.h>
17#include <assert.h> 17#include <assert.h>
18#include <ctype.h> 18#include <ctype.h>
19#include <math.h> 19#ifdef NO_TGMATH_H
20# include <math.h>
21#else
22# include <tgmath.h>
23#endif
20 24
21#include "puzzles.h" 25#include "puzzles.h"
22 26
@@ -68,16 +72,6 @@ static char *encode_params(const game_params *params, bool full)
68 return dupstr("FIXME"); 72 return dupstr("FIXME");
69} 73}
70 74
71static config_item *game_configure(const game_params *params)
72{
73 return NULL;
74}
75
76static game_params *custom_params(const config_item *cfg)
77{
78 return NULL;
79}
80
81static const char *validate_params(const game_params *params, bool full) 75static const char *validate_params(const game_params *params, bool full)
82{ 76{
83 return NULL; 77 return NULL;
@@ -118,22 +112,6 @@ static void free_game(game_state *state)
118 sfree(state); 112 sfree(state);
119} 113}
120 114
121static char *solve_game(const game_state *state, const game_state *currstate,
122 const char *aux, const char **error)
123{
124 return NULL;
125}
126
127static bool game_can_format_as_text_now(const game_params *params)
128{
129 return true;
130}
131
132static char *game_text_format(const game_state *state)
133{
134 return NULL;
135}
136
137static game_ui *new_ui(const game_state *state) 115static game_ui *new_ui(const game_state *state)
138{ 116{
139 return NULL; 117 return NULL;
@@ -143,15 +121,6 @@ static void free_ui(game_ui *ui)
143{ 121{
144} 122}
145 123
146static char *encode_ui(const game_ui *ui)
147{
148 return NULL;
149}
150
151static void decode_ui(game_ui *ui, const char *encoding)
152{
153}
154
155static void game_changed_state(game_ui *ui, const game_state *oldstate, 124static void game_changed_state(game_ui *ui, const game_state *oldstate,
156 const game_state *newstate) 125 const game_state *newstate)
157{ 126{
@@ -179,7 +148,7 @@ static game_state *execute_move(const game_state *state, const char *move)
179 */ 148 */
180 149
181static void game_compute_size(const game_params *params, int tilesize, 150static void game_compute_size(const game_params *params, int tilesize,
182 int *x, int *y) 151 const game_ui *ui, int *x, int *y)
183{ 152{
184 *x = *y = 10 * tilesize; /* FIXME */ 153 *x = *y = 10 * tilesize; /* FIXME */
185} 154}
@@ -220,14 +189,6 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
220 int dir, const game_ui *ui, 189 int dir, const game_ui *ui,
221 float animtime, float flashtime) 190 float animtime, float flashtime)
222{ 191{
223 /*
224 * The initial contents of the window are not guaranteed and
225 * can vary with front ends. To be on the safe side, all games
226 * should start by drawing a big background-colour rectangle
227 * covering the whole window.
228 */
229 draw_rect(dr, 0, 0, 10*ds->tilesize, 10*ds->tilesize, COL_BACKGROUND);
230 draw_update(dr, 0, 0, 10*ds->tilesize, 10*ds->tilesize);
231} 192}
232 193
233static float game_anim_length(const game_state *oldstate, 194static float game_anim_length(const game_state *oldstate,
@@ -255,19 +216,6 @@ static int game_status(const game_state *state)
255 return 0; 216 return 0;
256} 217}
257 218
258static bool game_timing_state(const game_state *state, game_ui *ui)
259{
260 return true;
261}
262
263static void game_print_size(const game_params *params, float *x, float *y)
264{
265}
266
267static void game_print(drawing *dr, const game_state *state, int tilesize)
268{
269}
270
271#ifdef COMBINED 219#ifdef COMBINED
272#define thegame nullgame 220#define thegame nullgame
273#endif 221#endif
@@ -280,21 +228,23 @@ const struct game thegame = {
280 encode_params, 228 encode_params,
281 free_params, 229 free_params,
282 dup_params, 230 dup_params,
283 false, game_configure, custom_params, 231 false, NULL, NULL, /* configure, custom_params */
284 validate_params, 232 validate_params,
285 new_game_desc, 233 new_game_desc,
286 validate_desc, 234 validate_desc,
287 new_game, 235 new_game,
288 dup_game, 236 dup_game,
289 free_game, 237 free_game,
290 false, solve_game, 238 false, NULL, /* solve */
291 false, game_can_format_as_text_now, game_text_format, 239 false, NULL, NULL, /* can_format_as_text_now, text_format */
240 NULL, NULL, /* get_prefs, set_prefs */
292 new_ui, 241 new_ui,
293 free_ui, 242 free_ui,
294 encode_ui, 243 NULL, /* encode_ui */
295 decode_ui, 244 NULL, /* decode_ui */
296 NULL, /* game_request_keys */ 245 NULL, /* game_request_keys */
297 game_changed_state, 246 game_changed_state,
247 NULL, /* current_key_label */
298 interpret_move, 248 interpret_move,
299 execute_move, 249 execute_move,
300 20 /* FIXME */, game_compute_size, game_set_size, 250 20 /* FIXME */, game_compute_size, game_set_size,
@@ -306,8 +256,8 @@ const struct game thegame = {
306 game_flash_length, 256 game_flash_length,
307 game_get_cursor_location, 257 game_get_cursor_location,
308 game_status, 258 game_status,
309 false, false, game_print_size, game_print, 259 false, false, NULL, NULL, /* print_size, print */
310 false, /* wants_statusbar */ 260 false, /* wants_statusbar */
311 false, game_timing_state, 261 false, NULL, /* timing_state */
312 0, /* flags */ 262 0, /* flags */
313}; 263};