aboutsummaryrefslogtreecommitdiff
path: root/engines/adl/hires6.cpp
diff options
context:
space:
mode:
authorWalter van Niftrik2016-04-11 17:34:53 +0200
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commit7e9a8c00728592290c2c4f2ba0aa5bf3bf7efff9 (patch)
tree4d508719b617bbf4d3cdb6bbd3064a5abd62b294 /engines/adl/hires6.cpp
parentbf520ca3211a1638396efe71e19291e7dbd979c0 (diff)
downloadscummvm-rg350-7e9a8c00728592290c2c4f2ba0aa5bf3bf7efff9.tar.gz
scummvm-rg350-7e9a8c00728592290c2c4f2ba0aa5bf3bf7efff9.tar.bz2
scummvm-rg350-7e9a8c00728592290c2c4f2ba0aa5bf3bf7efff9.zip
ADL: Partially implement hires6 var handling
Diffstat (limited to 'engines/adl/hires6.cpp')
-rw-r--r--engines/adl/hires6.cpp39
1 files changed, 25 insertions, 14 deletions
diff --git a/engines/adl/hires6.cpp b/engines/adl/hires6.cpp
index 37c7154c81..5bc7711d13 100644
--- a/engines/adl/hires6.cpp
+++ b/engines/adl/hires6.cpp
@@ -236,6 +236,13 @@ void HiRes6Engine::initGameState() {
_state.items.push_back(item);
}
+
+ _currVerb = _currNoun = 0;
+}
+
+void HiRes6Engine::printRoomDescription() {
+ setVar(2, 0xff);
+ AdlEngine_v3::printRoomDescription();
}
void HiRes6Engine::applyDataBlockOffset(byte &track, byte &sector) const {
@@ -256,24 +263,28 @@ void HiRes6Engine::printString(const Common::String &str) {
++found;
if (found == 3)
found = 0;
- continue;
- }
-
- switch (found) {
- case 0:
- s += str[i];
- break;
- case 1:
- if (getVar(27) == 0)
- s += str[i];
- break;
- case 2:
- if (getVar(27) == 1)
+ } else {
+ if (found == 0 || found - 1 == getVar(27))
s += str[i];
}
}
- AdlEngine_v2::printString(s);
+ if (getVar(2) != 0xff) {
+ AdlEngine_v2::printString(s);
+ } else {
+ if (getVar(26) == 0) {
+ if (str.size() != 1 || APPLECHAR(str[0]) != APPLECHAR(' '))
+ return AdlEngine_v2::printString(s);
+ setVar(2, APPLECHAR(' '));
+ } else if (getVar(26) == 0xff) {
+ setVar(2, 'P');
+ } else {
+ setVar(26, _state.room);
+ setVar(2, 1);
+ }
+
+ doAllCommands(_globalCommands, _currVerb, _currNoun);
+ }
}
Engine *HiRes6Engine_create(OSystem *syst, const AdlGameDescription *gd) {