aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/various.cpp
diff options
context:
space:
mode:
authorGregory Montoir2007-05-30 18:43:28 +0000
committerGregory Montoir2007-05-30 18:43:28 +0000
commit45b721d3cc47c6682edbf3e8cf30c31ca72c5a3c (patch)
treee0329109829389fc11607bdc50a9bfc14c4430ed /engines/cine/various.cpp
parent5006dbd932bb548b1f648a33576b22d8b5210c26 (diff)
downloadscummvm-rg350-45b721d3cc47c6682edbf3e8cf30c31ca72c5a3c.tar.gz
scummvm-rg350-45b721d3cc47c6682edbf3e8cf30c31ca72c5a3c.tar.bz2
scummvm-rg350-45b721d3cc47c6682edbf3e8cf30c31ca72c5a3c.zip
cleanup, don't rely on assert() to ensure a gamefile/savefile is opened. Also removed the use of Common::File global objects.
svn-id: r27021
Diffstat (limited to 'engines/cine/various.cpp')
-rw-r--r--engines/cine/various.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index fcf67a23b7..12643bf274 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -56,8 +56,6 @@ int16 buildObjectListCommand(void);
void drawString(const char *string, byte param) {
}
-Common::File *partFileHandleP = NULL;
-
void waitPlayerInput(void) {
}
@@ -999,15 +997,14 @@ void CineEngine::makeSystemMenu(void) {
if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
char saveString[256], tmp[80];
- Common::OutSaveFile *fHandle;
-
snprintf(tmp, 80, "%s.dir", _targetName.c_str());
- fHandle = g_saveFileMan->openForSaving(tmp);
- // FIXME: Properly handle openForSaving failures instead of
- // just crashing silently!
- assert(fHandle);
-
+ Common::OutSaveFile *fHandle = g_saveFileMan->openForSaving(tmp);
+ if (!fHandle) {
+ warning("Unable to open file %s for saving", tmp);
+ break;
+ }
+
fHandle->write(currentSaveName, 200);
delete fHandle;
@@ -1031,7 +1028,7 @@ void CineEngine::makeSystemMenu(void) {
}
}
-const int16 choiceResultTable[] = {
+static const int16 choiceResultTable[] = {
1,
1,
1,
@@ -1041,7 +1038,7 @@ const int16 choiceResultTable[] = {
1
};
-const int16 subObjectUseTable[] = {
+static const int16 subObjectUseTable[] = {
3,
3,
3,
@@ -1051,7 +1048,7 @@ const int16 subObjectUseTable[] = {
0
};
-const int16 canUseOnItemTable[] = {
+static const int16 canUseOnItemTable[] = {
1,
0,
0,