From b5e98dd6e9b67b92175e83b072d101d3392495d2 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 1 Oct 2015 19:19:40 +0200 Subject: [PATCH] Removed CSettings access through CRobotMain --- src/level/robotmain.cpp | 15 --------------- src/level/robotmain.h | 3 --- src/object/old_object.cpp | 3 ++- src/ui/controls/control.cpp | 4 +++- src/ui/controls/control.h | 2 ++ 5 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp index 9e086e8d..de186d8c 100644 --- a/src/level/robotmain.cpp +++ b/src/level/robotmain.cpp @@ -5279,21 +5279,6 @@ char* CRobotMain::GetScriptFile() } -bool CRobotMain::GetInterfaceGlint() -{ - return m_settings->GetInterfaceGlint(); -} - -bool CRobotMain::GetSoluce4() -{ - return m_settings->GetSoluce4(); -} - -bool CRobotMain::GetMovies() -{ - return m_settings->GetMovies(); -} - bool CRobotMain::GetShowSoluce() { return m_showSoluce; diff --git a/src/level/robotmain.h b/src/level/robotmain.h index 9f943231..a78ca4fa 100644 --- a/src/level/robotmain.h +++ b/src/level/robotmain.h @@ -234,9 +234,6 @@ public: char* GetScriptFile(); bool GetTrainerPilot(); bool GetFixScene(); - bool GetInterfaceGlint(); - bool GetSoluce4(); - bool GetMovies(); bool GetShowSoluce(); bool GetSceneSoluce(); bool GetShowAll(); diff --git a/src/object/old_object.cpp b/src/object/old_object.cpp index ca68afee..1939f655 100644 --- a/src/object/old_object.cpp +++ b/src/object/old_object.cpp @@ -26,6 +26,7 @@ #include "common/global.h" #include "common/make_unique.h" +#include "common/settings.h" #include "common/stringutils.h" #include "graphics/engine/lightman.h" @@ -1118,7 +1119,7 @@ void COldObject::Read(CLevelParserLine* line) int i = line->GetParam("run")->AsInt(-1); if (i != -1) { - if (i != PARAM_FIXSCENE && !m_main->GetMovies()) i = 0; + if (i != PARAM_FIXSCENE && !CSettings::GetInstancePointer()->GetMovies()) i = 0; m_auto->Start(i); // starts the film } } diff --git a/src/ui/controls/control.cpp b/src/ui/controls/control.cpp index 992c43c8..3e442c28 100644 --- a/src/ui/controls/control.cpp +++ b/src/ui/controls/control.cpp @@ -23,6 +23,7 @@ #include "app/app.h" #include "common/restext.h" +#include "common/settings.h" #include "level/robotmain.h" @@ -38,6 +39,7 @@ CControl::CControl() m_engine = Gfx::CEngine::GetInstancePointer(); m_main = CRobotMain::GetInstancePointer(); m_particle = m_engine->GetParticle(); + m_settings = CSettings::GetInstancePointer(); m_eventType = EVENT_NULL; m_state = STATE_ENABLE|STATE_VISIBLE|STATE_GLINT; m_fontSize = Gfx::FONT_SIZE_SMALL; @@ -420,7 +422,7 @@ void CControl::GlintFrame(const Event &event) (m_state & STATE_ENABLE ) == 0 || (m_state & STATE_VISIBLE) == 0 ) return; - if ( !m_main->GetInterfaceGlint() ) return; + if ( !m_settings->GetInterfaceGlint() ) return; m_glintProgress += event.rTime; diff --git a/src/ui/controls/control.h b/src/ui/controls/control.h index 287d68ca..1b1bdf07 100644 --- a/src/ui/controls/control.h +++ b/src/ui/controls/control.h @@ -27,6 +27,7 @@ class CRobotMain; class CSoundInterface; +class CSettings; namespace Gfx { @@ -120,6 +121,7 @@ protected: CEventQueue* m_event; CRobotMain* m_main; CSoundInterface* m_sound; + CSettings* m_settings; Math::Point m_pos; // corner upper / left Math::Point m_dim; // dimensions