diff options
author | Robert Göffringmann | 2003-12-18 14:38:17 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-12-18 14:38:17 +0000 |
commit | ee2c8b2ddb9bb444b67643017928e32c8bbe3411 (patch) | |
tree | c56285e6a1d62567d66d04845e35cd013732e6ff | |
parent | 501b7d687a376ed42c44ebd8c12d00b73bb9bdd6 (diff) | |
download | scummvm-rg350-ee2c8b2ddb9bb444b67643017928e32c8bbe3411.tar.gz scummvm-rg350-ee2c8b2ddb9bb444b67643017928e32c8bbe3411.tar.bz2 scummvm-rg350-ee2c8b2ddb9bb444b67643017928e32c8bbe3411.zip |
fix mouse cursor animations
svn-id: r11748
-rw-r--r-- | sword1/mouse.cpp | 16 | ||||
-rw-r--r-- | sword1/mouse.h | 2 |
2 files changed, 6 insertions, 12 deletions
diff --git a/sword1/mouse.cpp b/sword1/mouse.cpp index 895edc5e33..7a65783a38 100644 --- a/sword1/mouse.cpp +++ b/sword1/mouse.cpp @@ -184,12 +184,9 @@ void SwordMouse::setPointer(uint32 resId, uint32 rate) { _resMan->resClose(_specialPtrId); _specialPtrId = 0; } - _rate = rate; - _rateCnt = 1; _frame = 0; if (resId == 0) { - _rateCnt = 0; _system->set_mouse_cursor(NULL, 0, 0, 0, 0); _system->show_mouse(false); } else { @@ -207,18 +204,15 @@ void SwordMouse::setPointer(uint32 resId, uint32 rate) { void SwordMouse::animate(void) { MousePtr *currentPtr; - if (_rateCnt && ((_mouseStatus == 1) || _menuStatus)) { + if ((_mouseStatus == 1) || _menuStatus) { if (_specialPtrId) currentPtr = _specialPtr; else currentPtr = _pointers[_currentPtrId]; - _rateCnt--; - if (!_rateCnt) { - _rateCnt = _rate; - _frame = (_frame + 1) % currentPtr->numFrames; - uint16 size = currentPtr->sizeX * currentPtr->sizeY; - _system->set_mouse_cursor(currentPtr->data + 0x30 + _frame * size, currentPtr->sizeX, currentPtr->sizeY, currentPtr->hotSpotX, currentPtr->hotSpotY); - } + + _frame = (_frame + 1) % currentPtr->numFrames; + uint16 size = currentPtr->sizeX * currentPtr->sizeY; + _system->set_mouse_cursor(currentPtr->data + 0x30 + _frame * size, currentPtr->sizeX, currentPtr->sizeY, currentPtr->hotSpotX, currentPtr->hotSpotY); } } diff --git a/sword1/mouse.h b/sword1/mouse.h index 1a433b009c..a6abdd3e9a 100644 --- a/sword1/mouse.h +++ b/sword1/mouse.h @@ -85,7 +85,7 @@ public: void setMenuStatus(uint8 status); private: MousePtr *_pointers[17]; - uint32 _currentPtrId, _rate, _rateCnt, _frame; + uint32 _currentPtrId, _frame; OSystem *_system; SwordLogic *_logic; SwordMenu *_menu; |