|
Oolite
|
#include <stdio.h>#include <math.h>#include <stdint.h>#include <stdbool.h>#include <assert.h>#include "legacy_random.h"
Include dependency graph for legacy_random.c: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().
Here is the call graph for this function:| 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(), and OOPlanetEntity::initFromDictionary:withAtmosphere:andSeed:forSystem:.
Here is the caller graph for this function:| 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(), OldRandomDigrams(), and OOPlanetEntity::RandomHSBColor(void).
Here is the caller graph for this function:| 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().
Here is the call graph for this function:
Here is the caller graph for this function:| RANROTSeed MakeRanrotSeed | ( | uint32_t | seed | ) |
Definition at line 113 of file legacy_random.c.
References RANROTSeed::low, and RanrotWithSeed().
Referenced by ranrot_srand(), and RanrotSeedFromRNGSeed().
Here is the call graph for this function:
Here is the caller graph for this function:| void OOInitReallyRandom | ( | uint64_t | seed | ) |
Definition at line 256 of file legacy_random.c.
References RANROTSeed::high, RANROTSeed::low, OOReallyRandom(), sReallyRandomInited, and sReallyRandomSeed.
Here is the call graph for this function:| uint32_t OOReallyRandom | ( | void | ) |
Definition at line 249 of file legacy_random.c.
References RanrotWithSeed(), sReallyRandomInited, and sReallyRandomSeed.
Referenced by OOInitReallyRandom(), OOSetReallyRandomRANROTSeed(), and OOSetReallyRandomRndSeed().
Here is the call graph for this function:
Here is the caller graph for this function:| 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().
Here is the caller graph for this function:| OORandomState OOSaveRandomState | ( | void | ) |
Definition at line 292 of file legacy_random.c.
References OORandomState::ranrot, rnd_seed, and sRANROT.
Referenced by OOExpandDescriptionString().
Here is the caller graph for this function:| void OOSetReallyRandomRANROTAndRndSeeds | ( | void | ) |
Definition at line 285 of file legacy_random.c.
References OOSetReallyRandomRANROTSeed(), and OOSetReallyRandomRndSeed().
Referenced by OOExpandDescriptionString().
Here is the call graph for this function:
Here is the caller graph for this function:| void OOSetReallyRandomRANROTSeed | ( | void | ) |
Definition at line 267 of file legacy_random.c.
References OOReallyRandom(), sRANROT, sReallyRandomInited, and sReallyRandomSeed.
Referenced by OOSetReallyRandomRANROTAndRndSeeds().
Here is the call graph for this function:
Here is the caller graph for this function:| 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().
Here is the call graph for this function:
Here is the caller graph for this function:| 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().
Here is the call graph for this function:
Here is the caller graph for this function:| float randfWithSeed | ( | RANROTSeed * | ioSeed | ) |
Definition at line 162 of file legacy_random.c.
References RanrotWithSeed().
Here is the call graph for this function:| 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().
Here is the caller graph for this function:| void ranrot_srand | ( | uint32_t | seed | ) |
Definition at line 150 of file legacy_random.c.
References MakeRanrotSeed(), and sRANROT.
Here is the call graph for this function:| RANROTSeed RANROTGetFullSeed | ( | void | ) |
Definition at line 185 of file legacy_random.c.
References sRANROT.
Referenced by fillRanNoiseBuffer(), and OOPlanetEntity::initFromDictionary:withAtmosphere:andSeed:forSystem:.
Here is the caller graph for this function:| RANROTSeed RanrotSeedFromRandomSeed | ( | Random_Seed | seed | ) |
Definition at line 136 of file legacy_random.c.
References RNG_Seed::a, Random_Seed::c, Random_Seed::d, Random_Seed::e, Random_Seed::f, and RanrotSeedFromRNGSeed().
Here is the call graph for this function:| 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().
Here is the call graph for this function:
Here is the caller graph for this function:| void RANROTSetFullSeed | ( | RANROTSeed | seed | ) |
Definition at line 191 of file legacy_random.c.
References sRANROT.
Referenced by OOPlanetEntity::initFromDictionary:withAtmosphere:andSeed:forSystem:.
Here is the caller graph for this function:| 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().
Here is the caller graph for this function:| 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.
Referenced by OOPlanetEntity::initFromDictionary:withAtmosphere:andSeed:forSystem:.
Here is the call graph for this function:
Here is the caller graph for this function:| 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().
Here is the caller graph for this function:| void setRandomSeed | ( | RNG_Seed | a_seed | ) |
Definition at line 219 of file legacy_random.c.
References rnd_seed.
Referenced by GlobalRandomName(), and OOPlanetEntity::initFromDictionary:withAtmosphere:andSeed:forSystem:.
Here is the caller graph for this function:
|
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().