[Scummvm-cvs-logs] SF.net SVN: scummvm:[53015] scummvm/branches/branch-1-2-0/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Mon Oct 4 13:58:51 CEST 2010
Revision: 53015
http://scummvm.svn.sourceforge.net/scummvm/?rev=53015&view=rev
Author: thebluegr
Date: 2010-10-04 11:58:51 +0000 (Mon, 04 Oct 2010)
Log Message:
-----------
SCI: Removed the recently added WIP magnifier cursors from the stable branch
Modified Paths:
--------------
scummvm/branches/branch-1-2-0/engines/sci/engine/kgraphics.cpp
scummvm/branches/branch-1-2-0/engines/sci/graphics/cursor.cpp
scummvm/branches/branch-1-2-0/engines/sci/graphics/cursor.h
Modified: scummvm/branches/branch-1-2-0/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/engine/kgraphics.cpp 2010-10-04 09:23:06 UTC (rev 53014)
+++ scummvm/branches/branch-1-2-0/engines/sci/engine/kgraphics.cpp 2010-10-04 11:58:51 UTC (rev 53015)
@@ -129,7 +129,8 @@
g_sci->_gfxCursor->kernelHide();
break;
case -1:
- g_sci->_gfxCursor->kernelClearZoomZone();
+ // TODO: Special case at least in kq6, check disassembly
+ // Does something with magCursor, which is set on argc = 10, which we don't support
break;
case -2:
g_sci->_gfxCursor->kernelResetMoveZone();
@@ -183,10 +184,15 @@
break;
case 10:
// Freddy pharkas, when using the whiskey glass to read the prescription (bug #3034973)
- g_sci->_gfxCursor->kernelSetZoomZone(argv[0].toUint16(),
- Common::Rect(argv[1].toUint16(), argv[2].toUint16(), argv[3].toUint16(), argv[4].toUint16()),
- argv[5].toUint16(), argv[6].toUint16(), argv[7].toUint16(),
- argv[8].toUint16(), argv[9].toUint16());
+ // magnifier support, disabled using argc == 1, argv == -1
+ warning("kSetCursor: unsupported magnifier");
+ // we just set the view cursor currently
+ g_sci->_gfxCursor->kernelSetView(argv[5].toUint16(), argv[6].toUint16(), argv[7].toUint16(), hotspot);
+ // argv[0] -> 1, 2, 4 -> maybe magnification multiplier
+ // argv[1-4] -> rect for magnification
+ // argv[5, 6, 7] -> view resource for cursor
+ // argv[8] -> picture resource for mag
+ // argv[9] -> color for magnifier replacement
break;
default :
error("kSetCursor: Unhandled case: %d arguments given", argc);
Modified: scummvm/branches/branch-1-2-0/engines/sci/graphics/cursor.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/graphics/cursor.cpp 2010-10-04 09:23:06 UTC (rev 53014)
+++ scummvm/branches/branch-1-2-0/engines/sci/graphics/cursor.cpp 2010-10-04 11:58:51 UTC (rev 53015)
@@ -49,15 +49,6 @@
// center mouse cursor
setPosition(Common::Point(_screen->getWidth() / 2, _screen->getHeight() / 2));
_moveZoneActive = false;
-
- _zoomZoneActive = false;
- _zoomZone = Common::Rect();
- _zoomCursorView = 0;
- _zoomCursorLoop = 0;
- _zoomCursorCel = 0;
- _zoomPicView = 0;
- _zoomColor = 0;
- _zoomMultiplier = 0;
}
GfxCursor::~GfxCursor() {
@@ -338,10 +329,9 @@
}
void GfxCursor::refreshPosition() {
- Common::Point mousePoint = getPosition();
-
if (_moveZoneActive) {
bool clipped = false;
+ Common::Point mousePoint = getPosition();
if (mousePoint.x < _moveZone.left) {
mousePoint.x = _moveZone.left;
@@ -363,37 +353,6 @@
if (clipped)
setPosition(mousePoint);
}
-
- if (_zoomZoneActive) {
- // Cursor
- const CelInfo *cursorCelInfo = _zoomCursorView->getCelInfo(_zoomCursorLoop, _zoomCursorCel);
- const byte *cursorBitmap = _zoomCursorView->getBitmap(_zoomCursorLoop, _zoomCursorCel);
- byte *finalBitmap = new byte[cursorCelInfo->width * cursorCelInfo->height];
- // Pic
- const CelInfo *picCelInfo = _zoomPicView->getCelInfo(0, 0);
- const byte *rawPicBitmap = _zoomPicView->getBitmap(0, 0);
- // Compute hotspot from xoffset/yoffset
- Common::Point cursorHotspot = Common::Point((cursorCelInfo->width >> 1) - cursorCelInfo->displaceX, cursorCelInfo->height - cursorCelInfo->displaceY - 1);
-
- memcpy(finalBitmap, cursorBitmap, cursorCelInfo->width * cursorCelInfo->height);
-
- uint16 targetX = CLIP<int>((mousePoint.x - _zoomZone.left) * _zoomMultiplier, 0, picCelInfo->width - cursorCelInfo->width);
- uint16 targetY = CLIP<int>((mousePoint.y - _zoomZone.top) * _zoomMultiplier, 0, picCelInfo->height - cursorCelInfo->height);
-
- // Replace the special magnifier color with the associated magnified pixels
- for (int x = 0; x < cursorCelInfo->width; x++) {
- for (int y = 0; y < cursorCelInfo->height; y++) {
- int curPos = cursorCelInfo->width * y + x;
- if (finalBitmap[curPos] == _zoomColor) {
- finalBitmap[curPos] = rawPicBitmap[picCelInfo->width * (targetY + y) + (targetX + x)];
- }
- }
- }
-
- CursorMan.replaceCursor((const byte *)finalBitmap, cursorCelInfo->width, cursorCelInfo->height, cursorHotspot.x, cursorHotspot.y, cursorCelInfo->clearKey);
-
- delete[] finalBitmap;
- }
}
void GfxCursor::kernelResetMoveZone() {
@@ -405,44 +364,6 @@
_moveZoneActive = true;
}
-void GfxCursor::kernelClearZoomZone() {
- kernelResetMoveZone();
- _zoomZone = Common::Rect();
- _zoomColor = 0;
- _zoomMultiplier = 0;
- _zoomZoneActive = false;
-}
-
-void GfxCursor::kernelSetZoomZone(byte multiplier, Common::Rect zone, GuiResourceId viewNum, int loopNum, int celNum, GuiResourceId picNum, byte zoomColor) {
- if (multiplier != 1 && multiplier != 2) {
- warning("kernelSetZoomZone: Unsupported magnifier %d", multiplier);
- return;
- }
-
- _zoomMultiplier = multiplier;
-
- if (_cachedCursors.size() >= MAX_CACHED_CURSORS)
- purgeCache();
-
- if (!_cachedCursors.contains(viewNum))
- _cachedCursors[viewNum] = new GfxView(_resMan, _screen, _palette, viewNum);
- if (!_cachedCursors.contains(picNum))
- _cachedCursors[picNum] = new GfxView(_resMan, _screen, _palette, picNum);
-
- _zoomCursorView = _cachedCursors[viewNum];
- _zoomCursorLoop = (byte)loopNum;
- _zoomCursorCel = (byte)celNum;
- _zoomPicView = _cachedCursors[picNum];
-
- kernelSetView(viewNum, loopNum, celNum, NULL);
-
- _zoomZone = zone;
- kernelSetMoveZone(_zoomZone);
-
- _zoomColor = zoomColor;
- _zoomZoneActive = true;
-}
-
void GfxCursor::kernelSetPos(Common::Point pos) {
_coordAdjuster->setCursorPos(pos);
kernelMoveCursor(pos);
Modified: scummvm/branches/branch-1-2-0/engines/sci/graphics/cursor.h
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/graphics/cursor.h 2010-10-04 09:23:06 UTC (rev 53014)
+++ scummvm/branches/branch-1-2-0/engines/sci/graphics/cursor.h 2010-10-04 11:58:51 UTC (rev 53015)
@@ -79,9 +79,6 @@
*/
void kernelSetMoveZone(Common::Rect zone);
- void kernelClearZoomZone();
- void kernelSetZoomZone(byte multiplier, Common::Rect zone, GuiResourceId viewNum, int loopNum, int celNum, GuiResourceId picNum, byte zoomColor);
-
void kernelSetPos(Common::Point pos);
void kernelMoveCursor(Common::Point pos);
@@ -99,15 +96,6 @@
bool _moveZoneActive;
Common::Rect _moveZone; // Rectangle in which the pointer can move
- bool _zoomZoneActive;
- Common::Rect _zoomZone;
- GfxView *_zoomCursorView;
- byte _zoomCursorLoop;
- byte _zoomCursorCel;
- GfxView *_zoomPicView;
- byte _zoomColor;
- byte _zoomMultiplier;
-
CursorCache _cachedCursors;
bool _isVisible;
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