aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/script_v5.cpp
diff options
context:
space:
mode:
authorMax Horn2006-12-19 21:52:29 +0000
committerMax Horn2006-12-19 21:52:29 +0000
commitcd46b0d57d709956b34a4ae37a87ee4767a7986f (patch)
tree645fb7a2b0435f888f99a5ccd0730ec65d057b79 /engines/scumm/script_v5.cpp
parent3e5240d7022b9625f96ab24aeed6028e8acb84fb (diff)
downloadscummvm-rg350-cd46b0d57d709956b34a4ae37a87ee4767a7986f.tar.gz
scummvm-rg350-cd46b0d57d709956b34a4ae37a87ee4767a7986f.tar.bz2
scummvm-rg350-cd46b0d57d709956b34a4ae37a87ee4767a7986f.zip
Added a comment to ScummEngine_v5::saveVars (we need to implement it for IQ support in Indy3), and fixed a memory leak in o5_saveLoadGame
svn-id: r24892
Diffstat (limited to 'engines/scumm/script_v5.cpp')
-rw-r--r--engines/scumm/script_v5.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index c56ed57d32..2f2374f722 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -868,6 +868,15 @@ void ScummEngine_v5::o5_saveLoadVars() {
void ScummEngine_v5::saveVars() {
int a, b;
+ // FIXME: This opcode is currently a stub. It is needed for at least two things:
+ // * storing save game names in Indy 3 (and maybe others)
+ // * storing the global IQ (Indy Quotient) in Indy 3
+ // The former is not so important as we have our own save system, but the
+ // latter one of course is a desirable feature.
+ // So implementing this would be nice indeed. Not sure what the filename
+ // should be -- either base it on the target name, or base it on the gameid.
+ // Both approaches have their merits, though.
+
while ((_opcode = fetchScriptByte()) != 0) {
switch (_opcode & 0x1F) {
case 0x01: // write a range of variables
@@ -899,6 +908,8 @@ void ScummEngine_v5::saveVars() {
void ScummEngine_v5::loadVars() {
int a, b;
+ // FIXME: See ScummEngine_v5::saveVars
+
// Common::hexdump(_scriptPointer, 64);
while ((_opcode = fetchScriptByte()) != 0) {
switch (_opcode & 0x1F) {
@@ -1153,14 +1164,16 @@ void ScummEngine_v5::o5_saveLoadGame() {
result = 2; // failed to save
break;
case 0xC0: // test if save exists
+ Common::InSaveFile *file;
bool avail_saves[100];
char filename[256];
listSavegames(avail_saves, ARRAYSIZE(avail_saves));
makeSavegameName(filename, slot, false);
- if (avail_saves[slot] && (_saveFileMan->openForLoading(filename)))
+ if (avail_saves[slot] && (file = _saveFileMan->openForLoading(filename))) {
result = 6; // save file exists
- else
+ delete file;
+ } else
result = 7; // save file does not exist
break;
default: