Skip to content

Commit

Permalink
Refactor keyboard and mouse getters
Browse files Browse the repository at this point in the history
  • Loading branch information
matt77hias committed Aug 9, 2017
1 parent 07c9803 commit 960b5e6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion MAGE/FPS/src/samples/brdf/brdf_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion MAGE/MAGE/src/script/character_motor_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion MAGE/MAGE/src/script/manhattan_motor_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion MAGE/MAGE/src/script/mouse_look_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
2 changes: 1 addition & 1 deletion MAGE/MAGE/src/script/wireframe_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 960b5e6

Please sign in to comment.