mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 17:57:14 +00:00
SCUMM: (COMI/CJK) - fix blast text shading and positioning
- COMI adds a y-Offset of 2 in CJK mode. - The shadowed glyphs are used for all CJK font drawing, not only Korean. Also, the char height has to be adjusted by one pixel for the shadow.
This commit is contained in:
parent
4a7b720a31
commit
7b3b47024b
@ -1280,8 +1280,11 @@ void CharsetRendererNut::printChar(int chr, bool ignoreCharsetMask) {
|
||||
int height = _current->getCharHeight(chr);
|
||||
|
||||
bool is2byte = chr >= 256 && _vm->_useCJKMode;
|
||||
if (is2byte)
|
||||
if (is2byte) {
|
||||
width = _vm->_2byteWidth;
|
||||
if (_vm->_game.id == GID_CMI)
|
||||
height++; // One extra pixel for the shadow
|
||||
}
|
||||
|
||||
shadow.right = _left + width;
|
||||
shadow.bottom = _top + height;
|
||||
|
@ -405,24 +405,10 @@ void NutRenderer::draw2byte(const Graphics::Surface &s, int c, int x, int y, byt
|
||||
return;
|
||||
}
|
||||
|
||||
enum ShadowMode {
|
||||
kNone,
|
||||
kKoreanV8ShadowMode
|
||||
};
|
||||
|
||||
ShadowMode shadowMode = kNone;
|
||||
|
||||
if (_vm->_language == Common::KO_KOR && _vm->_game.version == 8) {
|
||||
shadowMode = kKoreanV8ShadowMode;
|
||||
}
|
||||
|
||||
int shadowOffsetXTable[4] = {-1, 0, 1, 0};
|
||||
int shadowOffsetYTable[4] = {0, 1, 0, 0};
|
||||
int shadowOffsetColorTable[4] = {0, 0, 0, color};
|
||||
|
||||
int shadowIdx = 3;
|
||||
if (shadowMode == kKoreanV8ShadowMode)
|
||||
shadowIdx = 0;
|
||||
int shadowIdx = (_vm->_useCJKMode && _vm->_game.id == GID_CMI) ? 0 : 3;
|
||||
|
||||
const byte *origSrc = src;
|
||||
|
||||
|
@ -132,9 +132,12 @@ void ScummEngine_v6::enqueueText(const byte *text, int x, int y, byte color, byt
|
||||
if (_useCJKMode) {
|
||||
// The Dig expressly checks for x == 160 && y == 189 && charset == 3. Usually, if the game wants to print CJK text at the bottom
|
||||
// of the screen it will use y = 183. So maybe this is a hack to fix some script texts that weren forgotten in the CJK converting
|
||||
// process. COMI doesn't have anything like that.
|
||||
// process.
|
||||
if (_game.id == GID_DIG && x == 160 && y == 189 && charset == 3)
|
||||
y -= 6;
|
||||
// COMI always adds a y-offset of 2 in CJK mode.
|
||||
if (_game.id == GID_CMI)
|
||||
y += 2;
|
||||
}
|
||||
|
||||
convertMessageToString(text, bt.text, sizeof(bt.text));
|
||||
|
Loading…
x
Reference in New Issue
Block a user