diff options
author | Walter van Niftrik | 2018-08-02 10:56:49 +0200 |
---|---|---|
committer | Walter van Niftrik | 2019-07-16 16:24:19 +0200 |
commit | ce8a8409332ff28a80de918a5771baa20d6980d1 (patch) | |
tree | 99ce86ba7c7d343b8951490c41644e9383f342fe /engines/adl/adl_v2.cpp | |
parent | 0cd761086a72e9fd83c23f1c6267fe79829f3f07 (diff) | |
download | scummvm-rg350-ce8a8409332ff28a80de918a5771baa20d6980d1.tar.gz scummvm-rg350-ce8a8409332ff28a80de918a5771baa20d6980d1.tar.bz2 scummvm-rg350-ce8a8409332ff28a80de918a5771baa20d6980d1.zip |
ADL: Remove APPLECHAR macro
Diffstat (limited to 'engines/adl/adl_v2.cpp')
-rw-r--r-- | engines/adl/adl_v2.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp index aed38beaed..81ff145689 100644 --- a/engines/adl/adl_v2.cpp +++ b/engines/adl/adl_v2.cpp @@ -101,7 +101,7 @@ void AdlEngine_v2::advanceClock() { } void AdlEngine_v2::checkTextOverflow(char c) { - if (c != APPLECHAR('\r')) + if (c != _display->asciiToNative('\r')) return; ++_linesPrinted; @@ -135,7 +135,7 @@ void AdlEngine_v2::handleTextOverflow() { if (shouldQuit()) return; - if (key == APPLECHAR('\r')) + if (key == _display->asciiToNative('\r')) break; bell(3); @@ -158,16 +158,19 @@ void AdlEngine_v2::printString(const Common::String &str) { uint startPos = 0; uint pos = 0; + const char spaceChar = _display->asciiToNative(' '); + const char returnChar = _display->asciiToNative('\r'); + while (pos < s.size()) { - s.setChar(APPLECHAR(s[pos]), pos); + s.setChar(_display->asciiToNative(s[pos]), pos); if (pos == endPos) { - while (s[pos] != APPLECHAR(' ') && s[pos] != APPLECHAR('\r')) { + while (s[pos] != spaceChar && s[pos] != returnChar) { if (pos-- == startPos) error("Word wrapping failed"); } - s.setChar(APPLECHAR('\r'), pos); + s.setChar(returnChar, pos); endPos = pos + textWidth; startPos = pos + 1; } @@ -180,8 +183,8 @@ void AdlEngine_v2::printString(const Common::String &str) { _display->printChar(s[pos]); } - checkTextOverflow(APPLECHAR('\r')); - _display->printChar(APPLECHAR('\r')); + checkTextOverflow(returnChar); + _display->printChar(returnChar); _display->copyTextSurface(); } @@ -565,10 +568,12 @@ int AdlEngine_v2::o_tellTime(ScriptEnv &e) { Common::String time = _strings_v2.time; - time.setChar(APPLECHAR('0') + _state.time.hours / 10, 12); - time.setChar(APPLECHAR('0') + _state.time.hours % 10, 13); - time.setChar(APPLECHAR('0') + _state.time.minutes / 10, 15); - time.setChar(APPLECHAR('0') + _state.time.minutes % 10, 16); + const char zeroChar = _display->asciiToNative('0'); + + time.setChar(zeroChar + _state.time.hours / 10, 12); + time.setChar(zeroChar + _state.time.hours % 10, 13); + time.setChar(zeroChar + _state.time.minutes / 10, 15); + time.setChar(zeroChar + _state.time.minutes % 10, 16); printString(time); @@ -611,8 +616,8 @@ int AdlEngine_v2::askForSlot(const Common::String &question) { if (shouldQuit()) return -1; - if (input.size() > 0 && input[0] >= APPLECHAR('A') && input[0] <= APPLECHAR('O')) - return input[0] - APPLECHAR('A'); + if (input.size() > 0 && input[0] >= _display->asciiToNative('A') && input[0] <= _display->asciiToNative('O')) + return input[0] - _display->asciiToNative('A'); } } |