diff options
| author | hatal175 <hatal175@users.noreply.github.com> | 2025-04-12 00:54:08 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-11 14:54:08 -0700 |
| commit | cc3e0856bfc1d7597c47c84fb428da5f8e0a5536 (patch) | |
| tree | 4dadb3c5af2b853451ab4d879aeaef75e1c11502 /include/JSystem/JMath | |
| parent | 0b50e106ccc4fb32b52ee6d9487bc9b3d5fc16aa (diff) | |
Misc Matches using debug (#2388)
Diffstat (limited to 'include/JSystem/JMath')
| -rw-r--r-- | include/JSystem/JMath/JMath.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JMath/random.h | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index 50ad426d36..68cfab2315 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -12,7 +12,7 @@ void JMAVECScaleAdd(register const Vec* vec1, register const Vec* vec2, register register f32 scale); inline int JMAAbs(int value) { - return value > 0 ? value : -value; + return __abs(value); } inline f32 JMAFastReciprocal(f32 value) { diff --git a/include/JSystem/JMath/random.h b/include/JSystem/JMath/random.h index 4b4babb2f7..cfb8ecc1aa 100644 --- a/include/JSystem/JMath/random.h +++ b/include/JSystem/JMath/random.h @@ -20,10 +20,6 @@ struct TRandom_fast_ { u32 get_bit32(void) { return this->get(); } - u8 get_uint8(u8 param_0) { - return get_ufloat_1() * param_0; - } - // due to the float constant, having this function inlined adds that float to data, // making it not match float get_ufloat_1(void) { @@ -39,6 +35,17 @@ struct TRandom_fast_ { void setSeed(u32 seed) { value = seed; } }; + +template <class RandomT> +class TRandom_ : public RandomT { +public: + TRandom_(u32 value) : RandomT(value) {} + + u8 get_uint8(u8 param_0) { + return get_ufloat_1() * param_0; + } +}; + } // namespace JMath #endif /* RANDOM_H */ |
