diff options
| author | robojumper <robojumper@gmail.com> | 2026-05-31 00:09:11 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2026-05-31 00:22:16 +0200 |
| commit | 9b4820921c10c7157b9f21fbf0da0acc93075bcb (patch) | |
| tree | a18c851ac393218e8b88f7cd90c3fdd5574ba063 /src/nw4r | |
| parent | 31423c25ae448ddf8c4c6c8577bd76530eb33e02 (diff) | |
Re-import MSL_C from TP
Diffstat (limited to 'src/nw4r')
| -rw-r--r-- | src/nw4r/g3d/g3d_anmchr.cpp | 2 | ||||
| -rw-r--r-- | src/nw4r/g3d/g3d_anmtexsrt.cpp | 2 | ||||
| -rw-r--r-- | src/nw4r/g3d/res/g3d_restev.cpp | 1 | ||||
| -rw-r--r-- | src/nw4r/snd/snd_AnimSound.cpp | 8 | ||||
| -rw-r--r-- | src/nw4r/snd/snd_Sound3DCalculator.cpp | 4 | ||||
| -rw-r--r-- | src/nw4r/ut/ut_TextWriterBase.cpp | 3 |
6 files changed, 11 insertions, 9 deletions
diff --git a/src/nw4r/g3d/g3d_anmchr.cpp b/src/nw4r/g3d/g3d_anmchr.cpp index 5541270f..459dc226 100644 --- a/src/nw4r/g3d/g3d_anmchr.cpp +++ b/src/nw4r/g3d/g3d_anmchr.cpp @@ -5,7 +5,7 @@ #include "rvl/GX.h" // IWYU pragma: export -#include <cmath.h> +#include <cmath> namespace nw4r { namespace g3d { diff --git a/src/nw4r/g3d/g3d_anmtexsrt.cpp b/src/nw4r/g3d/g3d_anmtexsrt.cpp index 7c479a19..dad02061 100644 --- a/src/nw4r/g3d/g3d_anmtexsrt.cpp +++ b/src/nw4r/g3d/g3d_anmtexsrt.cpp @@ -515,7 +515,7 @@ void ApplyTexSrtAnmResult(ResTexSrt srt, ResMatIndMtxAndScale ind, const TexSrtA maxElem = ut::Max(maxElem, ut::Abs(mtx._13)); scaleExp = static_cast<s8>(math::FGetExpPart(maxElem) + 1); - f32 invScale = std::ldexp(1.0f, -scaleExp); // TODO ldexpf rename + f32 invScale = std::ldexpf(1.0f, -scaleExp); mtx._00 *= invScale; mtx._01 *= invScale; diff --git a/src/nw4r/g3d/res/g3d_restev.cpp b/src/nw4r/g3d/res/g3d_restev.cpp index 644450ee..2151c9f0 100644 --- a/src/nw4r/g3d/res/g3d_restev.cpp +++ b/src/nw4r/g3d/res/g3d_restev.cpp @@ -2,6 +2,7 @@ #include "rvl/BASE.h" // IWYU pragma: export #include "rvl/GX.h" // IWYU pragma: export +#include <cstdint> namespace nw4r { namespace g3d { diff --git a/src/nw4r/snd/snd_AnimSound.cpp b/src/nw4r/snd/snd_AnimSound.cpp index 05ec3ef8..9bcdcf0b 100644 --- a/src/nw4r/snd/snd_AnimSound.cpp +++ b/src/nw4r/snd/snd_AnimSound.cpp @@ -90,8 +90,8 @@ void AnimSoundImpl::UpdateFrame(f32 frame, PlayDirection dir) { } void AnimSoundImpl::UpdateForward(f32 frame) { - s32 currFrameFloor = std::floorf(mCurrentFrame); - s32 targetFrame = std::floorf(frame); + s32 currFrameFloor = std::floor(mCurrentFrame); + s32 targetFrame = std::floor(frame); if (mNeedTriggerEventsAtCurrentFrame && mCurrentFrame == currFrameFloor) { currFrameFloor -= 1; @@ -118,8 +118,8 @@ void AnimSoundImpl::UpdateForward(f32 frame) { } void AnimSoundImpl::UpdateBackward(f32 frame) { - s32 currFrameCeil = std::ceilf(mCurrentFrame); - s32 targetFrame = std::ceilf(frame); + s32 currFrameCeil = std::ceil(mCurrentFrame); + s32 targetFrame = std::ceil(frame); if (currFrameCeil >= mReader.GetAnimDuration()) { currFrameCeil -= mReader.GetAnimDuration(); diff --git a/src/nw4r/snd/snd_Sound3DCalculator.cpp b/src/nw4r/snd/snd_Sound3DCalculator.cpp index 8c1c1b9d..2651724e 100644 --- a/src/nw4r/snd/snd_Sound3DCalculator.cpp +++ b/src/nw4r/snd/snd_Sound3DCalculator.cpp @@ -210,9 +210,9 @@ void Sound3DCalculator::CalcPanDpl2( } // clang-format on - f32 cosAvg = (std::cosf(mFrontSpeakerAngleDpl2) + std::cosf(mRearSpeakerAngleDpl2)) / 2.0f; + f32 cosAvg = (std::cos(mFrontSpeakerAngleDpl2) + std::cos(mRearSpeakerAngleDpl2)) / 2.0f; - f32 rearFactor = cosAvg / (cosAvg + -std::cosf(mRearSpeakerAngleDpl2)); + f32 rearFactor = cosAvg / (cosAvg + -std::cos(mRearSpeakerAngleDpl2)); panLR *= mPanRange; panFR *= mPanRange; diff --git a/src/nw4r/ut/ut_TextWriterBase.cpp b/src/nw4r/ut/ut_TextWriterBase.cpp index af8f085e..570ad621 100644 --- a/src/nw4r/ut/ut_TextWriterBase.cpp +++ b/src/nw4r/ut/ut_TextWriterBase.cpp @@ -1,9 +1,10 @@ // Ported from https://github.com/kiwi515/ogws/blob/master/src/nw4r/ut/ut_TextWriterBase.cpp -#include "__va_arg.h" #include "nw4r/ut.h" +#include <cstdarg> + namespace nw4r { namespace ut { |
