~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch from Mark Wooding: stop setting GTK_EXPAND for the x-direction
[sgt/puzzles]
/
inertia.c
diff --git
a/inertia.c
b/inertia.c
index
4e84f56
..
aebd314
100644
(file)
--- a/
inertia.c
+++ b/
inertia.c
@@
-1445,6
+1445,11
@@
static char *solve_game(game_state *state, game_state *currstate,
return soln;
}
return soln;
}
+static int game_can_format_as_text_now(game_params *params)
+{
+ return TRUE;
+}
+
static char *game_text_format(game_state *state)
{
return NULL;
static char *game_text_format(game_state *state)
{
return NULL;
@@
-1575,7
+1580,8
@@
static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
dir = 1;
else if (button == (MOD_NUM_KEYPAD | '3'))
dir = 3;
dir = 1;
else if (button == (MOD_NUM_KEYPAD | '3'))
dir = 3;
- else if (button == ' ' && state->soln && state->solnpos < state->soln->len)
+ else if (IS_CURSOR_SELECT(button) &&
+ state->soln && state->solnpos < state->soln->len)
dir = state->soln->list[state->solnpos];
if (dir < 0)
dir = state->soln->list[state->solnpos];
if (dir < 0)
@@
-1626,6
+1632,10
@@
static game_state *execute_move(game_state *state, char *move)
sol->list[i] = move[i] - '0';
ret = dup_game(state);
ret->cheated = TRUE;
sol->list[i] = move[i] - '0';
ret = dup_game(state);
ret->cheated = TRUE;
+ if (ret->soln && --ret->soln->refcount == 0) {
+ sfree(ret->soln->list);
+ sfree(ret->soln);
+ }
ret->soln = sol;
ret->solnpos = 0;
sol->refcount = 1;
ret->soln = sol;
ret->solnpos = 0;
sol->refcount = 1;
@@
-2180,7
+2190,7
@@
const struct game thegame = {
dup_game,
free_game,
TRUE, solve_game,
dup_game,
free_game,
TRUE, solve_game,
- FALSE, game_text_format,
+ FALSE, game_
can_format_as_text_now, game_
text_format,
new_ui,
free_ui,
encode_ui,
new_ui,
free_ui,
encode_ui,