Oolite 1.91.0.7646-241128-10e222e
|
#include <stdio.h>
#include <math.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include "legacy_random.h"
Go to the source code of this file.
Variables | |
const Random_Seed | kNilRandomSeed = {0} |
static RNG_Seed | rnd_seed |
static int32_t | checksum |
static RANROTSeed | sRANROT |
static bool | sReallyRandomInited = false |
static RANROTSeed | sReallyRandomSeed |
float bellf | ( | int | n | ) |
Definition at line 168 of file legacy_random.c.
References EXPECT_NOT, and Ranrot().
void clear_checksum | ( | void | ) |
Definition at line 42 of file legacy_random.c.
References checksum.
double cunningFee | ( | double | value, |
double | precision ) |
Definition at line 62 of file legacy_random.c.
RNG_Seed currentRandomSeed | ( | void | ) |
Definition at line 213 of file legacy_random.c.
References rnd_seed.
Referenced by GlobalRandomName().
int gen_rnd_number | ( | void | ) |
Definition at line 225 of file legacy_random.c.
References RNG_Seed::a, RNG_Seed::b, RNG_Seed::c, RNG_Seed::d, rnd_seed, and x.
Referenced by make_pseudo_random_seed(), and OldRandomDigrams().
void make_pseudo_random_seed | ( | Random_Seed * | seed_ptr | ) |
Definition at line 309 of file legacy_random.c.
References Random_Seed::a, Random_Seed::b, Random_Seed::c, Random_Seed::d, Random_Seed::e, Random_Seed::f, and gen_rnd_number().
Referenced by GlobalRandomInhabitantsDescription().
RANROTSeed MakeRanrotSeed | ( | uint32_t | seed | ) |
Definition at line 113 of file legacy_random.c.
References RanrotWithSeed().
Referenced by ranrot_srand(), and RanrotSeedFromRNGSeed().
void OOInitReallyRandom | ( | uint64_t | seed | ) |
Definition at line 256 of file legacy_random.c.
References RANROTSeed::high, RANROTSeed::low, OOReallyRandom(), sReallyRandomInited, and sReallyRandomSeed.
uint32_t OOReallyRandom | ( | void | ) |
Definition at line 249 of file legacy_random.c.
References RanrotWithSeed(), sReallyRandomInited, and sReallyRandomSeed.
Referenced by OOInitReallyRandom(), OOSetReallyRandomRANROTSeed(), and OOSetReallyRandomRndSeed().
void OORestoreRandomState | ( | OORandomState | state | ) |
Definition at line 302 of file legacy_random.c.
References OORandomState::ranrot, OORandomState::rnd, rnd_seed, and sRANROT.
Referenced by OOExpandDescriptionString().
OORandomState OOSaveRandomState | ( | void | ) |
Definition at line 292 of file legacy_random.c.
References rnd_seed, and sRANROT.
Referenced by OOExpandDescriptionString().
void OOSetReallyRandomRANROTAndRndSeeds | ( | void | ) |
Definition at line 285 of file legacy_random.c.
References OOSetReallyRandomRANROTSeed(), and OOSetReallyRandomRndSeed().
Referenced by OOExpandDescriptionString().
void OOSetReallyRandomRANROTSeed | ( | void | ) |
Definition at line 267 of file legacy_random.c.
References OOReallyRandom(), sRANROT, sReallyRandomInited, and sReallyRandomSeed.
Referenced by OOSetReallyRandomRANROTAndRndSeeds().
void OOSetReallyRandomRndSeed | ( | void | ) |
Definition at line 275 of file legacy_random.c.
References RNG_Seed::a, RNG_Seed::b, RNG_Seed::c, RNG_Seed::d, OOReallyRandom(), and rnd_seed.
Referenced by OOSetReallyRandomRANROTAndRndSeeds().
float randf | ( | void | ) |
Definition at line 156 of file legacy_random.c.
References Ranrot().
Referenced by WormholeEntity::DrawWormholeCorona, fillRanNoiseBuffer(), OOFuzzyBooleanFromObject(), OOHPRandomPositionInBoundingBox(), OOHPVectorRandomRadial(), OOHPVectorRandomSpatial(), OORandomPositionInBoundingBox(), OORandomPositionInCylinder(), OORandomUnitHPVector(), OORandomUnitVector(), OOVectorRandomRadial(), and OOVectorRandomSpatial().
float randfWithSeed | ( | RANROTSeed * | ioSeed | ) |
Definition at line 162 of file legacy_random.c.
References RanrotWithSeed().
unsigned Ranrot | ( | void | ) |
Definition at line 93 of file legacy_random.c.
References RANROTSeed::high, RANROTSeed::low, and sRANROT.
Referenced by bellf(), GlobalRandomName(), quaternion_set_random(), randf(), Octree::randomFullNodeFrom, StationAddShipToShipyard(), and SVGDumpBeginPrimitive().
void ranrot_srand | ( | uint32_t | seed | ) |
Definition at line 150 of file legacy_random.c.
References MakeRanrotSeed(), and sRANROT.
RANROTSeed RANROTGetFullSeed | ( | void | ) |
Definition at line 185 of file legacy_random.c.
References sRANROT.
Referenced by fillRanNoiseBuffer().
RANROTSeed RanrotSeedFromRandomSeed | ( | Random_Seed | seed | ) |
Definition at line 136 of file legacy_random.c.
References Random_Seed::c, Random_Seed::d, Random_Seed::e, Random_Seed::f, and RanrotSeedFromRNGSeed().
RANROTSeed RanrotSeedFromRNGSeed | ( | RNG_Seed | seed | ) |
Definition at line 130 of file legacy_random.c.
References RNG_Seed::a, RNG_Seed::b, RNG_Seed::c, RNG_Seed::d, and MakeRanrotSeed().
Referenced by RanrotSeedFromRandomSeed(), and seed_for_planet_description().
void RANROTSetFullSeed | ( | RANROTSeed | seed | ) |
unsigned RanrotWithSeed | ( | RANROTSeed * | ioSeed | ) |
Definition at line 102 of file legacy_random.c.
References RANROTSeed::high, and RANROTSeed::low.
Referenced by MakeRanrotSeed(), OOReallyRandom(), and randfWithSeed().
void rotate_seed | ( | Random_Seed * | seed_ptr | ) |
Definition at line 320 of file legacy_random.c.
References Random_Seed::a, Random_Seed::b, Random_Seed::c, Random_Seed::d, Random_Seed::e, Random_Seed::f, x, and y.
void seed_for_planet_description | ( | Random_Seed | s_seed | ) |
Definition at line 206 of file legacy_random.c.
References RanrotSeedFromRNGSeed(), rnd_seed, seed_RNG_only_for_planet_description(), and sRANROT.
void seed_RNG_only_for_planet_description | ( | Random_Seed | s_seed | ) |
Definition at line 197 of file legacy_random.c.
References RNG_Seed::a, RNG_Seed::b, Random_Seed::c, RNG_Seed::c, Random_Seed::d, RNG_Seed::d, Random_Seed::e, Random_Seed::f, and rnd_seed.
Referenced by OOGenerateSystemDescription(), and seed_for_planet_description().
void setRandomSeed | ( | RNG_Seed | a_seed | ) |
Definition at line 219 of file legacy_random.c.
References rnd_seed.
Referenced by GlobalRandomName().
|
static |
Definition at line 41 of file legacy_random.c.
Referenced by clear_checksum(), and munge_checksum().
const Random_Seed kNilRandomSeed = {0} |
Definition at line 34 of file legacy_random.c.
Referenced by GlobalExpandDescription(), GlobalExpandMissionText(), is_nil_seed(), and RandomSeedFromString().
|
static |
Definition at line 37 of file legacy_random.c.
Referenced by currentRandomSeed(), gen_rnd_number(), OORestoreRandomState(), OOSaveRandomState(), OOSetReallyRandomRndSeed(), seed_for_planet_description(), seed_RNG_only_for_planet_description(), and setRandomSeed().
|
static |
Definition at line 90 of file legacy_random.c.
Referenced by OORestoreRandomState(), OOSaveRandomState(), OOSetReallyRandomRANROTSeed(), Ranrot(), ranrot_srand(), RANROTGetFullSeed(), RANROTSetFullSeed(), and seed_for_planet_description().
|
static |
Definition at line 245 of file legacy_random.c.
Referenced by OOInitReallyRandom(), OOReallyRandom(), and OOSetReallyRandomRANROTSeed().
|
static |
Definition at line 246 of file legacy_random.c.
Referenced by OOInitReallyRandom(), OOReallyRandom(), and OOSetReallyRandomRANROTSeed().