diff --git a/desktop_version/src/GraphicsUtil.cpp b/desktop_version/src/GraphicsUtil.cpp index 907819eb..8e1b5509 100644 --- a/desktop_version/src/GraphicsUtil.cpp +++ b/desktop_version/src/GraphicsUtil.cpp @@ -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; diff --git a/desktop_version/src/GraphicsUtil.h b/desktop_version/src/GraphicsUtil.h index b76a7747..78f264d7 100644 --- a/desktop_version/src/GraphicsUtil.h +++ b/desktop_version/src/GraphicsUtil.h @@ -46,6 +46,7 @@ void ScrollSurface(SDL_Surface* _src, int pX, int py); SDL_Surface * FlipSurfaceHorizontal(SDL_Surface* _src); SDL_Surface * FlipSurfaceVerticle(SDL_Surface* _src); SDL_Surface * ScaleSurfaceSlow( SDL_Surface *_surface, int Width, int Height ); +void UpdateFilter(); SDL_Surface* ApplyFilter( SDL_Surface* _src ); #endif /* GRAPHICSUTIL_H */ diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index c04ff99d..e543224d 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -486,6 +486,11 @@ int main(int argc, char *argv[]) graphics.updatescreenshake(); } + if (graphics.screenbuffer->badSignalEffect) + { + UpdateFilter(); + } + //We did editorinput, now it's safe to turn this off key.linealreadyemptykludge = false;