From a293bbbbb4e349dd7504de26ded47c818cf9464b Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 9 Oct 2011 22:13:30 +0100 Subject: DRASCULA: Remove unecessary VOC header dependency. Also, remove two engines not using VOC from voc.h header. --- engines/drascula/sound.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/drascula') diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 4721d2d369..413a631118 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -23,7 +23,6 @@ #include "audio/audiostream.h" #include "audio/mixer.h" #include "audio/decoders/raw.h" -#include "audio/decoders/voc.h" #include "common/config-manager.h" #include "common/textconsole.h" -- cgit v1.2.3 From 32972a5ffb180c9e8a6a9eae51d0e7564ce76d9e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 23 Oct 2011 17:52:43 +0100 Subject: AD: Switched rest of the engines to new GUIO --- engines/drascula/detection.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'engines/drascula') diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 6ba5597e8a..0969ad4131 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -63,8 +63,6 @@ static const PlainGameDescriptor drasculaGames[] = { namespace Drascula { -using Common::GUIO_NONE; - static const DrasculaGameDescription gameDescriptions[] = { { // Drascula English version @@ -75,7 +73,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -95,7 +93,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, GF_PACKED, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -112,7 +110,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, GF_PACKED, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -129,7 +127,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, GF_PACKED, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -142,7 +140,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, GF_PACKED, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -155,7 +153,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -168,7 +166,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -181,7 +179,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -194,7 +192,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, GF_PACKED, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, { @@ -206,7 +204,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -223,7 +221,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, GF_PACKED, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -240,7 +238,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, GF_PACKED, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -257,7 +255,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, GF_PACKED, - GUIO_NONE + GUIO1(GUIO_NONE) }, }, @@ -270,7 +268,7 @@ class DrasculaMetaEngine : public AdvancedMetaEngine { public: DrasculaMetaEngine() : AdvancedMetaEngine(Drascula::gameDescriptions, sizeof(Drascula::DrasculaGameDescription), drasculaGames) { _singleid = "drascula"; - _guioptions = Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD; + _guioptions = GUIO2(GUIO_NOMIDI, GUIO_NOLAUNCHLOAD); } virtual const char *getName() const { -- cgit v1.2.3 From 6d4189e2edd8c62e00e03799aa9c788b4d669d3b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 2 Nov 2011 23:18:10 +0000 Subject: DRASCULA: Fix warnings --- engines/drascula/drascula.cpp | 2 +- engines/drascula/graphics.cpp | 4 ++-- engines/drascula/saveload.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/drascula') diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index b4f009eb44..5f4e5c5ca9 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -882,7 +882,7 @@ bool DrasculaEngine::loadDrasculaDat() { in.read(buf, 8); buf[8] = '\0'; - if (strcmp(buf, "DRASCULA")) { + if (strcmp(buf, "DRASCULA") != 0) { Common::String errorMessage = "File 'drascula.dat' is corrupt. Get it from the ScummVM website"; GUIErrorMessage(errorMessage); warning("%s", errorMessage.c_str()); diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 9ea20e3e12..f9f6c1f58c 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -361,7 +361,7 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) { curWord = strtok(msg, " "); while (curWord != NULL) { // Check if the word and the current line fit on screen - if (strlen(tmpMessageLine) > 0) + if (tmpMessageLine[0] != '\0') strcat(tmpMessageLine, " "); strcat(tmpMessageLine, curWord); if (textFitsCentered(tmpMessageLine, textX)) { @@ -643,7 +643,7 @@ void DrasculaEngine::waitFrameSSN() { } bool DrasculaEngine::animate(const char *animationFile, int FPS) { - int NFrames = 1; + int NFrames; int cnt = 2; Common::SeekableReadStream *stream = _archives.open(animationFile); diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp index c8622f3c92..35e3821dc4 100644 --- a/engines/drascula/saveload.cpp +++ b/engines/drascula/saveload.cpp @@ -123,7 +123,7 @@ bool DrasculaEngine::saveLoadScreen() { if (mouseX > 115 && mouseY > y + (9 * n) && mouseX < 115 + 175 && mouseY < y + 10 + (9 * n)) { strcpy(select, _saveNames[n]); - if (strcmp(select, "*")) + if (strcmp(select, "*") != 0) selectionMade = 1; else { enterName(); -- cgit v1.2.3 From 4066137f5daf90408aba77d7e96348937d2176d7 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 9 Nov 2011 22:14:32 +0100 Subject: DRASCULA: Don't go straight to inventory after close volume settings. --- engines/drascula/sound.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/drascula') diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 413a631118..cd7ea9cb2f 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -78,6 +78,8 @@ void DrasculaEngine::volumeControls() { ; if (rightMouseButton == 1) { + // Clear this to avoid going straight to the inventory + rightMouseButton = 0; delay(100); break; } -- cgit v1.2.3 From 7600751525441a1f68ebe89ec5d3756b55a17c3f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 13 Nov 2011 20:54:13 +0100 Subject: DRASCULA: Allow faster quit when in the mid of a conversation. This allows quitting ScummVM in only a minimal time when a converstion is running instead of waiting for it to finish. It is still not instant but much better. --- engines/drascula/converse.cpp | 2 +- engines/drascula/drascula.cpp | 2 +- engines/drascula/talk.cpp | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/drascula') diff --git a/engines/drascula/converse.cpp b/engines/drascula/converse.cpp index 6f028e6e12..7abbb3214b 100644 --- a/engines/drascula/converse.cpp +++ b/engines/drascula/converse.cpp @@ -197,7 +197,7 @@ void DrasculaEngine::converse(int index) { // from 1(top) to 31 color_abc(kColorLightGreen); - while (breakOut == 0) { + while (breakOut == 0 && !shouldQuit()) { updateRoom(); if (musicStatus() == 0 && roomMusic != 0) { diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 5f4e5c5ca9..1b3c4038f0 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -789,7 +789,7 @@ void DrasculaEngine::delay(int ms) { _system->delayMillis(10); updateEvents(); _system->updateScreen(); - } while (_system->getMillis() < end); + } while (_system->getMillis() < end && !shouldQuit()); } void DrasculaEngine::pause(int duration) { diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index 6d1509fe3c..c97191fc0a 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -34,6 +34,11 @@ void DrasculaEngine::talkInit(const char *filename) { } bool DrasculaEngine::isTalkFinished() { + if (shouldQuit()) { + stopSound(); + return true; + } + if (getScan() != 0) stopSound(); if (soundIsActive()) -- cgit v1.2.3 From 9a719851712845acaa6096bcb1c9ca2df2d46444 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 13 Nov 2011 21:05:01 +0100 Subject: DRASCULA: Improve confirm quit screen. Now the confirm quit screen still updates the room and allows mouse movement. For me that removes the feeling that ScummVM locked up when I pressed escape. --- engines/drascula/interface.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'engines/drascula') diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp index e3a97087c0..5e4f7a1541 100644 --- a/engines/drascula/interface.cpp +++ b/engines/drascula/interface.cpp @@ -100,9 +100,18 @@ bool DrasculaEngine::confirmExit() { key = getScan(); if (key != 0) break; + + // This gives a better feedback to the user when he is asked to + // confirm whether he wants to quit. It now still updates the room and + // shows mouse cursor movement. Hopefully it will work in all + // locations of the game. + updateRoom(); + color_abc(kColorRed); + centerText(_textsys[1], 160, 87); + updateScreen(); } - if (key == Common::KEYCODE_ESCAPE) { + if (key == Common::KEYCODE_ESCAPE || shouldQuit()) { stopMusic(); return false; } -- cgit v1.2.3 From 15d52025c2b067d9d9d519dca336116682e181f9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 13 Nov 2011 20:37:06 +0100 Subject: DRASCULA: Simplify speech mute handling. This also adds two TODOs to playFile, which are related to how the sound data size is calculated. --- engines/drascula/sound.cpp | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'engines/drascula') diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index cd7ea9cb2f..0c3aded362 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -26,6 +26,7 @@ #include "common/config-manager.h" #include "common/textconsole.h" +#include "common/substream.h" #include "backends/audiocd/audiocd.h" @@ -165,29 +166,42 @@ void DrasculaEngine::MusicFadeout() { void DrasculaEngine::playFile(const char *fname) { Common::SeekableReadStream *stream = _archives.open(fname); if (stream) { - int soundSize = stream->size(); - byte *soundData = (byte *)malloc(soundSize); - - if (!(!strcmp(fname, "3.als") && soundSize == 145166 && _lang != kSpanish)) { - stream->seek(32); - } else { + // TODO: I don't really see a reason why we have this offset here. The + // file "S3.ALS" for example does not contain any silence at the start + // nor end. Thus it looks like this cuts off part of the sound. + // + // Would be good if someone could double check this and clarify why + // the code is working like this if it is fine and otherwise just fix + // it. + int startOffset = 32; + int soundSize = stream->size() - startOffset; + + if (!strcmp(fname, "3.als") && soundSize == 145166 && _lang != kSpanish) { // WORKAROUND: File 3.als with English speech files has a big silence at // its beginning and end. We seek past the silence at the beginning, // and ignore the silence at the end // Fixes bug #2111815 - "DRASCULA: Voice delayed" - stream->seek(73959, SEEK_SET); - soundSize = 117158 - 73959; + startOffset = 73959; + // TODO: The old code also subtracted 64 later on when creating + // the RAW audio stream. It would be good if someone could check + // whether this has been properly taking into account when + // calculating the soundSize. If it hasn't been taken into account + // when it is probably better to remove the minus 64 here. + soundSize = 117158 - 73959 - 64; } - stream->read(soundData, soundSize); - delete stream; + Common::SeekableReadStream *subStream = new Common::SeekableSubReadStream( + stream, startOffset, startOffset + soundSize, DisposeAfterUse::YES); + if (!subStream) { + warning("playFile: Out of memory"); + delete stream; + return; + } _subtitlesDisabled = !ConfMan.getBool("subtitles"); - if (ConfMan.getBool("speech_mute")) - memset(soundData, 0x80, soundSize); // Mute speech but keep the pause - Audio::AudioStream *sound = Audio::makeRawStream(soundData, soundSize - 64, - 11025, Audio::FLAG_UNSIGNED); + Audio::AudioStream *sound = Audio::makeRawStream(subStream, 11025, + Audio::FLAG_UNSIGNED); _mixer->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, sound); } else warning("playFile: Could not open %s", fname); -- cgit v1.2.3 From c71ed522de1bc1e3dcd84ca8cf759d7624571b7c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 16 Nov 2011 12:03:31 +0200 Subject: DRASCULA: Further cleanup of the sound playing code --- engines/drascula/sound.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'engines/drascula') diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 0c3aded362..112f6fd06c 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -166,14 +166,7 @@ void DrasculaEngine::MusicFadeout() { void DrasculaEngine::playFile(const char *fname) { Common::SeekableReadStream *stream = _archives.open(fname); if (stream) { - // TODO: I don't really see a reason why we have this offset here. The - // file "S3.ALS" for example does not contain any silence at the start - // nor end. Thus it looks like this cuts off part of the sound. - // - // Would be good if someone could double check this and clarify why - // the code is working like this if it is fine and otherwise just fix - // it. - int startOffset = 32; + int startOffset = 0; int soundSize = stream->size() - startOffset; if (!strcmp(fname, "3.als") && soundSize == 145166 && _lang != kSpanish) { @@ -182,12 +175,7 @@ void DrasculaEngine::playFile(const char *fname) { // and ignore the silence at the end // Fixes bug #2111815 - "DRASCULA: Voice delayed" startOffset = 73959; - // TODO: The old code also subtracted 64 later on when creating - // the RAW audio stream. It would be good if someone could check - // whether this has been properly taking into account when - // calculating the soundSize. If it hasn't been taken into account - // when it is probably better to remove the minus 64 here. - soundSize = 117158 - 73959 - 64; + soundSize = soundSize - startOffset - 26306; } Common::SeekableReadStream *subStream = new Common::SeekableSubReadStream( @@ -198,8 +186,6 @@ void DrasculaEngine::playFile(const char *fname) { return; } - _subtitlesDisabled = !ConfMan.getBool("subtitles"); - Audio::AudioStream *sound = Audio::makeRawStream(subStream, 11025, Audio::FLAG_UNSIGNED); _mixer->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, sound); -- cgit v1.2.3 From bab4b6f7295f6fb960ebbf44b009bd6adbd0d33e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 16 Nov 2011 22:38:58 +0100 Subject: LAUNCHER: Introduce GUIO0() in order to replace GUIO1(GUIO_NONE) --- engines/drascula/detection.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'engines/drascula') diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 0969ad4131..3310ac0598 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -73,7 +73,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -93,7 +93,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, GF_PACKED, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -110,7 +110,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, GF_PACKED, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -127,7 +127,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, GF_PACKED, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -140,7 +140,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, GF_PACKED, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -153,7 +153,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -166,7 +166,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -179,7 +179,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -192,7 +192,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, GF_PACKED, - GUIO1(GUIO_NONE) + GUIO0() }, }, { @@ -204,7 +204,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -221,7 +221,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, GF_PACKED, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -238,7 +238,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, GF_PACKED, - GUIO1(GUIO_NONE) + GUIO0() }, }, @@ -255,7 +255,7 @@ static const DrasculaGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, GF_PACKED, - GUIO1(GUIO_NONE) + GUIO0() }, }, -- cgit v1.2.3 From a0dbe45a454f8b64efb784131b13b942ee060675 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Fri, 25 Nov 2011 06:30:10 +0000 Subject: DRASCULA: Add fix for crash/OOB memory accesses in bug #3440895 This bug is "DRASCULA-IT: Crash/graphic glitch at castle towers". The crash was due to width and height values being passed to copyBackground() being invalid due to out of bounds read from the factor_red array. This adds debugging statements and fixes the crash by clipping accesses to the maximum index of factor_red. This doesn't however fix the observed GFX glitch, but stops it being a segfault. --- engines/drascula/graphics.cpp | 1 + engines/drascula/talk.cpp | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'engines/drascula') diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index f9f6c1f58c..590561f0bd 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -154,6 +154,7 @@ void DrasculaEngine::showFrame(Common::SeekableReadStream *stream, bool firstFra } void DrasculaEngine::copyBackground(int xorg, int yorg, int xdes, int ydes, int width, int height, byte *src, byte *dest) { + debug(1, "DrasculaEngine::copyBackground(xorg:%d, yorg:%d, xdes:%d, ydes:%d width:%d height:%d, src, dest)", xorg, yorg, xdes, ydes, width,height); dest += xdes + ydes * 320; src += xorg + yorg * 320; /* Unoptimized code diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index c97191fc0a..a326852e96 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -372,6 +372,7 @@ void DrasculaEngine::talk(int index) { } void DrasculaEngine::talk(const char *said, const char *filename) { + debug(1, "DrasculaEngine::talk(said:\"%s\", filename:\"%s\")", said, filename); int talkOffset = 0; if (currentChapter != 2) talkOffset = 1; @@ -414,8 +415,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) { if (currentChapter == 2) copyBackground(curX, curY, OBJWIDTH + 1, 0, curWidth, talkHeight - 1, screenSurface, drawSurface3); else - copyBackground(curX, curY, OBJWIDTH + 1, 0, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]), - (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]), + copyBackground(curX, curY, OBJWIDTH + 1, 0, (int)(((float)curWidth / 100) * factor_red[MIN(201, curY + curHeight)]), + (int)(((float)(talkHeight - 1) / 100) * factor_red[MIN(201, curY + curHeight)]), screenSurface, drawSurface3); moveCharacters(); @@ -424,8 +425,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) { if (!strcmp(menuBackground, "99.alg") || !strcmp(menuBackground, "994.alg")) copyBackground(OBJWIDTH + 1, 0, curX, curY, curWidth, talkHeight - 1, drawSurface3, screenSurface); } else { - copyBackground(OBJWIDTH + 1, 0, curX, curY, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]), - (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]), + copyBackground(OBJWIDTH + 1, 0, curX, curY, (int)(((float)curWidth / 100) * factor_red[MIN(201, curY + curHeight)]), + (int)(((float)(talkHeight - 1) / 100) * factor_red[MIN(201, curY + curHeight)]), drawSurface3, screenSurface); } @@ -434,8 +435,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) { copyRect(x_talk_izq[face], y_mask_talk, curX + 8, curY - 1, talkWidth, talkHeight, extraSurface, screenSurface); else - reduce_hare_chico(x_talk_izq[face], y_mask_talk, curX + (int)((8.0f / 100) * factor_red[curY + curHeight]), - curY, talkWidth, talkHeight, factor_red[curY + curHeight], + reduce_hare_chico(x_talk_izq[face], y_mask_talk, curX + (int)((8.0f / 100) * factor_red[MIN(201, curY + curHeight)]), + curY, talkWidth, talkHeight, factor_red[MIN(201, curY + curHeight)], extraSurface, screenSurface); updateRefresh(); @@ -444,8 +445,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) { copyRect(x_talk_dch[face], y_mask_talk, curX + 12, curY, talkWidth, talkHeight, extraSurface, screenSurface); else - reduce_hare_chico(x_talk_dch[face], y_mask_talk, curX + (int)((12.0f / 100) * factor_red[curY + curHeight]), - curY, talkWidth, talkHeight, factor_red[curY + curHeight], extraSurface, screenSurface); + reduce_hare_chico(x_talk_dch[face], y_mask_talk, curX + (int)((12.0f / 100) * factor_red[MIN(201, curY + curHeight)]), + curY, talkWidth, talkHeight, factor_red[MIN(201, curY + curHeight)], extraSurface, screenSurface); updateRefresh(); } else if (trackProtagonist == 2) { if (currentChapter == 2) @@ -453,8 +454,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) { frontSurface, screenSurface); else reduce_hare_chico(x_talk_izq[face], y_mask_talk, - talkOffset + curX + (int)((12.0f / 100) * factor_red[curY + curHeight]), - curY, talkWidth, talkHeight, factor_red[curY + curHeight], + talkOffset + curX + (int)((12.0f / 100) * factor_red[MIN(201, curY + curHeight)]), + curY, talkWidth, talkHeight, factor_red[MIN(201, curY + curHeight)], frontSurface, screenSurface); updateRefresh(); } else if (trackProtagonist == 3) { @@ -463,8 +464,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) { frontSurface, screenSurface); else reduce_hare_chico(x_talk_dch[face], y_mask_talk, - talkOffset + curX + (int)((8.0f / 100) * factor_red[curY + curHeight]), - curY, talkWidth,talkHeight, factor_red[curY + curHeight], + talkOffset + curX + (int)((8.0f / 100) * factor_red[MIN(201, curY + curHeight)]), + curY, talkWidth,talkHeight, factor_red[MIN(201, curY + curHeight)], frontSurface, screenSurface); updateRefresh(); } -- cgit v1.2.3