aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src/scumm_globals.cpp
diff options
context:
space:
mode:
authorChris Apers2003-11-03 16:09:12 +0000
committerChris Apers2003-11-03 16:09:12 +0000
commitb4c40ceb1240cc439817128c606f206b6a345280 (patch)
tree01474fc11d756ab84bfa1e757c5a09dd169d5038 /backends/PalmOS/Src/scumm_globals.cpp
parent2bfad6efced38d16ca4c0902d2c75131484c2a80 (diff)
downloadscummvm-rg350-b4c40ceb1240cc439817128c606f206b6a345280.tar.gz
scummvm-rg350-b4c40ceb1240cc439817128c606f206b6a345280.tar.bz2
scummvm-rg350-b4c40ceb1240cc439817128c606f206b6a345280.zip
Read database only if it is opened
svn-id: r11097
Diffstat (limited to 'backends/PalmOS/Src/scumm_globals.cpp')
-rw-r--r--backends/PalmOS/Src/scumm_globals.cpp65
1 files changed, 42 insertions, 23 deletions
diff --git a/backends/PalmOS/Src/scumm_globals.cpp b/backends/PalmOS/Src/scumm_globals.cpp
index e27bc89466..7f8cb9611b 100644
--- a/backends/PalmOS/Src/scumm_globals.cpp
+++ b/backends/PalmOS/Src/scumm_globals.cpp
@@ -25,33 +25,49 @@
#include "globals.h"
#include "scumm_globals.h"
+#include "scumm.h"
+
static void GlbInitAll() {
#ifndef DISABLE_SCUMM
- CALL_INIT(IMuseDigital)
- CALL_INIT(NewGui)
- CALL_INIT(Akos)
- CALL_INIT(Bundle)
- CALL_INIT(Codec47)
- CALL_INIT(Gfx)
- CALL_INIT(Dialogs)
- CALL_INIT(Charset)
- CALL_INIT(Costume)
- CALL_INIT(PlayerV2)
+ if (gVars->globals[GBVARS_SCUMM]) {
+ CALL_INIT(IMuseDigital)
+ CALL_INIT(NewGui)
+ CALL_INIT(Akos)
+ CALL_INIT(Bundle)
+ CALL_INIT(Codec47)
+ CALL_INIT(Gfx)
+ CALL_INIT(Dialogs)
+ CALL_INIT(Charset)
+ CALL_INIT(Costume)
+ CALL_INIT(PlayerV2)
+ }
+#endif
+#ifndef DISABLE_QUEEN
+ if (gVars->globals[GBVARS_QUEEN]) {
+ CALL_INIT(Restables)
+ }
#endif
}
static void GlbReleaseAll() {
#ifndef DISABLE_SCUMM
- CALL_RELEASE(IMuseDigital)
- CALL_RELEASE(NewGui)
- CALL_RELEASE(Akos)
- CALL_RELEASE(Bundle)
- CALL_RELEASE(Codec47)
- CALL_RELEASE(Gfx)
- CALL_RELEASE(Dialogs)
- CALL_RELEASE(Charset)
- CALL_RELEASE(Costume)
- CALL_RELEASE(PlayerV2)
+ if (gVars->globals[GBVARS_SCUMM]) {
+ CALL_RELEASE(IMuseDigital)
+ CALL_RELEASE(NewGui)
+ CALL_RELEASE(Akos)
+ CALL_RELEASE(Bundle)
+ CALL_RELEASE(Codec47)
+ CALL_RELEASE(Gfx)
+ CALL_RELEASE(Dialogs)
+ CALL_RELEASE(Charset)
+ CALL_RELEASE(Costume)
+ CALL_RELEASE(PlayerV2)
+ }
+#endif
+#ifndef DISABLE_QUEEN
+ if (gVars->globals[GBVARS_QUEEN]) {
+ CALL_RELEASE(Restables)
+ }
#endif
}
@@ -71,8 +87,9 @@ static DmOpenRef GlbOpenInternal(const Char *nameP) {
void GlbOpen() {
gVars->globals[GBVARS_SCUMM] = GlbOpenInternal("Scumm-Globals");
gVars->globals[GBVARS_SIMON] = GlbOpenInternal("Simon-Globals");
- gVars->globals[GBVARS_SKY] = GlbOpenInternal("Sky-Globals");
-
+ gVars->globals[GBVARS_SKY ] = GlbOpenInternal("Sky-Globals");
+ gVars->globals[GBVARS_QUEEN] = GlbOpenInternal("Queen-Globals");
+
GlbInitAll();
}
@@ -85,6 +102,8 @@ void GlbClose() {
DmCloseDatabase(gVars->globals[GBVARS_SIMON]);
if (gVars->globals[GBVARS_SKY])
DmCloseDatabase(gVars->globals[GBVARS_SKY]);
+ if (gVars->globals[GBVARS_QUEEN])
+ DmCloseDatabase(gVars->globals[GBVARS_QUEEN]);
}
void *GlbGetRecord(UInt16 index, UInt16 id) {
@@ -102,4 +121,4 @@ void GlbReleaseRecord(UInt16 index, UInt16 id) {
if (recordH)
MemHandleUnlock(recordH);
}
-} \ No newline at end of file
+}