mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-07 17:39:44 +01:00
drawpixeltextbox: Draw remaining horz/vert tile if non-multiple-8
This draws the remaining horizontal/vertical tile just beside the final corner if the width/height is not a multiple of 8. (It'd be wasteful to draw it if the width/height was a perfect multiple of 8, and result in double-drawing translucent pixels if there were any.) This has an advantage over the previous system of shifting the horizontal/vertical tiling, in that custom corner textures don't look weird due to overlapping like this. Now, custom horizontal/vertical tiles _can_ look weird if they don't completely tile correctly (or if they have translucent pixels), but that's better than mucking up the corners.
This commit is contained in:
parent
1eb3e73c00
commit
02b1fedeb1
1 changed files with 12 additions and 0 deletions
|
@ -1302,12 +1302,24 @@ void Graphics::drawpixeltextbox( int x, int y, int w, int h, int w2, int h2, int
|
|||
drawcoloredtile(x + 8 + (k * 8), y + (h) - 8, 46, r, g, b);
|
||||
}
|
||||
|
||||
if (w % 8 != 0)
|
||||
{
|
||||
drawcoloredtile(x + w - 16, y, 41, r, g, b);
|
||||
drawcoloredtile(x + w - 16, y + h - 8, 46, r, g, b);
|
||||
}
|
||||
|
||||
for (int k = 0; k < h/8-2; k++)
|
||||
{
|
||||
drawcoloredtile(x, y + 8 + (k * 8), 43, r, g, b);
|
||||
drawcoloredtile(x + (w) - 8, y + 8 + (k * 8), 44, r, g, b);
|
||||
}
|
||||
|
||||
if (h % 8 != 0)
|
||||
{
|
||||
drawcoloredtile(x, y + h - 16, 43, r, g, b);
|
||||
drawcoloredtile(x + w - 8, y + h - 16, 44, r, g, b);
|
||||
}
|
||||
|
||||
drawcoloredtile(x, y, 40, r, g, b);
|
||||
drawcoloredtile(x + (w) - 8, y, 42, r, g, b);
|
||||
drawcoloredtile(x, y + (h) - 8, 45, r, g, b);
|
||||
|
|
Loading…
Reference in a new issue