mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 09:23:37 +00:00
ADL: Move ASCII print function into Display class
This commit is contained in:
parent
fd8a5f419f
commit
86d58534e7
@ -87,7 +87,7 @@ Common::Error AdlEngine::run() {
|
||||
}
|
||||
|
||||
_display->setMode(DISPLAY_MODE_MIXED);
|
||||
printASCIIString("\r\r\r\r\r");
|
||||
_display->printAsciiString("\r\r\r\r\r");
|
||||
|
||||
while (1) {
|
||||
uint verb = 0, noun = 0;
|
||||
@ -119,7 +119,7 @@ Common::Error AdlEngine::run() {
|
||||
// means that restoring a game will always run through
|
||||
// the global commands and increase the move counter
|
||||
// before the first user input.
|
||||
printASCIIString("\r");
|
||||
_display->printAsciiString("\r");
|
||||
_isRestoring = false;
|
||||
verb = _restoreVerb;
|
||||
noun = _restoreNoun;
|
||||
@ -889,16 +889,6 @@ void AdlEngine::getInput(uint &verb, uint &noun) {
|
||||
}
|
||||
}
|
||||
|
||||
void AdlEngine::printASCIIString(const Common::String &str) const {
|
||||
Common::String aStr;
|
||||
|
||||
Common::String::const_iterator it;
|
||||
for (it = str.begin(); it != str.end(); ++it)
|
||||
aStr += APPLECHAR(*it);
|
||||
|
||||
_display->printString(aStr);
|
||||
}
|
||||
|
||||
Common::String AdlEngine::inputString(byte prompt) const {
|
||||
Common::String s;
|
||||
|
||||
|
@ -146,7 +146,6 @@ protected:
|
||||
Common::String readStringAt(Common::SeekableReadStream &stream, uint offset, byte until = 0) const;
|
||||
|
||||
virtual void printMessage(uint idx, bool wait = true) const;
|
||||
void printASCIIString(const Common::String &str) const;
|
||||
void delay(uint32 ms) const;
|
||||
|
||||
Common::String inputString(byte prompt = 0) const;
|
||||
|
@ -289,6 +289,16 @@ void Display::printString(const Common::String &str) {
|
||||
updateTextScreen();
|
||||
}
|
||||
|
||||
void Display::printAsciiString(const Common::String &str) {
|
||||
Common::String aStr;
|
||||
|
||||
Common::String::const_iterator it;
|
||||
for (it = str.begin(); it != str.end(); ++it)
|
||||
aStr += APPLECHAR(*it);
|
||||
|
||||
printString(aStr);
|
||||
}
|
||||
|
||||
void Display::setCharAtCursor(byte c) {
|
||||
_textBuf[_cursorPos] = c;
|
||||
}
|
||||
|
@ -70,6 +70,7 @@ public:
|
||||
void moveCursorForward();
|
||||
void moveCursorBackward();
|
||||
void printString(const Common::String &str);
|
||||
void printAsciiString(const Common::String &str);
|
||||
void setCharAtCursor(byte c);
|
||||
void showCursor(bool enable);
|
||||
|
||||
|
@ -55,16 +55,16 @@ void HiRes1Engine::runIntro() const {
|
||||
Common::String str;
|
||||
|
||||
str = readStringAt(basic, IDI_HR1_OFS_PD_TEXT_0, '"');
|
||||
printASCIIString(str + '\r');
|
||||
_display->printAsciiString(str + '\r');
|
||||
|
||||
str = readStringAt(basic, IDI_HR1_OFS_PD_TEXT_1, '"');
|
||||
printASCIIString(str + "\r\r");
|
||||
_display->printAsciiString(str + "\r\r");
|
||||
|
||||
str = readStringAt(basic, IDI_HR1_OFS_PD_TEXT_2, '"');
|
||||
printASCIIString(str + "\r\r");
|
||||
_display->printAsciiString(str + "\r\r");
|
||||
|
||||
str = readStringAt(basic, IDI_HR1_OFS_PD_TEXT_3, '"');
|
||||
printASCIIString(str + '\r');
|
||||
_display->printAsciiString(str + '\r');
|
||||
|
||||
inputKey();
|
||||
if (g_engine->shouldQuit())
|
||||
@ -120,7 +120,7 @@ void HiRes1Engine::runIntro() const {
|
||||
}
|
||||
}
|
||||
|
||||
printASCIIString("\r");
|
||||
_display->printAsciiString("\r");
|
||||
|
||||
file.close();
|
||||
|
||||
@ -240,7 +240,7 @@ void HiRes1Engine::restartGame() {
|
||||
initState();
|
||||
_display->printString(_gameStrings.pressReturn);
|
||||
inputString(); // Missing in the original
|
||||
printASCIIString("\r\r\r\r\r");
|
||||
_display->printAsciiString("\r\r\r\r\r");
|
||||
}
|
||||
|
||||
void HiRes1Engine::loadData() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user