aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mortevielle/mortevielle.cpp2
-rw-r--r--engines/mortevielle/mortevielle.h2
-rw-r--r--engines/mortevielle/var_mor.cpp6
3 files changed, 7 insertions, 3 deletions
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index f3ad46894d..bdb5b710c8 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -37,7 +37,7 @@ namespace Mortevielle {
MortevielleEngine *g_vm;
MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc):
- Engine(system), _gameDescription(gameDesc) {
+ Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle") {
g_vm = this;
_lastGameFrame = 0;
_mouseButtons = 0;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 9974d1c40e..b0e7343d0e 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -25,6 +25,7 @@
#include "common/events.h"
#include "common/file.h"
+#include "common/random.h"
#include "common/rect.h"
#include "common/stack.h"
#include "engines/advancedDetector.h"
@@ -65,6 +66,7 @@ public:
ScreenSurface _screenSurface;
PaletteManager _paletteManager;
GfxSurface _backgroundSurface;
+ Common::RandomSource _randomSource;
public:
MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
~MortevielleEngine();
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 444d9c6d5d..92f20a4442 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -307,9 +307,11 @@ void graphbackground(int c) {
void intr(int intNum, registres &regs) {
}
+/**
+ * Get a random number between two values
+ */
int get_random_number(int minval, int maxval) {
- // TODO: Replace with a proper random source in the engine
- return minval;
+ return g_vm->_randomSource.getRandomNumber(maxval - minval) + minval;
}
bool keypressed() {