[Scummvm-cvs-logs] SF.net SVN: scummvm:[47140] scummvm/trunk/engines/sci

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Thu Jan 7 21:29:48 CET 2010


Revision: 47140
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47140&view=rev
Author:   m_kiewitz
Date:     2010-01-07 20:29:48 +0000 (Thu, 07 Jan 2010)

Log Message:
-----------
SCI: implement crazy hack that fixes coordinates of some cel placements. I'm not sure if thats what sierra sci actually does or if we get coordinates 0,0 due some error somewhere. Fixes portrait window placement in kq6 - strangely they are still not at the correct height perhaps related to not adjusting "correctly" (whatever this means in this ugly mess that hires was implemented) inside BitsSave()

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/graphics/gui.cpp
    scummvm/trunk/engines/sci/graphics/gui.h

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-01-07 20:13:02 UTC (rev 47139)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-01-07 20:29:48 UTC (rev 47140)
@@ -910,9 +910,9 @@
 	uint16 y = argv[4].toUint16();
 	int16 priority = (argc > 5) ? argv[5].toSint16()  : -1;
 	uint16 paletteNo = (argc > 6) ? argv[6].toUint16() : 0;
-	bool upscaledHires = (argc > 7) ? true : false; // actual parameter is MemoryHandle to saved upscaled hires rect
+	reg_t upscaledHiresHandle = (argc > 7) ? argv[7] : NULL_REG;
 
-	s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, upscaledHires);
+	s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, upscaledHiresHandle);
 
 	return s->r_acc;
 }

Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp	2010-01-07 20:13:02 UTC (rev 47139)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp	2010-01-07 20:29:48 UTC (rev 47140)
@@ -367,11 +367,25 @@
 	_gfx->SetPort(oldPort);
 }
 
-void SciGui::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool upscaledHires) {
-	if (!upscaledHires)
+void SciGui::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, reg_t upscaledHiresHandle) {
+	if (upscaledHiresHandle.isNull()) {
 		_gfx->drawCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
-	else
+	} else {
+		if ((leftPos == 0) && (topPos == 0)) {
+			// HACK: in kq6, we get leftPos&topPos == 0 SOMETIMES, that's why we need to get coordinates from upscaledHiresHandle
+			//  I'm not sure if this is what we are supposed to do or if there is some other bug that actually makes
+			//  coordinates to be 0 in the first place
+			byte *memoryPtr = NULL;
+			memoryPtr = kmem(_s->_segMan, upscaledHiresHandle);
+			if (memoryPtr) {
+				Common::Rect upscaledHiresRect;
+				_screen->bitsGetRect(memoryPtr, &upscaledHiresRect);
+				leftPos = upscaledHiresRect.left;
+				topPos = upscaledHiresRect.top;
+			}
+		}
 		_gfx->drawHiresCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
+	}
 	_palette->setOnScreen();
 }
 

Modified: scummvm/trunk/engines/sci/graphics/gui.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.h	2010-01-07 20:13:02 UTC (rev 47139)
+++ scummvm/trunk/engines/sci/graphics/gui.h	2010-01-07 20:29:48 UTC (rev 47140)
@@ -88,7 +88,7 @@
 	virtual reg_t menuSelect(reg_t eventObject);
 
 	virtual void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
-	virtual void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool upscaledHires = false);
+	virtual void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, reg_t upscaledHiresHandle = NULL_REG);
 	virtual void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite);
 	virtual void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 alignment, int16 style, bool hilite);
 	virtual void drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite);


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