From 800987ab95c4faa5532d735a85516fd09f5de724 Mon Sep 17 00:00:00 2001 From: yinsimei Date: Tue, 11 Jul 2017 14:57:31 +0200 Subject: SLUDGE: replace char *by Common::String --- engines/sludge/statusba.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'engines/sludge/statusba.cpp') diff --git a/engines/sludge/statusba.cpp b/engines/sludge/statusba.cpp index 2f1eb6fc15..de434ae22e 100644 --- a/engines/sludge/statusba.cpp +++ b/engines/sludge/statusba.cpp @@ -27,7 +27,6 @@ #include "sludge/sprites.h" #include "sludge/fonttext.h" #include "sludge/moreio.h" -#include "sludge/stringy.h" #include "sludge/newfatal.h" #include "sludge/statusba.h" @@ -49,7 +48,6 @@ void killLastStatus() { if (nowStatus->firstStatusBar) { statusBar *kill = nowStatus->firstStatusBar; nowStatus->firstStatusBar = kill->next; - delete kill->text; delete kill; } } @@ -61,7 +59,6 @@ void clearStatusBar() { while (stat) { kill = stat; stat = stat->next; - delete kill->text; delete kill; } nowStatus->firstStatusBar = NULL; @@ -71,15 +68,15 @@ void addStatusBar() { statusBar *newStat = new statusBar; if (checkNew(newStat)) { newStat->next = nowStatus->firstStatusBar; - newStat->text = copyString(""); + newStat->text.clear(); nowStatus->firstStatusBar = newStat; } } -void setStatusBar(char *txt) { +void setStatusBar(Common::String &txt) { if (nowStatus->firstStatusBar) { - delete[] nowStatus->firstStatusBar->text; - nowStatus->firstStatusBar->text = copyString(txt); + nowStatus->firstStatusBar->text.clear(); + nowStatus->firstStatusBar->text = txt; } } @@ -166,7 +163,7 @@ void initStatusBar() { statusBarLitColour(255, 255, 128); } -const char *statusBarText() { +const Common::String &statusBarText() { if (nowStatus->firstStatusBar) { return nowStatus->firstStatusBar->text; } else { -- cgit v1.2.3