From 78b120a04fb685b7e8f8de36fa3265f931372210 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 20 Mar 2018 09:42:26 +1100 Subject: [PATCH] Moved wiimote handling into input manager. --- src/input/input_manager.cpp | 7 ++++++- src/main_loop.cpp | 9 +++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/input/input_manager.cpp b/src/input/input_manager.cpp index 2999d48d0..0dd3c4bcb 100644 --- a/src/input/input_manager.cpp +++ b/src/input/input_manager.cpp @@ -28,9 +28,10 @@ #include "guiengine/screen_keyboard.hpp" #include "input/device_manager.hpp" #include "input/gamepad_device.hpp" +#include "input/input.hpp" #include "input/keyboard_device.hpp" #include "input/multitouch_device.hpp" -#include "input/input.hpp" +#include "input/wiimote_manager.hpp" #include "karts/controller/controller.hpp" #include "karts/abstract_kart.hpp" #include "modes/demo_world.hpp" @@ -84,6 +85,10 @@ InputManager::InputManager() : m_mode(BOOTSTRAP), // ----------------------------------------------------------------------------- void InputManager::update(float dt) { +#ifdef ENABLE_WIIUSE + wiimote_manager->update(); +#endif + if(m_timer_in_use) { m_timer -= dt; diff --git a/src/main_loop.cpp b/src/main_loop.cpp index 7bedf80fe..318590e56 100644 --- a/src/main_loop.cpp +++ b/src/main_loop.cpp @@ -19,8 +19,6 @@ #include "main_loop.hpp" -#include - #include "audio/sfx_manager.hpp" #include "config/user_config.hpp" #include "graphics/irr_driver.hpp" @@ -28,7 +26,6 @@ #include "guiengine/engine.hpp" #include "guiengine/message_queue.hpp" #include "input/input_manager.hpp" -#include "input/wiimote_manager.hpp" #include "modes/profile_world.hpp" #include "modes/world.hpp" #include "network/network_config.hpp" @@ -44,8 +41,11 @@ #include "states_screens/state_manager.hpp" #include "utils/profiler.hpp" +#include + MainLoop* main_loop = 0; +// ---------------------------------------------------------------------------- MainLoop::MainLoop() : m_abort(false) { @@ -323,9 +323,6 @@ void MainLoop::run() PROFILER_POP_CPU_MARKER(); PROFILER_PUSH_CPU_MARKER("Input/GUI", 0x7F, 0x00, 0x00); - #ifdef ENABLE_WIIUSE - wiimote_manager->update(); - #endif input_manager->update(frame_duration); GUIEngine::update(frame_duration); PROFILER_POP_CPU_MARKER();