diff options
author | Martin Kiewitz | 2010-04-19 16:36:47 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-04-19 16:36:47 +0000 |
commit | 5e472b1ba22a26d6cc54b9b07f20ad45cd47a89e (patch) | |
tree | 9df3ef485bf531eacd46431a3ada5e7afd4d1a92 | |
parent | b5851dab00986c7e441eecc06b3630a3e58e7d8d (diff) | |
download | scummvm-rg350-5e472b1ba22a26d6cc54b9b07f20ad45cd47a89e.tar.gz scummvm-rg350-5e472b1ba22a26d6cc54b9b07f20ad45cd47a89e.tar.bz2 scummvm-rg350-5e472b1ba22a26d6cc54b9b07f20ad45cd47a89e.zip |
SCI: added upscaling for shape cursors in upscaled hires games (will make the cursor "normal" sized in japanese sci01 games)
svn-id: r48720
-rw-r--r-- | engines/sci/graphics/cursor.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index 13968974f0..bbfa079253 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -92,6 +92,7 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) { 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 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) { } } - 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 @@ void GfxCursor::kernelSetView(GuiResourceId viewNum, int loopNum, int celNum, Co 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 @@ void GfxCursor::kernelSetView(GuiResourceId viewNum, int loopNum, int celNum, Co return; } - byte *cursorBitmap = cursorView->getBitmap(loopNum, celNum); - if (_upscaledHires) { // Scale cursor by 2x width *= 2; @@ -176,6 +190,8 @@ void GfxCursor::kernelSetView(GuiResourceId viewNum, int loopNum, int celNum, Co 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); |