diff options
author | Johannes Schickel | 2009-07-25 12:59:46 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-07-25 12:59:46 +0000 |
commit | 7e71865e91a19b022a5ad839802f79a5f300fe8d (patch) | |
tree | c86e3e37eea3ec566c6c8a1811cb8cc16196b910 /engines/lure | |
parent | 6d1a386471711df4c9ed48be3646a16f81ae0d46 (diff) | |
download | scummvm-rg350-7e71865e91a19b022a5ad839802f79a5f300fe8d.tar.gz scummvm-rg350-7e71865e91a19b022a5ad839802f79a5f300fe8d.tar.bz2 scummvm-rg350-7e71865e91a19b022a5ad839802f79a5f300fe8d.zip |
Move the event recorder to its own class (EventRecoder inside common/EventRecorder.[h/cpp]).
svn-id: r42751
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/hotspots.cpp | 11 | ||||
-rw-r--r-- | engines/lure/res.cpp | 3 | ||||
-rw-r--r-- | engines/lure/scripts.cpp | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 5231c9217f..b5ec00fdf9 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -38,6 +38,7 @@ #include "lure/sound.h" #include "lure/lure.h" #include "common/endian.h" +#include "common/EventRecorder.h" namespace Lure { @@ -600,7 +601,7 @@ void Hotspot::setRandomDest() { Common::RandomSource rnd; int16 xp, yp; - g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); + g_eventRec.registerRandomSource(rnd, "lureHotspots"); if (currentActions().isEmpty()) currentActions().addFront(START_WALKING, roomNumber()); @@ -3147,7 +3148,7 @@ void HotspotTickHandlers::followerAnimHandler(Hotspot &h) { Common::RandomSource rnd; RandomActionType actionType; uint16 scheduleId; - g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); + g_eventRec.registerRandomSource(rnd, "lureHotspots"); int actionIndex = rnd.getRandomNumber(set->numActions() - 1); set->getEntry(actionIndex, actionType, scheduleId); @@ -3337,7 +3338,7 @@ void HotspotTickHandlers::prisonerAnimHandler(Hotspot &h) { ValueTableData &fields = Resources::getReference().fieldList(); Common::RandomSource rnd; - g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); + g_eventRec.registerRandomSource(rnd, "lureHotspots"); h.handleTalkDialog(); if (h.frameCtr() > 0) { @@ -3380,7 +3381,7 @@ void HotspotTickHandlers::morkusAnimHandler(Hotspot &h) { if (h.executeScript()) { // Script is done - set new script to one of two alternates randomly Common::RandomSource rnd; - g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); + g_eventRec.registerRandomSource(rnd, "lureHotspots"); h.setHotspotScript(rnd.getRandomNumber(100) >= 50 ? 0x54 : 0); h.setFrameCtr(20 + rnd.getRandomNumber(63)); @@ -3680,7 +3681,7 @@ void HotspotTickHandlers::barmanAnimHandler(Hotspot &h) { Common::RandomSource rnd; static bool ewanXOffset = false; - g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); + g_eventRec.registerRandomSource(rnd, "lureHotspots"); h.handleTalkDialog(); if (h.delayCtr() > 0) { diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index 95cb0a2f1b..7eb76cad32 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -30,6 +30,7 @@ #include "lure/lure.h" #include "common/endian.h" #include "common/events.h" +#include "common/EventRecorder.h" namespace Lure { @@ -42,7 +43,7 @@ Resources &Resources::getReference() { } Resources::Resources() { - g_system->getEventManager()->registerRandomSource(_rnd, "lureResources"); + g_eventRec.registerRandomSource(_rnd, "lureResources"); int_resources = this; reloadData(); diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 391147ebd5..f9d854a73b 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -34,6 +34,7 @@ #include "lure/sound.h" #include "common/stack.h" #include "common/endian.h" +#include "common/EventRecorder.h" namespace Lure { @@ -739,7 +740,7 @@ void Script::addActions(uint16 hotspotId, uint16 actions, uint16 v3) { void Script::randomToGeneral(uint16 maxVal, uint16 minVal, uint16 v3) { Common::RandomSource rnd; - g_system->getEventManager()->registerRandomSource(rnd, "lureScripts"); + g_eventRec.registerRandomSource(rnd, "lureScripts"); uint16 v = minVal + rnd.getRandomNumber(maxVal - minVal); Resources::getReference().fieldList().setField(GENERAL, v); } |