mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-17 07:07:10 +00:00
CGE: Implement random number source
This commit is contained in:
parent
a1f177317c
commit
41c7482a52
@ -41,7 +41,7 @@
|
||||
namespace CGE {
|
||||
|
||||
CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
|
||||
: Engine(syst), _gameDescription(gameDescription) {
|
||||
: Engine(syst), _gameDescription(gameDescription), _randomSource("cge") {
|
||||
|
||||
// Debug/console setup
|
||||
DebugMan.addDebugChannel(kCGEDebug, "general", "CGE general debug channel");
|
||||
|
@ -70,6 +70,7 @@ public:
|
||||
bool _music;
|
||||
int _pocref[POCKET_NX];
|
||||
uint8 _volume[2];
|
||||
Common::RandomSource _randomSource;
|
||||
|
||||
virtual Common::Error run();
|
||||
GUI::Debugger *getDebugger() {
|
||||
|
@ -25,6 +25,7 @@
|
||||
* Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon
|
||||
*/
|
||||
|
||||
#include "cge/cge.h"
|
||||
#include "cge/general.h"
|
||||
#include "cge/snddrv.h"
|
||||
#include "cge/wav.h"
|
||||
@ -356,8 +357,7 @@ long timer(void) {
|
||||
}
|
||||
|
||||
int new_random(int range) {
|
||||
warning("STUB: new_random(a)");
|
||||
return 0;
|
||||
return ((CGEEngine *)g_engine)->_randomSource.getRandomNumber(range - 1);
|
||||
}
|
||||
|
||||
#define TIMER_INT 0x08
|
||||
|
Loading…
Reference in New Issue
Block a user