aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorEugene Sandulenko2007-09-19 13:55:05 +0000
committerEugene Sandulenko2007-09-19 13:55:05 +0000
commit77eea722afe175003baba3ed5341bfbf8cf988f6 (patch)
treeff95cd001b8929308468d69466623f0c28be476b /engines/parallaction
parent2254028365cf5f162bd41cf0011b4475ec608f4c (diff)
downloadscummvm-rg350-77eea722afe175003baba3ed5341bfbf8cf988f6.tar.gz
scummvm-rg350-77eea722afe175003baba3ed5341bfbf8cf988f6.tar.bz2
scummvm-rg350-77eea722afe175003baba3ed5341bfbf8cf988f6.zip
Modified patch #1738058: "Action recorder".
svn-id: r28968
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/objects.cpp3
-rw-r--r--engines/parallaction/parallaction.cpp2
-rw-r--r--engines/parallaction/parallaction.h1
3 files changed, 5 insertions, 1 deletions
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index 30ce5b77a9..283802ef45 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "parallaction/parallaction.h"
#include "parallaction/objects.h"
#include "parallaction/parser.h"
@@ -287,7 +288,7 @@ int16 ScriptVar::getRValue() {
}
if (_flags & kParaRandom) {
- return (rand() * _value) / 32767;
+ return (_vm->_rnd.getRandomNumber(65536) * _value) / 32767;
}
error("Parameter is not an r-value");
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 22ebd51439..c1b64ad009 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -111,6 +111,8 @@ Parallaction::Parallaction(OSystem *syst) :
Common::addSpecialDebugLevel(kDebugInput, "input", "Input debug level");
Common::addSpecialDebugLevel(kDebugAudio, "audio", "Audio debug level");
Common::addSpecialDebugLevel(kDebugMenu, "menu", "Menu debug level");
+
+ syst->getEventManager()->registerRandomSource(_rnd, "parallaction");
}
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index c0975d4c85..6fc9477214 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -492,6 +492,7 @@ public:
Font *_menuFont;
Font *_dialogueFont;
+ Common::RandomSource _rnd;
protected: // data