Fix a memory leak.
[sgt/puzzles] / nullgame.c
index b4b94fe..67982b9 100644 (file)
@@ -15,6 +15,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
+#include <ctype.h>
 #include <math.h>
 
 #include "puzzles.h"
@@ -61,6 +62,20 @@ game_params *dup_params(game_params *params)
     return ret;
 }
 
+game_params *decode_params(char const *string)
+{
+    game_params *ret = snew(game_params);
+
+    ret->FIXME = 0;
+
+    return ret;
+}
+
+char *encode_params(game_params *params)
+{
+    return dupstr("FIXME");
+}
+
 config_item *game_configure(game_params *params)
 {
     return NULL;
@@ -164,6 +179,13 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
                  game_state *state, game_ui *ui,
                  float animtime, float flashtime)
 {
+    /*
+     * The initial contents of the window are not guaranteed and
+     * can vary with front ends. To be on the safe side, all games
+     * should start by drawing a big background-colour rectangle
+     * covering the whole window.
+     */
+    draw_rect(fe, 0, 0, 200, 200, COL_BACKGROUND);
 }
 
 float game_anim_length(game_state *oldstate, game_state *newstate)