aboutsummaryrefslogtreecommitdiff
path: root/engines/adl/hires2.cpp
diff options
context:
space:
mode:
authorWalter van Niftrik2016-03-20 07:56:53 +0100
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commita7a371c63d1570714c7b5cb766f6acc3fd26f5fc (patch)
treed6186ca34ee6c5c85665e86523f7b0dd26a51d22 /engines/adl/hires2.cpp
parente7c93489e4f6055c988d048c9c479de3eff94ece (diff)
downloadscummvm-rg350-a7a371c63d1570714c7b5cb766f6acc3fd26f5fc.tar.gz
scummvm-rg350-a7a371c63d1570714c7b5cb766f6acc3fd26f5fc.tar.bz2
scummvm-rg350-a7a371c63d1570714c7b5cb766f6acc3fd26f5fc.zip
ADL: Implement time opcode
Diffstat (limited to 'engines/adl/hires2.cpp')
-rw-r--r--engines/adl/hires2.cpp61
1 files changed, 1 insertions, 60 deletions
diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp
index 6f517dacdb..49e70a1631 100644
--- a/engines/adl/hires2.cpp
+++ b/engines/adl/hires2.cpp
@@ -84,6 +84,7 @@ void HiRes2Engine::init() {
_strings.nounError = readStringAt(f, IDI_HR2_OFS_STR_NOUN_ERROR);
_strings.playAgain = readStringAt(f, IDI_HR2_OFS_STR_PLAY_AGAIN);
_strings.pressReturn = readStringAt(f, IDI_HR2_OFS_STR_PRESS_RETURN);
+ _strings_v2.time = readStringAt(f, IDI_HR2_OFS_STR_TIME, 0xff);
_messageIds.cantGoThere = IDI_HR2_MSG_CANT_GO_THERE;
_messageIds.dontUnderstand = IDI_HR2_MSG_DONT_UNDERSTAND;
@@ -248,66 +249,6 @@ void HiRes2Engine::checkInput(byte verb, byte noun) {
AdlEngine::checkInput(verb, noun);
}
-void HiRes2Engine::checkTextOverflow(char c) {
- if (c != APPLECHAR('\r'))
- return;
-
- ++_linesPrinted;
-
- if (_linesPrinted < 4)
- return;
-
- _linesPrinted = 0;
- _display->updateTextScreen();
- bell();
-
- while (true) {
- char key = inputKey(false);
-
- if (shouldQuit())
- return;
-
- if (key == APPLECHAR('\r'))
- break;
-
- bell(3);
- }
-}
-
-void HiRes2Engine::printString(const Common::String &str) {
- Common::String s(str);
- byte endPos = TEXT_WIDTH - 1;
- byte pos = 0;
-
- while (true) {
- while (pos != endPos && pos != s.size()) {
- s.setChar(APPLECHAR(s[pos]), pos);
- ++pos;
- }
-
- if (pos == s.size())
- break;
-
- while (s[pos] != APPLECHAR(' ') && s[pos] != APPLECHAR('\r'))
- --pos;
-
- s.setChar(APPLECHAR('\r'), pos);
- endPos = pos + TEXT_WIDTH;
- ++pos;
- }
-
- pos = 0;
- while (pos != s.size()) {
- checkTextOverflow(s[pos]);
- _display->printChar(s[pos]);
- ++pos;
- }
-
- checkTextOverflow(APPLECHAR('\r'));
- _display->printChar(APPLECHAR('\r'));
- _display->updateTextScreen();
-}
-
Engine *HiRes2Engine_create(OSystem *syst, const AdlGameDescription *gd) {
return new HiRes2Engine(syst, gd);
}