`Fifteen' was getting the parity wrong on any size of board where
[sgt/puzzles] / nullgame.c
CommitLineData
699b896a 1/*
2 * nullgame.c [FIXME]: Template defining the null game (in which no
3 * moves are permitted and nothing is ever drawn). This file exists
4 * solely as a basis for constructing new game definitions - it
5 * helps to have something which will compile from the word go and
6 * merely doesn't _do_ very much yet.
7 *
8 * Parts labelled FIXME actually want _removing_ (e.g. the dummy
9 * field in each of the required data structures, and this entire
10 * comment itself) when converting this source file into one
11 * describing a real game.
12 */
13
14#include <stdio.h>
15#include <stdlib.h>
16#include <string.h>
17#include <assert.h>
18#include <math.h>
19
20#include "puzzles.h"
21
22const char *const game_name = "Null Game";
c8230524 23const int game_can_configure = FALSE;
699b896a 24
25enum {
26 COL_BACKGROUND,
27 NCOLOURS
28};
29
30struct game_params {
31 int FIXME;
32};
33
34struct game_state {
35 int FIXME;
36};
37
38game_params *default_params(void)
39{
40 game_params *ret = snew(game_params);
41
42 ret->FIXME = 0;
43
44 return ret;
45}
46
47int game_fetch_preset(int i, char **name, game_params **params)
48{
49 return FALSE;
50}
51
52void free_params(game_params *params)
53{
54 sfree(params);
55}
56
57game_params *dup_params(game_params *params)
58{
59 game_params *ret = snew(game_params);
60 *ret = *params; /* structure copy */
61 return ret;
62}
63
c8230524 64config_item *game_configure(game_params *params)
65{
66 return NULL;
67}
68
69game_params *custom_params(config_item *cfg)
70{
71 return NULL;
72}
73
74char *validate_params(game_params *params)
75{
76 return NULL;
77}
78
699b896a 79char *new_game_seed(game_params *params)
80{
81 return dupstr("FIXME");
82}
83
84game_state *new_game(game_params *params, char *seed)
85{
86 game_state *state = snew(game_state);
87
88 state->FIXME = 0;
89
90 return state;
91}
92
93game_state *dup_game(game_state *state)
94{
95 game_state *ret = snew(game_state);
96
97 ret->FIXME = state->FIXME;
98
99 return ret;
100}
101
102void free_game(game_state *state)
103{
104 sfree(state);
105}
106
107game_state *make_move(game_state *from, int x, int y, int button)
108{
109 return NULL;
110}
111
112/* ----------------------------------------------------------------------
113 * Drawing routines.
114 */
115
116struct game_drawstate {
117 int FIXME;
118};
119
120void game_size(game_params *params, int *x, int *y)
121{
122 *x = *y = 200; /* FIXME */
123}
124
125float *game_colours(frontend *fe, game_state *state, int *ncolours)
126{
127 float *ret = snewn(3 * NCOLOURS, float);
128
129 frontend_default_colour(fe, &ret[COL_BACKGROUND * 3]);
130
131 *ncolours = NCOLOURS;
132 return ret;
133}
134
135game_drawstate *game_new_drawstate(game_state *state)
136{
137 struct game_drawstate *ds = snew(struct game_drawstate);
138
139 ds->FIXME = 0;
140
141 return ds;
142}
143
144void game_free_drawstate(game_drawstate *ds)
145{
146 sfree(ds);
147}
148
149void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
150 game_state *state, float animtime, float flashtime)
151{
152}
153
154float game_anim_length(game_state *oldstate, game_state *newstate)
155{
156 return 0.0F;
157}
158
159float game_flash_length(game_state *oldstate, game_state *newstate)
160{
161 return 0.0F;
162}
fd1a1a2b 163
164int game_wants_statusbar(void)
165{
166 return FALSE;
167}