From eef83714322b98fbe02249478ad66b88fd4c1fe2 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sat, 16 Apr 2016 16:46:38 +0100 Subject: DRASCULA: Swap extraSurface and tableSurface use in chapter 6 for Spanish version This simplifies the code and bring it closer to the original source code. This should help if we need to debug issues in the future. --- engines/drascula/actors.cpp | 20 ++++++++------------ engines/drascula/animation.cpp | 4 ++-- engines/drascula/drascula.cpp | 9 +++------ engines/drascula/graphics.cpp | 6 +++++- engines/drascula/interface.cpp | 9 --------- engines/drascula/rooms.cpp | 2 +- engines/drascula/sound.cpp | 21 +++++++++------------ engines/drascula/talk.cpp | 10 ++-------- 8 files changed, 30 insertions(+), 51 deletions(-) (limited to 'engines/drascula') diff --git a/engines/drascula/actors.cpp b/engines/drascula/actors.cpp index a1f2c5386c..b459c4539b 100644 --- a/engines/drascula/actors.cpp +++ b/engines/drascula/actors.cpp @@ -196,10 +196,6 @@ void DrasculaEngine::moveCharacters() { return; } } - - byte *srcSurface = extraSurface; - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = tableSurface; if (characterMoved == 0) { curPos[0] = 0; @@ -218,17 +214,17 @@ void DrasculaEngine::moveCharacters() { curPos[1] = 0; if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - srcSurface, screenSurface); + extraSurface, screenSurface); else reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - factor_red[curY + curHeight], srcSurface, screenSurface); + factor_red[curY + curHeight], extraSurface, screenSurface); } else if (trackProtagonist == 1) { if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - srcSurface, screenSurface); + extraSurface, screenSurface); else reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - factor_red[curY + curHeight], srcSurface, screenSurface); + factor_red[curY + curHeight], extraSurface, screenSurface); } else if (trackProtagonist == 2) { if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], @@ -260,17 +256,17 @@ void DrasculaEngine::moveCharacters() { curPos[1] = 0; if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - srcSurface, screenSurface); + extraSurface, screenSurface); else reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - factor_red[curY + curHeight], srcSurface, screenSurface); + factor_red[curY + curHeight], extraSurface, screenSurface); } else if (trackProtagonist == 1) { if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - srcSurface, screenSurface); + extraSurface, screenSurface); else reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - factor_red[curY + curHeight], srcSurface, screenSurface); + factor_red[curY + curHeight], extraSurface, screenSurface); } else if (trackProtagonist == 2) { if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp index 0ed2c61e3f..f672ad3b55 100644 --- a/engines/drascula/animation.cpp +++ b/engines/drascula/animation.cpp @@ -1612,7 +1612,7 @@ void DrasculaEngine::animation_6_6() { removeObject(20); loadPic(96, frontSurface); loadPic(97, frontSurface); - loadPic(97, _lang == kSpanish ? tableSurface : extraSurface); + loadPic(97, extraSurface); loadPic(99, backSurface); doBreak = 1; objExit = 104; @@ -2216,7 +2216,7 @@ void DrasculaEngine::activatePendulum() { _roomNumber = 102; loadPic(102, bgSurface, HALF_PAL); loadPic("an_p1.alg", drawSurface3); - loadPic("an_p2.alg", _lang == kSpanish ? tableSurface : extraSurface); + loadPic("an_p2.alg", extraSurface); loadPic("an_p3.alg", frontSurface); copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3); diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 75a81c20b0..f20f0202bd 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -359,16 +359,13 @@ Common::Error DrasculaEngine::run() { for (i = 0; i < 25; i++) memcpy(crosshairCursor + i * 40, tableSurface + 225 + (56 + i) * 320, 40); - if (_lang == kSpanish) - loadPic(currentChapter == 6 ? 97 : 974, tableSurface); + if (_lang == kSpanish && currentChapter != 6) + loadPic(974, tableSurface); if (currentChapter != 2) { loadPic(99, cursorSurface); loadPic(99, backSurface); - if (currentChapter == 6 && _lang == kSpanish) - loadPic(95, extraSurface); - else - loadPic(97, extraSurface); + loadPic(97, extraSurface); } memset(iconName, 0, sizeof(iconName)); diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 01bd267158..6bfb2e1823 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -217,6 +217,10 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { int letterY = 0, letterX = 0, i; uint len = strlen(said); byte c; + + byte *srcSurface = tableSurface; + if (_lang == kSpanish && currentChapter == 6) + srcSurface = extraSurface; for (uint h = 0; h < len; h++) { c = toupper(said[h]); @@ -241,7 +245,7 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { } // for copyRect(letterX, letterY, screenX, screenY, - CHAR_WIDTH, CHAR_HEIGHT, tableSurface, screenSurface); + CHAR_WIDTH, CHAR_HEIGHT, srcSurface, screenSurface); screenX = screenX + CHAR_WIDTH; if (screenX > 317) { diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp index a09b9da07d..07f192cd4c 100644 --- a/engines/drascula/interface.cpp +++ b/engines/drascula/interface.cpp @@ -123,15 +123,6 @@ void DrasculaEngine::showMenu() { int h, n, x; byte *srcSurface = (currentChapter == 6) ? tableSurface : frontSurface; x = whichObject(); - - // The original uses extraSurface to draw text in draw_abc() in the Spanish version - // while other languages use tableSurface. Here all language use tableSurface for - // chapter 6. However the code in ScummVM was changed to use tableSurface for all - // labguage in draw_abc(). So instead here for the Spanish version we use extraSurface. - // Compared to the original the use of the tableSurface and extraSurface has been swapped - // for the Spanish language all through chapter 6. - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = extraSurface; for (n = 1; n < ARRAYSIZE(inventoryObjects); n++) { h = inventoryObjects[n]; diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index acfc528b0c..57d4517295 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -1501,7 +1501,7 @@ void DrasculaEngine::update_102() { if (actorFrames[kFramePendulum] <= 4) pendulumSurface = drawSurface3; else if (actorFrames[kFramePendulum] <= 11) - pendulumSurface = _lang == kSpanish ? tableSurface : extraSurface; + pendulumSurface = extraSurface; else pendulumSurface = frontSurface; diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 6c0c171664..204a6f231c 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -44,13 +44,10 @@ void DrasculaEngine::updateVolume(Audio::Mixer::SoundType soundType, int prevVol } void DrasculaEngine::volumeControls() { - byte* srcSurface = tableSurface; - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = extraSurface; - if (_lang == kSpanish) - loadPic(95, srcSurface); + if (_lang == kSpanish && currentChapter != 6) + loadPic(95, tableSurface); - copyRect(1, 56, 73, 63, 177, 97, srcSurface, screenSurface); + copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface); updateScreen(73, 63, 73, 63, 177, 97, screenSurface); setCursor(kCursorCrosshair); @@ -67,11 +64,11 @@ void DrasculaEngine::volumeControls() { updateRoom(); - copyRect(1, 56, 73, 63, 177, 97, srcSurface, screenSurface); + copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface); - copyBackground(183, 56, 82, masterVolumeY, 39, 2 + masterVolume * 4, srcSurface, screenSurface); - copyBackground(183, 56, 138, voiceVolumeY, 39, 2 + voiceVolume * 4, srcSurface, screenSurface); - copyBackground(183, 56, 194, musicVolumeY, 39, 2 + musicVolume * 4, srcSurface, screenSurface); + copyBackground(183, 56, 82, masterVolumeY, 39, 2 + masterVolume * 4, tableSurface, screenSurface); + copyBackground(183, 56, 138, voiceVolumeY, 39, 2 + voiceVolume * 4, tableSurface, screenSurface); + copyBackground(183, 56, 194, musicVolumeY, 39, 2 + musicVolume * 4, tableSurface, screenSurface); updateScreen(); @@ -104,8 +101,8 @@ void DrasculaEngine::volumeControls() { } - if (_lang == kSpanish) - loadPic(currentChapter == 6 ? 95 : 974, srcSurface); + if (_lang == kSpanish && currentChapter != 6) + loadPic(974, tableSurface); selectVerb(kVerbNone); diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index 3176c5e0f3..cc329b206b 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -440,12 +440,9 @@ void DrasculaEngine::talk(const char *said, const char *filename) { copyRect(x_talk_izq[face], y_mask_talk, curX + 8, curY - 1, TALK_WIDTH, TALK_HEIGHT, extraSurface, screenSurface); else if (notTowers) { - byte *srcSurface = extraSurface; - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = tableSurface; reduce_hare_chico(x_talk_izq[face], y_mask_talk, curX + (int)((8.0f / 100) * factor_red[MIN(201, curY + curHeight)]), curY, TALK_WIDTH, TALK_HEIGHT, factor_red[MIN(201, curY + curHeight)], - srcSurface, screenSurface); + extraSurface, screenSurface); } updateRefresh(); } else if (trackProtagonist == 1) { @@ -453,11 +450,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) { copyRect(x_talk_dch[face], y_mask_talk, curX + 12, curY, TALK_WIDTH, TALK_HEIGHT, extraSurface, screenSurface); else if (notTowers) { - byte *srcSurface = extraSurface; - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = tableSurface; reduce_hare_chico(x_talk_dch[face], y_mask_talk, curX + (int)((12.0f / 100) * factor_red[MIN(201, curY + curHeight)]), - curY, TALK_WIDTH, TALK_HEIGHT, factor_red[MIN(201, curY + curHeight)], srcSurface, screenSurface); + curY, TALK_WIDTH, TALK_HEIGHT, factor_red[MIN(201, curY + curHeight)], extraSurface, screenSurface); } updateRefresh(); } else if (trackProtagonist == 2) { -- cgit v1.2.3