[Scummvm-cvs-logs] scummvm master -> 71294a8a988f86d0d0fa91e058d2ca6faaa42815
csnover
csnover at users.noreply.github.com
Wed Aug 24 22:23:59 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:
1b6ea78216 SCI32: Remove error check for negative celNo
64f4ad4ad5 SCI32: Fix incorrect boolean operator
71294a8a98 SCI32: Remove extra ! in error message
Commit: 1b6ea7821696355cb116516834c9caa068b5fc02
https://github.com/scummvm/scummvm/commit/1b6ea7821696355cb116516834c9caa068b5fc02
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-08-24T15:21:42-05:00
Commit Message:
SCI32: Remove error check for negative celNo
Negative cel numbers are exploited by at least the hi-res mode of
PQ4CD.
Changed paths:
engines/sci/graphics/celobj32.cpp
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index d053fa2..7ca510d 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -916,8 +916,17 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int
_info.celNo = celCount - 1;
}
- if (_info.celNo < 0) {
- error("Cel is less than 0!");
+ // A celNo can be negative and still valid. At least PQ4CD uses this strange
+ // arrangement to load its high-resolution main menu resource. In PQ4CD, the
+ // low-resolution menu is at view 23, loop 9, cel 0, and the high-resolution
+ // menu is at view 2300, loop 0, cel 0. View 2300 is specially crafted to
+ // have 2 loops, with the second loop having 0 cels. When in high-resolution
+ // mode, the game scripts only change the view resource ID from 23 to 2300,
+ // leaving loop 9 and cel 0 the same. The code in CelObjView constructor
+ // auto-corrects loop 9 to loop 1, and then auto-corrects the cel number
+ // from 0 to -1, which effectively causes loop 0, cel 0 to be read.
+ if (_info.celNo < 0 && _info.loopNo == 0) {
+ error("Cel is less than 0 on loop 0");
}
_hunkPaletteOffset = READ_SCI11ENDIAN_UINT32(data + 8);
Commit: 64f4ad4ad55319fbf4af3af1eb768a05df2c129d
https://github.com/scummvm/scummvm/commit/64f4ad4ad55319fbf4af3af1eb768a05df2c129d
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-08-24T15:22:55-05:00
Commit Message:
SCI32: Fix incorrect boolean operator
Changed paths:
engines/sci/graphics/celobj32.cpp
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index 7ca510d..ea42308 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -872,7 +872,7 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int
_scaledWidth = READ_SCI11ENDIAN_UINT16(data + 14);
_scaledHeight = READ_SCI11ENDIAN_UINT16(data + 16);
- if (_scaledWidth == 0 || _scaledHeight == 0) {
+ if (_scaledWidth == 0 && _scaledHeight == 0) {
byte sizeFlag = data[5];
if (sizeFlag == 0) {
_scaledWidth = kLowResX;
Commit: 71294a8a988f86d0d0fa91e058d2ca6faaa42815
https://github.com/scummvm/scummvm/commit/71294a8a988f86d0d0fa91e058d2ca6faaa42815
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-08-24T15:23:30-05:00
Commit Message:
SCI32: Remove extra ! in error message
Changed paths:
engines/sci/graphics/celobj32.cpp
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index ea42308..d67a4dc 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -894,7 +894,7 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int
// NOTE: This is the actual check, in the actual location,
// from SCI engine.
if (loopNo < 0) {
- error("Loop is less than 0!");
+ error("Loop is less than 0");
}
const uint16 viewHeaderSize = READ_SCI11ENDIAN_UINT16(data);
More information about the Scummvm-git-logs
mailing list