summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/palisade.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/puzzles/src/palisade.c')
-rw-r--r--apps/plugins/puzzles/src/palisade.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/apps/plugins/puzzles/src/palisade.c b/apps/plugins/puzzles/src/palisade.c
index b9d578d0f7..5227a1d56c 100644
--- a/apps/plugins/puzzles/src/palisade.c
+++ b/apps/plugins/puzzles/src/palisade.c
@@ -119,10 +119,20 @@ static config_item *game_configure(const game_params *params)
119{ 119{
120 config_item *ret = snewn(4, config_item); 120 config_item *ret = snewn(4, config_item);
121 121
122 CONFIG(0, "Width", C_STRING, 0, string(20, "%d", params->w)); 122 ret[0].name = "Width";
123 CONFIG(1, "Height", C_STRING, 0, string(20, "%d", params->h)); 123 ret[0].type = C_STRING;
124 CONFIG(2, "Region size", C_STRING, 0, string(20, "%d", params->k)); 124 ret[0].u.string.sval = string(20, "%d", params->w);
125 CONFIG(3, NULL, C_END, 0, NULL); 125
126 ret[1].name = "Height";
127 ret[1].type = C_STRING;
128 ret[1].u.string.sval = string(20, "%d", params->h);
129
130 ret[2].name = "Region size";
131 ret[2].type = C_STRING;
132 ret[2].u.string.sval = string(20, "%d", params->k);
133
134 ret[3].name = NULL;
135 ret[3].type = C_END;
126 136
127 return ret; 137 return ret;
128} 138}
@@ -131,9 +141,9 @@ static game_params *custom_params(const config_item *cfg)
131{ 141{
132 game_params *params = snew(game_params); 142 game_params *params = snew(game_params);
133 143
134 params->w = atoi(cfg[0].sval); 144 params->w = atoi(cfg[0].u.string.sval);
135 params->h = atoi(cfg[1].sval); 145 params->h = atoi(cfg[1].u.string.sval);
136 params->k = atoi(cfg[2].sval); 146 params->k = atoi(cfg[2].u.string.sval);
137 147
138 return params; 148 return params;
139} 149}
@@ -145,7 +155,7 @@ static game_params *custom_params(const config_item *cfg)
145 * +---+ the dominos is horizontal or vertical. +---+---+ 155 * +---+ the dominos is horizontal or vertical. +---+---+
146 */ 156 */
147 157
148static char *validate_params(const game_params *params, int full) 158static const char *validate_params(const game_params *params, int full)
149{ 159{
150 int w = params->w, h = params->h, k = params->k, wh = w * h; 160 int w = params->w, h = params->h, k = params->k, wh = w * h;
151 161
@@ -691,7 +701,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
691 return sresize(numbers, p - numbers, clue); 701 return sresize(numbers, p - numbers, clue);
692} 702}
693 703
694static char *validate_desc(const game_params *params, const char *desc) 704static const char *validate_desc(const game_params *params, const char *desc)
695{ 705{
696 706
697 int w = params->w, h = params->h, wh = w*h, squares = 0; 707 int w = params->w, h = params->h, wh = w*h, squares = 0;
@@ -772,7 +782,7 @@ static void free_game(game_state *state)
772} 782}
773 783
774static char *solve_game(const game_state *state, const game_state *currstate, 784static char *solve_game(const game_state *state, const game_state *currstate,
775 const char *aux, char **error) 785 const char *aux, const char **error)
776{ 786{
777 int w = state->shared->params.w, h = state->shared->params.h, wh = w*h; 787 int w = state->shared->params.w, h = state->shared->params.h, wh = w*h;
778 borderflag *move; 788 borderflag *move;
@@ -986,7 +996,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
986 ui->x, ui->y, flag, x, y, newflag); 996 ui->x, ui->y, flag, x, y, newflag);
987 } else { 997 } else {
988 move_cursor(button, &ui->x, &ui->y, w, h, FALSE); 998 move_cursor(button, &ui->x, &ui->y, w, h, FALSE);
989 return ""; 999 return UI_UPDATE;
990 } 1000 }
991 } 1001 }
992 1002