mirror of
https://github.com/encounter/tp.git
synced 2026-03-30 11:40:53 -07:00
a61e3491f7
* initial freezard actor struct + setActionMode OK * daE_FZ_Draw * setReflectAngle * mBoundSoundset * daE_FZ_Execute & execute * demoDelete * daE_FZ_Delete & _delete * CreateHeap * useHeapInit * cc_set * mtx_set * action WIP * way_gake_check * executeRollMove * executeMove * draw WIP * executeDamage * checkpoint * create * checkpoint * daE_FZ_c::executeWait * checkpoint * daE_FZ_c::damage_check almost done * rm asm * rm headers * setup_profile WIP + doxygen update * fix merge issues * docs fix? * fix2 * doxygen updates * setup g_profile_E_FZ, profile setup script WIP * update github actions * update progress.md
40 lines
708 B
C++
40 lines
708 B
C++
#ifndef JPARANDOM_H
|
|
#define JPARANDOM_H
|
|
|
|
/**
|
|
* @ingroup jsystem-jparticle
|
|
*
|
|
*/
|
|
struct JPARandom {
|
|
public:
|
|
JPARandom() { mSeed = 0; }
|
|
void set_seed(u32 seed) { mSeed = seed; }
|
|
|
|
u32 get_rndm_u() { return mSeed = mSeed * 0x19660du + 0x3c6ef35fu; }
|
|
|
|
f32 get_rndm_f() {
|
|
union {
|
|
u32 u;
|
|
f32 f;
|
|
} a;
|
|
a.u = ((get_rndm_u() >> 9) | 0x3f800000);
|
|
return a.f - 1.0f;
|
|
}
|
|
|
|
f32 get_rndm_zp() {
|
|
f32 f = get_rndm_f();
|
|
return (f + f) - 1.0f;
|
|
}
|
|
|
|
f32 get_rndm_zh() {
|
|
f32 f = get_rndm_f();
|
|
return f - 0.5f;
|
|
}
|
|
|
|
s16 get_rndm_ss() { return (s16)(get_rndm_u() >> 16); }
|
|
|
|
public:
|
|
u32 mSeed;
|
|
};
|
|
|
|
#endif |