diff options
author | Tarek Soliman | 2012-02-17 12:17:51 -0600 |
---|---|---|
committer | Tarek Soliman | 2012-02-20 06:49:21 -0600 |
commit | e7ade8ae05aff3669059e6003e046d1ef6e914a3 (patch) | |
tree | e990dd504d398f6dc83b954f63d7a81c75f24dbf /common | |
parent | ae992bebe391ac1d0196e9e32f688b38cb3fd56f (diff) | |
download | scummvm-rg350-e7ade8ae05aff3669059e6003e046d1ef6e914a3.tar.gz scummvm-rg350-e7ade8ae05aff3669059e6003e046d1ef6e914a3.tar.bz2 scummvm-rg350-e7ade8ae05aff3669059e6003e046d1ef6e914a3.zip |
KEYMAPPER: EventMapper must now eat all events
Diffstat (limited to 'common')
-rw-r--r-- | common/EventDispatcher.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/common/EventDispatcher.cpp b/common/EventDispatcher.cpp index 4e3f671cfd..55eea9c7b2 100644 --- a/common/EventDispatcher.cpp +++ b/common/EventDispatcher.cpp @@ -21,6 +21,7 @@ */ #include "common/events.h" +#include "common/textconsole.h" namespace Common { @@ -54,18 +55,20 @@ void EventDispatcher::dispatch() { // We only try to process the events via the setup event mapper, when // we have a setup mapper and when the event source allows mapping. if (_mapper && allowMapping) { - if (_mapper->notifyEvent(event)) { - // We allow the event mapper to create multiple events, when - // eating an event. - while (_mapper->pollEvent(event)) - dispatchEvent(event); - - // Try getting another event from the current EventSource. - continue; - } + bool mapped = _mapper->notifyEvent(event); + // EventMappers must map all events + if (!mapped) + error("Event [%u] was not mapped by the EventMapper!", event.type); + // We allow the event mapper to create multiple events, when + // eating an event. + while (_mapper->pollEvent(event)) + dispatchEvent(event); + + // Try getting another event from the current EventSource. + continue; + } else { + dispatchEvent(event); } - - dispatchEvent(event); } } } |