aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2004-08-04 18:07:57 +0000
committerEugene Sandulenko2004-08-04 18:07:57 +0000
commit11078570dcd3a5be520cdc84223674411a08f088 (patch)
tree4658d51133292bbb027870034a0f20bf652c52dd
parent5e7d2494bb65e47326d47ebcec3e6a62193986a0 (diff)
downloadscummvm-rg350-11078570dcd3a5be520cdc84223674411a08f088.tar.gz
scummvm-rg350-11078570dcd3a5be520cdc84223674411a08f088.tar.bz2
scummvm-rg350-11078570dcd3a5be520cdc84223674411a08f088.zip
Move state static variable to appropriate class
svn-id: r14462
-rw-r--r--saga/saga.cpp23
-rw-r--r--saga/saga.h3
2 files changed, 11 insertions, 15 deletions
diff --git a/saga/saga.cpp b/saga/saga.cpp
index cf9c9764dc..a8f196e215 100644
--- a/saga/saga.cpp
+++ b/saga/saga.cpp
@@ -75,16 +75,9 @@ namespace Saga {
#define R_MAX_TIME_DELTA 100
-struct R_MAIN_DATA {
- int sound_enabled;
- int music_enabled;
-};
-
static void CF_quitfunc(int argc, char *argv[], void *refCon);
static void CF_testfunc(int argc, char *argv[], void *refCon);
-static R_MAIN_DATA MainData;
-
SagaEngine *_vm = NULL;
SagaEngine::SagaEngine(GameDetector *detector, OSystem *syst)
@@ -118,14 +111,14 @@ void SagaEngine::go() {
GAME_Register();
SCENE_Register();
- MainData.sound_enabled = 1;
- MainData.music_enabled = 1;
+ _soundEnabled = 1;
+ _musicEnabled = 1;
CVAR_RegisterFunc(CF_testfunc, "testfunc", "foo [ optional foo ]", R_CVAR_NONE, 0, -1, this);
- CVAR_Register_I(&MainData.sound_enabled, "sound", NULL, R_CVAR_CFG, 0, 1);
+ CVAR_Register_I(&_soundEnabled, "sound", NULL, R_CVAR_CFG, 0, 1);
- CVAR_Register_I(&MainData.music_enabled, "music", NULL, R_CVAR_CFG, 0, 1);
+ CVAR_Register_I(&_musicEnabled, "music", NULL, R_CVAR_CFG, 0, 1);
CVAR_RegisterFunc(CF_quitfunc, "quit", NULL, R_CVAR_NONE, 0, 0, this);
@@ -174,10 +167,10 @@ void SagaEngine::go() {
else if (ConfMan.getBool("native_mt32"))
driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
- _music = new Music(driver, MainData.music_enabled);
+ _music = new Music(driver, _musicEnabled);
_music->hasNativeMT32(ConfMan.getBool("native_mt32"));
- if (!MainData.music_enabled) {
+ if (!_musicEnabled) {
debug(0, "Music disabled.");
}
@@ -196,8 +189,8 @@ void SagaEngine::go() {
}
// Initialize system specific sound
- _sound = new Sound(this, _mixer, MainData.sound_enabled);
- if (!MainData.sound_enabled) {
+ _sound = new Sound(this, _mixer, _soundEnabled);
+ if (!_soundEnabled) {
debug(0, "Sound disabled.");
}
diff --git a/saga/saga.h b/saga/saga.h
index 152fa17708..ab26f0a1c5 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -93,6 +93,9 @@ public:
void shutdown();
+ int _soundEnabled;
+ int _musicEnabled;
+
SndRes *_sndRes;
Sound *_sound;
Music *_music;