[Scummvm-git-logs] scummvm master -> 4e081dde8183d61bc96cb9b497f0af22ec821389
AndywinXp
noreply at scummvm.org
Tue Nov 7 23:21:41 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:
4e081dde81 SCUMM: INDY4 (DOS/V): Fix crashes related to charset rendering
Commit: 4e081dde8183d61bc96cb9b497f0af22ec821389
https://github.com/scummvm/scummvm/commit/4e081dde8183d61bc96cb9b497f0af22ec821389
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-11-08T00:21:32+01:00
Commit Message:
SCUMM: INDY4 (DOS/V): Fix crashes related to charset rendering
The text is still not accurate, but at least it doesn't crash...
Changed paths:
engines/scumm/charset.cpp
engines/scumm/charset.h
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 509ea4f7eaf..bd659e5c0f8 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -93,7 +93,9 @@ void ScummEngine::loadCJKFont() {
_useCJKMode = true;
#endif
} else if ((_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD && _language == Common::JA_JPN)
- || (_game.id == GID_INDY4 && _game.platform == Common::kPlatformMacintosh && _language == Common::JA_JPN)) {
+ || (_game.id == GID_INDY4 &&
+ (_game.platform == Common::kPlatformMacintosh || _game.platform == Common::kPlatformDOS) &&
+ _language == Common::JA_JPN)) {
_2byteWidth = 16;
_2byteHeight = 16;
_useCJKMode = true;
@@ -248,7 +250,7 @@ byte *ScummEngine::get2byteCharPtr(int idx) {
break;
case Common::JA_JPN:
if ((_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD)
- || (_game.id == GID_INDY4 && _game.platform == Common::kPlatformMacintosh)) {
+ || (_game.id == GID_INDY4 && (_game.platform == Common::kPlatformMacintosh || _game.platform == Common::kPlatformDOS))) {
// init pointer to charset resource
if (_2byteFontPtr[0] == 0xFF) {
int charsetId = 5;
@@ -440,8 +442,11 @@ void CharsetRendererV3::setCurID(int32 id) {
int CharsetRendererCommon::getFontHeight() const {
bool isSegaCD = _vm->_game.platform == Common::kPlatformSegaCD;
+ bool isIndyDOSJap = (_vm->_game.id == GID_INDY4 &&
+ _vm->_game.platform == Common::kPlatformDOS &&
+ _vm->_language == Common::JA_JPN);
- if (isSegaCD && _vm->_segaForce2ByteCharHeight) {
+ if (isIndyDOSJap || (isSegaCD && _vm->_segaForce2ByteCharHeight)) {
return MAX(_vm->_2byteHeight, _fontHeight);
} else if (_vm->_useCJKMode && !isSegaCD) {
return MAX(_vm->_2byteHeight + 1, _fontHeight);
diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h
index 089e2c5a7bd..af0b70682a1 100644
--- a/engines/scumm/charset.h
+++ b/engines/scumm/charset.h
@@ -169,7 +169,7 @@ protected:
public:
CharsetRendererClassic(ScummEngine *vm, int cjkSpacing) : CharsetRendererPC(vm), _cjkSpacing(cjkSpacing) {}
CharsetRendererClassic(ScummEngine *vm) : CharsetRendererClassic(vm, vm->_game.id == GID_INDY4 &&
- vm->_game.platform == Common::kPlatformMacintosh &&
+ (vm->_game.platform == Common::kPlatformMacintosh || vm->_game.platform == Common::kPlatformDOS) &&
vm->_language == Common::JA_JPN ? -3 : 0) {}
void printChar(int chr, bool ignoreCharsetMask) override;
More information about the Scummvm-git-logs
mailing list