~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Lee Dowling points out that duplicating the entire grid data
[sgt/puzzles]
/
untangle.c
diff --git
a/untangle.c
b/untangle.c
index
4e1067c
..
74a5e10
100644
(file)
--- a/
untangle.c
+++ b/
untangle.c
@@
-1000,8
+1000,8
@@
static char *solve_game(game_state *state, game_state *currstate,
pts[i].d = 2;
ox *= pts[i].d;
oy *= pts[i].d;
pts[i].d = 2;
ox *= pts[i].d;
oy *= pts[i].d;
- pts[i].x =
ox + 0.5
;
- pts[i].y =
oy + 0.5
;
+ pts[i].x =
(long)(ox + 0.5F)
;
+ pts[i].y =
(long)(oy + 0.5F)
;
extra = sprintf(buf, ";P%d:%ld,%ld/%ld", i,
pts[i].x, pts[i].y, pts[i].d);
extra = sprintf(buf, ";P%d:%ld,%ld/%ld", i,
pts[i].x, pts[i].y, pts[i].d);
@@
-1018,6
+1018,11
@@
static char *solve_game(game_state *state, game_state *currstate,
return ret;
}
return ret;
}
+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;
@@
-1072,7
+1077,7
@@
static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
{
int n = state->params.n;
{
int n = state->params.n;
- if (
button == LEFT_BUTTON
) {
+ if (
IS_MOUSE_DOWN(button)
) {
int i, best;
long bestd;
int i, best;
long bestd;
@@
-1106,12
+1111,12
@@
static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
return "";
}
return "";
}
- } else if (
button == LEFT_DRAG
&& ui->dragpoint >= 0) {
+ } else if (
IS_MOUSE_DRAG(button)
&& ui->dragpoint >= 0) {
ui->newpoint.x = x;
ui->newpoint.y = y;
ui->newpoint.d = ds->tilesize;
return "";
ui->newpoint.x = x;
ui->newpoint.y = y;
ui->newpoint.d = ds->tilesize;
return "";
- } else if (
button == LEFT_RELEASE
&& ui->dragpoint >= 0) {
+ } else if (
IS_MOUSE_RELEASE(button)
&& ui->dragpoint >= 0) {
int p = ui->dragpoint;
char buf[80];
int p = ui->dragpoint;
char buf[80];
@@
-1263,8
+1268,8
@@
static point mix(point a, point b, float distance)
point ret;
ret.d = a.d * b.d;
point ret;
ret.d = a.d * b.d;
- ret.x =
a.x * b.d + distance * (b.x * a.d - a.x * b.d
);
- ret.y =
a.y * b.d + distance * (b.y * a.d - a.y * b.d
);
+ ret.x =
(long)(a.x * b.d + distance * (b.x * a.d - a.x * b.d)
);
+ ret.y =
(long)(a.y * b.d + distance * (b.y * a.d - a.y * b.d)
);
return ret;
}
return ret;
}
@@
-1407,11
+1412,6
@@
static float game_flash_length(game_state *oldstate, game_state *newstate,
return 0.0F;
}
return 0.0F;
}
-static int game_wants_statusbar(void)
-{
- return FALSE;
-}
-
static int game_timing_state(game_state *state, game_ui *ui)
{
return TRUE;
static int game_timing_state(game_state *state, game_ui *ui)
{
return TRUE;
@@
-1430,7
+1430,7
@@
static void game_print(drawing *dr, game_state *state, int tilesize)
#endif
const struct game thegame = {
#endif
const struct game thegame = {
- "Untangle", "games.untangle",
+ "Untangle", "games.untangle",
"untangle",
default_params,
game_fetch_preset,
decode_params,
default_params,
game_fetch_preset,
decode_params,
@@
-1445,7
+1445,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,
@@
-1461,7
+1461,7
@@
const struct game thegame = {
game_anim_length,
game_flash_length,
FALSE, FALSE, game_print_size, game_print,
game_anim_length,
game_flash_length,
FALSE, FALSE, game_print_size, game_print,
- game_wants_statusbar,
+ FALSE, /* wants_statusbar */
FALSE, game_timing_state,
SOLVE_ANIMATES, /* flags */
};
FALSE, game_timing_state,
SOLVE_ANIMATES, /* flags */
};