Move analogue mode filter update logic to fixed-timestep loop

Otherwise if the analogue filter is scrolling, it'll scroll by REALLY
fast.
This commit is contained in:
Misa
2020-05-02 20:27:47 -07:00
committed by Ethan Lee
parent 995f0f126f
commit 97b8e062ff
3 changed files with 14 additions and 4 deletions

View File

@@ -315,11 +315,9 @@ void BlitSurfaceColoured(
int scrollamount = 0;
bool isscrolling = 0;
SDL_Surface* ApplyFilter( SDL_Surface* _src )
{
SDL_Surface* _ret = SDL_CreateRGBSurface(_src->flags, _src->w, _src->h, 32,
_src->format->Rmask, _src->format->Gmask, _src->format->Bmask, _src->format->Amask);
void UpdateFilter()
{
if (rand() % 4000 < 8)
{
isscrolling = true;
@@ -334,6 +332,12 @@ SDL_Surface* ApplyFilter( SDL_Surface* _src )
isscrolling = false;
}
}
}
SDL_Surface* ApplyFilter( SDL_Surface* _src )
{
SDL_Surface* _ret = SDL_CreateRGBSurface(_src->flags, _src->w, _src->h, 32,
_src->format->Rmask, _src->format->Gmask, _src->format->Bmask, _src->format->Amask);
int redOffset = rand() % 4;