aboutsummaryrefslogtreecommitdiff
path: root/engines/wage
diff options
context:
space:
mode:
authorD G Turner2011-05-30 04:02:48 +0100
committerEugene Sandulenko2015-12-27 15:39:52 +0100
commitaabe774cbe962491457ec17df9545642716d8315 (patch)
tree7f7fcb9eb4f81de85a097ca03a2e771a2a650d14 /engines/wage
parent2910ff45d800f543475608de04108ff0bae9b59c (diff)
downloadscummvm-rg350-aabe774cbe962491457ec17df9545642716d8315.tar.gz
scummvm-rg350-aabe774cbe962491457ec17df9545642716d8315.tar.bz2
scummvm-rg350-aabe774cbe962491457ec17df9545642716d8315.zip
WAGE: Update Engine Code For Common::RandomSource API Changes.
Signed-off-by: Eugene Sandulenko <sev@scummvm.org>
Diffstat (limited to 'engines/wage')
-rw-r--r--engines/wage/script.cpp10
-rw-r--r--engines/wage/wage.cpp4
-rw-r--r--engines/wage/wage.h4
3 files changed, 9 insertions, 9 deletions
diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp
index a478b8bfed..685ba66b12 100644
--- a/engines/wage/script.cpp
+++ b/engines/wage/script.cpp
@@ -208,17 +208,17 @@ Script::Operand *Script::readOperand() {
case 0xC3: // MONSTER@
return new Operand(_callbacks->_monster, Operand::CHR);
case 0xC4: // RANDOMSCN@
- return new Operand(_world->_orderedScenes[_callbacks->_rnd.getRandomNumber(_world->_orderedScenes.size())], Operand::SCENE);
+ return new Operand(_world->_orderedScenes[_callbacks->_rnd->getRandomNumber(_world->_orderedScenes.size())], Operand::SCENE);
case 0xC5: // RANDOMCHR@
- return new Operand(_world->_orderedChrs[_callbacks->_rnd.getRandomNumber(_world->_orderedChrs.size())], Operand::CHR);
+ return new Operand(_world->_orderedChrs[_callbacks->_rnd->getRandomNumber(_world->_orderedChrs.size())], Operand::CHR);
case 0xC6: // RANDOMOBJ@
- return new Operand(_world->_orderedObjs[_callbacks->_rnd.getRandomNumber(_world->_orderedObjs.size())], Operand::OBJ);
+ return new Operand(_world->_orderedObjs[_callbacks->_rnd->getRandomNumber(_world->_orderedObjs.size())], Operand::OBJ);
case 0xB0: // VISITS#
return new Operand(_world->_player->_context._visits, Operand::NUMBER);
case 0xB1: // RANDOM# for Star Trek, but VISITS# for some other games?
- return new Operand(1 + _callbacks->_rnd.getRandomNumber(100), Operand::NUMBER);
+ return new Operand(1 + _callbacks->_rnd->getRandomNumber(100), Operand::NUMBER);
case 0xB5: // RANDOM# // A random number between 1 and 100.
- return new Operand(1 + _callbacks->_rnd.getRandomNumber(100), Operand::NUMBER);
+ return new Operand(1 + _callbacks->_rnd->getRandomNumber(100), Operand::NUMBER);
case 0xB2: // LOOP#
return new Operand(_loopCount, Operand::NUMBER);
case 0xB3: // VICTORY#
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp
index 2be43e7880..35dc36e03d 100644
--- a/engines/wage/wage.cpp
+++ b/engines/wage/wage.cpp
@@ -62,8 +62,7 @@
namespace Wage {
WageEngine::WageEngine(OSystem *syst, const ADGameDescription *desc) : Engine(syst), _gameDescription(desc) {
- // Don't forget to register your random source
- g_eventRec.registerRandomSource(_rnd, "wage");
+ _rnd = new Common::RandomSource("wage");
_aim = -1;
@@ -76,6 +75,7 @@ WageEngine::~WageEngine() {
// Remove all of our debug levels here
Common::clearAllDebugChannels();
+ delete _rnd;
}
Common::Error WageEngine::run() {
diff --git a/engines/wage/wage.h b/engines/wage/wage.h
index 5c56d74eb8..0c70b5ce0f 100644
--- a/engines/wage/wage.h
+++ b/engines/wage/wage.h
@@ -57,6 +57,7 @@
#include "common/endian.h"
#include "common/rect.h"
#include "common/macresman.h"
+#include "common/random.h"
struct ADGameDescription;
@@ -99,8 +100,7 @@ private:
bool loadWorld(Common::MacResManager *resMan);
public:
- // We need random numbers
- Common::RandomSource _rnd;
+ Common::RandomSource *_rnd;
World *_world;