[Scummvm-git-logs] scummvm master -> dbad3d644366abe9c2342f62a812fefb4865babc
alxpnv
a04198622 at gmail.com
Wed Oct 27 10:18:26 UTC 2021
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:
dbad3d6443 ASYLUM: generalize handling of multipage dialogs
Commit: dbad3d644366abe9c2342f62a812fefb4865babc
https://github.com/scummvm/scummvm/commit/dbad3d644366abe9c2342f62a812fefb4865babc
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-10-27T13:20:47+03:00
Commit Message:
ASYLUM: generalize handling of multipage dialogs
Changed paths:
engines/asylum/resources/encounters.cpp
diff --git a/engines/asylum/resources/encounters.cpp b/engines/asylum/resources/encounters.cpp
index 34edcd4a4f..07e7fc5457 100644
--- a/engines/asylum/resources/encounters.cpp
+++ b/engines/asylum/resources/encounters.cpp
@@ -74,6 +74,14 @@ const char *opcodeNames[] = {
"SetCounterFromGameFlag"
};
+static const struct {
+ int textResourceId;
+ int millis;
+} tickDecrements[] = {
+ {0x0A8C, 1000},
+ {0x0CFC, 5000}
+};
+
Common::String Encounter::ScriptEntry::toString() {
return Common::String::format("0x%02X: %s (%d, %d)", opcode, OPCODE_NAME(opcode), param1, param2);
}
@@ -1195,8 +1203,11 @@ void Encounter::drawSubtitle(char *text, ResourceId font, int16 y) {
_tick = _vm->getTick() + 1000 * (getResource()->get(_soundResourceId/*getSpeech()->getSoundResourceId()*/)->size / 11025) / (uint16)_data_455B3C; // TODO replace with speech
// WORKAROUND: Handle multipage dialogs
- if (_data_455B70 - 1 > 8)
- _tick -= 1000 * ((_data_455B70 - 1) % 8);
+ for (int i = 0; i < ARRAYSIZE(tickDecrements); i++)
+ if (getSpeech()->getTextResourceId() == tickDecrements[i].textResourceId) {
+ _tick -= tickDecrements[i].millis;
+ break;
+ }
}
getText()->draw(_data_455BF0, 7, kTextCenter, Common::Point(x, y), 16, width, text);
More information about the Scummvm-git-logs
mailing list