mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-02 17:48:21 -04:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user