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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Oct 31 18:54:30 CET 2009


Revision: 45567
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45567&view=rev
Author:   thebluegr
Date:     2009-10-31 17:54:28 +0000 (Sat, 31 Oct 2009)

Log Message:
-----------
- Added some TODOs
- Disabled the kGraph case used in KQ6 Windows for now, as it's problematic and crashes the game
- Added extra param to kDrawCel(), used in KQ6 Windows

The icon bar in KQ6 Windows is shown a bit better now

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui.h
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp
    scummvm/trunk/engines/sci/gui/gui_gfx.h
    scummvm/trunk/engines/sci/gui/gui_view.cpp
    scummvm/trunk/engines/sci/gui/gui_view.h
    scummvm/trunk/engines/sci/gui32/gui32.cpp
    scummvm/trunk/engines/sci/gui32/gui32.h

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-31 17:02:11 UTC (rev 45566)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-31 17:54:28 UTC (rev 45567)
@@ -274,9 +274,14 @@
 		break;
 
 	case K_GRAPH_SAVE_UPSCALEDHIRES_BOX:
+		warning("kGraph case 15 (%d, %d, %d, %d)", x, y, x1, y1);
+
+		// TODO: implement this properly. The code below crashes KQ6
+
 		// Save an area given in upscaled-hires coordinates, so that a hires control will be drawn over it
-		kGraphCreateRect(x, y, x1, y1, &rect);
-		return s->_gui->graphSaveUpscaledHiresBox(rect);
+		//kGraphCreateRect(x, y, x1, y1, &rect);
+		//return s->_gui->graphSaveUpscaledHiresBox(rect);
+		break;
 
 	default:
 		error("Unsupported kGraph() operation %04x", argv[0].toSint16());
@@ -624,6 +629,8 @@
 
 reg_t kAssertPalette(EngineState *s, int argc, reg_t *argv) {
 	GuiResourceId viewId = argv[1].toUint16();
+	// TODO: implement this
+
 	warning("kAssertPalette() called with viewId = %d", viewId);
 	return s->r_acc;
 }
@@ -636,6 +643,9 @@
 	case 0: { // load resource (the corresponding .BIN file from the ACTORS directory)
 		if (argc == 2) {
 			Common::String resourceName = s->_segMan->getString(argv[1]);
+
+			// TODO: implement this
+
 		} else {
 			warning("kPortrait(loadResource) called with unsupported argc %d", argc);
 		}
@@ -651,6 +661,9 @@
 			uint cond = argv[7].toUint16() & 0xff;
 			uint seq = argv[8].toUint16() & 0xff;
 			// argv[9] is usually 0??!!
+
+			// TODO: implement this. Looks to be a modified version of kDoSync
+
 			warning("kPortrait(show) %s at %d, %d", resourceName.c_str(), portraitPos.x, portraitPos.y);
 		} else {
 			warning("kPortrait(show) called with unsupported argc %d", argc);
@@ -660,6 +673,9 @@
 	case 2: { // unload resource
 		if (argc == 2) {
 			uint16 portraitId = argv[1].toUint16();
+
+			// TODO: implement this
+
 		} else {
 			warning("kPortrait(unload) called with unsupported argc %d", argc);
 		}
@@ -669,7 +685,7 @@
 		warning("kPortrait(%d), not implemented (argc = %d)", operation, argc);
 	}
 
-	return NULL_REG;
+	return s->r_acc;
 }
 
 void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
@@ -896,10 +912,9 @@
 	uint16 y = argv[4].toUint16();
 	int16 priority = (argc > 5) ? argv[5].toSint16()  : -1;
 	uint16 paletteNo = (argc > 6) ? argv[6].toUint16() : 0;
-	// Unknown seems to be scaling related?!?
-	int16 unknown = (argc > 7) ? argv[7].toSint16() : -1;
+	int16 origHeight = (argc > 7) ? argv[7].toSint16() : -1;
 
-	s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo);
+	s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, origHeight);
 
 	return s->r_acc;
 }

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-31 17:02:11 UTC (rev 45566)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-31 17:54:28 UTC (rev 45567)
@@ -325,8 +325,8 @@
 	_gfx->SetPort(oldPort);
 }
 
-void SciGui::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo) {
-	_gfx->drawCel(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
+void SciGui::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight) {
+	_gfx->drawCel(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo, origHeight);
 	_palette->setOnScreen();
 }
 
@@ -456,6 +456,8 @@
 }
 
 reg_t SciGui::graphSaveUpscaledHiresBox(Common::Rect rect) {
+	rect.right *= 2;
+	rect.bottom *= 2;
 	return _gfx->BitsSave(rect, SCI_SCREEN_MASK_DISPLAY);
 }
 

Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h	2009-10-31 17:02:11 UTC (rev 45566)
+++ scummvm/trunk/engines/sci/gui/gui.h	2009-10-31 17:54:28 UTC (rev 45567)
@@ -82,7 +82,7 @@
 	virtual void drawMenuBar();
 	virtual void clearMenuBar();
 	virtual void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
-	virtual void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo);
+	virtual void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight = -1);
 	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);

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-31 17:02:11 UTC (rev 45566)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-31 17:54:28 UTC (rev 45567)
@@ -329,7 +329,7 @@
 }
 
 // This one is the only one that updates screen!
-void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo) {
+void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight) {
 	SciGuiView *view = getView(viewId);
 	Common::Rect rect;
 	Common::Rect clipRect;
@@ -346,7 +346,7 @@
 
 		Common::Rect clipRectTranslated = clipRect;
 		OffsetRect(clipRectTranslated);
-		view->draw(rect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo);
+		view->draw(rect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo, origHeight);
 		if (!_screen->_picNotValid)
 			BitsShow(rect);
 	}

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-31 17:02:11 UTC (rev 45566)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.h	2009-10-31 17:54:28 UTC (rev 45567)
@@ -87,7 +87,7 @@
 	void BitsFree(GuiMemoryHandle memoryHandle);
 
 	void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
-	void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo);
+	void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight = -1);
 	void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);
 	void drawCel(SciGuiView *view, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);
 

Modified: scummvm/trunk/engines/sci/gui/gui_view.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_view.cpp	2009-10-31 17:02:11 UTC (rev 45566)
+++ scummvm/trunk/engines/sci/gui/gui_view.cpp	2009-10-31 17:54:28 UTC (rev 45567)
@@ -451,7 +451,7 @@
 	}
 }
 
-void SciGuiView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr) {
+void SciGuiView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight) {
 	GuiPalette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
 	sciViewCelInfo *celInfo = getCelInfo(loopNo, celNo);
 	byte *bitmap = getBitmap(loopNo, celNo);
@@ -477,7 +477,10 @@
 			for (x = 0; x < width; x++) {
 				color = bitmap[x];
 				if (color != clearKey && priority >= _screen->getPriority(clipRectTranslated.left + x, y))
-					_screen->putPixel(clipRectTranslated.left + x, y, drawMask, palette->mapping[color], priority, 0);
+					if (origHeight == -1)
+						_screen->putPixel(clipRectTranslated.left + x, y, drawMask, palette->mapping[color], priority, 0);
+					else
+						_screen->putPixelOnDisplay(clipRectTranslated.left + x, y, palette->mapping[color]);
 			}
 		}
 	} else {

Modified: scummvm/trunk/engines/sci/gui/gui_view.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_view.h	2009-10-31 17:02:11 UTC (rev 45566)
+++ scummvm/trunk/engines/sci/gui/gui_view.h	2009-10-31 17:54:28 UTC (rev 45567)
@@ -60,7 +60,7 @@
 	sciViewLoopInfo *getLoopInfo(GuiViewLoopNo loopNo);
 	void getCelRect(GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect);
 	byte *getBitmap(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
-	void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr);
+	void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight = -1);
 	uint16 getLoopCount() const { return _loopCount; }
 	uint16 getCelCount(GuiViewLoopNo loopNo) { return _loop[loopNo].celCount; }
 	GuiPalette *getPalette();

Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-31 17:02:11 UTC (rev 45566)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-31 17:54:28 UTC (rev 45567)
@@ -883,7 +883,7 @@
 	_s->pic_is_new = 1;
 }
 
-void SciGui32::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo) {
+void SciGui32::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight) {
 	int loop = loopNo;
 	int cel = celNo;
 	GfxView *new_view;

Modified: scummvm/trunk/engines/sci/gui32/gui32.h
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-31 17:02:11 UTC (rev 45566)
+++ scummvm/trunk/engines/sci/gui32/gui32.h	2009-10-31 17:54:28 UTC (rev 45567)
@@ -62,7 +62,7 @@
 	void drawMenuBar();
 	void clearMenuBar();
 	void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
-	void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo);
+	void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight = -1);
 	void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite);
 	void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 alignment, int16 style, bool hilite);
 	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