diff --git a/src/game/acosasin.c b/src/game/acosasin.c index b413511f2..dea785d5c 100644 --- a/src/game/acosasin.c +++ b/src/game/acosasin.c @@ -57,7 +57,7 @@ s32 func0f096890(s32 arg0) return value - (((value - nextvalue) * (arg0 & mask)) >> shiftamount); } -u16 acos(s16 arg0) +u16 acosx(s16 arg0) { s32 value = arg0 >= 0 ? arg0 : -arg0; @@ -70,7 +70,7 @@ u16 acos(s16 arg0) return value; } -s16 asin(s16 arg0) +s16 asinx(s16 arg0) { s32 value = arg0 >= 0 ? arg0 : -arg0; diff --git a/src/game/acosfasinf.c b/src/game/acosfasinf.c index b13568869..432be5fce 100644 --- a/src/game/acosfasinf.c +++ b/src/game/acosfasinf.c @@ -17,7 +17,7 @@ f32 acosf(f32 value) intval = value * 32767.0f; } - return acos(intval) * M_PI / 65535.0f; + return acosx(intval) * M_PI / 65535.0f; } f32 asinf(f32 value) @@ -32,5 +32,5 @@ f32 asinf(f32 value) intval = value * 32767.0f; } - return asin(intval) * M_PI / 65535.0f; + return asinx(intval) * M_PI / 65535.0f; } diff --git a/src/game/bg.c b/src/game/bg.c index c05b5ce1d..8f896df60 100644 --- a/src/game/bg.c +++ b/src/game/bg.c @@ -2213,7 +2213,7 @@ Gfx *bgScissorToViewport(Gfx *gdl) Gfx *bgScissorWithinViewportF(Gfx *gdl, f32 viewleft, f32 viewtop, f32 viewright, f32 viewbottom) { - gdl = bgScissorWithinViewport(gdl, viewleft, viewtop, ceil(viewright), ceil(viewbottom)); + gdl = bgScissorWithinViewport(gdl, viewleft, viewtop, ceiltoint(viewright), ceiltoint(viewbottom)); return gdl; } diff --git a/src/game/ceil.c b/src/game/ceil.c index acc6002b1..cf39bee43 100644 --- a/src/game/ceil.c +++ b/src/game/ceil.c @@ -21,7 +21,7 @@ f32 ceilf(f32 value) return fvalue + 1; } -s32 ceil(f32 value) +s32 ceiltoint(f32 value) { s32 ivalue; diff --git a/src/game/floor.c b/src/game/floor.c index 346b00533..cf28e17a8 100644 --- a/src/game/floor.c +++ b/src/game/floor.c @@ -21,7 +21,7 @@ f32 floorf(f32 value) return fvalue - 1; } -s32 floor(f32 value) +s32 floortoint(f32 value) { s32 ivalue; diff --git a/src/game/race.c b/src/game/race.c index 7e299c002..9aa63a616 100644 --- a/src/game/race.c +++ b/src/game/race.c @@ -40,7 +40,7 @@ s32 raceInitAnimGroup(struct attackanimconfig *configs) struct attackanimconfig *config = configs; while (config->animnum != 0) { - u16 angle = raceGetAnimSumAngleAsInt(config->animnum, 0, floor(config->unk04)); + u16 angle = raceGetAnimSumAngleAsInt(config->animnum, 0, floortoint(config->unk04)); if (config->unk04 > 0) { if (angle < 0x8000) { @@ -67,7 +67,7 @@ s32 raceInitAnimConfigSingle(struct attackanimconfig *config) if (config->animnum != 0) { - u16 angle = raceGetAnimSumAngleAsInt(config->animnum, 0, floor(config->unk04)); + u16 angle = raceGetAnimSumAngleAsInt(config->animnum, 0, floortoint(config->unk04)); if (config->unk04 > 0) { if (angle < 0x8000) { diff --git a/src/include/game/acosasin.h b/src/include/game/acosasin.h index cc41d6bb9..94c9b2199 100644 --- a/src/include/game/acosasin.h +++ b/src/include/game/acosasin.h @@ -4,7 +4,7 @@ #include "data.h" #include "types.h" -u16 acos(s16 arg0); -s16 asin(s16 arg0); +u16 acosx(s16 arg0); +s16 asinx(s16 arg0); #endif diff --git a/src/include/game/ceil.h b/src/include/game/ceil.h index c59c0937c..7f2a78699 100644 --- a/src/include/game/ceil.h +++ b/src/include/game/ceil.h @@ -5,6 +5,6 @@ #include "types.h" f32 ceilf(f32 value); -s32 ceil(f32 value); +s32 ceiltoint(f32 value); #endif diff --git a/src/include/game/floor.h b/src/include/game/floor.h index cc28babdf..0d51f2948 100644 --- a/src/include/game/floor.h +++ b/src/include/game/floor.h @@ -5,6 +5,6 @@ #include "types.h" f32 floorf(f32 value); -s32 floor(f32 value); +s32 floortoint(f32 value); #endif diff --git a/src/lib/model.c b/src/lib/model.c index 152dd52bb..364b06cce 100644 --- a/src/lib/model.c +++ b/src/lib/model.c @@ -1718,7 +1718,7 @@ s32 modelConstrainOrWrapAnimFrame(s32 frame, s16 animnum, f32 endframe) frame = 0; } } else if (endframe >= 0 && frame > (s32)endframe) { - frame = ceil(endframe); + frame = ceiltoint(endframe); } else if (frame >= animGetNumFrames(animnum)) { if (var8005efbc || (g_Anims[animnum].flags & ANIMFLAG_LOOP)) { frame = frame % animGetNumFrames(animnum); @@ -2091,7 +2091,7 @@ void modelSetAnimFrame(struct model *model, f32 frame) struct anim *anim = model->anim; if (anim) { - framea = floor(frame); + framea = floortoint(frame); forwards = anim->speed >= 0; frameb = (forwards ? framea + 1 : framea - 1); @@ -2120,7 +2120,7 @@ void modelSetAnimFrame2(struct model *model, f32 frame1, f32 frame2) modelSetAnimFrame(model, frame1); if (anim->animnum2) { - s32 framea = floor(frame2); + s32 framea = floortoint(frame2); s32 frameb; bool forwards = anim->speed2 >= 0; @@ -2225,11 +2225,11 @@ void modelSetAnimFrame2WithChrStuff(struct model *model, f32 curframe, f32 endfr } if (forwards) { - floorcur = floor(curframe) + 1; - floorend = floor(endframe); + floorcur = floortoint(curframe) + 1; + floorend = floortoint(endframe); } else { - floorcur = ceil(curframe) - 1; - floorend = ceil(endframe); + floorcur = ceiltoint(curframe) - 1; + floorend = ceiltoint(endframe); } if (g_Anims[anim->animnum].flags & ANIMFLAG_ABSOLUTETRANSLATION) { @@ -2464,8 +2464,8 @@ void modelSetAnimFrame2WithChrStuff(struct model *model, f32 curframe, f32 endfr } if (anim->animnum2 && (g_Anims[anim->animnum].flags & ANIMFLAG_ABSOLUTETRANSLATION) == 0) { - s32 floorcur2 = floor(curframe2); - s32 floorend2 = floor(endframe2); + s32 floorcur2 = floortoint(curframe2); + s32 floorend2 = floortoint(endframe2); if ((forwards && floorcur2 < floorend2) || (!forwards && floorend2 < floorcur2)) { if (rwdata->unk02 != 0) {