[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src scumm_globals.cpp,1.1,1.2 scumm_globals.h,1.7,1.8
Chris Apers
chrilith at users.sourceforge.net
Mon Nov 3 08:10:22 CET 2003
Update of /cvsroot/scummvm/scummvm/backends/PalmOS/Src
In directory sc8-pr-cvs1:/tmp/cvs-serv1195
Modified Files:
scumm_globals.cpp scumm_globals.h
Log Message:
Read database only if it is opened
Index: scumm_globals.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/scumm_globals.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- scumm_globals.cpp 23 Sep 2003 16:11:54 -0000 1.1
+++ scumm_globals.cpp 3 Nov 2003 16:09:12 -0000 1.2
@@ -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 @@
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 @@
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 @@
if (recordH)
MemHandleUnlock(recordH);
}
-}
\ No newline at end of file
+}
Index: scumm_globals.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/scumm_globals.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- scumm_globals.h 23 Sep 2003 15:57:28 -0000 1.7
+++ scumm_globals.h 3 Nov 2003 16:09:12 -0000 1.8
@@ -55,15 +55,27 @@
GBVARS_PCJRFREQTABLE_INDEX
};
+enum {
+ GBVARS_RESOURCETABLEPE100V1_INDEX = 0,
+ GBVARS_RESOURCETABLEPE100V2_INDEX,
+ GBVARS_RESOURCETABLEPM10_INDEX,
+ GBVARS_RESOURCETABLECM10_INDEX
+};
+
void *GlbGetRecord(UInt16 index, UInt16 id);
void GlbReleaseRecord(UInt16 index, UInt16 id);
void GlbOpen();
void GlbClose();
-#define GBVARS_SCUMM 0
-#define GBVARS_SIMON 1
-#define GBVARS_SKY 2
-#define GBVARS_SWORD2 3
+enum {
+ GBVARS_SCUMM = 0,
+ GBVARS_SIMON,
+ GBVARS_SKY,
+ GBVARS_SWORD2,
+ GBVARS_QUEEN,
+
+ GBVARS_COUNT
+};
#define _GINIT(x) void initGlobals_##x() {
#define _GEND }
@@ -78,6 +90,7 @@
#define PROTO_GLOBALS(x) void CALL_INIT(x);\
void CALL_RELEASE(x);
+#ifndef DISABLE_SCUMM
PROTO_GLOBALS(IMuseDigital)
PROTO_GLOBALS(NewGui)
PROTO_GLOBALS(Akos)
@@ -88,7 +101,12 @@
PROTO_GLOBALS(Charset)
PROTO_GLOBALS(Costume)
PROTO_GLOBALS(PlayerV2)
+#endif
+
+#ifndef DISABLE_QUEEN
+PROTO_GLOBALS(Restables)
+#endif
#undef PROTO_GLOBALS
-#endif
\ No newline at end of file
+#endif
More information about the Scummvm-git-logs
mailing list