diff options
author | Joost Peters | 2003-06-09 18:58:37 +0000 |
---|---|---|
committer | Joost Peters | 2003-06-09 18:58:37 +0000 |
commit | 74bacc470f9442edad227cb9163abda6f7ba4f10 (patch) | |
tree | 613b45985664e77c24c525d9e60be2d224028aa7 /sky | |
parent | d398b818f82c3d8d6e467c6e1ffbf13edc3e8d9c (diff) | |
download | scummvm-rg350-74bacc470f9442edad227cb9163abda6f7ba4f10.tar.gz scummvm-rg350-74bacc470f9442edad227cb9163abda6f7ba4f10.tar.bz2 scummvm-rg350-74bacc470f9442edad227cb9163abda6f7ba4f10.zip |
mouse-fixes, note that: buttonPressed() keeping track of a repeated push DOES NOT WORK YET, _bMouseB gets cleared elsewhere, so we obviously need to come up with something else. and we still need a wait_relative equivalent to have a proper fnLookAt() ...hmm...this commit message is starting to look like a todo list. oh, well. :)
svn-id: r8419
Diffstat (limited to 'sky')
-rw-r--r-- | sky/mouse.cpp | 12 | ||||
-rw-r--r-- | sky/mouse.h | 2 | ||||
-rw-r--r-- | sky/sky.cpp | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/sky/mouse.cpp b/sky/mouse.cpp index 88dc5260e8..7461fca586 100644 --- a/sky/mouse.cpp +++ b/sky/mouse.cpp @@ -172,7 +172,7 @@ void SkyMouse::drawNewMouse() { } void SkyMouse::waitMouseNotPressed(void) { - while (_mouseB != 0) ; + while (_mouseB) ; _bMouseB = 0; } @@ -273,6 +273,16 @@ void SkyMouse::pointerEngine(void) { } } +void SkyMouse::buttonPressed(uint8 button) { + if (_bMouseB == button) + _mouseB = 1; + else + _mouseB = 0; + + _bMouseB = button; + +} + void SkyMouse::buttonEngine1(void) { //checks for clicking on special item //"compare the size of this routine to S1 mouse_button" diff --git a/sky/mouse.h b/sky/mouse.h index 534df1c94e..9b67e861a7 100644 --- a/sky/mouse.h +++ b/sky/mouse.h @@ -46,7 +46,7 @@ public: void drawNewMouse(void); void spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY); void useLogicInstance(SkyLogic *skyLogic) { _skyLogic = skyLogic; }; - void buttonPressed(uint8 button) { _bMouseB = button; }; + void buttonPressed(uint8 button); void waitMouseNotPressed(void); uint16 giveMouseX(void) { return _aMouseX; }; uint16 giveMouseY(void) { return _aMouseY; }; diff --git a/sky/sky.cpp b/sky/sky.cpp index 1effbef8f9..2603831dd6 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -285,7 +285,7 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp break; case OSystem::EVENT_LBUTTONDOWN: - _skyMouse->buttonPressed(1); + _skyMouse->buttonPressed(2); #ifdef _WIN32_WCE _sdl_mouse_x = event.mouse.x; _sdl_mouse_y = event.mouse.y; @@ -293,7 +293,7 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp break; case OSystem::EVENT_RBUTTONDOWN: - _skyMouse->buttonPressed(2); + _skyMouse->buttonPressed(1); break; case OSystem::EVENT_QUIT: |