aboutsummaryrefslogtreecommitdiff
path: root/loopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'loopy.c')
-rw-r--r--loopy.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/loopy.c b/loopy.c
index 92b27ab..8af9a30 100644
--- a/loopy.c
+++ b/loopy.c
@@ -640,29 +640,25 @@ static config_item *game_configure(const game_params *params)
ret[0].name = "Width";
ret[0].type = C_STRING;
sprintf(buf, "%d", params->w);
- ret[0].sval = dupstr(buf);
- ret[0].ival = 0;
+ ret[0].u.string.sval = dupstr(buf);
ret[1].name = "Height";
ret[1].type = C_STRING;
sprintf(buf, "%d", params->h);
- ret[1].sval = dupstr(buf);
- ret[1].ival = 0;
+ ret[1].u.string.sval = dupstr(buf);
ret[2].name = "Grid type";
ret[2].type = C_CHOICES;
- ret[2].sval = GRID_CONFIGS;
- ret[2].ival = params->type;
+ ret[2].u.choices.choicenames = GRID_CONFIGS;
+ ret[2].u.choices.selected = params->type;
ret[3].name = "Difficulty";
ret[3].type = C_CHOICES;
- ret[3].sval = DIFFCONFIG;
- ret[3].ival = params->diff;
+ ret[3].u.choices.choicenames = DIFFCONFIG;
+ ret[3].u.choices.selected = params->diff;
ret[4].name = NULL;
ret[4].type = C_END;
- ret[4].sval = NULL;
- ret[4].ival = 0;
return ret;
}
@@ -671,10 +667,10 @@ static game_params *custom_params(const config_item *cfg)
{
game_params *ret = snew(game_params);
- ret->w = atoi(cfg[0].sval);
- ret->h = atoi(cfg[1].sval);
- ret->type = cfg[2].ival;
- ret->diff = cfg[3].ival;
+ ret->w = atoi(cfg[0].u.string.sval);
+ ret->h = atoi(cfg[1].u.string.sval);
+ ret->type = cfg[2].u.choices.selected;
+ ret->diff = cfg[3].u.choices.selected;
return ret;
}