[Scummvm-cvs-logs] SF.net SVN: scummvm:[48720] scummvm/trunk/engines/sci/graphics/cursor.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Mon Apr 19 18:36:47 CEST 2010
Revision: 48720
http://scummvm.svn.sourceforge.net/scummvm/?rev=48720&view=rev
Author: m_kiewitz
Date: 2010-04-19 16:36:47 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
SCI: added upscaling for shape cursors in upscaled hires games (will make the cursor "normal" sized in japanese sci01 games)
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/cursor.cpp
Modified: scummvm/trunk/engines/sci/graphics/cursor.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/cursor.cpp 2010-04-19 16:24:44 UTC (rev 48719)
+++ scummvm/trunk/engines/sci/graphics/cursor.cpp 2010-04-19 16:36:47 UTC (rev 48720)
@@ -92,6 +92,7 @@
int16 maskA, maskB;
byte *pOut;
byte *rawBitmap = new byte[SCI_CURSOR_SCI0_HEIGHTWIDTH * SCI_CURSOR_SCI0_HEIGHTWIDTH];
+ int16 heightWidth;
if (resourceId == -1) {
// no resourceId given, so we actually hide the cursor
@@ -135,7 +136,20 @@
}
}
- CursorMan.replaceCursor(rawBitmap, SCI_CURSOR_SCI0_HEIGHTWIDTH, SCI_CURSOR_SCI0_HEIGHTWIDTH, hotspot.x, hotspot.y, SCI_CURSOR_SCI0_TRANSPARENCYCOLOR);
+ heightWidth = SCI_CURSOR_SCI0_HEIGHTWIDTH;
+
+ if (_upscaledHires) {
+ // Scale cursor by 2x
+ heightWidth *= 2;
+ hotspot.x *= 2;
+ hotspot.y *= 2;
+ byte *upscaledBitmap = new byte[heightWidth * heightWidth];
+ _screen->scale2x(rawBitmap, upscaledBitmap, SCI_CURSOR_SCI0_HEIGHTWIDTH, SCI_CURSOR_SCI0_HEIGHTWIDTH);
+ delete[] rawBitmap;
+ rawBitmap = upscaledBitmap;
+ }
+
+ CursorMan.replaceCursor(rawBitmap, heightWidth, heightWidth, hotspot.x, hotspot.y, SCI_CURSOR_SCI0_TRANSPARENCYCOLOR);
kernelShow();
delete[] rawBitmap;
@@ -155,6 +169,8 @@
int16 height = celInfo->height;
byte clearKey = celInfo->clearKey;
Common::Point *cursorHotspot = hotspot;
+ byte *cursorBitmap;
+
if (!cursorHotspot)
// Compute hotspot from xoffset/yoffset
cursorHotspot = new Common::Point((celInfo->width >> 1) - celInfo->displaceX, celInfo->height - celInfo->displaceY - 1);
@@ -166,8 +182,6 @@
return;
}
- byte *cursorBitmap = cursorView->getBitmap(loopNum, celNum);
-
if (_upscaledHires) {
// Scale cursor by 2x
width *= 2;
@@ -176,6 +190,8 @@
cursorHotspot->y *= 2;
cursorBitmap = new byte[width * height];
_screen->scale2x(celInfo->rawBitmap, cursorBitmap, celInfo->width, celInfo->height);
+ } else {
+ cursorBitmap = cursorView->getBitmap(loopNum, celNum);
}
CursorMan.replaceCursor(cursorBitmap, width, height, cursorHotspot->x, cursorHotspot->y, clearKey);
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