diff options
author | Torbjörn Andersson | 2004-05-05 07:22:35 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2004-05-05 07:22:35 +0000 |
commit | 06002009806a770198c7e228f8b3e0203439b17d (patch) | |
tree | 3230a6f752e27e115522d1097c02a8fdf50ed7b8 /sword2/driver/_mouse.cpp | |
parent | 5882ea5819563aa1c381a96e736bc3be85bb2b17 (diff) | |
download | scummvm-rg350-06002009806a770198c7e228f8b3e0203439b17d.tar.gz scummvm-rg350-06002009806a770198c7e228f8b3e0203439b17d.tar.bz2 scummvm-rg350-06002009806a770198c7e228f8b3e0203439b17d.zip |
Take advantage of the changes in the backend's mouse cursor handling. It
didn't do the change I was hoping for: the coyote stone is still partially
see-through, but perhaps it was in the original as well.
At least we no longer need to keep the buffer the mouse cursor is decoded
to, since that's now handled by the backend.
svn-id: r13782
Diffstat (limited to 'sword2/driver/_mouse.cpp')
-rw-r--r-- | sword2/driver/_mouse.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sword2/driver/_mouse.cpp b/sword2/driver/_mouse.cpp index d57b01a306..c4fe24a18a 100644 --- a/sword2/driver/_mouse.cpp +++ b/sword2/driver/_mouse.cpp @@ -64,10 +64,6 @@ MouseEvent *Input::mouseEvent(void) { return NULL; } -// FIXME: The original code used 0 for transparency, while our backend uses -// 0xFF. That means that parts of the mouse cursor that weren't meant to be -// transparent may be now. - void Graphics::decompressMouse(byte *decomp, byte *comp, int width, int height, int pitch, int xOff, int yOff) { int32 size = width * height; int32 i = 0; @@ -94,6 +90,8 @@ void Graphics::decompressMouse(byte *decomp, byte *comp, int width, int height, } void Graphics::drawMouse(void) { + byte mouseData[MAX_MOUSE_W * MAX_MOUSE_H]; + if (!_mouseAnim && !_luggageAnim) return; @@ -147,21 +145,21 @@ void Graphics::drawMouse(void) { mouse_width += deltaX; mouse_height += deltaY; - if ((uint32) (mouse_width * mouse_height) > sizeof(_mouseData)) { + if ((uint32) (mouse_width * mouse_height) > sizeof(mouseData)) { warning("Mouse cursor too large"); return; } - memset(_mouseData, 0xFF, mouse_width * mouse_height); + memset(mouseData, 0, mouse_width * mouse_height); if (_luggageAnim) - decompressMouse(_mouseData, (byte *) _luggageAnim + READ_LE_UINT32(_luggageOffset), _luggageAnim->mousew, + decompressMouse(mouseData, (byte *) _luggageAnim + READ_LE_UINT32(_luggageOffset), _luggageAnim->mousew, _luggageAnim->mouseh, mouse_width, deltaX, deltaY); if (_mouseAnim) - decompressMouse(_mouseData, _mouseSprite, _mouseAnim->mousew, _mouseAnim->mouseh, mouse_width); + decompressMouse(mouseData, _mouseSprite, _mouseAnim->mousew, _mouseAnim->mouseh, mouse_width); - _vm->_system->setMouseCursor(_mouseData, mouse_width, mouse_height, hotspot_x, hotspot_y); + _vm->_system->setMouseCursor(mouseData, mouse_width, mouse_height, hotspot_x, hotspot_y, 0); } /** |