mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
De-duplicate screen effects timer decrementing
The code to decrement the timers for flashing and shaking is now handled outside the game-gamestate case-switch, instead of having to be duplicated inside each render function. As a bonus, I made it so the timer decrements even if screen effects are disabled. This is to prevent any theoretical situation where the timer can "pile up" due to disabled screen effects not letting it tick down.
This commit is contained in:
@@ -479,6 +479,16 @@ int main(int argc, char *argv[])
|
||||
|
||||
}
|
||||
|
||||
//Screen effects timers
|
||||
if (game.infocus && game.flashlight > 0)
|
||||
{
|
||||
game.flashlight--;
|
||||
}
|
||||
if (game.infocus && game.screenshake > 0)
|
||||
{
|
||||
game.screenshake--;
|
||||
}
|
||||
|
||||
//We did editorinput, now it's safe to turn this off
|
||||
key.linealreadyemptykludge = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user