Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
random.h
Go to the documentation of this file.
1
#ifndef RANDOM_H
2
#define RANDOM_H
3
4
#include "
dolphin/types.h
"
5
6
namespace
JMath
{
7
12
struct
TRandom_fast_
{
13
u32
value
;
14
15
TRandom_fast_
(
u32
value
);
16
u32
get
(
void
) {
17
value
= (
value
* 0x19660d) + 0x3c6ef35f;
18
return
value
;
19
}
20
21
u32
get_bit32
(
void
) {
return
this->
get
(); }
22
23
s8
get_uint8
(
u8
param_0
) {
24
return
get_ufloat_1
() *
param_0
;
25
}
26
27
// due to the float constant, having this function inlined adds that float to data,
28
// making it not match
29
float
get_ufloat_1
(
void
) {
30
// !@bug UB: in C++ it's not legal to read from an union member other
31
// than the last one that was written to.
32
union
{
33
f32
f;
34
u32
s
;
35
}
out
;
36
out
.s = (this->
get
() >> 9) | 0x3f800000;
37
return
out
.f - 1;
38
}
39
40
void
setSeed
(
u32
seed
) {
value
=
seed
; }
41
};
42
}
// namespace JMath
43
44
#endif
/* RANDOM_H */
cLib_calcTimer
T cLib_calcTimer(T *value)
Definition
c_lib.h:74
s
s
Definition
e_acos.c:94
JMath
Definition
JMATrigonometric.cpp:78
JMath::TRandom_fast_
Definition
random.h:12
JMath::TRandom_fast_::get
u32 get(void)
Definition
random.h:16
JMath::TRandom_fast_::get_uint8
s8 get_uint8(u8 param_0)
Definition
random.h:23
JMath::TRandom_fast_::get_ufloat_1
float get_ufloat_1(void)
Definition
random.h:29
JMath::TRandom_fast_::setSeed
void setSeed(u32 seed)
Definition
random.h:40
JMath::TRandom_fast_::get_bit32
u32 get_bit32(void)
Definition
random.h:21
JMath::TRandom_fast_::value
u32 value
Definition
random.h:13
types.h
s8
signed char s8
Definition
types.h:4
u32
unsigned long u32
Definition
types.h:10
f32
float f32
Definition
types.h:22
u8
unsigned char u8
Definition
types.h:8
include
JSystem
JMath
random.h
Generated by
1.9.8