aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2016-01-05 23:00:06 +0100
committerWillem Jan Palenstijn2016-01-05 23:00:06 +0100
commit15bbcff786d830bf665901b7bf02591fc818360c (patch)
tree8e1b826d10105092707c080f4f622c2a9df8eb6c /engines
parent1eed77c376d9131be926a6e2f587afdb5e52b456 (diff)
downloadscummvm-rg350-15bbcff786d830bf665901b7bf02591fc818360c.tar.gz
scummvm-rg350-15bbcff786d830bf665901b7bf02591fc818360c.tar.bz2
scummvm-rg350-15bbcff786d830bf665901b7bf02591fc818360c.zip
LAB: Fix switching between texts in monitor
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/lab.h2
-rw-r--r--engines/lab/special.cpp13
2 files changed, 8 insertions, 7 deletions
diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index 2c3a723f3e..0e9cdd36b1 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -461,7 +461,7 @@ private:
/**
* Processes user input.
*/
- void processMonitor(const char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect);
+ void processMonitor(const Common::String &ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect);
/**
* Figures out what a room's coordinates should be.
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index d06d5911ee..48e32cb1dc 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -334,10 +334,11 @@ void LabEngine::drawMonText(const char *text, TextFont *monitorFont, Common::Rec
_event->mouseShow();
}
-void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect) {
+void LabEngine::processMonitor(const Common::String &ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect) {
Common::String startFileName = _monitorTextFilename;
const CloseData *startClosePtr = _closeDataPtr, *lastClosePtr[10];
uint16 depth = 0;
+ Common::String text = ntext;
lastClosePtr[0] = _closeDataPtr;
@@ -356,7 +357,7 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
_monitorPage = 0;
_monitorTextFilename = filename;
- Common::String text = _resource->getText(_monitorTextFilename);
+ text = _resource->getText(_monitorTextFilename);
_graphics->fade(false);
drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
_graphics->fade(true);
@@ -402,7 +403,7 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
}
} else if (_monitorPage > 0) {
_monitorPage = 0;
- drawMonText(ntext, monitorFont, textRect, isInteractive);
+ drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
}
} else if (mouseX < _utils->vgaScaleX(259)) {
// empty region; ignore
@@ -410,12 +411,12 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
// Page down button
if (!_lastPage) {
_monitorPage += 1;
- drawMonText(ntext, monitorFont, textRect, isInteractive);
+ drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
}
} else if (_monitorPage >= 1) {
// Page up button
_monitorPage -= 1;
- drawMonText(ntext, monitorFont, textRect, isInteractive);
+ drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
}
} else if (isInteractive) {
const CloseData *tmpClosePtr = _closeDataPtr;
@@ -458,7 +459,7 @@ void LabEngine::doMonitor(const Common::String background, const Common::String
drawMonText(ntext.c_str(), monitorFont, scaledRect, isinteractive);
_event->mouseShow();
_graphics->fade(true);
- processMonitor(ntext.c_str(), monitorFont, isinteractive, scaledRect);
+ processMonitor(ntext, monitorFont, isinteractive, scaledRect);
_graphics->fade(false);
_event->mouseHide();
_graphics->freeFont(&monitorFont);