1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-09 10:29:45 +01:00

Remove unnecessary middleman game.infocus

It does the same thing as key.isActive, so no need to make it a separate
variable.
This commit is contained in:
Misa 2020-06-26 17:45:53 -07:00 committed by Ethan Lee
parent 5052391f60
commit a87ebd2945
3 changed files with 4 additions and 10 deletions

View file

@ -117,7 +117,6 @@ bool GetButtonFromString(const char *pText, SDL_GameControllerButton *button)
void Game::init(void)
{
mutebutton = 0;
infocus = true;
muted = false;
musicmuted = false;
musicmutebutton = 0;

View file

@ -179,7 +179,6 @@ public:
int jumppressed;
int gravitycontrol;
bool infocus;
bool muted;
int mutebutton;
bool musicmuted;

View file

@ -203,7 +203,6 @@ int main(int argc, char *argv[])
graphics.init();
game.init();
game.infocus = true;
// This loads music too...
graphics.reloadresources();
@ -351,7 +350,6 @@ int main(int argc, char *argv[])
}
#endif
game.infocus = true;
key.isActive = true;
game.gametimer = 0;
@ -425,7 +423,7 @@ void inline deltaloop()
const float alpha = game.over30mode ? static_cast<float>(accumulator) / timesteplimit : 1.0f;
graphics.alpha = alpha;
if (game.infocus)
if (key.isActive)
{
switch (game.gamestate)
{
@ -466,8 +464,6 @@ void inline deltaloop()
void inline fixedloop()
{
game.infocus = key.isActive;
// Update network per frame.
NETWORK_update();
@ -501,7 +497,7 @@ void inline fixedloop()
game.press_map = false;
}
if(!game.infocus)
if(!key.isActive)
{
Mix_Pause(-1);
Mix_PauseMusic();
@ -605,11 +601,11 @@ void inline fixedloop()
}
//Screen effects timers
if (game.infocus && game.flashlight > 0)
if (key.isActive && game.flashlight > 0)
{
game.flashlight--;
}
if (game.infocus && game.screenshake > 0)
if (key.isActive && game.screenshake > 0)
{
game.screenshake--;
graphics.updatescreenshake();