mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-20 16:59:06 +00:00
MORTEVIELLE: Properly implement get_random_number method
This commit is contained in:
parent
962069f937
commit
37386cdf7c
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -307,9 +307,11 @@ void graphbackground(int c) {
|
||||
void intr(int intNum, registres ®s) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
|
Loading…
Reference in New Issue
Block a user