refactor use of _messagePtr -> instead of using it as an implicit parameter for various methods, pass its value explicitly to those methods. Note: this *should* be just a code transformation, with no change to the program logic - unless I messed up once again <sigh>

svn-id: r13298
This commit is contained in:
Max Horn 2004-03-15 03:09:48 +00:00
parent 759c05f936
commit ba5aa37dcc
9 changed files with 79 additions and 87 deletions

View file

@ -467,6 +467,7 @@ void ScummEngine_v8::writeVar(uint var, int value) {
void ScummEngine_v8::decodeParseString(int m, int n) {
byte b;
const byte *msg;
b = fetchScriptByte();
@ -513,29 +514,30 @@ void ScummEngine_v8::decodeParseString(int m, int n) {
_string[m].no_talk_anim = true;
break;
case 0xD1: // SO_PRINT_STRING
_messagePtr = translateTextAndPlaySpeech(_scriptPointer);
_scriptPointer += resStrLen(_scriptPointer)+ 1;
msg = translateTextAndPlaySpeech(_scriptPointer);
_scriptPointer += resStrLen(_scriptPointer) + 1;
switch (m) {
case 0:
actorTalk();
actorTalk(msg);
break;
case 1:
drawString(1);
drawString(1, msg);
break;
case 2:
unkMessage1();
unkMessage1(msg);
break;
case 3:
unkMessage2();
unkMessage2(msg);
break;
case 5:{
byte buffer[256];
addMessageToStack(_messagePtr, buffer, sizeof(buffer));
addMessageToStack(msg, buffer, sizeof(buffer));
enqueueText(buffer, _string[m].xpos, _string[m].ypos, _string[m].color, _string[m].charset, _string[m].center);
}
break;
}
break;
case 0xD2: // SO_PRINT_WRAP Set print wordwrap
//warning("decodeParseString: SO_PRINT_WRAP");