aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
authorMax Horn2011-05-16 16:35:10 +0200
committerMax Horn2011-05-17 12:17:26 +0200
commit4cbe4ede66e65ec9289811eca2f5f62285174c8d (patch)
tree19e97e1d96797a2e063786e5f7f9c3e4ebb71d93 /engines/sword1
parent305c13a4aac6074ac734f77dad708e0aca86bbd7 (diff)
downloadscummvm-rg350-4cbe4ede66e65ec9289811eca2f5f62285174c8d.tar.gz
scummvm-rg350-4cbe4ede66e65ec9289811eca2f5f62285174c8d.tar.bz2
scummvm-rg350-4cbe4ede66e65ec9289811eca2f5f62285174c8d.zip
COMMON: Registers RandomSources in constructor with the event recorder
This also removes the dependency of engines on the event recorder header and API, and will make it easier to RandomSources that are not properly registered.
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/logic.cpp5
-rw-r--r--engines/sword1/logic.h2
-rw-r--r--engines/sword1/sound.cpp5
3 files changed, 6 insertions, 6 deletions
diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp
index b334294b09..00f7112c05 100644
--- a/engines/sword1/logic.cpp
+++ b/engines/sword1/logic.cpp
@@ -22,7 +22,6 @@
#include "common/endian.h"
#include "common/util.h"
-#include "common/EventRecorder.h"
#include "common/textconsole.h"
#include "sword1/logic.h"
@@ -50,8 +49,8 @@ namespace Sword1 {
uint32 Logic::_scriptVars[NUM_SCRIPT_VARS];
-Logic::Logic(SwordEngine *vm, ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, Audio::Mixer *mixer) {
- g_eventRec.registerRandomSource(_rnd, "sword1");
+Logic::Logic(SwordEngine *vm, ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, Audio::Mixer *mixer)
+ : _rnd("sword1") {
_vm = vm;
_objMan = pObjMan;
diff --git a/engines/sword1/logic.h b/engines/sword1/logic.h
index 461355ad1a..13ddbc989b 100644
--- a/engines/sword1/logic.h
+++ b/engines/sword1/logic.h
@@ -30,6 +30,8 @@
#include "common/random.h"
#include "audio/mixer.h"
+class OSystem;
+
namespace Sword1 {
#define NON_ZERO_SCRIPT_VARS 95
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index a5a3634f72..f7ab9ca1de 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -24,7 +24,6 @@
#include "common/endian.h"
#include "common/util.h"
-#include "common/EventRecorder.h"
#include "common/memstream.h"
#include "common/textconsole.h"
@@ -46,8 +45,8 @@ namespace Sword1 {
#define SOUND_SPEECH_ID 1
#define SPEECH_FLAGS (Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN)
-Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan) {
- g_eventRec.registerRandomSource(_rnd, "sword1sound");
+Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan)
+ : _rnd("sword1sound") {
strcpy(_filePath, searchPath);
_mixer = mixer;
_resMan = pResMan;