[Scummvm-cvs-logs] scummvm master -> 0baa0afb38e018a2d80db759f584fd184fb7478d
tramboi
bertrand_augereau at yahoo.fr
Thu Aug 25 05:50:09 CEST 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0baa0afb38 DREAMWEB: Better 'mouseCall' api, DreamWebEngine should not use _context, ideally
Commit: 0baa0afb38e018a2d80db759f584fd184fb7478d
https://github.com/scummvm/scummvm/commit/0baa0afb38e018a2d80db759f584fd184fb7478d
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-24T22:46:23-07:00
Commit Message:
DREAMWEB: Better 'mouseCall' api, DreamWebEngine should not use _context, ideally
Changed paths:
engines/dreamweb/dreamweb.cpp
engines/dreamweb/dreamweb.h
engines/dreamweb/stubs.cpp
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 19d1d84..0e43f18 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 a7de64a..97f6007 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 d192807..5f058a5 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() {
More information about the Scummvm-git-logs
mailing list