diff options
author | Walter van Niftrik | 2017-02-20 22:47:22 +0100 |
---|---|---|
committer | Walter van Niftrik | 2017-02-20 22:53:04 +0100 |
commit | 8ca719b2bc0ca0539ceb995067a1bdf7a183eb05 (patch) | |
tree | f2a9d6eba597862e04fc30f2f866c84f384b5502 /engines/adl | |
parent | 27c956a255bd00bde3215c68f1c39c77343f3dc8 (diff) | |
download | scummvm-rg350-8ca719b2bc0ca0539ceb995067a1bdf7a183eb05.tar.gz scummvm-rg350-8ca719b2bc0ca0539ceb995067a1bdf7a183eb05.tar.bz2 scummvm-rg350-8ca719b2bc0ca0539ceb995067a1bdf7a183eb05.zip |
ADL: Clean up/comment hires6 string printing
Diffstat (limited to 'engines/adl')
-rw-r--r-- | engines/adl/hires6.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/engines/adl/hires6.cpp b/engines/adl/hires6.cpp index 10d8580fcc..b3b66f6873 100644 --- a/engines/adl/hires6.cpp +++ b/engines/adl/hires6.cpp @@ -430,6 +430,8 @@ void HiRes6Engine::printString(const Common::String &str) { Common::String s; uint found = 0; + // Variable 27 is 1 when Kira is present, 0 otherwise. It's used for choosing + // between singular and plural variants of a string. // This does not emulate the corner cases of the original, hence this check if (getVar(27) > 1) error("Invalid value %i encountered for variable 27", getVar(27)); @@ -445,21 +447,24 @@ void HiRes6Engine::printString(const Common::String &str) { } } - if (getVar(2) != 0xff) { - AdlEngine_v5::printString(s); - } else { + // Variables 2 and 26 are used for controlling the printing of room descriptions + if (getVar(2) == 0xff) { if (getVar(26) == 0) { + // This checks for special room description string " " if (str.size() != 1 || APPLECHAR(str[0]) != APPLECHAR(' ')) return AdlEngine_v5::printString(s); - setVar(2, APPLECHAR(' ')); - } else if (getVar(26) != 0xff) { - setVar(2, 'P'); - } else { + setVar(2, 160); + } else if (getVar(26) == 0xff) { + // Storing the room number in a variable allows for range comparisons setVar(26, _state.room); setVar(2, 1); + } else { + setVar(2, 80); } doAllCommands(_globalCommands, _currVerb, _currNoun); + } else { + AdlEngine_v5::printString(s); } } |