From 1ee9304012a162a418d5f030ee32dae82b80d2d7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 15 Oct 2006 01:26:23 +0000 Subject: Replaced function level static variable (YUCK) called 'sentence' by ScummEngine_v2:_sentenceBuf svn-id: r24324 --- engines/scumm/script_v2.cpp | 17 ++++++++--------- 1 file changed, 8 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 5fb6956a3a..675626645b 100644 --- a/engines/scumm/script_v2.cpp +++ b/engines/scumm/script_v2.cpp @@ -976,7 +976,6 @@ void ScummEngine_v2::o2_doSentence() { void ScummEngine_v2::o2_drawSentence() { Common::Rect sentenceline; - static char sentence[256]; const byte *temp; int slot = getVerbSlot(VAR(VAR_SENTENCE_VERB), 0); @@ -984,15 +983,15 @@ void ScummEngine_v2::o2_drawSentence() { return; if (getResourceAddress(rtVerb, slot)) - strcpy(sentence, (char*)getResourceAddress(rtVerb, slot)); + strcpy(_sentenceBuf, (char*)getResourceAddress(rtVerb, slot)); else return; if (VAR(VAR_SENTENCE_OBJECT1) > 0) { temp = getObjOrActorName(VAR(VAR_SENTENCE_OBJECT1)); if (temp) { - strcat(sentence, " "); - strcat(sentence, (const char*)temp); + strcat(_sentenceBuf, " "); + strcat(_sentenceBuf, (const char*)temp); } // For V1 games, the engine must compute the preposition. @@ -1037,16 +1036,16 @@ void ScummEngine_v2::o2_drawSentence() { } if (_game.platform == Common::kPlatformNES) { - strcat(sentence, (const char *)(getResourceAddress(rtCostume, 78) + VAR(VAR_SENTENCE_PREPOSITION) * 8 + 2)); + strcat(_sentenceBuf, (const char *)(getResourceAddress(rtCostume, 78) + VAR(VAR_SENTENCE_PREPOSITION) * 8 + 2)); } else - strcat(sentence, prepositions[lang][VAR(VAR_SENTENCE_PREPOSITION)]); + strcat(_sentenceBuf, prepositions[lang][VAR(VAR_SENTENCE_PREPOSITION)]); } if (VAR(VAR_SENTENCE_OBJECT2) > 0) { temp = getObjOrActorName(VAR(VAR_SENTENCE_OBJECT2)); if (temp) { - strcat(sentence, " "); - strcat(sentence, (const char*)temp); + strcat(_sentenceBuf, " "); + strcat(_sentenceBuf, (const char*)temp); } } @@ -1063,7 +1062,7 @@ void ScummEngine_v2::o2_drawSentence() { _string[2].color = 13; byte string[80]; - char *ptr = sentence; + char *ptr = _sentenceBuf; int i = 0, len = 0; // Maximum length of printable characters -- cgit v1.2.3