~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch from Ton van Overbeek to correct Loopy's misplaced line ends
[sgt/puzzles]
/
loopy.c
diff --git
a/loopy.c
b/loopy.c
index
1832ed9
..
f4d3e6a
100644
(file)
--- a/
loopy.c
+++ b/
loopy.c
@@
-373,9
+373,14
@@
static game_params *default_params(void)
{
game_params *ret = snew(game_params);
{
game_params *ret = snew(game_params);
+#ifdef SLOW_SYSTEM
+ ret->h = 4;
+ ret->w = 4;
+#else
ret->h = 10;
ret->w = 10;
ret->h = 10;
ret->w = 10;
- ret->rec = 0;
+#endif
+ ret->rec = 0;
return ret;
}
return ret;
}
@@
-396,9
+401,11
@@
static const struct {
{ "7x7 Easy", { 7, 7, 0 } },
{ "7x7 Hard", { 7, 7, 2 } },
{ "10x10 Easy", { 10, 10, 0 } },
{ "7x7 Easy", { 7, 7, 0 } },
{ "7x7 Hard", { 7, 7, 2 } },
{ "10x10 Easy", { 10, 10, 0 } },
+#ifndef SLOW_SYSTEM
{ "10x10 Hard", { 10, 10, 2 } },
{ "15x15 Easy", { 15, 15, 0 } },
{ "30x20 Easy", { 30, 20, 0 } }
{ "10x10 Hard", { 10, 10, 2 } },
{ "15x15 Easy", { 15, 15, 0 } },
{ "30x20 Easy", { 30, 20, 0 } }
+#endif
};
static int game_fetch_preset(int i, char **name, game_params **params)
};
static int game_fetch_preset(int i, char **name, game_params **params)
@@
-506,7
+513,7
@@
static char *validate_params(game_params *params, int full)
* light towards those with high scores */
struct square {
int score;
* light towards those with high scores */
struct square {
int score;
-
int
random;
+
unsigned long
random;
int x, y;
};
int x, y;
};
@@
-538,10
+545,10
@@
static int square_sort_cmpfn(void *v1, void *v2)
return r;
}
return r;
}
- r = s1->random - s2->random;
- if (r) {
- return r;
- }
+ if (s1->random < s2->random)
+ return -1;
+ else if (s1->random > s2->random)
+ return 1;
/*
* It's _just_ possible that two squares might have been given
/*
* It's _just_ possible that two squares might have been given
@@
-2452,7
+2459,7
@@
static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
#define CLEAR_VL(i, j) do { \
draw_rect(dr, \
BORDER + i * TILE_SIZE - CROSS_SIZE, \
#define CLEAR_VL(i, j) do { \
draw_rect(dr, \
BORDER + i * TILE_SIZE - CROSS_SIZE, \
- BORDER + j * TILE_SIZE + LINEWIDTH/2, \
+ BORDER + j * TILE_SIZE + LINEWIDTH
- LINEWIDTH
/2, \
CROSS_SIZE * 2, \
TILE_SIZE - LINEWIDTH, \
COL_BACKGROUND); \
CROSS_SIZE * 2, \
TILE_SIZE - LINEWIDTH, \
COL_BACKGROUND); \
@@
-2465,7
+2472,7
@@
static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
#define CLEAR_HL(i, j) do { \
draw_rect(dr, \
#define CLEAR_HL(i, j) do { \
draw_rect(dr, \
- BORDER + i * TILE_SIZE + LINEWIDTH/2, \
+ BORDER + i * TILE_SIZE + LINEWIDTH
- LINEWIDTH
/2, \
BORDER + j * TILE_SIZE - CROSS_SIZE, \
TILE_SIZE - LINEWIDTH, \
CROSS_SIZE * 2, \
BORDER + j * TILE_SIZE - CROSS_SIZE, \
TILE_SIZE - LINEWIDTH, \
CROSS_SIZE * 2, \
@@
-2492,7
+2499,7
@@
static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
CLEAR_VL(i, j);
draw_rect(dr,
BORDER + i * TILE_SIZE - LINEWIDTH/2,
CLEAR_VL(i, j);
draw_rect(dr,
BORDER + i * TILE_SIZE - LINEWIDTH/2,
- BORDER + j * TILE_SIZE + LINEWIDTH/2,
+ BORDER + j * TILE_SIZE + LINEWIDTH
- LINEWIDTH
/2,
LINEWIDTH, TILE_SIZE - LINEWIDTH,
line_colour);
}
LINEWIDTH, TILE_SIZE - LINEWIDTH,
line_colour);
}
@@
-2533,7
+2540,7
@@
static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
flash_changed) {
CLEAR_HL(i, j);
draw_rect(dr,
flash_changed) {
CLEAR_HL(i, j);
draw_rect(dr,
- BORDER + i * TILE_SIZE + LINEWIDTH/2,
+ BORDER + i * TILE_SIZE + LINEWIDTH
- LINEWIDTH
/2,
BORDER + j * TILE_SIZE - LINEWIDTH/2,
TILE_SIZE - LINEWIDTH, LINEWIDTH,
line_colour);
BORDER + j * TILE_SIZE - LINEWIDTH/2,
TILE_SIZE - LINEWIDTH, LINEWIDTH,
line_colour);