aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2006-10-15 01:26:23 +0000
committerMax Horn2006-10-15 01:26:23 +0000
commit1ee9304012a162a418d5f030ee32dae82b80d2d7 (patch)
tree547d3b7be1c4bc7a1f7654ed19a65d90ab93bd69
parent2888110b3ccea294bed469aa2a3dbb522ddc909b (diff)
downloadscummvm-rg350-1ee9304012a162a418d5f030ee32dae82b80d2d7.tar.gz
scummvm-rg350-1ee9304012a162a418d5f030ee32dae82b80d2d7.tar.bz2
scummvm-rg350-1ee9304012a162a418d5f030ee32dae82b80d2d7.zip
Replaced function level static variable (YUCK) called 'sentence' by ScummEngine_v2:_sentenceBuf
svn-id: r24324
-rw-r--r--engines/scumm/intern.h2
-rw-r--r--engines/scumm/script_c64.cpp15
-rw-r--r--engines/scumm/script_v2.cpp17
3 files changed, 17 insertions, 17 deletions
diff --git a/engines/scumm/intern.h b/engines/scumm/intern.h
index 413446fca2..81f031e7ed 100644
--- a/engines/scumm/intern.h
+++ b/engines/scumm/intern.h
@@ -273,6 +273,8 @@ protected:
V2MouseoverBox _mouseOverBoxesV2[7];
int8 _mouseOverBoxV2;
+
+ static char _sentenceBuf[256];
public:
ScummEngine_v2(OSystem *syst, const DetectorResult &dr);
diff --git a/engines/scumm/script_c64.cpp b/engines/scumm/script_c64.cpp
index 0f613bfa62..b610fafbcc 100644
--- a/engines/scumm/script_c64.cpp
+++ b/engines/scumm/script_c64.cpp
@@ -460,7 +460,6 @@ void ScummEngine_c64::ifNotStateCommon(byte type) {
void ScummEngine_c64::drawSentence() {
Common::Rect sentenceline;
- static char sentence[256];
const byte *temp;
int sentencePrep = 0;
@@ -468,7 +467,7 @@ void ScummEngine_c64::drawSentence() {
return;
if (getResourceAddress(rtVerb, _activeVerb)) {
- strcpy(sentence, (char*)getResourceAddress(rtVerb, _activeVerb));
+ strcpy(_sentenceBuf, (char*)getResourceAddress(rtVerb, _activeVerb));
} else {
return;
}
@@ -476,8 +475,8 @@ void ScummEngine_c64::drawSentence() {
if (_activeObject > 0) {
temp = getObjOrActorName(_activeObject);
if (temp) {
- strcat(sentence, " ");
- strcat(sentence, (const char*)temp);
+ strcat(_sentenceBuf, " ");
+ strcat(_sentenceBuf, (const char*)temp);
}
if (_verbs[_activeVerb].prep == 0xFF) {
@@ -518,14 +517,14 @@ void ScummEngine_c64::drawSentence() {
lang = 0; // Default to english
}
- strcat(sentence, prepositions[lang][sentencePrep]);
+ strcat(_sentenceBuf, prepositions[lang][sentencePrep]);
}
if (_activeInventory > 0) {
temp = getObjOrActorName(_activeInventory);
if (temp) {
- strcat(sentence, " ");
- strcat(sentence, (const char*)temp);
+ strcat(_sentenceBuf, " ");
+ strcat(_sentenceBuf, (const char*)temp);
}
}
@@ -536,7 +535,7 @@ void ScummEngine_c64::drawSentence() {
_string[2].color = 16;
byte string[80];
- char *ptr = sentence;
+ char *ptr = _sentenceBuf;
int i = 0, len = 0;
// Maximum length of printable characters
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