aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorMax Horn2002-08-18 17:48:18 +0000
committerMax Horn2002-08-18 17:48:18 +0000
commitedae5b06db08b3c614b1efc0fe49c214857cbcc8 (patch)
tree0e5092c1816feef55b4deebe5b9049468969db83 /simon
parent97d127252bf5ae7958cd0ded27855be3c2188fa6 (diff)
downloadscummvm-rg350-edae5b06db08b3c614b1efc0fe49c214857cbcc8.tar.gz
scummvm-rg350-edae5b06db08b3c614b1efc0fe49c214857cbcc8.tar.bz2
scummvm-rg350-edae5b06db08b3c614b1efc0fe49c214857cbcc8.zip
MAJOR change to the way how Engine objects are instantiated
svn-id: r4758
Diffstat (limited to 'simon')
-rw-r--r--simon/simon.cpp23
-rw-r--r--simon/simon.h15
2 files changed, 19 insertions, 19 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 23c07aba65..67ea4d9092 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -22,7 +22,9 @@
#include "stdafx.h"
#include "simon.h"
#include "simonintern.h"
+#include "gameDetector.h"
#include <errno.h>
+#include <time.h>
#ifdef _WIN32_WCE
@@ -109,13 +111,23 @@ static const GameSpecificSettings simon2dos_settings = {
};
-SimonState::SimonState()
+SimonState::SimonState(GameDetector *detector, OSystem *syst)
+ : Engine(detector, syst)
{
+ MidiDriver *driver = detector->createMidi();
+
_dummy_item_1 = new Item();
_dummy_item_2 = new Item();
_dummy_item_3 = new Item();
_fcs_list = new FillOrCopyStruct[16];
+
+ /* Setup midi driver */
+ midi.set_driver(driver);
+
+ _game = detector->_gameId;
+ set_volume(detector->_sfx_volume);
+ _game_path = detector->_gameDataPath;
}
SimonState::~SimonState()
@@ -127,14 +139,9 @@ SimonState::~SimonState()
delete [] _fcs_list;
}
-SimonState *SimonState::create(OSystem *syst, MidiDriver *driver)
+SimonState *SimonState::createFromDetector(GameDetector *detector, OSystem *syst)
{
- SimonState *s = new SimonState;
-
- s->_system = syst;
-
- /* Setup midi driver */
- s->midi.set_driver(driver);
+ SimonState *s = new SimonState(detector, syst);
/* Setup mixer */
if (!s->_mixer->bind_to_system(syst))
diff --git a/simon/simon.h b/simon/simon.h
index aed088aca3..5f43f7d019 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -22,10 +22,10 @@
#ifndef SIMON_H
#define SIMON_H
-#include <time.h>
-#include <sys/stat.h>
+#include <stdio.h>
#include "engine.h"
#include "simon/midi.h"
+#include "sound/mixer.h"
/* Various other settings */
//#define DUMP_CONTINOUS_MAINSCRIPT
@@ -356,7 +356,7 @@ public:
byte *_sdl_buf;
byte *_sdl_buf_attached;
- SimonState();
+ SimonState(GameDetector *detector, OSystem *syst);
virtual ~SimonState();
int allocGamePcVars(FILE *in);
@@ -795,7 +795,7 @@ public:
void vc_kill_thread(uint file, uint sprite);
- static SimonState *create(OSystem *syst, MidiDriver *driver);
+ static SimonState *createFromDetector(GameDetector *detector, OSystem *syst);
void set_dummy_cursor();
@@ -820,13 +820,6 @@ public:
void NORETURN CDECL error(const char *errmsg, ...);
void CDECL warning(const char *errmsg, ...);
-void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch,
- int width, int height);
-int Init_2xSaI(uint32 BitFormat);
-void Super2xSaI(uint8 *srcPtr, uint32 srcPitch,
- uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void initializeHardware();
-void dx_set_palette(uint32 *colors, uint num);
void palette_fadeout(uint32 *pal_values, uint num);
#endif