Same Game: scale TILE_GAP with tilesize

TILE_GAP represents the gap between the coloured parts of adjacent
different-coloured tiles.  Rather than a fixed 2 pixels, it's now 1/16
of the tilesize (rounded to nearest).

This looks the same at the default tilesize of 32, but behaves better
with larger or smaller tilesizes.  At tilesizes below 8, the gap
disappears altogether, but that seems appropriate: at 7 pixels there's
not much space for the inner and outer squares and the cursor, and those
are all more important than the gap..
This commit is contained in:
Ben Harris
2023-07-31 22:39:33 +01:00
parent 29eaa8f55c
commit 56237fa5fa

View File

@ -1370,7 +1370,7 @@ static game_state *execute_move(const game_state *from, const char *move)
static void game_set_size(drawing *dr, game_drawstate *ds,
const game_params *params, int tilesize)
{
ds->tilegap = 2;
ds->tilegap = (tilesize + 8) / 16;
ds->tileinner = tilesize - ds->tilegap;
}