[Scummvm-git-logs] scummvm master -> bf45eb3daa8be2ad7feec6e4835550388de33db7
athrxx
noreply at scummvm.org
Sat Jul 16 21:15:04 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:
bf45eb3daa SCUMM (v3/CGA) - improved rendermode post-load fix
Commit: bf45eb3daa8be2ad7feec6e4835550388de33db7
https://github.com/scummvm/scummvm/commit/bf45eb3daa8be2ad7feec6e4835550388de33db7
Author: athrxx (athrxx at scummvm.org)
Date: 2022-07-16T23:13:45+02:00
Commit Message:
SCUMM (v3/CGA) - improved rendermode post-load fix
Fix actor palettes for savegames saved with a different rendering mode. This works for Loom and Indy3...
Changed paths:
engines/scumm/actor.cpp
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 5678b66924c..ec37dc69144 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -3827,12 +3827,6 @@ void Actor::saveLoadWithSerializer(Common::Serializer &s) {
_cost.frame[i] = (_cost.frame[i] << 2) | newDirToOldDir(_facing);
}
}
-
- // Post-load fix for games that were saved with a different video mode and which do not receive the normal
- // post-load treatment in ScummEngine_v3::scummLoop_handleSaveLoad() where the script will take care of the
- // actor palette. This fix is only for Bobbin in his normal costume.
- if (_vm->_game.id == GID_LOOM && s.isLoading() && _vm->_renderMode == Common::kRenderCGA && _number == 1 && _palette[8] == 8)
- _palette[8] = 0;
}
void Actor_v3::saveLoadWithSerializer(Common::Serializer &s) {
@@ -3867,6 +3861,23 @@ void Actor_v3::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsUint16LE(_stepX, VER(rev));
s.syncAsUint16LE(_stepThreshold, VER(rev));
}
+
+ // Post-load actor palette fixes for games that were saved with a different video mode.
+ if (s.isLoading() && _vm->_game.version == 3 && _vm->_game.platform == Common::kPlatformDOS) {
+ // Loom is not really much of a problem here, since it has extensive scripted post-load
+ // treatment in ScummEngine_v3::scummLoop_handleSaveLoad(). But there are situations
+ // where it won't be triggered (basically savegames from places where the original does
+ // not allow saving). Indy3 is more dependant on this than Loom, since it does have much
+ // less scripted post-load magic of its own.
+ bool cga = (_vm->_renderMode == Common::kRenderCGA);
+ if ((cga && _palette[6] == 6 && _palette[7] == 7) || (!cga && _palette[6] == 5 && _palette[7] == 15)) {
+ _palette[6] ^= 3;
+ _palette[7] ^= 8;
+ }
+ // Extra fix for Bobbin in his normal costume.
+ if (_vm->_game.id == GID_LOOM && _number == 1 && ((cga && _palette[8] == 8) || (!cga && _palette[8] == 0)))
+ _palette[8] ^= 8;
+ }
}
} // End of namespace Scumm
More information about the Scummvm-git-logs
mailing list