Textboxes: Don't use separate RGB variables

Text boxes have `r`, `g`, and `b`, and `tr`, `tg`, and `tb`. `tr`, `tg`,
and `tb` are the real colors of the text box, and `r`, `g`, and `b` are
merely the colors of the text box as the text box's alpha value is
applied to them.

Compare this with, say, activity zones (which are drawn like text boxes
but aren't text boxes): There is `activity_r`, `activity_g`, and
`activity_b`, and when they're drawn they're all multiplied by
`act_alpha`.

So just do the same thing here. Ditch the `tr`, `tg`, and `tb`
variables, and make `r`, `g`, and `b` the new `tr`, `tg`, and `tb`
variables. That way, there's simply less state to have to update
separately. So we can get rid of `textboxclass::setcol()` as well.
This commit is contained in:
Misa
2021-09-06 00:48:42 -07:00
parent 13a0c1282d
commit 730c935218
3 changed files with 20 additions and 36 deletions

View File

@@ -16,9 +16,6 @@ textboxclass::textboxclass(void)
r = 0;
g = 0;
b = 0;
tr = 0;
tg = 0;
tb = 0;
flipme = false;
@@ -49,21 +46,11 @@ void textboxclass::adjust(void)
}
void textboxclass::initcol(int rr, int gg, int bb)
{
tr = rr;
tg = gg;
tb = bb;
r = 0;
g = 0;
b = 0;
tl = 0.5;
}
void textboxclass::setcol(int rr, int gg, int bb)
{
r = rr;
g = gg;
b = bb;
tl = 0.5;
}
void textboxclass::update(void)