mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Name conditionals in text box loop
With the recent change to drawing overlays (images and sprites) from PR #1058, it's starting to get a bit hairy. This names the conditionals responsible for determining if the text box is transparent (checking that all of its RGB is 0) and if overlays should be drawn or not (which is now either when it's opaque or transparent).
This commit is contained in:
parent
44a889efeb
commit
af35be5bb6
1 changed files with 6 additions and 4 deletions
|
@ -853,7 +853,6 @@ void Graphics::drawgui(void)
|
|||
{
|
||||
int text_yoff;
|
||||
int yp;
|
||||
bool opaque;
|
||||
int font_height = font::height(textboxes[i].print_flags);
|
||||
if (flipmode)
|
||||
{
|
||||
|
@ -872,7 +871,9 @@ void Graphics::drawgui(void)
|
|||
|
||||
char buffer[SCREEN_WIDTH_CHARS + 1];
|
||||
|
||||
if (textboxes[i].r == 0 && textboxes[i].g == 0 && textboxes[i].b == 0)
|
||||
const bool transparent = (textboxes[i].r | textboxes[i].g | textboxes[i].b) == 0;
|
||||
|
||||
if (transparent)
|
||||
{
|
||||
/* To avoid the outlines for different lines overlapping the text itself,
|
||||
* first draw all the outlines and then draw the text. */
|
||||
|
@ -937,9 +938,10 @@ void Graphics::drawgui(void)
|
|||
}
|
||||
}
|
||||
|
||||
opaque = textboxes[i].tl >= 1.0;
|
||||
const bool opaque = textboxes[i].tl >= 1.0;
|
||||
const bool draw_overlays = opaque || transparent;
|
||||
|
||||
if (!opaque && textboxes[i].r != 0 && textboxes[i].g != 0 && textboxes[i].b != 0)
|
||||
if (!draw_overlays)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue