aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-08-14 10:18:03 +0000
committerMax Horn2002-08-14 10:18:03 +0000
commit7f3ba176e1c5ca1e816e0f55c6fbf76c77b67d6c (patch)
treee7ee8cebdcf6ab09e873ff07d2aaa588c4b61c57
parent2125df5f6d7ff229be4cd1ba3c9a8db673e3475c (diff)
downloadscummvm-rg350-7f3ba176e1c5ca1e816e0f55c6fbf76c77b67d6c.tar.gz
scummvm-rg350-7f3ba176e1c5ca1e816e0f55c6fbf76c77b67d6c.tar.bz2
scummvm-rg350-7f3ba176e1c5ca1e816e0f55c6fbf76c77b67d6c.zip
added common Engine base class for Scumm and SimonState (not yet very useful)
svn-id: r4742
-rw-r--r--engine.h46
-rw-r--r--scumm.h9
-rw-r--r--scummvm.cpp2
-rw-r--r--simon/simon.h10
4 files changed, 50 insertions, 17 deletions
diff --git a/engine.h b/engine.h
new file mode 100644
index 0000000000..b57741f12a
--- /dev/null
+++ b/engine.h
@@ -0,0 +1,46 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2002 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#ifndef ENGINE_H
+#define ENGINE_H
+
+#include "scummsys.h"
+#include "system.h"
+#include "sound/mixer.h"
+
+class Engine {
+public:
+ OSystem *_system;
+
+ SoundMixer *_mixer;
+
+ Engine()
+ {
+ _mixer = new SoundMixer();
+ }
+
+ ~Engine()
+ {
+ delete _mixer;
+ }
+};
+
+
+#endif
diff --git a/scumm.h b/scumm.h
index 3955ac3f58..9fb54b9f9e 100644
--- a/scumm.h
+++ b/scumm.h
@@ -23,9 +23,7 @@
#ifndef SCUMM_H
#define SCUMM_H
-#include "scummsys.h"
-#include "system.h"
-#include "sound/mixer.h"
+#include "engine.h"
#include "bundle.h"
#include "timer.h"
@@ -326,12 +324,11 @@ enum MouseButtonStatus {
#include "gfx.h"
#include "boxes.h"
-class Scumm {
+class Scumm : public Engine {
public:
/* Put often used variables at the top.
* That results in a shorter form of the opcode
* on some architectures. */
- OSystem *_system;
IMuse *_imuse;
Gui *_gui;
NewGui *_newgui;
@@ -700,8 +697,6 @@ public:
void setVerbObject(uint room, uint object, uint verb);
/* Should be in Sound class */
- SoundMixer *_mixer;
-
// MixerChannel _mixer_channel[NUM_MIXER];
byte _sfxMode;
bool _use_adlib;
diff --git a/scummvm.cpp b/scummvm.cpp
index 908139311c..95f371857d 100644
--- a/scummvm.cpp
+++ b/scummvm.cpp
@@ -65,7 +65,6 @@ uint Scumm::getRandomNumberRng(uint min, uint max)
Scumm::Scumm (void) {
- _mixer = new SoundMixer();
_newgui = new NewGui(this);
_bundle = new Bundle(this);
_timer = new Timer(this);
@@ -73,7 +72,6 @@ Scumm::Scumm (void) {
Scumm::~Scumm (void) {
delete [] _actors;
- delete _mixer;
delete _newgui;
delete _bundle;
delete _timer;
diff --git a/simon/simon.h b/simon/simon.h
index e14ab9eaa8..1ce7ee452a 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -21,9 +21,7 @@
#include <time.h>
#include <sys/stat.h>
-#include "scummsys.h"
-#include "system.h"
-#include "../sound/mixer.h"
+#include "engine.h"
/* Various other settings */
//#define DUMP_CONTINOUS_MAINSCRIPT
@@ -354,10 +352,8 @@ struct GameSpecificSettings {
};
-class SimonState {
+class SimonState : public Engine {
public:
- OSystem *_system;
-
char *_game_path;
byte *_vc_ptr; /* video code ptr */
@@ -552,8 +548,6 @@ public:
byte _fcs_data_1[8];
bool _fcs_data_2[8];
- SoundMixer _mixer[1];
-
ThreeValues _threevalues_1, _threevalues_2, _threevalues_3, _threevalues_4;
int _free_string_slot;