[Scummvm-git-logs] scummvm master -> fca2fc4eb6ddc2ee902a0e3428c7052444fbaaa6
athrxx
noreply at scummvm.org
Fri Sep 20 12:03:23 UTC 2024
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:
fca2fc4eb6 SCI: fix bug no. 15375
Commit: fca2fc4eb6ddc2ee902a0e3428c7052444fbaaa6
https://github.com/scummvm/scummvm/commit/fca2fc4eb6ddc2ee902a0e3428c7052444fbaaa6
Author: athrxx (athrxx at scummvm.org)
Date: 2024-09-20T14:03:01+02:00
Commit Message:
SCI: fix bug no. 15375
(SQ4 Korean text not rendered after refactor)
This should get some testing if possible.
Also, it would be interesting to know if other
controls (icon, list, text edit) would also need
a similar solution.
Changed paths:
engines/sci/graphics/controls16.cpp
diff --git a/engines/sci/graphics/controls16.cpp b/engines/sci/graphics/controls16.cpp
index e2f8c05c99c..53a8845b8ca 100644
--- a/engines/sci/graphics/controls16.cpp
+++ b/engines/sci/graphics/controls16.cpp
@@ -326,21 +326,44 @@ void GfxControls16::kernelDrawButton(Common::Rect rect, reg_t obj, const char *t
rect.grow(1);
_paint16->eraseRect(rect);
_paint16->frameRect(rect);
+
+ // Unlike PC-98, the Korean fan translations have CJK text for some button controls. The original PC-98
+ // interpreters which were used to make the necessary code changes to kernelDrawText do not have any
+ // modifications for button controls, since it is not necessary (due to the English button labels). I
+ // have now tried to adapt the code changes from kernelDrawText for the button controls. It does require
+ // some extra attention, like drawing the buttons frames first, but seems to work as intended. Also, the
+ // different handling also seems to work fine for the English buttons (which both the Korean and the PC-98
+ // versions have).
+ if (_screen->gfxDriver()->driverBasedTextRendering() && !getPicNotValid()) {
+ if (style & SCI_CONTROLS_STYLE_SELECTED) {
+ rect.grow(-1);
+ _paint16->frameRect(rect);
+ rect.grow(1);
+ }
+ _paint16->bitsShow(rect);
+ }
+
rect.grow(-2);
_ports->textGreyedOutput(!(style & SCI_CONTROLS_STYLE_ENABLED));
+
if (!g_sci->hasMacFonts()) {
- _text16->Box(text, languageSplitter, false, rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId);
+ _text16->Box(text, languageSplitter, _screen->gfxDriver()->driverBasedTextRendering(), rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId);
} else {
_text16->macDraw(text, rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId, _text16->GetFontId(), 0);
}
_ports->textGreyedOutput(false);
- rect.grow(1);
- if (style & SCI_CONTROLS_STYLE_SELECTED)
- _paint16->frameRect(rect);
- if (!getPicNotValid()) {
+
+ // Fix for Korean fan translation, see comment above.
+ if (!_screen->gfxDriver()->driverBasedTextRendering()) {
rect.grow(1);
- _paint16->bitsShow(rect);
+ if (style & SCI_CONTROLS_STYLE_SELECTED)
+ _paint16->frameRect(rect);
+ if (!getPicNotValid()) {
+ rect.grow(1);
+ _paint16->bitsShow(rect);
+ }
}
+
if (getSciVersion() == SCI_VERSION_0_EARLY) {
_ports->penColor(sci0EarlyPen);
_ports->backColor(sci0EarlyBack);
More information about the Scummvm-git-logs
mailing list