summaryrefslogtreecommitdiff
path: root/include/SSystem
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2023-06-06 20:32:17 +0300
committerGitHub <noreply@github.com>2023-06-06 11:32:17 -0600
commit98582af6d2999108c2bce482f1a5b91bbc4ac5fa (patch)
treea334b85f6ad254146b148d82124f5f9a8367bfef /include/SSystem
parent565453690e25c7e7dcd398befc5b621827db4745 (diff)
work on d_a_npc, d_a_npc_ash, d_a_tag_evtarea (#345)
All credit goes to randomsalience
Diffstat (limited to 'include/SSystem')
-rw-r--r--include/SSystem/SComponent/c_cc_d.h1
-rw-r--r--include/SSystem/SComponent/c_lib.h5
-rw-r--r--include/SSystem/SComponent/c_math.h4
3 files changed, 8 insertions, 2 deletions
diff --git a/include/SSystem/SComponent/c_cc_d.h b/include/SSystem/SComponent/c_cc_d.h
index fe834acc38..b8b1ba29fa 100644
--- a/include/SSystem/SComponent/c_cc_d.h
+++ b/include/SSystem/SComponent/c_cc_d.h
@@ -458,6 +458,7 @@ public:
void OffAtVsPlayerBit() { mObjAt.OffSPrmBit(0xC); }
void OnAtVsPlayerBit() { mObjAt.OnSPrmBit(0xC); }
void OnCoSPrmBit(u32 flag) { mObjCo.OnSPrmBit(flag); }
+ void SetTgSPrm(u32 prm) { mObjTg.SetSPrm(prm); }
void SetCoSPrm(u32 prm) { mObjCo.SetSPrm(prm); }
}; // Size = 0x40
diff --git a/include/SSystem/SComponent/c_lib.h b/include/SSystem/SComponent/c_lib.h
index 886f72583d..f1488363f6 100644
--- a/include/SSystem/SComponent/c_lib.h
+++ b/include/SSystem/SComponent/c_lib.h
@@ -94,6 +94,11 @@ T cLib_calcTimer(T* value) {
return *value;
}
+template <typename T>
+T cLib_getRndValue(T min, T range) {
+ return (T)(min + cM_rndF((f32)range));
+}
+
void MtxInit(void);
void MtxTrans(f32, f32, f32, u8);
void MtxScale(f32, f32, f32, u8);
diff --git a/include/SSystem/SComponent/c_math.h b/include/SSystem/SComponent/c_math.h
index 1a9f67eefe..ae0d798509 100644
--- a/include/SSystem/SComponent/c_math.h
+++ b/include/SSystem/SComponent/c_math.h
@@ -18,11 +18,11 @@ float cM_rndF2(float);
float cM_rndFX2(float);
inline f32 cM_scos(s16 s) {
- return JMath::sincosTable_.table[static_cast<u16>(s) >> 3].second;
+ return JMASCos(s);
}
inline f32 cM_ssin(s16 s) {
- return JMath::sincosTable_.table[static_cast<u16>(s) >> 3].first;
+ return JMASSin(s);
}
inline s16 cM_deg2s(f32 val) {