~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Proof that check_errors() is sufficient.
[sgt/puzzles]
/
nullgame.c
diff --git
a/nullgame.c
b/nullgame.c
index
8af76ce
..
118cefe
100644
(file)
--- a/
nullgame.c
+++ b/
nullgame.c
@@
-94,7
+94,7
@@
static char *validate_desc(game_params *params, char *desc)
return NULL;
}
return NULL;
}
-static game_state *new_game(midend
_data
*me, game_params *params, char *desc)
+static game_state *new_game(midend *me, game_params *params, char *desc)
{
game_state *state = snew(game_state);
{
game_state *state = snew(game_state);
@@
-123,6
+123,11
@@
static char *solve_game(game_state *state, game_state *currstate,
return NULL;
}
return NULL;
}
+static int game_can_format_as_text_now(game_params *params)
+{
+ return TRUE;
+}
+
static char *game_text_format(game_state *state)
{
return NULL;
static char *game_text_format(game_state *state)
{
return NULL;
@@
-177,13
+182,13
@@
static void game_compute_size(game_params *params, int tilesize,
*x = *y = 10 * tilesize; /* FIXME */
}
*x = *y = 10 * tilesize; /* FIXME */
}
-static void game_set_size(
game_drawstate *ds, game_params *param
s,
- int tilesize)
+static void game_set_size(
drawing *dr, game_drawstate *d
s,
+
game_params *params,
int tilesize)
{
ds->tilesize = tilesize;
}
{
ds->tilesize = tilesize;
}
-static float *game_colours(frontend *fe,
game_state *state,
int *ncolours)
+static float *game_colours(frontend *fe, int *ncolours)
{
float *ret = snewn(3 * NCOLOURS, float);
{
float *ret = snewn(3 * NCOLOURS, float);
@@
-193,7
+198,7
@@
static float *game_colours(frontend *fe, game_state *state, int *ncolours)
return ret;
}
return ret;
}
-static game_drawstate *game_new_drawstate(game_state *state)
+static game_drawstate *game_new_drawstate(
drawing *dr,
game_state *state)
{
struct game_drawstate *ds = snew(struct game_drawstate);
{
struct game_drawstate *ds = snew(struct game_drawstate);
@@
-203,12
+208,12
@@
static game_drawstate *game_new_drawstate(game_state *state)
return ds;
}
return ds;
}
-static void game_free_drawstate(game_drawstate *ds)
+static void game_free_drawstate(
drawing *dr,
game_drawstate *ds)
{
sfree(ds);
}
{
sfree(ds);
}
-static void game_redraw(
frontend *fe
, game_drawstate *ds, game_state *oldstate,
+static void game_redraw(
drawing *dr
, game_drawstate *ds, game_state *oldstate,
game_state *state, int dir, game_ui *ui,
float animtime, float flashtime)
{
game_state *state, int dir, game_ui *ui,
float animtime, float flashtime)
{
@@
-218,7
+223,7
@@
static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
* should start by drawing a big background-colour rectangle
* covering the whole window.
*/
* should start by drawing a big background-colour rectangle
* covering the whole window.
*/
- draw_rect(
fe
, 0, 0, 10*ds->tilesize, 10*ds->tilesize, COL_BACKGROUND);
+ draw_rect(
dr
, 0, 0, 10*ds->tilesize, 10*ds->tilesize, COL_BACKGROUND);
}
static float game_anim_length(game_state *oldstate, game_state *newstate,
}
static float game_anim_length(game_state *oldstate, game_state *newstate,
@@
-233,14
+238,17
@@
static float game_flash_length(game_state *oldstate, game_state *newstate,
return 0.0F;
}
return 0.0F;
}
-static int game_
wants_statusbar(void
)
+static int game_
timing_state(game_state *state, game_ui *ui
)
{
{
- return
FALS
E;
+ return
TRU
E;
}
}
-static int game_timing_state(game_state *state)
+static void game_print_size(game_params *params, float *x, float *y)
+{
+}
+
+static void game_print(drawing *dr, game_state *state, int tilesize)
{
{
- return TRUE;
}
#ifdef COMBINED
}
#ifdef COMBINED
@@
-248,7
+256,7
@@
static int game_timing_state(game_state *state)
#endif
const struct game thegame = {
#endif
const struct game thegame = {
- "Null Game", NULL,
+ "Null Game", NULL,
NULL,
default_params,
game_fetch_preset,
decode_params,
default_params,
game_fetch_preset,
decode_params,
@@
-263,7
+271,7
@@
const struct game thegame = {
dup_game,
free_game,
FALSE, solve_game,
dup_game,
free_game,
FALSE, solve_game,
- FALSE, game_text_format,
+ FALSE, game_
can_format_as_text_now, game_
text_format,
new_ui,
free_ui,
encode_ui,
new_ui,
free_ui,
encode_ui,
@@
-278,7
+286,8
@@
const struct game thegame = {
game_redraw,
game_anim_length,
game_flash_length,
game_redraw,
game_anim_length,
game_flash_length,
- game_wants_statusbar,
+ FALSE, FALSE, game_print_size, game_print,
+ FALSE, /* wants_statusbar */
FALSE, game_timing_state,
FALSE, game_timing_state,
- 0, /*
mouse_prioritie
s */
+ 0, /*
flag
s */
};
};