[Scummvm-git-logs] scummvm master -> 73988683f299755395d048310a746b758c6b4a7d
AndywinXp
noreply at scummvm.org
Fri Nov 10 15:34:38 UTC 2023
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:
73988683f2 SCUMM: INDY4 (DOS/Mac Jap): Implement accurate character shading
Commit: 73988683f299755395d048310a746b758c6b4a7d
https://github.com/scummvm/scummvm/commit/73988683f299755395d048310a746b758c6b4a7d
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-11-10T16:34:33+01:00
Commit Message:
SCUMM: INDY4 (DOS/Mac Jap): Implement accurate character shading
This is taken from disasm.
Changed paths:
engines/scumm/charset.cpp
engines/scumm/scumm.cpp
engines/scumm/scumm.h
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 1d0247496f4..0c240085d5f 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -739,16 +739,33 @@ void CharsetRendererPC::drawBits1(Graphics::Surface &dest, int x, int y, const b
int pitch = dest.pitch - width * dest.format.bytesPerPixel;
byte *dst2 = dst + dest.pitch;
+ bool isIndy4Jap = _vm->_game.id == GID_INDY4 && _vm->_language == Common::JA_JPN &&
+ (_vm->_game.platform == Common::kPlatformDOS || _vm->_game.platform == Common::kPlatformMacintosh);
+
+ if (isIndy4Jap) {
+ // Characters allow shadows only if this is the main virtual screen, and we are not drawing
+ // a message on a GUI banner. The main menu is fine though, and allows shadows as well.
+ bool canDrawShadow = _vm->findVirtScreen(_top)->number == kMainVirtScreen && !_vm->isMessageBannerActive();
+ enableShadow(canDrawShadow);
+ }
+
for (y = 0; y < height && y + drawTop < dest.h; y++) {
for (x = 0; x < width; x++) {
if ((x % 8) == 0)
bits = *src++;
if ((bits & revBitMask(x % 8)) && y + drawTop >= 0) {
if (_enableShadow) {
- if (_shadowType == kNormalShadowType)
- dst[1] = dst2[0] = dst2[1] = _shadowColor;
- else if (_shadowType == kHorizontalShadowType)
+ if (_shadowType == kNormalShadowType) {
+ dst[1] = dst2[1] = _shadowColor;
+
+ // Mac and DOS/V versions of Japanese INDY4 don't
+ // draw a shadow pixel below the first pixel.
+ // Verified from disasm.
+ if (!isIndy4Jap)
+ dst2[0] = _shadowColor;
+ } else if (_shadowType == kHorizontalShadowType) {
dst[1] = _shadowColor;
+ }
}
dst[0] = col;
} else if (!(bits & revBitMask(x % 8)) && (y < height - 1) &&
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 9f747c920da..e845c94da90 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -3682,6 +3682,10 @@ bool ScummEngine::isUsingOriginalGUI() {
return _useOriginalGUI;
}
+bool ScummEngine::isMessageBannerActive() {
+ return _messageBannerActive;
+}
+
void ScummEngine::runBootscript() {
int args[NUM_SCRIPT_LOCAL];
memset(args, 0, sizeof(args));
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 73fc0d0a533..1ffa6698114 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -660,6 +660,7 @@ public:
void pauseGame();
void restart();
bool isUsingOriginalGUI();
+ bool isMessageBannerActive(); // For Indy4 Jap character shadows
protected:
Dialog *_pauseDialog = nullptr;
More information about the Scummvm-git-logs
mailing list