mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 02:14:09 +03:00
Move mapclass r/g/b variables off onto TowerBG
This fixes a bug where if you entered a tower before watching the credits sequence, the credits sequence would have mismatched text and background colors. This bug happened because entering a tower modified the r/g/b attributes of mapclass, and updated graphics.towerbg, without updating graphics.titlebg too. Then gamecompleterender() uses the r/g/b attributes of mapclass. The solution is to put the r/g/b attributes on TowerBG instead. That way, entering a tower will only modify the r/g/b attributes used to render towers, and won't affect the r/g/b attributes used to render the credits sequence. Additionally, I also de-duplicated the case-switch that updated the r/g/b attributes based off of the current colstate, because it got copy-pasted twice, leading to three instances of one piece of code.
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
|
||||
void titleupdatetextcol()
|
||||
{
|
||||
graphics.col_tr = map.r - (help.glow / 4) - int(fRandom() * 4);
|
||||
graphics.col_tg = map.g - (help.glow / 4) - int(fRandom() * 4);
|
||||
graphics.col_tb = map.b - (help.glow / 4) - int(fRandom() * 4);
|
||||
graphics.col_tr = graphics.titlebg.r - (help.glow / 4) - int(fRandom() * 4);
|
||||
graphics.col_tg = graphics.titlebg.g - (help.glow / 4) - int(fRandom() * 4);
|
||||
graphics.col_tb = graphics.titlebg.b - (help.glow / 4) - int(fRandom() * 4);
|
||||
if (graphics.col_tr < 0) graphics.col_tr = 0;
|
||||
if(graphics.col_tr>255) graphics.col_tr=255;
|
||||
if (graphics.col_tg < 0) graphics.col_tg = 0;
|
||||
|
||||
Reference in New Issue
Block a user