From 4a36d64f15f898854bb8a76be86ac9a8c536b291 Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 10 Jul 2019 17:18:26 +0200 Subject: added wrappers around math functions --- src/render/Clouds.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/render/Clouds.cpp') diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp index d582bff8..2ead715b 100644 --- a/src/render/Clouds.cpp +++ b/src/render/Clouds.cpp @@ -53,7 +53,7 @@ CClouds::Shutdown(void) void CClouds::Update(void) { - float s = sin(TheCamera.Orientation - 0.85f); + float s = Sin(TheCamera.Orientation - 0.85f); CloudRotation += CWeather::Wind*s*0.0025f; IndividualRotation += (CWeather::Wind*CTimer::GetTimeStep() + 0.3f) * 60.0f; } @@ -81,7 +81,7 @@ CClouds::Render(void) float coverage = CWeather::CloudCoverage <= CWeather::Foggyness ? CWeather::Foggyness : CWeather::CloudCoverage; // Moon - int moonfadeout = abs(minute - 180); // fully visible at 3AM + int moonfadeout = Abs(minute - 180); // fully visible at 3AM if(moonfadeout < 180){ // fade in/out 3 hours int brightness = (1.0f - coverage) * (180 - moonfadeout); RwV3d pos = { 0.0f, -100.0f, 15.0f }; @@ -169,8 +169,8 @@ CClouds::Render(void) } // Fluffy clouds - float rot_sin = sin(CloudRotation); - float rot_cos = cos(CloudRotation); + float rot_sin = Sin(CloudRotation); + float rot_cos = Cos(CloudRotation); int fluffyalpha = 160 * (1.0f - CWeather::Foggyness); if(fluffyalpha != 0){ static float CoorsOffsetX[37] = { @@ -210,7 +210,7 @@ CClouds::Render(void) worldpos.z = pos.z; if(CSprite::CalcScreenCoors(worldpos, &screenpos, &szx, &szy, false)){ - float sundist = sqrt(sq(screenpos.x-CCoronas::SunScreenX) + sq(screenpos.y-CCoronas::SunScreenY)); + float sundist = Sqrt(sq(screenpos.x-CCoronas::SunScreenX) + sq(screenpos.y-CCoronas::SunScreenY)); int tr = CTimeCycle::GetFluffyCloudsTopRed(); int tg = CTimeCycle::GetFluffyCloudsTopGreen(); int tb = CTimeCycle::GetFluffyCloudsTopBlue(); @@ -302,7 +302,7 @@ CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue, int16 botred, int16 botgreen, int16 botblue, int16 alpha) { RwMatrix *mat = RwFrameGetLTM(RwCameraGetFrame(TheCamera.m_pRwCamera)); - float c = sqrt(mat->right.x * mat->right.x + mat->right.y * mat->right.y); + float c = Sqrt(mat->right.x * mat->right.x + mat->right.y * mat->right.y); if(c > 1.0f) c = 1.0f; ms_cameraRoll = acos(c); @@ -424,7 +424,7 @@ CClouds::RenderHorizon(void) SCREEN_HEIGHT/300.0f * max(TheCamera.GetPosition().z, 0.0f); float b = TheCamera.GetUp().z < 0.0f ? SCREEN_HEIGHT : - SCREEN_HEIGHT * fabs(TheCamera.GetRight().z); + SCREEN_HEIGHT * Abs(TheCamera.GetRight().z); float z2 = z1 + (a + b)*TheCamera.LODDistMultiplier; z2 = min(z2, SCREEN_HEIGHT); CSprite2d::DrawRect(CRect(0, z1, SCREEN_WIDTH, z2), -- cgit v1.2.3 From 90e093cd47fb2af10617b1d404fc65ca813782ec Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 10 Jul 2019 17:34:11 +0200 Subject: and of course the last commit didnt fix everything --- src/render/Clouds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/render/Clouds.cpp') diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp index 2ead715b..2884894c 100644 --- a/src/render/Clouds.cpp +++ b/src/render/Clouds.cpp @@ -305,7 +305,7 @@ CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue, float c = Sqrt(mat->right.x * mat->right.x + mat->right.y * mat->right.y); if(c > 1.0f) c = 1.0f; - ms_cameraRoll = acos(c); + ms_cameraRoll = Acos(c); if(mat->right.z < 0.0f) ms_cameraRoll = -ms_cameraRoll; -- cgit v1.2.3