[colobot] 30/377: Removed CSettings access through CRobotMain

Didier Raboud odyx at moszumanska.debian.org
Wed Mar 30 13:33:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit b5e98dd6e9b67b92175e83b072d101d3392495d2
Author: krzys-h <krzys_h at interia.pl>
Date:   Thu Oct 1 19:19:40 2015 +0200

    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 9e086e8..de186d8 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 9f94323..a78ca4f 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 ca68afe..1939f65 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 992c43c..3e442c2 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 287d68c..1b1bdf0 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list