diff options
author | Robin Watts | 2008-02-17 16:12:54 +0000 |
---|---|---|
committer | Robin Watts | 2008-02-17 16:12:54 +0000 |
commit | 890bca8f7ec17d308733b5d740700807508868b9 (patch) | |
tree | 7e408e92c8788cf2ba84f7512f823c12a31ef89e /common/util.h | |
parent | 5b31fe75d4cf8cc7c6c0272d660ebf07a49916bd (diff) | |
download | scummvm-rg350-890bca8f7ec17d308733b5d740700807508868b9.tar.gz scummvm-rg350-890bca8f7ec17d308733b5d740700807508868b9.tar.bz2 scummvm-rg350-890bca8f7ec17d308733b5d740700807508868b9.zip |
Tweaks to fmopl; same net effect overall, just faster.
Eliminate divisions, floating point, and mod operation from inner synth loop.
svn-id: r30896
Diffstat (limited to 'common/util.h')
-rw-r--r-- | common/util.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/util.h b/common/util.h index e7a71ff42c..dd205f159c 100644 --- a/common/util.h +++ b/common/util.h @@ -83,7 +83,7 @@ bool matchString(const char *str, const char *pat); class StringTokenizer { public: /** - * Creates a StringTokenizer. + * Creates a StringTokenizer. * @param str The string to be tokenized. * @param delimiters String containing all the delimiter characters (i.e. the characters to be ignored). * @note Uses space, horizontal tab, carriage return, newline, form feed and vertical tab as delimiters by default. @@ -132,6 +132,12 @@ public: */ uint getRandomNumber(uint max); /** + * Generates a random unsigned integer in the interval [0, 1]. + * Identical to getRandomNumber(1), but faster, hopefully. + * @return a random number in the interval [0, max]. + */ + uint getRandomBit(void); + /** * Generates a random unsigned integer in the interval [min, max]. * @param min the lower bound * @param max the upper bound |