aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-08-02 00:36:38 +0000
committerMax Horn2003-08-02 00:36:38 +0000
commit103112dd3da9e9b8ee0610d4cc6dc4a8320f2b98 (patch)
tree7d65f9b26a214f40647f330831f7a2f627bc26fc
parent208a3925e90999e7bd28b53571e27e1b7a1a36cb (diff)
downloadscummvm-rg350-103112dd3da9e9b8ee0610d4cc6dc4a8320f2b98.tar.gz
scummvm-rg350-103112dd3da9e9b8ee0610d4cc6dc4a8320f2b98.tar.bz2
scummvm-rg350-103112dd3da9e9b8ee0610d4cc6dc4a8320f2b98.zip
removed OSystem::set_mouse_pos (I hope I didn't break any backends, but if I did it should be trivial to get them working again)
svn-id: r9391
-rw-r--r--backends/PalmOS/Src/palm.cpp2
-rw-r--r--backends/dc/input.cpp1
-rw-r--r--backends/gp32/gp32.cpp172
-rw-r--r--backends/morphos/morphos.cpp1
-rw-r--r--backends/sdl/sdl-common.cpp2
-rw-r--r--backends/wince/wince.cpp3
-rw-r--r--backends/x11/x11.cpp1
-rw-r--r--common/system.h11
-rw-r--r--gui/newgui.cpp1
-rw-r--r--scumm/scummvm.cpp2
-rw-r--r--simon/simon.cpp6
-rw-r--r--simon/simon.h1
-rw-r--r--sky/control.cpp1
-rw-r--r--sky/sky.cpp1
-rw-r--r--sword2/driver/rdwin.cpp1
15 files changed, 97 insertions, 109 deletions
diff --git a/backends/PalmOS/Src/palm.cpp b/backends/PalmOS/Src/palm.cpp
index d0ae3c65a2..a64d99668b 100644
--- a/backends/PalmOS/Src/palm.cpp
+++ b/backends/PalmOS/Src/palm.cpp
@@ -603,6 +603,7 @@ void OSystem_PALMOS::SimulateArrowKeys(Event *event, Int8 iHoriz, Int8 iVert, Bo
event->event_code = EVENT_MOUSEMOVE;
event->mouse.x = x;
event->mouse.y = y;
+ set_mouse_pos(event->mouse.x, event->mouse.y);
}
static void getCoordinates(EventPtr event, Boolean wide, Coord *x, Coord *y) {
@@ -811,6 +812,7 @@ bool OSystem_PALMOS::poll_event(Event *event) {
event->event_code = EVENT_MOUSEMOVE;
event->mouse.x = x;
event->mouse.y = y - _decaly;
+ set_mouse_pos(event->mouse.x, event->mouse.y);
return true;
case penDownEvent:
diff --git a/backends/dc/input.cpp b/backends/dc/input.cpp
index 868f6c1fe0..e7b3dad072 100644
--- a/backends/dc/input.cpp
+++ b/backends/dc/input.cpp
@@ -184,6 +184,7 @@ bool OSystem_Dreamcast::poll_event(Event *event)
event->event_code = EVENT_MOUSEMOVE;
_ms_old_x = _ms_cur_x;
_ms_old_y = _ms_cur_y;
+ set_mouse_pos(event->mouse.x, event->mouse.y);
return true;
} else {
event->event_code = (EventCode)0;
diff --git a/backends/gp32/gp32.cpp b/backends/gp32/gp32.cpp
index 2c266aeca4..d81fbc2b8e 100644
--- a/backends/gp32/gp32.cpp
+++ b/backends/gp32/gp32.cpp
@@ -873,107 +873,107 @@ bool OSystem_GP32::poll_event(Event *event) { // fixme: make more user-friendly
int key;
key=GpKeyGet();
- if (key == GPC_VK_NONE) {
- if (lastevent==EVENT_LBUTTONDOWN) {
- lastevent=0;
- event->event_code = EVENT_LBUTTONUP;
- return true;
- }
- return false;
- }
-
- if (key == oldkey) {
- eventcount--;
- if (eventcount) return false;
+ if (key == GPC_VK_NONE) {
+ if (lastevent==EVENT_LBUTTONDOWN) {
+ lastevent=0;
+ event->event_code = EVENT_LBUTTONUP;
+ return true;
}
- oldkey=key;
- eventcount=EVENT_COUNT;
-
- event->event_code = EVENT_KEYDOWN;
+ return false;
+ }
- if (key & GPC_VK_FL && key & GPC_VK_FR) { // L+R = save state
- printf("Saving game, please wait...");
+ if (key == oldkey) {
+ eventcount--;
+ if (eventcount) return false;
+ }
+ oldkey=key;
+ eventcount=EVENT_COUNT;
- //extern void autosave(void * engine);
- //autosave(NULL); //FIXME?
- do key=GpKeyGet(); while (key != GPC_VK_NONE) ;
- return false;
- } else
+ event->event_code = EVENT_KEYDOWN;
- if(key & GPC_VK_FL) { // L = debug console
- //GpGraphicModeSet(8, NULL); //FIXME: if 16bit?
- currsurface=DEBUG_SURFACE;
- GpSurfaceFlip(&gpDraw[currsurface]);
- GpSetPaletteEntry ( 0, 0,0,0 );
- GpSetPaletteEntry ( 1, 255,0,0 );
- GpSetPaletteEntry ( 2, 255,255,255 );
- return false;
- } else
-
- if (key & GPC_VK_FR) { // R = game screen
- //if (_overlay_visible) GpGraphicModeSet(16, NULL);
- // else GpGraphicModeSet(8, NULL);
- currsurface=GAME_SURFACE;
- GpSurfaceFlip(&gpDraw[currsurface]);
+ if (key & GPC_VK_FL && key & GPC_VK_FR) { // L+R = save state
+ printf("Saving game, please wait...");
- _paletteDirtyStart=0;
- _paletteDirtyEnd=255; //fixme?
- return false;
- }
+ //extern void autosave(void * engine);
+ //autosave(NULL); //FIXME?
+ do key=GpKeyGet(); while (key != GPC_VK_NONE) ;
+ return false;
+ }
+
+ if (key & GPC_VK_FL) { // L = debug console
+ //GpGraphicModeSet(8, NULL); //FIXME: if 16bit?
+ currsurface=DEBUG_SURFACE;
+ GpSurfaceFlip(&gpDraw[currsurface]);
+ GpSetPaletteEntry ( 0, 0,0,0 );
+ GpSetPaletteEntry ( 1, 255,0,0 );
+ GpSetPaletteEntry ( 2, 255,255,255 );
+ return false;
+ }
+
+ if (key & GPC_VK_FR) { // R = game screen
+ //if (_overlay_visible) GpGraphicModeSet(16, NULL);
+ // else GpGraphicModeSet(8, NULL);
+ currsurface=GAME_SURFACE;
+ GpSurfaceFlip(&gpDraw[currsurface]);
- if(key & GPC_VK_START) { // START = menu
- event->kbd.keycode = 319;
- event->kbd.ascii = 319;
- return true;
- }
+ _paletteDirtyStart=0;
+ _paletteDirtyEnd=255; //fixme?
+ return false;
+ }
- if(key & GPC_VK_SELECT) { // SELECT == escape/skip
- if (_overlay_visible)
- do key=GpKeyGet(); while (key != GPC_VK_NONE) ; // prevent 2xESC
- event->kbd.keycode = 27;
- event->kbd.ascii = 27;
- return true;
- }
+ if (key & GPC_VK_START) { // START = menu
+ event->kbd.keycode = 319;
+ event->kbd.ascii = 319;
+ return true;
+ }
- if (key & GPC_VK_FA) {
- lastevent=EVENT_LBUTTONDOWN;
- event->event_code = EVENT_LBUTTONDOWN;
- return true;
- }
- if (key & GPC_VK_FB) {
- lastevent=EVENT_RBUTTONDOWN;
- event->event_code = EVENT_RBUTTONDOWN;
- return true;
- }
+ if (key & GPC_VK_SELECT) { // SELECT == escape/skip
+ if (_overlay_visible)
+ do key=GpKeyGet(); while (key != GPC_VK_NONE) ; // prevent 2xESC
+ event->kbd.keycode = 27;
+ event->kbd.ascii = 27;
+ return true;
+ }
+
+ if (key & GPC_VK_FA) {
+ lastevent=EVENT_LBUTTONDOWN;
+ event->event_code = EVENT_LBUTTONDOWN;
+ return true;
+ }
+ if (key & GPC_VK_FB) {
+ lastevent=EVENT_RBUTTONDOWN;
+ event->event_code = EVENT_RBUTTONDOWN;
+ return true;
+ }
- event->event_code = EVENT_MOUSEMOVE;
+ if(key & GPC_VK_LEFT) {
+ mx-=MOUSE_MIPS;
+ if (mx<1) mx=1; // wrong if 0?
+ }
- if(key & GPC_VK_LEFT) {
- mx-=MOUSE_MIPS;
- if (mx<1) mx=1; // wrong if 0?
- }
+ if(key & GPC_VK_RIGHT) {
+ mx+=MOUSE_MIPS;
+ if (mx>319) mx=319;
+ }
- if(key & GPC_VK_RIGHT) {
- mx+=MOUSE_MIPS;
- if (mx>319) mx=319;
- }
+ if(key & GPC_VK_UP) {
+ my-=MOUSE_MIPS;
+ if (my<1) my=1; // wrong if 0?
+ }
- if(key & GPC_VK_UP) {
- my-=MOUSE_MIPS;
- if (my<1) my=1; // wrong if 0?
- }
+ if(key & GPC_VK_DOWN) {
+ my+=MOUSE_MIPS;
+ if (my>199) my=199;
+ }
- if(key & GPC_VK_DOWN) {
- my+=MOUSE_MIPS;
- if (my>199) my=199;
- }
+ event->event_code = EVENT_MOUSEMOVE;
+ km.x = event->mouse.x = mx;
+ km.y = event->mouse.y = my;
- event->event_code = EVENT_MOUSEMOVE;
- km.x = event->mouse.x = mx;
- km.y = event->mouse.y = my;
+ event->mouse.x /= _scaleFactor;
+ event->mouse.y /= _scaleFactor;
- event->mouse.x /= _scaleFactor;
- event->mouse.y /= _scaleFactor;
+ set_mouse_pos(event->mouse.x, event->mouse.y);
}
// Set the function to be invoked whenever samples need to be generated
diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp
index b8d6b0d963..1dab006808 100644
--- a/backends/morphos/morphos.cpp
+++ b/backends/morphos/morphos.cpp
@@ -894,6 +894,7 @@ bool OSystem_MorphOS::poll_event(Event *event)
event->event_code = EVENT_MOUSEMOVE;
event->mouse.x = newx;
event->mouse.y = newy;
+ set_mouse_pos(event->mouse.x, event->mouse.y);
break;
}
diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp
index 84d80f3ca8..0b94433384 100644
--- a/backends/sdl/sdl-common.cpp
+++ b/backends/sdl/sdl-common.cpp
@@ -708,6 +708,8 @@ bool OSystem_SDL_Common::poll_event(Event *event) {
if (_adjustAspectRatio)
event->mouse.y = aspect2Real(event->mouse.y);
+
+ set_mouse_pos(event->mouse.x, event->mouse.y);
return true;
case SDL_MOUSEBUTTONDOWN:
diff --git a/backends/wince/wince.cpp b/backends/wince/wince.cpp
index 703e752ab3..78962e550e 100644
--- a/backends/wince/wince.cpp
+++ b/backends/wince/wince.cpp
@@ -1751,6 +1751,9 @@ bool OSystem_WINCE3::poll_event(Event *event) {
return false;
*event = _event;
+
+ if (_event.event_code == EVENT_MOUSEMOVE)
+ set_mouse_pos(_event.mouse.x, _event.mouse.y);
_event.event_code = EVENT_WHEELUP;
diff --git a/backends/x11/x11.cpp b/backends/x11/x11.cpp
index f146f02824..29d394c86d 100644
--- a/backends/x11/x11.cpp
+++ b/backends/x11/x11.cpp
@@ -1006,6 +1006,7 @@ bool OSystem_X11::poll_event(Event *scumm_event)
scumm_event->event_code = EVENT_MOUSEMOVE;
scumm_event->mouse.x = event.xmotion.x - scumm_x;
scumm_event->mouse.y = event.xmotion.y - scumm_y;
+ set_mouse_pos(scumm_event->mouse.x, scumm_event->mouse.y);
return true;
case ConfigureNotify:{
diff --git a/common/system.h b/common/system.h
index 5814e7a3c8..51fca24f66 100644
--- a/common/system.h
+++ b/common/system.h
@@ -198,17 +198,8 @@ public:
/** Show or hide the mouse cursor. */
virtual bool show_mouse(bool visible) = 0;
- /**
- * Set the position of the mouse cursor.
- * @see warp_mouse
- */
- virtual void set_mouse_pos(int x, int y) = 0;
-
/**
- * Warp the mouse cursor to the specified position. Where set_mouse_pos()
- * only informs the backend of the mouse cursor's current position, this
- * function actually moves the cursor to the specified position.
- * @see set_mouse_pos
+ * Move ("warp) the mouse cursor to the specified position.
*/
virtual void warp_mouse(int x, int y) = 0;
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index 5bdcb77df7..5a23fbfb19 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -164,7 +164,6 @@ void NewGui::runLoop() {
_currentKeyDown.keycode = 0;
break;
case OSystem::EVENT_MOUSEMOVE:
- _system->set_mouse_pos(event.mouse.x, event.mouse.y);
activeDialog->handleMouseMoved(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y, 0);
break;
// We don't distinguish between mousebuttons (for now at least)
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index b81a591741..ff641ee67c 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -1431,8 +1431,6 @@ void Scumm::parseEvents() {
case OSystem::EVENT_MOUSEMOVE:
_mouse.x = event.mouse.x;
_mouse.y = event.mouse.y;
- _system->set_mouse_pos(event.mouse.x, event.mouse.y);
- _system->update_screen();
break;
case OSystem::EVENT_LBUTTONDOWN:
diff --git a/simon/simon.cpp b/simon/simon.cpp
index b24da6cb6f..5e39858db9 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -264,7 +264,6 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_fast_mode = 0;
_dx_use_3_or_4_for_lock = 0;
- _mouse_pos_changed = 0;
_debugMode = 0;
_debugLevel = 0;
_language = 0;
@@ -4289,10 +4288,6 @@ void SimonEngine::dx_update_screen_and_palette() {
}
}
- if (_mouse_pos_changed) {
- _mouse_pos_changed = false;
- _system->set_mouse_pos(_sdl_mouse_x, _sdl_mouse_y);
- }
_system->copy_rect(_sdl_buf_attached, 320, 0, 0, 320, 200);
_system->update_screen();
@@ -4494,7 +4489,6 @@ void SimonEngine::delay(uint amount) {
case OSystem::EVENT_MOUSEMOVE:
_sdl_mouse_x = event.mouse.x;
_sdl_mouse_y = event.mouse.y;
- _mouse_pos_changed = true;
break;
case OSystem::EVENT_LBUTTONDOWN:
diff --git a/simon/simon.h b/simon/simon.h
index f032fdb3cd..d38ebc4eaf 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -179,7 +179,6 @@ protected:
bool _fast_mode;
bool _dx_use_3_or_4_for_lock;
- bool _mouse_pos_changed;
uint16 _debugMode;
uint16 _language;
bool _noSubtitles;
diff --git a/sky/control.cpp b/sky/control.cpp
index 5a9ffc7780..a161066b3e 100644
--- a/sky/control.cpp
+++ b/sky/control.cpp
@@ -1697,7 +1697,6 @@ void SkyControl::delay(unsigned int amount) {
case OSystem::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
- _system->set_mouse_pos(_mouseX, _mouseY);
break;
case OSystem::EVENT_LBUTTONDOWN:
diff --git a/sky/sky.cpp b/sky/sky.cpp
index 85d351329c..cb0ba22b82 100644
--- a/sky/sky.cpp
+++ b/sky/sky.cpp
@@ -415,7 +415,6 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp
if (!(_systemVars.systemFlags & SF_MOUSE_LOCKED)) {
_sdl_mouse_x = event.mouse.x;
_sdl_mouse_y = event.mouse.y;
- _system->set_mouse_pos(_sdl_mouse_x, _sdl_mouse_y);
}
break;
diff --git a/sword2/driver/rdwin.cpp b/sword2/driver/rdwin.cpp
index 101c4cf7e2..2a3205f61b 100644
--- a/sword2/driver/rdwin.cpp
+++ b/sword2/driver/rdwin.cpp
@@ -168,7 +168,6 @@ void Sword2State::parseEvents() {
case OSystem::EVENT_MOUSEMOVE:
mousex = event.mouse.x;
mousey = event.mouse.y;
- _system->set_mouse_pos(event.mouse.x, event.mouse.y);
break;
case OSystem::EVENT_LBUTTONDOWN:
LogMouseEvent(RD_LEFTBUTTONDOWN);