aboutsummaryrefslogtreecommitdiff
path: root/engines/access/scripts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/access/scripts.cpp')
-rw-r--r--engines/access/scripts.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp
index 3c60065bfe..958696e09d 100644
--- a/engines/access/scripts.cpp
+++ b/engines/access/scripts.cpp
@@ -180,11 +180,7 @@ void Scripts::cmdNull() {
void Scripts::cmdPrint() {
// Get a text line for display
- Common::String msg;
- byte c;
- while ((c = (char)_data->readByte()) != '\0')
- msg += c;
-
+ Common::String msg = readString();
printString(msg);
}
@@ -208,6 +204,15 @@ void Scripts::printString(const Common::String &msg) {
_vm->_screen->restoreBlock();
}
+Common::String Scripts::readString() {
+ Common::String msg;
+ byte c;
+ while ((c = (char)_data->readByte()) != '\0')
+ msg += c;
+
+ return msg;
+}
+
void Scripts::cmdRetPos() {
_endFlag = true;
_returnCode = 0;