mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-09 10:29:45 +01:00
3dd1dcc131
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.
20 lines
246 B
C
20 lines
246 B
C
#ifndef TOWERBG_H
|
|
#define TOWERBG_H
|
|
|
|
#include <SDL.h>
|
|
|
|
struct TowerBG
|
|
{
|
|
SDL_Surface* buffer;
|
|
SDL_Surface* buffer_lerp;
|
|
bool tdrawback;
|
|
int bypos;
|
|
int bscroll;
|
|
int colstate;
|
|
int scrolldir;
|
|
int r;
|
|
int g;
|
|
int b;
|
|
};
|
|
|
|
#endif /* TOWERBG_H */
|