[Scummvm-git-logs] scummvm master -> 5d5ba3470f010fe67b54e58b95fde7dac77ab7b7
dwatteau
noreply at scummvm.org
Sat Oct 8 18:44:50 UTC 2022
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:
5d5ba3470f SCUMM: Fix AkosCostumeLoader on big-endian hosts
Commit: 5d5ba3470f010fe67b54e58b95fde7dac77ab7b7
https://github.com/scummvm/scummvm/commit/5d5ba3470f010fe67b54e58b95fde7dac77ab7b7
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-10-08T20:43:18+02:00
Commit Message:
SCUMM: Fix AkosCostumeLoader on big-endian hosts
Commit befd3b3511477b946e8a51b2809f4c1b1d3c2ef7 introduced a regression
on big-endian systems, causing Guybrush to moonwalk and Wally to lose
his body in the first scene of COMI, for example.
`costumeFlags` must be read as a little-endian value, now that it it's
been confirmed to be an uint16 and not a byte, in the disasms.
Found after diff'ing the -fverbose-asm output of akos.cpp during a Git
bisect on a big-endian system.
Changed paths:
engines/scumm/akos.cpp
diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp
index 51051277d30..c4b6eb3cf09 100644
--- a/engines/scumm/akos.cpp
+++ b/engines/scumm/akos.cpp
@@ -86,7 +86,7 @@ bool AkosCostumeLoader::hasManyDirections() {
const AkosHeader *akhd;
akhd = (const AkosHeader *)_vm->findResourceData(MKTAG('A','K','H','D'), _akos);
- return (akhd->costumeFlags & 2) != 0;
+ return (READ_LE_UINT16(&akhd->costumeFlags) & 2) != 0;
}
void AkosCostumeLoader::costumeDecodeData(Actor *a, int frame, uint useMask) {
@@ -300,7 +300,7 @@ void AkosRenderer::setCostume(int costume, int shadow) {
}
void AkosRenderer::setFacing(const Actor *a) {
- _mirror = (newDirToOldDir(a->getFacing()) != 0 || _akhd->costumeFlags & 1);
+ _mirror = (newDirToOldDir(a->getFacing()) != 0 || READ_LE_UINT16(&_akhd->costumeFlags) & 1);
if (a->_flip)
_mirror = !_mirror;
}
More information about the Scummvm-git-logs
mailing list