aboutsummaryrefslogtreecommitdiff
path: root/midend.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-10-22 16:44:38 +0000
committerSimon Tatham <anakin@pobox.com>2005-10-22 16:44:38 +0000
commit40fcf516f40e10f23f5a9f6760bfffae206b2e49 (patch)
tree6c6ca9b79fdbcc5f57280812d8b2a032d6266b62 /midend.c
parentb44d75aa4e97e9264e585712a8ec5fa757b645ec (diff)
downloadpuzzles-40fcf516f40e10f23f5a9f6760bfffae206b2e49.zip
puzzles-40fcf516f40e10f23f5a9f6760bfffae206b2e49.tar.gz
puzzles-40fcf516f40e10f23f5a9f6760bfffae206b2e49.tar.bz2
puzzles-40fcf516f40e10f23f5a9f6760bfffae206b2e49.tar.xz
Cleanup: remove the game_state parameter to game_colours(). No game
was actually using it, and also it wasn't being called again for different game states or different game parameters, so it would have been a mistake to depend on anything in that game state. Games are now expected to commit in advance to a single fixed list of all the colours they will ever need, which was the case in practice already and simplifies any later port to a colour-poor platform. Also this change has removed a lot of unnecessary faff from midend_colours(). [originally from svn r6416]
Diffstat (limited to 'midend.c')
-rw-r--r--midend.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/midend.c b/midend.c
index 979a3b6..0d19beb 100644
--- a/midend.c
+++ b/midend.c
@@ -767,20 +767,9 @@ void midend_timer(midend *me, float tplus)
float *midend_colours(midend *me, int *ncolours)
{
- game_state *state = NULL;
float *ret;
- if (me->nstates == 0) {
- char *aux = NULL;
- char *desc = me->ourgame->new_desc(me->params, me->random,
- &aux, TRUE);
- state = me->ourgame->new_game(me, me->params, desc);
- sfree(desc);
- sfree(aux);
- } else
- state = me->states[0].state;
-
- ret = me->ourgame->colours(me->frontend, state, ncolours);
+ ret = me->ourgame->colours(me->frontend, ncolours);
{
int i;
@@ -810,9 +799,6 @@ float *midend_colours(midend *me, int *ncolours)
}
}
- if (me->nstates == 0)
- me->ourgame->free_game(state);
-
return ret;
}