[Scummvm-cvs-logs] CVS: scummvm/sword2/driver _mouse.cpp,1.35,1.36 d_draw.h,1.28,1.29

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Wed May 5 00:23:05 CEST 2004


Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2075/driver

Modified Files:
	_mouse.cpp d_draw.h 
Log Message:
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.


Index: _mouse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/_mouse.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- _mouse.cpp	23 Apr 2004 07:02:08 -0000	1.35
+++ _mouse.cpp	5 May 2004 07:22:35 -0000	1.36
@@ -64,10 +64,6 @@
 	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::drawMouse(void) {
+	byte mouseData[MAX_MOUSE_W * MAX_MOUSE_H];
+
 	if (!_mouseAnim && !_luggageAnim)
 		return;
 
@@ -147,21 +145,21 @@
 	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);
 }
 
 /**

Index: d_draw.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/d_draw.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- d_draw.h	23 Apr 2004 07:02:10 -0000	1.28
+++ d_draw.h	5 May 2004 07:22:35 -0000	1.29
@@ -99,8 +99,6 @@
 	int32 _fadeStartTime;
 	int32 _fadeTotalTime;
 
-	byte _mouseData[MAX_MOUSE_W * MAX_MOUSE_H];
-
 	uint8 _mouseFrame;
 	byte *_mouseSprite;
 	struct MouseAnim *_mouseAnim;





More information about the Scummvm-git-logs mailing list