diff options
author | Oliver Kiehl | 2003-08-19 21:42:21 +0000 |
---|---|---|
committer | Oliver Kiehl | 2003-08-19 21:42:21 +0000 |
commit | 050241ff87213d18f393cffb734ce102f09b37fe (patch) | |
tree | 7a3cef51ce8aafb3d350035eb374a79fb0dfc7f1 /sword2 | |
parent | f5cdcfa3db1056c5bf79c94e8528bc07dedfea18 (diff) | |
download | scummvm-rg350-050241ff87213d18f393cffb734ce102f09b37fe.tar.gz scummvm-rg350-050241ff87213d18f393cffb734ce102f09b37fe.tar.bz2 scummvm-rg350-050241ff87213d18f393cffb734ce102f09b37fe.zip |
preliminary cursor code. dirty, hacky and no animation yet. but at least something...
svn-id: r9785
Diffstat (limited to 'sword2')
-rw-r--r-- | sword2/driver/_mouse.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/sword2/driver/_mouse.cpp b/sword2/driver/_mouse.cpp index 9df9104e99..b8d4b95e84 100644 --- a/sword2/driver/_mouse.cpp +++ b/sword2/driver/_mouse.cpp @@ -137,6 +137,7 @@ #include "d_draw.h" #include "render.h" #include "menu.h" +#include "../sword2.h" @@ -534,9 +535,37 @@ int32 AnimateMouse(void) int32 SetMouseAnim(uint8 *ma, int32 size, int32 mouseFlash) - { - warning("stub SetMouseAnim( %d, %d )", size, mouseFlash); + if (ma) { + if (mouseAnim) + free(mouseAnim); + + if (mouseFlash == RDMOUSE_FLASH) + mouseFrame = 0; + else + mouseFrame = MOUSEFLASHFRAME; + + mouseAnim = (_mouseAnim *)malloc(size); + memcpy((uint8 *)mouseAnim, ma, size); + + mouseOffsets = (int32 *)((uint8 *)mouseAnim + sizeof(_mouseAnim)); + AnimateMouse(); + + uint8 *decompSprite = (uint8 *)malloc(mouseAnim->mousew * mouseAnim->mouseh); + DecompressMouse(decompSprite, mouseSprite, mouseAnim->mousew * mouseAnim->mouseh); + + int i; + for (i = 0; i < mouseAnim->mousew * mouseAnim->mouseh; i++) + if (decompSprite[i] == 0) + decompSprite[i] = 0xff; + + g_sword2->_system->set_mouse_cursor(decompSprite, + mouseAnim->mousew, mouseAnim->mouseh, + mouseAnim->xHotSpot, mouseAnim->yHotSpot - MENUDEEP); + g_sword2->_system->show_mouse(true); + } else + g_sword2->_system->show_mouse(false); + /* int32 i; |