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:
Ben Harris
2023-07-30 17:16:36 +01:00
parent 58511aa009
commit 29eaa8f55c

View File

@ -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,