From 93375526c081f279578058fd4336c695898488c3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 5 May 2010 20:43:22 +0000 Subject: SCUMM: Convert some code to use Common::String svn-id: r48957 --- engines/scumm/script_v2.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'engines/scumm/script_v2.cpp') diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp index 22c015c644..d93e2ea3e4 100644 --- a/engines/scumm/script_v2.cpp +++ b/engines/scumm/script_v2.cpp @@ -965,15 +965,15 @@ void ScummEngine_v2::o2_drawSentence() { return; if (getResourceAddress(rtVerb, slot)) - strcpy(_sentenceBuf, (char*)getResourceAddress(rtVerb, slot)); + _sentenceBuf = (char *)getResourceAddress(rtVerb, slot); else return; if (VAR(VAR_SENTENCE_OBJECT1) > 0) { temp = getObjOrActorName(VAR(VAR_SENTENCE_OBJECT1)); if (temp) { - strcat(_sentenceBuf, " "); - strcat(_sentenceBuf, (const char*)temp); + _sentenceBuf += " "; + _sentenceBuf += (const char *)temp; } // For V1 games, the engine must compute the preposition. @@ -1018,16 +1018,16 @@ void ScummEngine_v2::o2_drawSentence() { } if (_game.platform == Common::kPlatformNES) { - strcat(_sentenceBuf, (const char *)(getResourceAddress(rtCostume, 78) + VAR(VAR_SENTENCE_PREPOSITION) * 8 + 2)); + _sentenceBuf += (const char *)(getResourceAddress(rtCostume, 78) + VAR(VAR_SENTENCE_PREPOSITION) * 8 + 2); } else - strcat(_sentenceBuf, prepositions[lang][VAR(VAR_SENTENCE_PREPOSITION)]); + _sentenceBuf += prepositions[lang][VAR(VAR_SENTENCE_PREPOSITION)]; } if (VAR(VAR_SENTENCE_OBJECT2) > 0) { temp = getObjOrActorName(VAR(VAR_SENTENCE_OBJECT2)); if (temp) { - strcat(_sentenceBuf, " "); - strcat(_sentenceBuf, (const char*)temp); + _sentenceBuf += " "; + _sentenceBuf += (const char *)temp; } } @@ -1044,7 +1044,7 @@ void ScummEngine_v2::o2_drawSentence() { _string[2].color = 13; byte string[80]; - char *ptr = _sentenceBuf; + const char *ptr = _sentenceBuf.c_str(); int i = 0, len = 0; // Maximum length of printable characters @@ -1078,7 +1078,7 @@ void ScummEngine_v2::o2_drawSentence() { } restoreBackground(sentenceline); - drawString(2, (byte*)string); + drawString(2, (byte *)string); } void ScummEngine_v2::o2_ifClassOfIs() { -- cgit v1.2.3