aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/agi/agi.cpp3
-rw-r--r--engines/agos/cursor.cpp2
-rw-r--r--engines/agos/event.cpp3
-rw-r--r--engines/engine.cpp1
-rw-r--r--engines/engine.h2
-rw-r--r--engines/kyra/gui.cpp6
-rw-r--r--engines/kyra/kyra.cpp8
-rw-r--r--engines/kyra/sequences_v1.cpp3
-rw-r--r--engines/kyra/text.cpp3
-rw-r--r--engines/saga/input.cpp5
-rw-r--r--engines/scumm/input.cpp3
-rw-r--r--engines/scumm/scumm.cpp3
-rw-r--r--engines/sky/sky.cpp3
-rw-r--r--engines/sword1/sword1.cpp3
-rw-r--r--engines/sword2/sword2.cpp3
-rw-r--r--engines/touche/touche.cpp6
-rw-r--r--engines/touche/touche.h2
17 files changed, 23 insertions, 36 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index be46647b58..626ba8f7fe 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -61,8 +61,7 @@ void AgiEngine::processEvents() {
Common::Event event;
int key = 0;
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_QUIT:
_gfx->deinitVideo();
diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp
index efed42202b..33471f2e43 100644
--- a/engines/agos/cursor.cpp
+++ b/engines/agos/cursor.cpp
@@ -309,7 +309,7 @@ void AGOSEngine::handleMouseMoved() {
}
CursorMan.showMouse(true);
- _mouse = _system->getEventManager()->getMousePos();
+ _mouse = _eventMan->getMousePos();
if (_defaultVerb) {
uint id = 101;
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index 6f465e8390..93ab997e64 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -332,8 +332,7 @@ void AGOSEngine::delay(uint amount) {
_inCallBack = false;
}
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode >= '0' && event.kbd.keycode <='9'
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 0d870e51cd..5eca4cfa25 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -48,6 +48,7 @@ Engine::Engine(OSystem *syst)
: _system(syst),
_mixer(_system->getMixer()),
_timer(_system->getTimerManager()),
+ _eventMan(_system->getEventManager()),
_saveFileMan(_system->getSavefileManager()),
_targetName(ConfMan.getActiveDomainName()),
_gameDataPath(ConfMan.get("path")) {
diff --git a/engines/engine.h b/engines/engine.h
index 62da2cc3ff..37cf63e88b 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -31,6 +31,7 @@ namespace Audio {
class Mixer;
}
namespace Common {
+ class EventManager;
class SaveFileManager;
class TimerManager;
}
@@ -45,6 +46,7 @@ public:
Common::TimerManager * _timer;
protected:
+ Common::EventManager *_eventMan;
Common::SaveFileManager *_saveFileMan;
const Common::String _targetName; // target name for saves
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index 3573157277..c9b8b045c2 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -811,8 +811,7 @@ void KyraEngine::gui_getInput() {
uint32 now = _system->getMillis();
_mouseWheel = 0;
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_QUIT:
quitGame();
@@ -1487,8 +1486,7 @@ void KyraEngine::gui_updateMainMenuAnimation() {
bool KyraEngine::gui_mainMenuGetInput() {
Common::Event event;
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_QUIT:
quitGame();
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index 6b3a2dc3a1..aba461a231 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -608,8 +608,7 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
uint32 start = _system->getMillis();
do {
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' &&
@@ -690,7 +689,7 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
}
Common::Point KyraEngine::getMousePos() const {
- Common::Point mouse = g_system->getEventManager()->getMousePos();
+ Common::Point mouse = _eventMan->getMousePos();
if (_flags.useHiResOverlay) {
mouse.x >>= 1;
mouse.y >>= 1;
@@ -702,8 +701,7 @@ void KyraEngine::waitForEvent() {
bool finished = false;
Common::Event event;
while (!finished && !_quitFlag) {
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
finished = true;
diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp
index 7503462dd2..771949b852 100644
--- a/engines/kyra/sequences_v1.cpp
+++ b/engines/kyra/sequences_v1.cpp
@@ -1171,8 +1171,7 @@ void KyraEngine::seq_playCredits() {
_screen->updateScreen();
}
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
finished = true;
diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp
index 4bc9bfc629..dd536a87ae 100644
--- a/engines/kyra/text.cpp
+++ b/engines/kyra/text.cpp
@@ -118,8 +118,7 @@ void KyraEngine::waitForChatToFinish(int vocFile, int16 chatDuration, const char
uint32 nextTime = loopStart + _tickLength;
while (_system->getMillis() < nextTime) {
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == '.')
diff --git a/engines/saga/input.cpp b/engines/saga/input.cpp
index 3f9495ce8c..e0216ba2fa 100644
--- a/engines/saga/input.cpp
+++ b/engines/saga/input.cpp
@@ -40,8 +40,7 @@ namespace Saga {
int SagaEngine::processInput() {
Common::Event event;
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
if (event.kbd.flags == Common::KBD_CTRL) {
@@ -153,7 +152,7 @@ int SagaEngine::processInput() {
}
Point SagaEngine::mousePos() const {
- return _system->getEventManager()->getMousePos();
+ return _eventMan->getMousePos();
}
} // End of namespace Saga
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 4b317098f4..54feafb115 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -57,8 +57,7 @@ enum MouseButtonStatus {
void ScummEngine::parseEvents() {
Common::Event event;
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 5298593a1e..9ff08d7e5b 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -851,8 +851,7 @@ int ScummEngine_vCUPhe::go() {
void ScummEngine_vCUPhe::parseEvents() {
Common::Event event;
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_QUIT:
_quit = true;
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index 7cf1566f35..195aa240e2 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -511,7 +511,6 @@ void SkyEngine::gotTimerTick(void) {
void SkyEngine::delay(int32 amount) {
- Common::EventManager *eventMan = _system->getEventManager();
Common::Event event;
uint32 start = _system->getMillis();
@@ -521,7 +520,7 @@ void SkyEngine::delay(int32 amount) {
amount = 0;
do {
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
_keyFlags = event.kbd.flags;
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index 7a783c63b3..751fb0f1ac 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -706,8 +706,7 @@ void SwordEngine::delay(int32 amount) { //copied and mutilated from sky.cpp
uint32 start = _system->getMillis();
do {
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
// Make sure backspace works right (this fixes a small issue on OS X)
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 075c0123c2..8f49bba839 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -534,8 +534,7 @@ uint32 Sword2Engine::setInputEventFilter(uint32 filter) {
void Sword2Engine::parseInputEvents() {
Common::Event event;
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(event)) {
+ while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
if (event.kbd.flags == Common::KBD_CTRL) {
diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp
index 895bb0da6c..54503f2235 100644
--- a/engines/touche/touche.cpp
+++ b/engines/touche/touche.cpp
@@ -237,10 +237,8 @@ void ToucheEngine::writeConfigurationSettings() {
ConfMan.flushToDisk();
}
-Common::Point ToucheEngine::getMousePos() {
- Common::EventManager *eventMan = _system->getEventManager();
-
- return eventMan->getMousePos();
+Common::Point ToucheEngine::getMousePos() const {
+ return _eventMan->getMousePos();
}
void ToucheEngine::mainLoop() {
diff --git a/engines/touche/touche.h b/engines/touche/touche.h
index 371f55d9bb..04fb42d80a 100644
--- a/engines/touche/touche.h
+++ b/engines/touche/touche.h
@@ -611,7 +611,7 @@ protected:
int displayQuitDialog();
void displayTextMode(int str);
- Common::Point getMousePos();
+ Common::Point getMousePos() const;
MidiPlayer *_midiPlayer;