tag_allmato almost, swhit0 treesh swball done, misc cleanup (#2312)

* d_a_tag_allmato almost done

* d_a_swhit0 done

* some SSystem cleanup

* treesh done

* swball done, some other rel cleanup
This commit is contained in:
TakaRikka
2025-03-01 04:48:49 -08:00
committed by GitHub
parent 80edf3c8a8
commit f06311cd09
54 changed files with 2162 additions and 1767 deletions
+7 -5
View File
@@ -41,8 +41,9 @@ void cLib_memSet(void* ptr, int value, unsigned long num) {
* @return The absolute value of remaining distance to target
*/
f32 cLib_addCalc(f32* pvalue, f32 target, f32 scale, f32 maxStep, f32 minStep) {
f32 step = 0.0f;
if (*pvalue != target) {
f32 step = scale * (target - *pvalue);
step = scale * (target - *pvalue);
if (step >= minStep || step <= -minStep) {
if (step > maxStep) {
step = maxStep;
@@ -54,15 +55,16 @@ f32 cLib_addCalc(f32* pvalue, f32 target, f32 scale, f32 maxStep, f32 minStep) {
} else {
if (step > 0) {
if (step < minStep) {
*pvalue += minStep;
step = minStep;
*pvalue += step;
if (*pvalue > target) {
*pvalue = target;
}
}
} else {
minStep = -minStep;
if (step > minStep) {
*pvalue += minStep;
if (step > -minStep) {
step = -minStep;
*pvalue += step;
if (*pvalue < target) {
*pvalue = target;
}