aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-05-05 07:22:35 +0000
committerTorbjörn Andersson2004-05-05 07:22:35 +0000
commit06002009806a770198c7e228f8b3e0203439b17d (patch)
tree3230a6f752e27e115522d1097c02a8fdf50ed7b8
parent5882ea5819563aa1c381a96e736bc3be85bb2b17 (diff)
downloadscummvm-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
-rw-r--r--sword2/driver/_mouse.cpp16
-rw-r--r--sword2/driver/d_draw.h2
2 files changed, 7 insertions, 11 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);
}
/**
diff --git a/sword2/driver/d_draw.h b/sword2/driver/d_draw.h
index 5c56246995..326862772e 100644
--- a/sword2/driver/d_draw.h
+++ b/sword2/driver/d_draw.h
@@ -99,8 +99,6 @@ private:
int32 _fadeStartTime;
int32 _fadeTotalTime;
- byte _mouseData[MAX_MOUSE_W * MAX_MOUSE_H];
-
uint8 _mouseFrame;
byte *_mouseSprite;
struct MouseAnim *_mouseAnim;