aboutsummaryrefslogtreecommitdiff
path: root/common/random.h
diff options
context:
space:
mode:
authorMax Horn2011-05-16 16:35:10 +0200
committerMax Horn2011-05-17 12:17:26 +0200
commit4cbe4ede66e65ec9289811eca2f5f62285174c8d (patch)
tree19e97e1d96797a2e063786e5f7f9c3e4ebb71d93 /common/random.h
parent305c13a4aac6074ac734f77dad708e0aca86bbd7 (diff)
downloadscummvm-rg350-4cbe4ede66e65ec9289811eca2f5f62285174c8d.tar.gz
scummvm-rg350-4cbe4ede66e65ec9289811eca2f5f62285174c8d.tar.bz2
scummvm-rg350-4cbe4ede66e65ec9289811eca2f5f62285174c8d.zip
COMMON: Registers RandomSources in constructor with the event recorder
This also removes the dependency of engines on the event recorder header and API, and will make it easier to RandomSources that are not properly registered.
Diffstat (limited to 'common/random.h')
-rw-r--r--common/random.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/random.h b/common/random.h
index 437675ab0a..308d8a62b9 100644
--- a/common/random.h
+++ b/common/random.h
@@ -26,6 +26,8 @@
namespace Common {
+class String;
+
/**
* Simple random number generator. Although it is definitely not suitable for
* cryptographic purposes, it serves our purposes just fine.
@@ -35,7 +37,21 @@ private:
uint32 _randSeed;
public:
+ /**
+ * Construct a new randomness source with the specific name.
+ * The name used name must be globally unique, and is used to
+ * register the randomness source with the active event recorder,
+ * if any.
+ */
+ RandomSource(const String &name);
+
+ // FIXME: This constructor for a nameless randomness source should be removed.
+ // I am only adding this temporarily to ease transition to the new
+ // system which enforces names for randomness sources.
RandomSource();
+
+ ~RandomSource();
+
void setSeed(uint32 seed);
uint32 getSeed() {