[Scummvm-cvs-logs] SF.net SVN: scummvm:[47118] scummvm/trunk

marcus_c at users.sourceforge.net marcus_c at users.sourceforge.net
Thu Jan 7 16:07:38 CET 2010


Revision: 47118
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47118&view=rev
Author:   marcus_c
Date:     2010-01-07 15:07:36 +0000 (Thu, 07 Jan 2010)

Log Message:
-----------
The default keycolor for mouse pointers used to be 255.
This makes sense as a default for CLUT8 modes, but not really
for anything else.  As part of the gsoc2009-16bit merge, the
default was changed to "all ones", with extra code in the SDL
backend to truncate this to the depth of the mode.  However,
"all ones" (white) still isn't a very useful default for RGB modes.
So rather than jumping through hoops to provide a bad default,
it's better to remove the default altogether.  Engines which relied
on the old default of 255 have been updated to specify it explicitly.

Modified Paths:
--------------
    scummvm/trunk/backends/vkeybd/virtual-keyboard-gui.cpp
    scummvm/trunk/common/system.h
    scummvm/trunk/engines/agos/cursor.cpp
    scummvm/trunk/engines/cine/gfx.cpp
    scummvm/trunk/engines/cruise/mouse.cpp
    scummvm/trunk/engines/draci/mouse.cpp
    scummvm/trunk/engines/drascula/interface.cpp
    scummvm/trunk/engines/sword1/mouse.cpp
    scummvm/trunk/graphics/cursorman.h
    scummvm/trunk/gui/GuiManager.cpp

Modified: scummvm/trunk/backends/vkeybd/virtual-keyboard-gui.cpp
===================================================================
--- scummvm/trunk/backends/vkeybd/virtual-keyboard-gui.cpp	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/backends/vkeybd/virtual-keyboard-gui.cpp	2010-01-07 15:07:36 UTC (rev 47118)
@@ -444,7 +444,7 @@
 	};
 
 	CursorMan.pushCursorPalette(palette, 0, 4);
-	CursorMan.pushCursor(NULL, 0, 0, 0, 0);
+	CursorMan.pushCursor(NULL, 0, 0, 0, 0, 0);
 	CursorMan.showMouse(true);
 }
 
@@ -458,7 +458,7 @@
 			}
 		}
 
-		CursorMan.replaceCursor(_cursor, 16, 16, 7, 7);
+		CursorMan.replaceCursor(_cursor, 16, 16, 7, 7, 255);
 
 		_cursorAnimateTimer = time;
 		_cursorAnimateCounter = (_cursorAnimateCounter + 1) % 4;

Modified: scummvm/trunk/common/system.h
===================================================================
--- scummvm/trunk/common/system.h	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/common/system.h	2010-01-07 15:07:36 UTC (rev 47118)
@@ -779,7 +779,7 @@
 	 * @param cursorTargetScale	scale factor which cursor is designed for
 	 * @param format			pointer to the pixel format which cursor graphic uses
 	 */
-	virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) = 0;
+	virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) = 0;
 
 	/**
 	 * Replace the specified range of cursor the palette with new colors.

Modified: scummvm/trunk/engines/agos/cursor.cpp
===================================================================
--- scummvm/trunk/engines/agos/cursor.cpp	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/engines/agos/cursor.cpp	2010-01-07 15:07:36 UTC (rev 47118)
@@ -797,7 +797,7 @@
 
 void AGOSEngine::drawMousePointer() {
 	if (getGameType() == GType_SIMON2) {
-		CursorMan.replaceCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7);
+		CursorMan.replaceCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7, 0xFF);
 	} else if (getGameType() != GType_SIMON1) {
 		const uint16 *src;
 		int i, j;

Modified: scummvm/trunk/engines/cine/gfx.cpp
===================================================================
--- scummvm/trunk/engines/cine/gfx.cpp	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/engines/cine/gfx.cpp	2010-01-07 15:07:36 UTC (rev 47118)
@@ -1407,7 +1407,7 @@
 			}
 			++src;
 		}
-		CursorMan.replaceCursor(mouseCursor, 16, 16, mc->hotspotX, mc->hotspotY);
+		CursorMan.replaceCursor(mouseCursor, 16, 16, mc->hotspotX, mc->hotspotY, 0xFF);
 		CursorMan.replaceCursorPalette(cursorPalette, 0, 2);
 		currentMouseCursor = cursor;
 	}

Modified: scummvm/trunk/engines/cruise/mouse.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mouse.cpp	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/engines/cruise/mouse.cpp	2010-01-07 15:07:36 UTC (rev 47118)
@@ -76,7 +76,7 @@
 			}
 			++src;
 		}
-		CursorMan.replaceCursor(mouseCursor, 16, 16, mc->hotspotX, mc->hotspotY);
+		CursorMan.replaceCursor(mouseCursor, 16, 16, mc->hotspotX, mc->hotspotY, 0xFF);
 		CursorMan.replaceCursorPalette(cursorPalette, 0, 2);
 		currentCursor = eType;
 	}

Modified: scummvm/trunk/engines/draci/mouse.cpp
===================================================================
--- scummvm/trunk/engines/draci/mouse.cpp	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/engines/draci/mouse.cpp	2010-01-07 15:07:36 UTC (rev 47118)
@@ -108,7 +108,7 @@
 	Sprite sp(f->_data, f->_length, 0, 0, true);
 	CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColours);
 	CursorMan.replaceCursor(sp.getBuffer(), sp.getWidth(), sp.getHeight(),
-	        sp.getWidth() / 2, sp.getHeight() / 2);
+	        sp.getWidth() / 2, sp.getHeight() / 2, 255);
 }
 
 void Mouse::loadItemCursor(const GameItem *item, bool highlighted) {
@@ -126,7 +126,7 @@
 	Sprite sp(f->_data, f->_length, 0, 0, true);
 	CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColours);
 	CursorMan.replaceCursor(sp.getBuffer(), sp.getWidth(), sp.getHeight(),
-	        sp.getWidth() / 2, sp.getHeight() / 2);
+	        sp.getWidth() / 2, sp.getHeight() / 2, 255);
 }
 
 } // End of namespace Draci

Modified: scummvm/trunk/engines/drascula/interface.cpp
===================================================================
--- scummvm/trunk/engines/drascula/interface.cpp	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/engines/drascula/interface.cpp	2010-01-07 15:07:36 UTC (rev 47118)
@@ -31,10 +31,10 @@
 void DrasculaEngine::setCursor(int cursor) {
 	switch (cursor) {
 	case kCursorCrosshair:
-		CursorMan.replaceCursor((const byte *)crosshairCursor, 40, 25, 20, 17);
+		CursorMan.replaceCursor((const byte *)crosshairCursor, 40, 25, 20, 17, 255);
 		break;
 	case kCursorCurrentItem:
-		CursorMan.replaceCursor((const byte *)mouseCursor, OBJWIDTH, OBJHEIGHT, 20, 17);
+		CursorMan.replaceCursor((const byte *)mouseCursor, OBJWIDTH, OBJHEIGHT, 20, 17, 255);
 	default:
 		break;
 	}

Modified: scummvm/trunk/engines/sword1/mouse.cpp
===================================================================
--- scummvm/trunk/engines/sword1/mouse.cpp	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/engines/sword1/mouse.cpp	2010-01-07 15:07:36 UTC (rev 47118)
@@ -307,7 +307,7 @@
 		_frame = (_frame + 1) % _currentPtr->numFrames;
 		uint8 *ptrData = (uint8*)_currentPtr + sizeof(MousePtr);
 		ptrData += _frame * _currentPtr->sizeX * _currentPtr->sizeY;
-		CursorMan.replaceCursor(ptrData, _currentPtr->sizeX, _currentPtr->sizeY, _currentPtr->hotSpotX, _currentPtr->hotSpotY);
+		CursorMan.replaceCursor(ptrData, _currentPtr->sizeX, _currentPtr->sizeY, _currentPtr->hotSpotX, _currentPtr->hotSpotY, 255);
 	}
 }
 

Modified: scummvm/trunk/graphics/cursorman.h
===================================================================
--- scummvm/trunk/graphics/cursorman.h	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/graphics/cursorman.h	2010-01-07 15:07:36 UTC (rev 47118)
@@ -72,7 +72,7 @@
 	 *       useful to push a "dummy" cursor and modify it later. The
 	 *       cursor will be added to the stack, but not to the backend.
 	 */
-	void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
+	void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
 
 	/**
 	 * Pop a cursor from the stack, and restore the previous one to the
@@ -95,7 +95,7 @@
 	 * @param format	a pointer to the pixel format which the cursor graphic uses,
 	 *					CLUT8 will be used if this is NULL or not specified.
 	 */
-	void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
+	void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
 
 	/**
 	 * Pop all of the cursors and cursor palettes from their respective stacks.
@@ -180,7 +180,7 @@
 
 		uint _size;
 
-		Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
+		Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
 		~Cursor();
 	};
 

Modified: scummvm/trunk/gui/GuiManager.cpp
===================================================================
--- scummvm/trunk/gui/GuiManager.cpp	2010-01-07 14:56:49 UTC (rev 47117)
+++ scummvm/trunk/gui/GuiManager.cpp	2010-01-07 15:07:36 UTC (rev 47118)
@@ -412,7 +412,7 @@
 	};
 
 	CursorMan.pushCursorPalette(palette, 0, 4);
-	CursorMan.pushCursor(NULL, 0, 0, 0, 0);
+	CursorMan.pushCursor(NULL, 0, 0, 0, 0, 0);
 	CursorMan.showMouse(true);
 }
 
@@ -430,7 +430,7 @@
 			}
 		}
 
-		CursorMan.replaceCursor(_cursor, 16, 16, 7, 7);
+		CursorMan.replaceCursor(_cursor, 16, 16, 7, 7, 255);
 
 		_cursorAnimateTimer = time;
 		_cursorAnimateCounter = (_cursorAnimateCounter + 1) % 4;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list