1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-24 09:49:46 +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) void Game::init(void)
{ {
mutebutton = 0; mutebutton = 0;
infocus = true;
muted = false; muted = false;
musicmuted = false; musicmuted = false;
musicmutebutton = 0; musicmutebutton = 0;

View file

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

View file

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