mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-07 19:36:21 +00:00
PETKA: moved handling events to QSystem
This commit is contained in:
parent
b1e83d068a
commit
5473724684
@ -102,20 +102,8 @@ Common::Error PetkaEngine::run() {
|
||||
case Common::EVENT_QUIT:
|
||||
case Common::EVENT_RETURN_TO_LAUNCHER:
|
||||
return Common::kNoError;
|
||||
case Common::EVENT_MOUSEMOVE:
|
||||
_qsystem->_currInterface->onMouseMove(event.mouse);
|
||||
break;
|
||||
case Common::EVENT_LBUTTONDOWN:
|
||||
_qsystem->_currInterface->onLeftButtonDown(event.mouse);
|
||||
break;
|
||||
case Common::EVENT_LBUTTONUP:
|
||||
break;
|
||||
case Common::EVENT_RBUTTONDOWN:
|
||||
_qsystem->_currInterface->onRightButtonDown(event.mouse);
|
||||
break;
|
||||
case Common::EVENT_KEYDOWN:
|
||||
break;
|
||||
default:
|
||||
_qsystem->onEvent(event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -302,4 +302,20 @@ QObjectStar *QSystem::getStar() const {
|
||||
return (QObjectStar *)_allObjects.back();
|
||||
}
|
||||
|
||||
void QSystem::onEvent(const Common::Event &event) {
|
||||
switch (event.type) {
|
||||
case Common::EVENT_MOUSEMOVE:
|
||||
_currInterface->onMouseMove(event.mouse);
|
||||
break;
|
||||
case Common::EVENT_LBUTTONDOWN:
|
||||
_currInterface->onLeftButtonDown(event.mouse);
|
||||
break;
|
||||
case Common::EVENT_RBUTTONDOWN:
|
||||
_currInterface->onRightButtonDown(event.mouse);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#define PETKA_Q_SYSTEM_H
|
||||
|
||||
#include "common/ptr.h"
|
||||
#include "common/events.h"
|
||||
#include "common/stream.h"
|
||||
#include "common/list.h"
|
||||
#include "common/hashmap.h"
|
||||
@ -76,6 +77,8 @@ public:
|
||||
|
||||
void setChapayev();
|
||||
|
||||
void onEvent(const Common::Event &event);
|
||||
|
||||
public:
|
||||
Common::Array<QMessageObject *> _allObjects;
|
||||
Common::List<QMessage> _messages;
|
||||
|
Loading…
x
Reference in New Issue
Block a user