~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revise the printing colour framework so that we can explicitly
[sgt/puzzles]
/
map.c
diff --git
a/map.c
b/map.c
index
6302ef7
..
4e9bdd6
100644
(file)
--- a/
map.c
+++ b/
map.c
@@
-100,8
+100,13
@@
static game_params *default_params(void)
{
game_params *ret = snew(game_params);
{
game_params *ret = snew(game_params);
+#ifdef PORTRAIT_SCREEN
+ ret->w = 16;
+ ret->h = 18;
+#else
ret->w = 20;
ret->h = 15;
ret->w = 20;
ret->h = 15;
+#endif
ret->n = 30;
ret->diff = DIFF_NORMAL;
ret->n = 30;
ret->diff = DIFF_NORMAL;
@@
-109,12
+114,21
@@
static game_params *default_params(void)
}
static const struct game_params map_presets[] = {
}
static const struct game_params map_presets[] = {
+#ifdef PORTRAIT_SCREEN
+ {16, 18, 30, DIFF_EASY},
+ {16, 18, 30, DIFF_NORMAL},
+ {16, 18, 30, DIFF_HARD},
+ {16, 18, 30, DIFF_RECURSE},
+ {25, 30, 75, DIFF_NORMAL},
+ {25, 30, 75, DIFF_HARD},
+#else
{20, 15, 30, DIFF_EASY},
{20, 15, 30, DIFF_NORMAL},
{20, 15, 30, DIFF_HARD},
{20, 15, 30, DIFF_RECURSE},
{30, 25, 75, DIFF_NORMAL},
{30, 25, 75, DIFF_HARD},
{20, 15, 30, DIFF_EASY},
{20, 15, 30, DIFF_NORMAL},
{20, 15, 30, DIFF_HARD},
{20, 15, 30, DIFF_RECURSE},
{30, 25, 75, DIFF_NORMAL},
{30, 25, 75, DIFF_HARD},
+#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)
@@
-1695,8
+1709,7
@@
static char *parse_edge_list(game_params *params, char **desc, int *map)
int i, k, pos, state;
char *p = *desc;
int i, k, pos, state;
char *p = *desc;
- for (i = 0; i < wh; i++)
- map[wh+i] = i;
+ dsf_init(map+wh, wh);
pos = -1;
state = 0;
pos = -1;
state = 0;
@@
-1868,7
+1881,7
@@
static game_state *new_game(midend *me, game_params *params, char *desc)
* outlines by the judicious use of diagonally divided squares.
*/
{
* outlines by the judicious use of diagonally divided squares.
*/
{
- random_state *rs = random_
init
(desc, strlen(desc));
+ random_state *rs = random_
new
(desc, strlen(desc));
int *squares = snewn(wh, int);
int done_something;
int *squares = snewn(wh, int);
int done_something;
@@
-2518,16
+2531,24
@@
static void game_set_size(drawing *dr, game_drawstate *ds,
}
const float map_colours[FOUR][3] = {
}
const float map_colours[FOUR][3] = {
+#ifdef VIVID_COLOURS
+ /* Use more vivid colours (e.g. on the Pocket PC) */
+ {0.75F, 0.25F, 0.25F},
+ {0.3F, 0.7F, 0.3F},
+ {0.3F, 0.3F, 0.7F},
+ {0.85F, 0.85F, 0.1F},
+#else
{0.7F, 0.5F, 0.4F},
{0.8F, 0.7F, 0.4F},
{0.5F, 0.6F, 0.4F},
{0.55F, 0.45F, 0.35F},
{0.7F, 0.5F, 0.4F},
{0.8F, 0.7F, 0.4F},
{0.5F, 0.6F, 0.4F},
{0.55F, 0.45F, 0.35F},
+#endif
};
const int map_hatching[FOUR] = {
HATCH_VERT, HATCH_SLASH, HATCH_HORIZ, HATCH_BACKSLASH
};
};
const int map_hatching[FOUR] = {
HATCH_VERT, HATCH_SLASH, HATCH_HORIZ, HATCH_BACKSLASH
};
-static float *game_colours(frontend *fe,
game_state *state,
int *ncolours)
+static float *game_colours(frontend *fe, int *ncolours)
{
float *ret = snewn(3 * NCOLOURS, float);
{
float *ret = snewn(3 * NCOLOURS, float);
@@
-2923,11
+2944,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;
@@
-2961,8
+2977,9
@@
static void game_print(drawing *dr, game_state *state, int tilesize)
ink = print_mono_colour(dr, 0);
for (i = 0; i < FOUR; i++)
ink = print_mono_colour(dr, 0);
for (i = 0; i < FOUR; i++)
- c[i] = print_rgb_colour(dr, map_hatching[i], map_colours[i][0],
- map_colours[i][1], map_colours[i][2]);
+ c[i] = print_rgb_hatched_colour(dr, map_colours[i][0],
+ map_colours[i][1], map_colours[i][2],
+ map_hatching[i]);
coordsize = 0;
coords = NULL;
coordsize = 0;
coords = NULL;
@@
-3090,7
+3107,7
@@
static void game_print(drawing *dr, game_state *state, int tilesize)
#endif
const struct game thegame = {
#endif
const struct game thegame = {
- "Map", "games.map",
+ "Map", "games.map",
"map",
default_params,
game_fetch_preset,
decode_params,
default_params,
game_fetch_preset,
decode_params,
@@
-3121,9
+3138,9
@@
const struct game thegame = {
game_anim_length,
game_flash_length,
TRUE, TRUE, game_print_size, game_print,
game_anim_length,
game_flash_length,
TRUE, TRUE, game_print_size, game_print,
- game_wants_statusbar,
+ FALSE, /* wants_statusbar */
FALSE, game_timing_state,
FALSE, game_timing_state,
- 0, /*
mouse_prioritie
s */
+ 0, /*
flag
s */
};
#ifdef STANDALONE_SOLVER
};
#ifdef STANDALONE_SOLVER