X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frandom_generator.hpp;h=5e5b3c6513ece2f12c8b3851c23d8105fea016cf;hb=472d0ad804844d28811c86f03da74b6d6be53f1b;hp=3bd391d42084563aa396e83059c8d1f31184be53;hpb=d963f8dc3d2c4e432d3eeecd15351169e10243da;p=supertux.git diff --git a/src/random_generator.hpp b/src/random_generator.hpp index 3bd391d42..5e5b3c651 100644 --- a/src/random_generator.hpp +++ b/src/random_generator.hpp @@ -1,5 +1,5 @@ // $Id$ -// +// // A strong random number generator // // Copyright (C) 2006 Allen King @@ -9,16 +9,16 @@ // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. +// documentation and/or other materials provided with the distribution. // 3. Neither the name of the project nor the names of its contributors // may be used to endorse or promote products derived from this software -// without specific prior written permission. -// +// without specific prior written permission. +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -28,16 +28,13 @@ // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. #ifndef __RANDOM_GENERATOR__ #define __RANDOM_GENERATOR__ -#include "scripting/random_generator.hpp" -#include "script_interface.hpp" - -class RandomGenerator : public Scripting::RandomGenerator +class RandomGenerator { private: // Array versions of the above information to make code run faster -- @@ -82,6 +79,8 @@ private: long rand_deg; long rand_sep; long *end_ptr; + int debug; + static const int rand_max = 0x7fffffff; // biggest signed Uint32 public: RandomGenerator(); @@ -96,7 +95,7 @@ public: // generate random 31-bit numbers // calls to the following return a value evenly distributed between u (or - // 0 if not specified) and v (or RAND_MAX if not specified). Return + // 0 if not specified) and v (or rand_max if not specified). Return // values may include u, but never v. int rand(); int rand(int v);