[Scummvm-cvs-logs] SF.net SVN: scummvm:[41577] scummvm/branches/gsoc2009-16bit
upthorn at users.sourceforge.net
upthorn at users.sourceforge.net
Tue Jun 16 07:33:20 CEST 2009
Revision: 41577
http://scummvm.svn.sourceforge.net/scummvm/?rev=41577&view=rev
Author: upthorn
Date: 2009-06-16 05:33:11 +0000 (Tue, 16 Jun 2009)
Log Message:
-----------
Simplified cursor related 16-bit code.
Modified Paths:
--------------
scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp
scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp
scummvm/branches/gsoc2009-16bit/graphics/cursorman.h
Modified: scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp 2009-06-15 23:22:31 UTC (rev 41576)
+++ scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp 2009-06-16 05:33:11 UTC (rev 41577)
@@ -1379,11 +1379,11 @@
}
}
+void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale) {
#ifdef ENABLE_16BIT
-void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale) {
keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
-void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) {
+ keycolor &= 0xFF;
#endif
if (w == 0 || h == 0)
Modified: scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp 2009-06-15 23:22:31 UTC (rev 41576)
+++ scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp 2009-06-16 05:33:11 UTC (rev 41577)
@@ -57,11 +57,7 @@
return g_system->showMouse(visible);
}
-#ifdef ENABLE_16BIT
void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale) {
-#else
-void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
-#endif
Cursor *cur = new Cursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
cur->_visible = isVisible();
@@ -111,11 +107,7 @@
g_system->showMouse(isVisible());
}
-#ifdef ENABLE_16BIT
void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale) {
-#else
-void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetScale) {
-#endif
if (_cursorStack.empty()) {
pushCursor(buf, w, h, hotspotX, hotspotY, keycolor, targetScale);
@@ -125,11 +117,7 @@
Cursor *cur = _cursorStack.top();
#ifdef ENABLE_16BIT
- uint size;
- { //limit the lifespan of the format variable to minimize memory impact
- Graphics::PixelFormat f = g_system->getScreenFormat();
- size = w * h * (f.bytesPerPixel);
- }
+ uint size = w * h * g_system->getScreenFormat().bytesPerPixel;
#else
uint size = w * h;
#endif
Modified: scummvm/branches/gsoc2009-16bit/graphics/cursorman.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/graphics/cursorman.h 2009-06-15 23:22:31 UTC (rev 41576)
+++ scummvm/branches/gsoc2009-16bit/graphics/cursorman.h 2009-06-16 05:33:11 UTC (rev 41577)
@@ -60,11 +60,7 @@
* useful to push a "dummy" cursor and modify it later. The
* cursor will be added to the stack, but not to the backend.
*/
-#ifdef ENABLE_16BIT
void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
-#else
- void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
-#endif
/**
* Pop a cursor from the stack, and restore the previous one to the
@@ -85,11 +81,7 @@
* @param keycolor the index for the transparent color
* @param targetScale the scale for which the cursor is designed
*/
-#ifdef ENABLE_16BIT
void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1);
-#else
- void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1);
-#endif
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
@@ -178,26 +170,22 @@
uint _height;
int _hotspotX;
int _hotspotY;
-//#ifdef ENABLE_16BIT
uint32 _keycolor;
-//#else
-// byte _keycolor;
-//#endif
+
byte _targetScale;
uint _size;
-#ifdef ENABLE_16BIT
Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, uint8 bitDepth = 8) {
+#ifdef ENABLE_16BIT
{ //limit the lifespan of the format value to minimize impact on memory usage
Graphics::PixelFormat f = g_system->getScreenFormat();
_size = w * h * f.bytesPerPixel;
_keycolor = keycolor & ((1 << (f.bytesPerPixel << 3)) - 1);
}
#else
- Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int targetScale = 1) {
_size = w * h;
- _keycolor = keycolor;
+ _keycolor = keycolor & 0xFF;
#endif
_data = new byte[_size];
if (data && _data)
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