mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 11:51:52 +00:00
SCUMM: INDY4 (DOS/Mac Jap): Implement accurate character shading
This is taken from disasm.
This commit is contained in:
parent
f1a8595d6d
commit
73988683f2
@ -739,17 +739,34 @@ void CharsetRendererPC::drawBits1(Graphics::Surface &dest, int x, int y, const b
|
|||||||
int pitch = dest.pitch - width * dest.format.bytesPerPixel;
|
int pitch = dest.pitch - width * dest.format.bytesPerPixel;
|
||||||
byte *dst2 = dst + dest.pitch;
|
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 (y = 0; y < height && y + drawTop < dest.h; y++) {
|
||||||
for (x = 0; x < width; x++) {
|
for (x = 0; x < width; x++) {
|
||||||
if ((x % 8) == 0)
|
if ((x % 8) == 0)
|
||||||
bits = *src++;
|
bits = *src++;
|
||||||
if ((bits & revBitMask(x % 8)) && y + drawTop >= 0) {
|
if ((bits & revBitMask(x % 8)) && y + drawTop >= 0) {
|
||||||
if (_enableShadow) {
|
if (_enableShadow) {
|
||||||
if (_shadowType == kNormalShadowType)
|
if (_shadowType == kNormalShadowType) {
|
||||||
dst[1] = dst2[0] = dst2[1] = _shadowColor;
|
dst[1] = dst2[1] = _shadowColor;
|
||||||
else if (_shadowType == kHorizontalShadowType)
|
|
||||||
|
// 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[1] = _shadowColor;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
dst[0] = col;
|
dst[0] = col;
|
||||||
} else if (!(bits & revBitMask(x % 8)) && (y < height - 1) &&
|
} else if (!(bits & revBitMask(x % 8)) && (y < height - 1) &&
|
||||||
_vm->_useCJKMode && _vm->_game.platform == Common::kPlatformSegaCD) {
|
_vm->_useCJKMode && _vm->_game.platform == Common::kPlatformSegaCD) {
|
||||||
|
@ -3682,6 +3682,10 @@ bool ScummEngine::isUsingOriginalGUI() {
|
|||||||
return _useOriginalGUI;
|
return _useOriginalGUI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ScummEngine::isMessageBannerActive() {
|
||||||
|
return _messageBannerActive;
|
||||||
|
}
|
||||||
|
|
||||||
void ScummEngine::runBootscript() {
|
void ScummEngine::runBootscript() {
|
||||||
int args[NUM_SCRIPT_LOCAL];
|
int args[NUM_SCRIPT_LOCAL];
|
||||||
memset(args, 0, sizeof(args));
|
memset(args, 0, sizeof(args));
|
||||||
|
@ -660,6 +660,7 @@ public:
|
|||||||
void pauseGame();
|
void pauseGame();
|
||||||
void restart();
|
void restart();
|
||||||
bool isUsingOriginalGUI();
|
bool isUsingOriginalGUI();
|
||||||
|
bool isMessageBannerActive(); // For Indy4 Jap character shadows
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Dialog *_pauseDialog = nullptr;
|
Dialog *_pauseDialog = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user