From 960b5e6db37042858acedbcd80dca9e44d55eb5e Mon Sep 17 00:00:00 2001 From: REDDRAGON Date: Wed, 9 Aug 2017 14:37:35 +0200 Subject: [PATCH] Refactor keyboard and mouse getters --- MAGE/FPS/src/samples/brdf/brdf_script.cpp | 2 +- MAGE/MAGE/src/script/character_motor_script.cpp | 2 +- MAGE/MAGE/src/script/manhattan_motor_script.cpp | 2 +- MAGE/MAGE/src/script/mouse_look_script.cpp | 2 +- MAGE/MAGE/src/script/wireframe_script.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MAGE/FPS/src/samples/brdf/brdf_script.cpp b/MAGE/FPS/src/samples/brdf/brdf_script.cpp index ea28b93f2..c6397f9e9 100644 --- a/MAGE/FPS/src/samples/brdf/brdf_script.cpp +++ b/MAGE/FPS/src/samples/brdf/brdf_script.cpp @@ -101,7 +101,7 @@ namespace mage { void BRDFScript::Update(double time) { UNUSED(time); - const Keyboard * const keyboard = g_engine->GetInputManager()->GetKeyboard(); + const Keyboard * const keyboard = GetKeyboard(); // Switch model. if (keyboard->GetKeyPress(DIK_UP, false)) { diff --git a/MAGE/MAGE/src/script/character_motor_script.cpp b/MAGE/MAGE/src/script/character_motor_script.cpp index 6e7ad5b14..0d308d142 100644 --- a/MAGE/MAGE/src/script/character_motor_script.cpp +++ b/MAGE/MAGE/src/script/character_motor_script.cpp @@ -21,7 +21,7 @@ namespace mage { CharacterMotorScript::~CharacterMotorScript() = default; void CharacterMotorScript::Update(double delta_time) { - const Keyboard * const keyboard = g_engine->GetInputManager()->GetKeyboard(); + const Keyboard * const keyboard = GetKeyboard(); const double movement_magnitude = delta_time * m_velocity; const double movement_cos = cos(m_transform->GetRotationY()) * movement_magnitude; diff --git a/MAGE/MAGE/src/script/manhattan_motor_script.cpp b/MAGE/MAGE/src/script/manhattan_motor_script.cpp index 4c83c351d..1760517d2 100644 --- a/MAGE/MAGE/src/script/manhattan_motor_script.cpp +++ b/MAGE/MAGE/src/script/manhattan_motor_script.cpp @@ -21,7 +21,7 @@ namespace mage { ManhattanMotorScript::~ManhattanMotorScript() = default; void ManhattanMotorScript::Update(double delta_time) { - const Keyboard * const keyboard = g_engine->GetInputManager()->GetKeyboard(); + const Keyboard * const keyboard = GetKeyboard(); const double movement_magnitude = delta_time * m_velocity; diff --git a/MAGE/MAGE/src/script/mouse_look_script.cpp b/MAGE/MAGE/src/script/mouse_look_script.cpp index 481254965..39befdf92 100644 --- a/MAGE/MAGE/src/script/mouse_look_script.cpp +++ b/MAGE/MAGE/src/script/mouse_look_script.cpp @@ -33,7 +33,7 @@ namespace mage { MouseLookScript::~MouseLookScript() = default; void MouseLookScript::Update(double delta_time) { - const Mouse * const mouse = g_engine->GetInputManager()->GetMouse(); + const Mouse * const mouse = GetMouse(); switch (m_axes) { diff --git a/MAGE/MAGE/src/script/wireframe_script.cpp b/MAGE/MAGE/src/script/wireframe_script.cpp index 58c65555b..e7c194533 100644 --- a/MAGE/MAGE/src/script/wireframe_script.cpp +++ b/MAGE/MAGE/src/script/wireframe_script.cpp @@ -23,7 +23,7 @@ namespace mage { void WireframeScript::Update(double delta_time) { UNUSED(delta_time); - const Keyboard * const keyboard = g_engine->GetInputManager()->GetKeyboard(); + const Keyboard * const keyboard = GetKeyboard(); if (keyboard->GetKeyPress(DIK_SPACE)) { m_solid = !m_solid;