SCUMM: Cleanup Korean Multi-font code

- Remove unused code
- Fix uninitialized variables
This commit is contained in:
wonst719 2020-11-17 03:05:42 +09:00
parent c877097b49
commit d2aedb650b
2 changed files with 8 additions and 18 deletions

View File

@ -360,12 +360,10 @@ void CharsetRendererCommon::setCurID(int32 id) {
_numChars = READ_LE_UINT16(_fontPtr + 2);
if (_vm->_useMultiFont) {
if (id == 6) { // HACK: Fix inventory font error
_vm->_2byteFontPtr = _vm->_2byteMultiFontPtr[0];
_vm->_2byteWidth = _vm->_2byteMultiWidth[0];
_vm->_2byteHeight = _vm->_2byteMultiHeight[0];
_vm->_2byteShadow = _vm->_2byteMultiShadow[0];
} else if (_vm->_2byteMultiFontPtr[id]) {
if (id == 6) // HACK: Fix monkey1cd/monkey2/dott font error
id = 0;
if (_vm->_2byteMultiFontPtr[id]) {
_vm->_2byteFontPtr = _vm->_2byteMultiFontPtr[id];
_vm->_2byteWidth = _vm->_2byteMultiWidth[id];
_vm->_2byteHeight = _vm->_2byteMultiHeight[id];
@ -410,12 +408,7 @@ void CharsetRendererV3::setCurID(int32 id) {
_fontPtr += _numChars;
if (_vm->_useMultiFont) {
if (id == 6) { // HACK: Fix inventory font error
_vm->_2byteFontPtr = _vm->_2byteMultiFontPtr[0];
_vm->_2byteWidth = _vm->_2byteMultiWidth[0];
_vm->_2byteHeight = _vm->_2byteMultiHeight[0];
_vm->_2byteShadow = _vm->_2byteMultiShadow[0];
} else if (_vm->_2byteMultiFontPtr[id]) {
if (_vm->_2byteMultiFontPtr[id]) {
_vm->_2byteFontPtr = _vm->_2byteMultiFontPtr[id];
_vm->_2byteWidth = _vm->_2byteMultiWidth[id];
_vm->_2byteHeight = _vm->_2byteMultiHeight[id];
@ -753,7 +746,6 @@ void CharsetRendererPC::drawBits1Kor(Graphics::Surface &dest, int x1, int y1, co
// HACK: Since Korean fonts don't have shadow/stroke information,
// we use NUT-Renderer-like shadow drawing method.
//bool useOldShadow = false;
int offsetX[14] = {-2, -2, -2, -1, 0, -1, 0, 1, -1, 1, -1, 0, 1, 0};
int offsetY[14] = {0, 1, 2, 2, 2, -1, -1, -1, 0, 0, 1, 1, 1, 0};
@ -789,11 +781,6 @@ void CharsetRendererPC::drawBits1Kor(Graphics::Surface &dest, int x1, int y1, co
if ((x % 8) == 0)
bits = *src++;
if ((bits & revBitMask(x % 8)) && y + drawTop + offsetY[i] >= 0 && x + x1 + offsetX[i] >= 0) {
if (_enableShadow) {
*(dst + 1) = _shadowColor;
*(dst + dest.pitch) = _shadowColor;
*(dst + dest.pitch + 1) = _shadowColor;
}
*(dst + (dest.pitch * offsetY[i]) + offsetX[i]) = cTable[i];
}
dst++;

View File

@ -329,6 +329,9 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_translatedLines = 0;
_languageLineIndex = 0;
_2byteFontPtr = 0;
_2byteWidth = 0;
_2byteHeight = 0;
_2byteShadow = 0;
_krStrPost = 0;
_V1TalkingActor = 0;
for (int i = 0; i < 20; i++)