diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sky/control.cpp | 4 | ||||
-rw-r--r-- | engines/sky/mouse.cpp | 13 | ||||
-rw-r--r-- | engines/sky/mouse.h | 3 | ||||
-rw-r--r-- | engines/sky/sky.cpp | 17 | ||||
-rw-r--r-- | engines/sky/sky.h | 2 |
5 files changed, 15 insertions, 24 deletions
diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index e4b60629d0..76b15c4cbc 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -1560,14 +1560,14 @@ void Control::delay(unsigned int amount) { _keyPressed = (byte)event.kbd.ascii; break; case OSystem::EVENT_MOUSEMOVE: + _skyMouse->mouseMoved(event.mouse.x, event.mouse.y); _mouseX = event.mouse.x; _mouseY = event.mouse.y; break; case OSystem::EVENT_LBUTTONDOWN: -#ifdef PALMOS_MODE + _skyMouse->mouseMoved(event.mouse.x, event.mouse.y); _mouseX = event.mouse.x; _mouseY = event.mouse.y; -#endif _mouseClicked = true; break; case OSystem::EVENT_LBUTTONUP: diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp index 689fc98e0c..da614db04e 100644 --- a/engines/sky/mouse.cpp +++ b/engines/sky/mouse.cpp @@ -216,15 +216,12 @@ void Mouse::spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY) { CursorMan.showMouse(true); } -void Mouse::mouseEngine(uint16 mouseX, uint16 mouseY) { - _mouseX = mouseX; - _mouseY = mouseY; - +void Mouse::mouseEngine() { _logicClick = (_mouseB > 0); // click signal is available for Logic for one gamecycle if (!Logic::_scriptVariables[MOUSE_STOP]) { if (Logic::_scriptVariables[MOUSE_STATUS] & (1 << 1)) { - pointerEngine(mouseX + TOP_LEFT_X, mouseY + TOP_LEFT_Y); + pointerEngine(_mouseX + TOP_LEFT_X, _mouseY + TOP_LEFT_Y); if (Logic::_scriptVariables[MOUSE_STATUS] & (1 << 2)) //buttons enabled? buttonEngine1(); } @@ -271,10 +268,14 @@ void Mouse::pointerEngine(uint16 xPos, uint16 yPos) { } void Mouse::buttonPressed(uint8 button) { - _mouseB = button; } +void Mouse::mouseMoved(uint16 mouseX, uint16 mouseY) { + _mouseX = mouseX; + _mouseY = mouseY; +} + void Mouse::buttonEngine1(void) { //checks for clicking on special item //"compare the size of this routine to S1 mouse_button" diff --git a/engines/sky/mouse.h b/engines/sky/mouse.h index ccd2987022..b60108dcc9 100644 --- a/engines/sky/mouse.h +++ b/engines/sky/mouse.h @@ -41,7 +41,7 @@ public: Mouse(OSystem *system, Disk *skyDisk, SkyCompact *skyCompact); ~Mouse(void); - void mouseEngine(uint16 mouseX, uint16 mouseY); + void mouseEngine(); void replaceMouseCursors(uint16 fileNo); bool fnAddHuman(void); void fnSaveCoods(void); @@ -54,6 +54,7 @@ public: void spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY); void useLogicInstance(Logic *skyLogic) { _skyLogic = skyLogic; }; void buttonPressed(uint8 button); + void mouseMoved(uint16 mouseX, uint16 mouseY); void waitMouseNotPressed(int minDelay = 0); uint16 giveMouseX(void) { return _mouseX; }; uint16 giveMouseY(void) { return _mouseY; }; diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 375f484d8e..056189c54e 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -263,8 +263,6 @@ int SkyEngine::go() { _systemVars.quitGame = false; - _mouseX = GAME_SCREEN_WIDTH / 2; - _mouseY = GAME_SCREEN_HEIGHT / 2; _keyFlags = _keyPressed = 0; uint16 result = 0; @@ -303,7 +301,7 @@ int SkyEngine::go() { _lastSaveTime += 30 * 1000; // try again in 30 secs } _skySound->checkFxQueue(); - _skyMouse->mouseEngine((uint16)_mouseX, (uint16)_mouseY); + _skyMouse->mouseEngine(); handleKey(); if (_systemVars.paused) { do { @@ -532,22 +530,15 @@ void SkyEngine::delay(int32 amount) { break; case OSystem::EVENT_MOUSEMOVE: if (!(_systemVars.systemFlags & SF_MOUSE_LOCKED)) { - _mouseX = event.mouse.x; - _mouseY = event.mouse.y; + _skyMouse->mouseMoved(event.mouse.x, event.mouse.y); } break; case OSystem::EVENT_LBUTTONDOWN: -#ifdef PALMOS_MODE - _mouseX = event.mouse.x; - _mouseY = event.mouse.y; -#endif + _skyMouse->mouseMoved(event.mouse.x, event.mouse.y); _skyMouse->buttonPressed(2); break; case OSystem::EVENT_RBUTTONDOWN: -#ifdef PALMOS_MODE - _mouseX = event.mouse.x; - _mouseY = event.mouse.y; -#endif + _skyMouse->mouseMoved(event.mouse.x, event.mouse.y); _skyMouse->buttonPressed(1); break; case OSystem::EVENT_QUIT: diff --git a/engines/sky/sky.h b/engines/sky/sky.h index eeb8c3432b..e11f1b6cd5 100644 --- a/engines/sky/sky.h +++ b/engines/sky/sky.h @@ -60,8 +60,6 @@ protected: byte _keyPressed, _keyFlags; bool _floppyIntro; - int _mouseX, _mouseY; - Sound *_skySound; Disk *_skyDisk; Text *_skyText; |