mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-12 14:09:28 +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_QUIT:
|
||||||
case Common::EVENT_RETURN_TO_LAUNCHER:
|
case Common::EVENT_RETURN_TO_LAUNCHER:
|
||||||
return Common::kNoError;
|
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:
|
default:
|
||||||
|
_qsystem->onEvent(event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -302,4 +302,20 @@ QObjectStar *QSystem::getStar() const {
|
|||||||
return (QObjectStar *)_allObjects.back();
|
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
|
#define PETKA_Q_SYSTEM_H
|
||||||
|
|
||||||
#include "common/ptr.h"
|
#include "common/ptr.h"
|
||||||
|
#include "common/events.h"
|
||||||
#include "common/stream.h"
|
#include "common/stream.h"
|
||||||
#include "common/list.h"
|
#include "common/list.h"
|
||||||
#include "common/hashmap.h"
|
#include "common/hashmap.h"
|
||||||
@ -76,6 +77,8 @@ public:
|
|||||||
|
|
||||||
void setChapayev();
|
void setChapayev();
|
||||||
|
|
||||||
|
void onEvent(const Common::Event &event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Common::Array<QMessageObject *> _allObjects;
|
Common::Array<QMessageObject *> _allObjects;
|
||||||
Common::List<QMessage> _messages;
|
Common::List<QMessage> _messages;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user