mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 00:15:46 -07:00
Flood: don't draw zero-width tile separators
Flood's draw_tile() extravagantly uses up to eight rectangles to draw separators around each tile. This could be substantially improved, but a particularly low-hanging optimisation is not do draw them when the separator width is zero. This at least means that Flood completes its initial drawing on my test KaiOS device.
This commit is contained in:
2
flood.c
2
flood.c
@ -1101,6 +1101,7 @@ static void draw_tile(drawing *dr, game_drawstate *ds,
|
|||||||
colour += COL_1;
|
colour += COL_1;
|
||||||
draw_rect(dr, tx, ty, TILESIZE, TILESIZE, colour);
|
draw_rect(dr, tx, ty, TILESIZE, TILESIZE, colour);
|
||||||
|
|
||||||
|
if (SEP_WIDTH > 0) {
|
||||||
if (tile & BORDER_L)
|
if (tile & BORDER_L)
|
||||||
draw_rect(dr, tx, ty,
|
draw_rect(dr, tx, ty,
|
||||||
SEP_WIDTH, TILESIZE, COL_SEPARATOR);
|
SEP_WIDTH, TILESIZE, COL_SEPARATOR);
|
||||||
@ -1126,6 +1127,7 @@ static void draw_tile(drawing *dr, game_drawstate *ds,
|
|||||||
if (tile & CORNER_DR)
|
if (tile & CORNER_DR)
|
||||||
draw_rect(dr, tx + TILESIZE - SEP_WIDTH, ty + TILESIZE - SEP_WIDTH,
|
draw_rect(dr, tx + TILESIZE - SEP_WIDTH, ty + TILESIZE - SEP_WIDTH,
|
||||||
SEP_WIDTH, SEP_WIDTH, COL_SEPARATOR);
|
SEP_WIDTH, SEP_WIDTH, COL_SEPARATOR);
|
||||||
|
}
|
||||||
|
|
||||||
if (tile & CURSOR)
|
if (tile & CURSOR)
|
||||||
draw_rect_outline(dr, tx + CURSOR_INSET, ty + CURSOR_INSET,
|
draw_rect_outline(dr, tx + CURSOR_INSET, ty + CURSOR_INSET,
|
||||||
|
Reference in New Issue
Block a user