From c17612752950728844e607cd96e9dbfe369f6581 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 19 Apr 2020 13:11:51 -0700 Subject: [PATCH] Remove useless attributes m_globalVol, set/getGlobalSound from Game These do basically nothing. The only time they're used is getGlobalSound() in an if-statement in main.cpp, but all that if-conditional does is call setGlobalSound() anyway, which is something that doesn't really have any side effects. So I'm removing these vars to simplify the code. --- desktop_version/src/Game.cpp | 1 - desktop_version/src/Game.h | 14 -------------- desktop_version/src/main.cpp | 4 ---- 3 files changed, 19 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 20d7c4af..e87973f6 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -122,7 +122,6 @@ void Game::init(void) musicmuted = false; musicmutebutton = 0; globalsound = 128; - m_globalVol = 1.0f; glitchrunkludge = false; hascontrol = true; diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index 6047d19f..c1769bd2 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -84,16 +84,6 @@ public: ~Game(void); - void setGlobalSoundVol(const float _vol) - { - m_globalVol = _vol; - } - float getGlobalSoundVol() - { - return m_globalVol; - } - - int crewrescued(); std::string unrescued(); @@ -194,10 +184,6 @@ public: int mutebutton; bool musicmuted; int musicmutebutton; -private: - float m_globalVol; - -public: int tapleft, tapright; diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index b89d72d9..71a1f3b4 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -379,10 +379,6 @@ int main(int argc, char *argv[]) game.infocus = key.isActive; if(!game.infocus) { - if(game.getGlobalSoundVol()> 0) - { - game.setGlobalSoundVol(0); - } FillRect(graphics.backBuffer, 0x00000000); graphics.bprint(5, 110, "Game paused", 196 - help.glow, 255 - help.glow, 196 - help.glow, true); graphics.bprint(5, 120, "[click to resume]", 196 - help.glow, 255 - help.glow, 196 - help.glow, true);