mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-02 16:31:01 +00:00
Change DefaultEventManager to use EventDispatcher.
svn-id: r42725
This commit is contained in:
parent
38309da521
commit
141ded3063
@ -93,14 +93,18 @@ void writeRecord(Common::OutSaveFile *outFile, uint32 diff, Common::Event &event
|
||||
}
|
||||
|
||||
DefaultEventManager::DefaultEventManager(Common::EventSource *boss) :
|
||||
_boss(boss),
|
||||
_buttonState(0),
|
||||
_modifierState(0),
|
||||
_shouldQuit(false),
|
||||
_shouldRTL(false),
|
||||
_confirmExitDialogActive(false) {
|
||||
|
||||
assert(_boss);
|
||||
assert(boss);
|
||||
|
||||
g_eventDispatcher.registerSource(boss, false);
|
||||
g_eventDispatcher.registerSource(&_artificialEventSource, false);
|
||||
|
||||
g_eventDispatcher.registerObserver(this, 0, false);
|
||||
|
||||
_recordFile = NULL;
|
||||
_recordTimeFile = NULL;
|
||||
@ -378,12 +382,12 @@ void DefaultEventManager::processMillis(uint32 &millis) {
|
||||
|
||||
bool DefaultEventManager::pollEvent(Common::Event &event) {
|
||||
uint32 time = g_system->getMillis();
|
||||
bool result;
|
||||
bool result = false;
|
||||
|
||||
if (_artificialEventSource.pollEvent(event)) {
|
||||
g_eventDispatcher.dispatch();
|
||||
if (!_eventQueue.empty()) {
|
||||
event = _eventQueue.pop();
|
||||
result = true;
|
||||
} else {
|
||||
result = _boss->pollEvent(event);
|
||||
|
||||
#ifdef ENABLE_KEYMAPPER
|
||||
if (result) {
|
||||
|
@ -42,8 +42,6 @@ namespace Common {
|
||||
|
||||
|
||||
class DefaultEventManager : public Common::EventManager, Common::EventObserver {
|
||||
Common::EventSource *_boss;
|
||||
|
||||
#ifdef ENABLE_VKEYBD
|
||||
Common::VirtualKeyboard *_vk;
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user