aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-08-25 07:46:23 +0200
committerBertrand Augereau2011-08-25 07:46:23 +0200
commit0baa0afb38e018a2d80db759f584fd184fb7478d (patch)
treec39e0c7a81e80a53173e39fa8d029e99a1485f3e
parent2cecbe0e3a3caa59cf725b7fad5a90cd1b1e1026 (diff)
downloadscummvm-rg350-0baa0afb38e018a2d80db759f584fd184fb7478d.tar.gz
scummvm-rg350-0baa0afb38e018a2d80db759f584fd184fb7478d.tar.bz2
scummvm-rg350-0baa0afb38e018a2d80db759f584fd184fb7478d.zip
DREAMWEB: Better 'mouseCall' api, DreamWebEngine should not use _context, ideally
-rw-r--r--engines/dreamweb/dreamweb.cpp13
-rw-r--r--engines/dreamweb/dreamweb.h2
-rw-r--r--engines/dreamweb/stubs.cpp7
3 files changed, 13 insertions, 9 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 19d1d84a51..0e43f18db6 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -303,7 +303,7 @@ void DreamWebEngine::keyPressed(uint16 ascii) {
keybuf[in] = ascii;
}
-void DreamWebEngine::mouseCall() {
+void DreamWebEngine::mouseCall(uint16 *x, uint16 *y, uint16 *state) {
processEvents();
Common::EventManager *eventMan = _system->getEventManager();
Common::Point pos = eventMan->getMousePos();
@@ -315,13 +315,12 @@ void DreamWebEngine::mouseCall() {
pos.y = 15;
if (pos.y > 184)
pos.y = 184;
- _context.cx = pos.x;
- _context.dx = pos.y;
+ *x = pos.x;
+ *y = pos.y;
- unsigned state = eventMan->getButtonState();
- _context.bx = state == _oldMouseState? 0: state;
- _oldMouseState = state;
- _context.flags._c = false;
+ unsigned newState = eventMan->getButtonState();
+ *state = (newState == _oldMouseState? 0 : newState);
+ _oldMouseState = newState;
}
void DreamWebEngine::fadeDos() {
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index a7de64a350..97f6007f9d 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -82,7 +82,7 @@ public:
uint32 skipBytes(uint32 bytes);
void closeFile();
- void mouseCall(); //fill mouse pos and button state
+ void mouseCall(uint16 *x, uint16 *y, uint16 *state); //fill mouse pos and button state
void processEvents();
void setPalette();
void fadeDos();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index d1928072cb..5f058a5190 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -285,7 +285,12 @@ void DreamGenContext::dontloadseg() {
}
void DreamGenContext::mousecall() {
- engine->mouseCall();
+ uint16 x, y, state;
+ engine->mouseCall(&x, &y, &state);
+ cx = x;
+ dx = y;
+ bx = state;
+ flags._c = false;
}
void DreamGenContext::setmouse() {