aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/lure/room.cpp7
-rw-r--r--engines/lure/surface.cpp5
2 files changed, 5 insertions, 7 deletions
diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp
index 1be95ba3d4..cb817abbca 100644
--- a/engines/lure/room.cpp
+++ b/engines/lure/room.cpp
@@ -491,18 +491,17 @@ void Room::update() {
if (_hotspotId != 0)
s.writeString(0, 0, _hotspotName, false);
} else {
- // Word wrap (if necessary) the status line and dispaly it
- char *statusLineCopy = strdup(_statusLine);
+ // Word wrap (if necessary) the status line and display it
+ Common::String statusLineCopy(_statusLine);
char **lines;
uint8 numLines;
int16 yPos = 0;
- s.wordWrap(statusLineCopy, s.width(), lines, numLines);
+ s.wordWrap(statusLineCopy.begin(), s.width(), lines, numLines);
for (int lineNum = 0; lineNum < numLines; ++lineNum) {
s.writeString(0, yPos, lines[lineNum], false, white);
yPos += FONT_HEIGHT;
}
Memory::dealloc(lines);
- Memory::dealloc(statusLineCopy);
}
// Debug - if the bottle object is on layer 0FEh, then display it's surface
diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp
index e9de795670..55ba28de9a 100644
--- a/engines/lure/surface.cpp
+++ b/engines/lure/surface.cpp
@@ -479,16 +479,15 @@ Surface *Surface::newDialog(uint16 width, uint8 numLines, const char **lines, bo
Surface *Surface::newDialog(uint16 width, const char *line, int color) {
char **lines;
- char *lineCopy = strdup(line);
+ Common::String lineCopy(line);
uint8 numLines;
- wordWrap(lineCopy, width - (Surface::textX() * 2), lines, numLines);
+ wordWrap(lineCopy.begin(), width - (Surface::textX() * 2), lines, numLines);
// Create the dialog
Surface *result = newDialog(width, numLines, const_cast<const char **>(lines), true, color);
// Deallocate used resources
free(lines);
- free(lineCopy);
return result;
}