From 092183844f7f0bf1158717841b2ce458e2491d95 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Mon, 4 May 2009 12:25:00 +0000 Subject: [PATCH] Removed irrlicht debug output (only non-trivial messages are printed to stdout now). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3464 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/gui/engine.cpp | 4 ++-- src/input/input_manager.cpp | 17 +++++++++++++++-- src/input/input_manager.hpp | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/gui/engine.cpp b/src/gui/engine.cpp index 504377ec2..a09b82888 100644 --- a/src/gui/engine.cpp +++ b/src/gui/engine.cpp @@ -46,10 +46,10 @@ namespace GUIEngine { if(g_current_screen == NULL) return false; g_current_screen->OnEvent(event); + return false; } else - input_manager->input(event); - return false; + return input_manager->input(event); } }; IrrlichtEventCore* g_irrlicht_event_core = NULL; diff --git a/src/input/input_manager.cpp b/src/input/input_manager.cpp index adedb9c66..d5e70fb9d 100644 --- a/src/input/input_manager.cpp +++ b/src/input/input_manager.cpp @@ -280,7 +280,7 @@ void InputManager::input(Input::InputType type, int id0, int id1, int id2, * flexibility (= treat 4 directions as four buttons). * */ -void InputManager::input(const SEvent& event) +bool InputManager::input(const SEvent& event) { if(event.EventType == EET_JOYSTICK_INPUT_EVENT) @@ -315,6 +315,16 @@ void InputManager::input(const SEvent& event) } } + else if(event.EventType == EET_LOG_TEXT_EVENT) + { + // Ignore 'normal' messages + if(event.LogEvent.Level>0) + { + printf("Level %d: %s\n", + event.LogEvent.Level,event.LogEvent.Text); + } + return true; + } else if(event.EventType == EET_KEY_INPUT_EVENT) { const int key = event.KeyInput.Key; @@ -325,7 +335,7 @@ void InputManager::input(const SEvent& event) if(key == KEY_ESCAPE) { StateManager::escapePressed(); - return; + return true; } input(Input::IT_KEYBOARD, key, @@ -374,6 +384,9 @@ void InputManager::input(const SEvent& event) */ } #endif + // FIXME: to restore the original behaviour (engine returns false in the + // case the input_manager::input is called) + return false; } //----------------------------------------------------------------------------- diff --git a/src/input/input_manager.hpp b/src/input/input_manager.hpp index 31dc39dc1..27b20192a 100644 --- a/src/input/input_manager.hpp +++ b/src/input/input_manager.hpp @@ -75,7 +75,7 @@ public: // void initGamePadDevices(); //void input(); - void input(const irr::SEvent& event); + bool input(const irr::SEvent& event); DeviceManager* getDeviceList() { return m_device_manager; }