[Scummvm-cvs-logs] scummvm master -> 719160d4948ccd22d283d5b458cb15622db473f7

csnover csnover at users.noreply.github.com
Thu May 26 02:16:24 CEST 2016


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c231d22c28 SCI32: Fix LSL6 hires control panel script bug
c4e8ffc821 SCI32: Update header parameters with const, to match implementation
719160d494 SCI32: Fix assertion failures in LSL6 hires caused by bad rects


Commit: c231d22c28430eb9afe31af122ec08c08070d2d3
    https://github.com/scummvm/scummvm/commit/c231d22c28430eb9afe31af122ec08c08070d2d3
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-05-25T19:16:11-05:00

Commit Message:
SCI32: Fix LSL6 hires control panel script bug

The control panel initialisation script makes an invalid two-argument
call to get the width of the settings dial; this only happens to work
because the third argument on the stack was set to zero by an earlier
call.

Changed paths:
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/workarounds.cpp



diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 3463d05..0ede307 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -465,7 +465,7 @@ static SciKernelMapEntry s_kernelMap[] = {
 	{ MAP_CALL(CelWide),           SIG_SCI16, SIGFOR_ALL,    "ii(i)",                 NULL,            kCelWide_workarounds },
 #ifdef ENABLE_SCI32
 	{ "CelHigh", kCelHigh32,       SIG_SCI32, SIGFOR_ALL,    "iii",                   NULL,            NULL },
-	{ "CelWide", kCelWide32,       SIG_SCI32, SIGFOR_ALL,    "iii",                   NULL,            NULL },
+	{ "CelWide", kCelWide32,       SIG_SCI32, SIGFOR_ALL,    "iii",                   NULL,            kCelWide_workarounds },
 #endif
 	{ MAP_CALL(CheckFreeSpace),    SIG_SCI32, SIGFOR_ALL,    "r.*",                   NULL,            NULL },
 	{ MAP_CALL(CheckFreeSpace),    SIG_SCI11, SIGFOR_ALL,    "r(i)",                  NULL,            NULL },
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 3832f4c..0cb8ff4 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -407,6 +407,7 @@ const SciWorkaroundEntry kCelWide_workarounds[] = {
 	{ GID_PQ2,            -1,   255,  0,              "DIcon", "setSize",                   NULL,     0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
 	{ GID_SQ1,             1,   255,  0,              "DIcon", "setSize",                   NULL,     0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #5012
 	{ GID_FANMADE,        -1,   979,  0,              "DIcon", "setSize",                   NULL,     0, { WORKAROUND_STILLCALL, 0 } }, // In The Gem Scenario and perhaps other fanmade games, this is called with 2nd/3rd parameters as objects - bug #5144
+	{ GID_LSL6HIRES,      -1,    94,  0,    "ll6ControlPanel",    "init",                   NULL,     0, { WORKAROUND_STILLCALL, 0 } }, // when opening the "controls" panel from the main menu, the third argument is missing
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 


Commit: c4e8ffc821af321bedecd58d8f25dbe96e5b31ad
    https://github.com/scummvm/scummvm/commit/c4e8ffc821af321bedecd58d8f25dbe96e5b31ad
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-05-25T19:16:11-05:00

Commit Message:
SCI32: Update header parameters with const, to match implementation

Changed paths:
    engines/sci/graphics/celobj32.h



diff --git a/engines/sci/graphics/celobj32.h b/engines/sci/graphics/celobj32.h
index 0bb4b03..6e401b3 100644
--- a/engines/sci/graphics/celobj32.h
+++ b/engines/sci/graphics/celobj32.h
@@ -474,7 +474,7 @@ private:
 	bool analyzeForRemap() const;
 
 public:
-	CelObjView(GuiResourceId viewId, int16 loopNo, int16 celNo);
+	CelObjView(const GuiResourceId viewId, const int16 loopNo, const int16 celNo);
 	virtual ~CelObjView() override {};
 
 	using CelObj::draw;
@@ -525,7 +525,7 @@ public:
 	 */
 	int16 _priority;
 
-	CelObjPic(GuiResourceId pictureId, int16 celNo);
+	CelObjPic(const GuiResourceId pictureId, const int16 celNo);
 	virtual ~CelObjPic() override {};
 
 	using CelObj::draw;
@@ -546,7 +546,7 @@ public:
  */
 class CelObjMem : public CelObj {
 public:
-	CelObjMem(reg_t bitmap);
+	CelObjMem(const reg_t bitmap);
 	virtual ~CelObjMem() override {};
 
 	virtual CelObjMem *duplicate() const override;
@@ -562,7 +562,7 @@ public:
  */
 class CelObjColor : public CelObj {
 public:
-	CelObjColor(uint8 color, int16 width, int16 height);
+	CelObjColor(const uint8 color, const int16 width, const int16 height);
 	virtual ~CelObjColor() override {};
 
 	using CelObj::draw;


Commit: 719160d4948ccd22d283d5b458cb15622db473f7
    https://github.com/scummvm/scummvm/commit/719160d4948ccd22d283d5b458cb15622db473f7
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-05-25T19:16:11-05:00

Commit Message:
SCI32: Fix assertion failures in LSL6 hires caused by bad rects

LSL6 hires sends rectangles to kernel calls that have negative
dimensions. SSCI did not care about this and would simply accept
these invalid rects, so we do the same, at least for now.

Changed paths:
    engines/sci/graphics/compare.cpp
    engines/sci/graphics/plane32.h



diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp
index 729eeea..130416f 100644
--- a/engines/sci/graphics/compare.cpp
+++ b/engines/sci/graphics/compare.cpp
@@ -162,12 +162,20 @@ reg_t GfxCompare::kernelCantBeHere32(const reg_t curObject, const reg_t listRefe
 	// rects before operating on them, but this call leverages SCI16 engine
 	// code that operates on inclusive rects, so the rect's bottom-right
 	// point is not modified like in other SCI32 kernel calls
-	Common::Rect checkRect(
-		readSelectorValue(_segMan, curObject, SELECTOR(brLeft)),
-		readSelectorValue(_segMan, curObject, SELECTOR(brTop)),
-		readSelectorValue(_segMan, curObject, SELECTOR(brRight)),
-		readSelectorValue(_segMan, curObject, SELECTOR(brBottom))
-	);
+	Common::Rect checkRect;
+
+	// At least LSL6 hires passes invalid rectangles which trigger the
+	// isValidRect assertion in the Rect constructor; this is avoided by
+	// assigning the properties after construction and then testing the
+	// rect for validity ourselves here. SSCI does not care about whether
+	// or not the rects are valid
+	checkRect.left = readSelectorValue(_segMan, curObject, SELECTOR(brLeft));
+	checkRect.top = readSelectorValue(_segMan, curObject, SELECTOR(brTop));
+	checkRect.right = readSelectorValue(_segMan, curObject, SELECTOR(brRight));
+	checkRect.bottom = readSelectorValue(_segMan, curObject, SELECTOR(brBottom));
+	if (!checkRect.isValidRect()) {
+		return make_reg(0, 0);
+	}
 
 	uint16 result = 0;
 	uint16 signal = readSelectorValue(_segMan, curObject, SELECTOR(signal));
diff --git a/engines/sci/graphics/plane32.h b/engines/sci/graphics/plane32.h
index 770a6fa..53749f8 100644
--- a/engines/sci/graphics/plane32.h
+++ b/engines/sci/graphics/plane32.h
@@ -275,7 +275,11 @@ public:
 	 * given screen rect.
 	 */
 	inline void clipScreenRect(const Common::Rect &screenRect) {
-		if (_screenRect.intersects(screenRect)) {
+		// LSL6 hires creates planes with invalid rects; SSCI does not
+		// care about this, but `Common::Rect::clip` does, so we need to
+		// check whether or not the rect is actually valid before clipping
+		// and only clip valid rects
+		if (_screenRect.isValidRect() && _screenRect.intersects(screenRect)) {
 			_screenRect.clip(screenRect);
 		} else {
 			_screenRect.left = 0;






More information about the Scummvm-git-logs mailing list