summaryrefslogtreecommitdiff
path: root/src/code/code_800FD970.c
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2020-05-15 23:53:58 +0100
committerGitHub <noreply@github.com>2020-05-15 18:53:58 -0400
commit63985a001145d5e3721c35c725ae981073d6e106 (patch)
tree04830df2a107c5c0a7b25d6e0bfb9f9f1c1ae8ac /src/code/code_800FD970.c
parent47e25298a01a167e29af566e16aee031035850f2 (diff)
Rename variables in code_800FD970 (#142)
* Decompile code_800FD970 * Comment cleanups, ensure formatter won't cause a matching issue later * Make code_800FD970 variables static and rename * Delete data and bss asm files
Diffstat (limited to 'src/code/code_800FD970.c')
-rw-r--r--src/code/code_800FD970.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/code/code_800FD970.c b/src/code/code_800FD970.c
index ba981a07b..b99281774 100644
--- a/src/code/code_800FD970.c
+++ b/src/code/code_800FD970.c
@@ -2,23 +2,23 @@
#include <global.h>
// The latest generated random number, used to generate the next number in the sequence.
-u32 randomNumber = 1;
+static u32 sRandInt = 1;
// Space to store a value to be re-interpreted as a float.
-u32 floatStore;
+static u32 sRandFloat;
/**
* Gets the next integer in the sequence of pseudo-random numbers.
*/
u32 Math_Rand_Next() {
- return randomNumber = (randomNumber * 1664525) + 1013904223;
+ return sRandInt = (sRandInt * 1664525) + 1013904223;
}
/**
* Seeds the pseudo-random number generator by providing a starting value.
*/
void Math_Rand_Seed(u32 seed) {
- randomNumber = seed;
+ sRandInt = seed;
}
/**
@@ -27,9 +27,9 @@ void Math_Rand_Seed(u32 seed) {
* between 1.0f and 2.0f, returning the result subtract 1.0f.
*/
f32 Math_Rand_ZeroOne() {
- randomNumber = (randomNumber * 1664525) + 1013904223;
- floatStore = ((randomNumber >> 9) | 0x3F800000);
- return *((f32*)&floatStore) - 1.0f;
+ sRandInt = (sRandInt * 1664525) + 1013904223;
+ sRandFloat = ((sRandInt >> 9) | 0x3F800000);
+ return *((f32*)&sRandFloat) - 1.0f;
}
/**
@@ -37,9 +37,9 @@ f32 Math_Rand_ZeroOne() {
* manner in which Math_Rand_ZeroOne generates its result.
*/
f32 Math_Rand_Centered() {
- randomNumber = (randomNumber * 1664525) + 1013904223;
- floatStore = ((randomNumber >> 9) | 0x3F800000);
- return *((f32*)&floatStore) - 1.5f;
+ sRandInt = (sRandInt * 1664525) + 1013904223;
+ sRandFloat = ((sRandInt >> 9) | 0x3F800000);
+ return *((f32*)&sRandFloat) - 1.5f;
}
/**
@@ -65,9 +65,9 @@ f32 Math_Rand_ZeroOne_Variable(u32* rndNum) {
next = (*rndNum * 1664525) + 1013904223;
// clang-format off
- *rndNum = next; floatStore = (next >> 9) | 0x3F800000;
+ *rndNum = next; sRandFloat = (next >> 9) | 0x3F800000;
// clang-format on
- return *((f32*)&floatStore) - 1.0f;
+ return *((f32*)&sRandFloat) - 1.0f;
}
/**
@@ -79,7 +79,7 @@ f32 Math_Rand_Centered_Variable(u32* rndNum) {
next = (*rndNum * 1664525) + 1013904223;
// clang-format off
- *rndNum = next; floatStore = (next >> 9) | 0x3F800000;
+ *rndNum = next; sRandFloat = (next >> 9) | 0x3F800000;
// clang-format on
- return *((f32*)&floatStore) - 1.5f;
+ return *((f32*)&sRandFloat) - 1.5f;
}