[Scummvm-git-logs] scummvm master -> b8af2ca66f3f565ad0d86761d9eac3b69d68c52d
csnover
csnover at users.noreply.github.com
Fri Sep 15 19:10:19 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b8af2ca66f SCI32: Fix clipping of inventory items in Phant2
Commit: b8af2ca66f3f565ad0d86761d9eac3b69d68c52d
https://github.com/scummvm/scummvm/commit/b8af2ca66f3f565ad0d86761d9eac3b69d68c52d
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-15T12:08:31-05:00
Commit Message:
SCI32: Fix clipping of inventory items in Phant2
This fixes overlapping of the left arrow in all cases, but the
scroll delta and initial offset of inventory items will only be
fixed in new games because the affected objects are global objects
whose bad properties get persisted into save games.
Fixes Trac#10037.
Changed paths:
engines/sci/engine/script_patches.cpp
engines/sci/graphics/celobj32.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 87eeddf..2200657 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -126,6 +126,7 @@ static const char *const selectorNameTable[] = {
"setCel", // Phant2
"iconV", // Phant2
"update", // Phant2
+ "xOff", // Phant2
#endif
NULL
};
@@ -175,7 +176,8 @@ enum ScriptPatcherSelectors {
SELECTOR_setSize,
SELECTOR_setCel,
SELECTOR_iconV,
- SELECTOR_update
+ SELECTOR_update,
+ SELECTOR_xOff
#endif
};
@@ -4068,12 +4070,58 @@ static const uint16 phant2BadIconPatch[] = {
PATCH_END
};
+// The left and right arrows move inventory items a pixel more than each
+// inventory item is wide, which causes the inventory to creep to the left by
+// one pixel per scrolled item.
+// Applies to at least: US English
+static const uint16 phant2InvLeftDeltaSignature[] = {
+ SIG_MAGICDWORD,
+ SIG_UINT16(0x42), // delta
+ SIG_UINT16(0x19), // moveDelay
+ SIG_END
+};
+
+static const uint16 phant2InvLeftDeltaPatch[] = {
+ PATCH_UINT16(0x41), // delta
+ PATCH_END
+};
+
+static const uint16 phant2InvRightDeltaSignature[] = {
+ SIG_MAGICDWORD,
+ SIG_UINT16(0xffbe), // delta
+ SIG_UINT16(0x19), // moveDelay
+ SIG_END
+};
+
+static const uint16 phant2InvRightDeltaPatch[] = {
+ PATCH_UINT16(0xffbf), // delta
+ PATCH_END
+};
+
+// The first inventory item is put too far to the right, which causes wide items
+// to get cut off on the right side of the inventory.
+// Applies to at least: US English
+static const uint16 phant2InvOffsetSignature[] = {
+ SIG_MAGICDWORD,
+ 0x35, 0x26, // ldi 38
+ 0x64, SIG_SELECTOR16(xOff), // aTop xOff
+ SIG_END
+};
+
+static const uint16 phant2InvOffsetPatch[] = {
+ 0x35, 0x1d, // ldi 29
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry phantasmagoria2Signatures[] = {
{ true, 0, "slow interface fades", 3, phant2SlowIFadeSignature, phant2SlowIFadePatch },
{ true, 0, "bad arguments to get game version", 1, phant2GetVersionSignature, phant2GetVersionPatch },
{ true, 3000, "replace spin loop in alien password window", 1, phant2WaitParam1Signature, phant2WaitParam1Patch },
{ true, 4081, "replace spin loop after ratboy puzzle", 1, phant2RatboySignature, phant2RatboyPatch },
+ { true, 63001, "fix inventory left scroll delta", 1, phant2InvLeftDeltaSignature, phant2InvLeftDeltaPatch },
+ { true, 63001, "fix inventory right scroll delta", 1, phant2InvRightDeltaSignature, phant2InvRightDeltaPatch },
+ { true, 63001, "fix inventory wrong initial offset", 1, phant2InvOffsetSignature, phant2InvOffsetPatch },
{ true, 63004, "limit in-game audio volume", 1, phant2AudioVolumeSignature, phant2AudioVolumePatch },
{ true, 63016, "replace spin loop during music fades", 1, phant2Wait4FadeSignature, phant2Wait4FadePatch },
{ true, 63019, "replace spin loop during computer load", 1, phant2WaitParam1Signature, phant2WaitParam1Patch },
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index 687ecd6..a49690a 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -1003,9 +1003,6 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int
_height = celHeader.getUint16SEAt(2);
assert(_width <= kCelScalerTableSize && _height <= kCelScalerTableSize);
_origin.x = _width / 2 - celHeader.getInt16SEAt(4);
- if (g_sci->_features->usesAlternateSelectors() && _mirrorX) {
- _origin.x = _width - _origin.x - 1;
- }
_origin.y = _height - celHeader.getInt16SEAt(6) - 1;
_skipColor = celHeader[8];
_compressionType = (CelCompressionType)celHeader[9];
More information about the Scummvm-git-logs
mailing list