[Scummvm-cvs-logs] CVS: scummvm/scumm saveload.cpp,1.151,1.152 script_v2.cpp,2.245,2.246 script_v5.cpp,1.234,1.235 script_v6.cpp,1.327,1.328 script_v6he.cpp,2.43,2.44 script_v8.cpp,2.247,2.248 scumm.cpp,1.17,1.18 scumm.h,1.394,1.395 string.cpp,1.213,1.214
Max Horn
fingolfin at users.sourceforge.net
Mon Apr 5 17:08:36 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13209
Modified Files:
saveload.cpp script_v2.cpp script_v5.cpp script_v6.cpp
script_v6he.cpp script_v8.cpp scumm.cpp scumm.h string.cpp
Log Message:
Renamed StringTab::backup to StringTab::_default, as that describes better what it does
Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- saveload.cpp 4 Apr 2004 20:20:09 -0000 1.151
+++ saveload.cpp 5 Apr 2004 23:54:55 -0000 1.152
@@ -571,23 +571,23 @@
};
const SaveLoadEntry stringTabEntries[] = {
- // Then backup/restore of a StringTab entry becomes a one liner.
+ // Then _default/restore of a StringTab entry becomes a one liner.
MKLINE(StringTab, xpos, sleInt16, VER(8)),
- MKLINE(StringTab, backup.xpos, sleInt16, VER(8)),
+ MKLINE(StringTab, _default.xpos, sleInt16, VER(8)),
MKLINE(StringTab, ypos, sleInt16, VER(8)),
- MKLINE(StringTab, backup.ypos, sleInt16, VER(8)),
+ MKLINE(StringTab, _default.ypos, sleInt16, VER(8)),
MKLINE(StringTab, right, sleInt16, VER(8)),
- MKLINE(StringTab, backup.right, sleInt16, VER(8)),
+ MKLINE(StringTab, _default.right, sleInt16, VER(8)),
MKLINE(StringTab, color, sleInt8, VER(8)),
- MKLINE(StringTab, backup.color, sleInt8, VER(8)),
+ MKLINE(StringTab, _default.color, sleInt8, VER(8)),
MKLINE(StringTab, charset, sleInt8, VER(8)),
- MKLINE(StringTab, backup.charset, sleInt8, VER(8)),
+ MKLINE(StringTab, _default.charset, sleInt8, VER(8)),
MKLINE(StringTab, center, sleByte, VER(8)),
- MKLINE(StringTab, backup.center, sleByte, VER(8)),
+ MKLINE(StringTab, _default.center, sleByte, VER(8)),
MKLINE(StringTab, overhead, sleByte, VER(8)),
- MKLINE(StringTab, backup.overhead, sleByte, VER(8)),
+ MKLINE(StringTab, _default.overhead, sleByte, VER(8)),
MKLINE(StringTab, no_talk_anim, sleByte, VER(8)),
- MKLINE(StringTab, backup.no_talk_anim, sleByte, VER(8)),
+ MKLINE(StringTab, _default.no_talk_anim, sleByte, VER(8)),
MKEND()
};
Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.245
retrieving revision 2.246
diff -u -d -r2.245 -r2.246
--- script_v2.cpp 3 Apr 2004 19:41:30 -0000 2.245
+++ script_v2.cpp 5 Apr 2004 23:54:55 -0000 2.246
@@ -847,7 +847,7 @@
vs->dimcolor = 8;
}
vs->type = kTextVerbType;
- vs->charset_nr = _string[0].backup.charset;
+ vs->charset_nr = _string[0]._default.charset;
vs->curmode = 1;
vs->saveid = 0;
vs->key = 0;
Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.234
retrieving revision 1.235
diff -u -d -r1.234 -r1.235
--- script_v5.cpp 3 Apr 2004 19:41:30 -0000 1.234
+++ script_v5.cpp 5 Apr 2004 23:54:56 -0000 1.235
@@ -707,7 +707,7 @@
} else {
getWordVararg(table);
for (i = 0; i < 16; i++)
- _charsetColorMap[i] = _charsetData[_string[1].backup.charset][i] = (unsigned char)table[i];
+ _charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)table[i];
}
break;
}
@@ -2405,7 +2405,7 @@
vs->hicolor = (_version == 3) ? 14 : 0;
vs->dimcolor = 8;
vs->type = kTextVerbType;
- vs->charset_nr = _string[0].backup.charset;
+ vs->charset_nr = _string[0]._default.charset;
vs->curmode = 0;
vs->saveid = 0;
vs->key = 0;
@@ -2616,7 +2616,7 @@
textSlot = 0;
}
- _string[textSlot].restoreString();
+ _string[textSlot].loadDefault();
while ((_opcode = fetchScriptByte()) != 0xFF) {
switch (_opcode & 0xF) {
@@ -2709,9 +2709,9 @@
// speaks during the intro are put at position 0,0.
// In addition, Loom needs to remember the text colour.
if (_gameId == GID_LOOM || _gameId == GID_INDY3) {
- _string[textSlot].backup.xpos = _string[textSlot].xpos;
- _string[textSlot].backup.ypos = _string[textSlot].ypos;
- _string[textSlot].backup.color = _string[textSlot].color;
+ _string[textSlot]._default.xpos = _string[textSlot].xpos;
+ _string[textSlot]._default.ypos = _string[textSlot].ypos;
+ _string[textSlot]._default.color = _string[textSlot].color;
}
return;
default:
@@ -2720,7 +2720,7 @@
}
}
- _string[textSlot].backupString();
+ _string[textSlot].saveDefault();
}
void ScummEngine_v5::o5_oldRoomEffect() {
Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.327
retrieving revision 1.328
diff -u -d -r1.327 -r1.328
--- script_v6.cpp 3 Apr 2004 19:41:30 -0000 1.327
+++ script_v6.cpp 5 Apr 2004 23:54:56 -0000 1.328
@@ -949,7 +949,7 @@
case 0x9D: // SO_CHARSET_COLOR
getStackList(args, ARRAYSIZE(args));
for (i = 0; i < 16; i++)
- _charsetColorMap[i] = _charsetData[_string[1].backup.charset][i] = (unsigned char)args[i];
+ _charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)args[i];
break;
case 0xD6: // SO_CURSOR_TRANSPARENT Set cursor transparent color
makeCursorColorTransparent(pop());
@@ -1925,7 +1925,7 @@
vs->hicolor = 0;
vs->dimcolor = 8;
vs->type = kTextVerbType;
- vs->charset_nr = _string[0].backup.charset;
+ vs->charset_nr = _string[0]._default.charset;
vs->curmode = 0;
vs->saveid = 0;
vs->key = 0;
@@ -2294,7 +2294,7 @@
void ScummEngine_v6::o6_talkActor() {
_actorToPrintStrFor = pop();
- _string[0].restoreString();
+ _string[0].loadDefault();
actorTalk(_scriptPointer);
_scriptPointer += resStrLen(_scriptPointer) + 1;
@@ -3119,12 +3119,12 @@
break;
case 0xFE:
- _string[m].restoreString();
+ _string[m].loadDefault();
if (n)
_actorToPrintStrFor = pop();
break;
case 0xFF:
- _string[m].backupString();
+ _string[m].saveDefault();
break;
default:
error("decodeParseString: default case 0x%x", b);
Index: script_v6he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6he.cpp,v
retrieving revision 2.43
retrieving revision 2.44
diff -u -d -r2.43 -r2.44
--- script_v6he.cpp 5 Apr 2004 18:54:50 -0000 2.43
+++ script_v6he.cpp 5 Apr 2004 23:54:58 -0000 2.44
@@ -754,7 +754,7 @@
vs->hicolor = 0;
vs->dimcolor = 8;
vs->type = kTextVerbType;
- vs->charset_nr = _string[0].backup.charset;
+ vs->charset_nr = _string[0]._default.charset;
vs->curmode = 0;
vs->saveid = 0;
vs->key = 0;
@@ -1463,12 +1463,12 @@
warning("decodeParseString case 0xF9 stub");
break;
case 0xFE:
- _string[m].restoreString();
+ _string[m].loadDefault();
if (n)
_actorToPrintStrFor = pop();
break;
case 0xFF:
- _string[m].backupString();
+ _string[m].saveDefault();
break;
default:
error("decodeParseString: default case 0x%x", b);
Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.247
retrieving revision 2.248
diff -u -d -r2.247 -r2.248
--- script_v8.cpp 5 Apr 2004 18:24:35 -0000 2.247
+++ script_v8.cpp 5 Apr 2004 23:54:58 -0000 2.248
@@ -472,12 +472,12 @@
switch (b) {
case 0xC8: // SO_PRINT_BASEOP
- _string[m].restoreString();
+ _string[m].loadDefault();
if (n)
_actorToPrintStrFor = pop();
break;
case 0xC9: // SO_PRINT_END
- _string[m].backupString();
+ _string[m].saveDefault();
break;
case 0xCA: // SO_PRINT_AT
_string[m].ypos = pop();
@@ -762,7 +762,7 @@
case 0xE8: // SO_CHARSET_COLOR
getStackList(args, ARRAYSIZE(args));
for (i = 0; i < 16; i++)
- _charsetColorMap[i] = _charsetData[_string[1].backup.charset][i] = (unsigned char)args[i];
+ _charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)args[i];
break;
case 0xE9: // SO_CURSOR_PUT
{
@@ -1144,7 +1144,7 @@
vs->hicolor = 0;
vs->dimcolor = 8;
vs->type = kTextVerbType;
- vs->charset_nr = _string[0].backup.charset;
+ vs->charset_nr = _string[0]._default.charset;
vs->curmode = 0;
vs->saveid = 0;
vs->key = 0;
Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- scumm.cpp 5 Apr 2004 18:24:35 -0000 1.17
+++ scumm.cpp 5 Apr 2004 23:54:58 -0000 1.18
@@ -1132,16 +1132,16 @@
for (i = 0; i < 6; i++) {
if (_version == 3) { // FIXME - what is this?
- _string[i].backup.xpos = 0;
- _string[i].backup.ypos = 0;
+ _string[i]._default.xpos = 0;
+ _string[i]._default.ypos = 0;
} else {
- _string[i].backup.xpos = 2;
- _string[i].backup.ypos = 5;
+ _string[i]._default.xpos = 2;
+ _string[i]._default.ypos = 5;
}
- _string[i].backup.right = _screenWidth - 1;
- _string[i].backup.color = 0xF;
- _string[i].backup.center = 0;
- _string[i].backup.charset = 0;
+ _string[i]._default.right = _screenWidth - 1;
+ _string[i]._default.color = 0xF;
+ _string[i]._default.center = 0;
+ _string[i]._default.charset = 0;
}
// all keys are released
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.394
retrieving revision 1.395
diff -u -d -r1.394 -r1.395
--- scumm.h 5 Apr 2004 00:24:26 -0000 1.394
+++ scumm.h 5 Apr 2004 23:54:58 -0000 1.395
@@ -264,16 +264,19 @@
};
struct StringTab : StringSlot {
- StringSlot backup;
+ // The 'default' values for this string slot. This is used so that the
+ // string slot can temporarily be set to different values, and then be
+ // easily reset to a previously set default.
+ StringSlot _default;
- void backupString() {
+ void saveDefault() {
StringSlot &s = *this;
- backup = s;
+ _default = s;
}
- void restoreString() {
+ void loadDefault() {
StringSlot &s = *this;
- s = backup;
+ s = _default;
}
};
Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -d -r1.213 -r1.214
--- string.cpp 4 Apr 2004 20:20:09 -0000 1.213
+++ string.cpp 5 Apr 2004 23:54:58 -0000 1.214
@@ -598,8 +598,8 @@
if (!getResourceAddress(rtCharset, charsetno))
loadCharset(charsetno);
- _string[0].backup.charset = charsetno;
- _string[1].backup.charset = charsetno;
+ _string[0]._default.charset = charsetno;
+ _string[1]._default.charset = charsetno;
for (i = 0; i < 16; i++)
_charsetColorMap[i] = _charsetData[charsetno][i];
More information about the Scummvm-git-logs
mailing list