Removed CSettings access through CRobotMain

dev-time-step
krzys-h 2015-10-01 19:19:40 +02:00
parent 3815ef0bd6
commit b5e98dd6e9
5 changed files with 7 additions and 20 deletions

View File

@ -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;

View File

@ -234,9 +234,6 @@ public:
char* GetScriptFile();
bool GetTrainerPilot();
bool GetFixScene();
bool GetInterfaceGlint();
bool GetSoluce4();
bool GetMovies();
bool GetShowSoluce();
bool GetSceneSoluce();
bool GetShowAll();

View File

@ -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
}
}

View File

@ -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;

View File

@ -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