diff options
author | aap <aap@papnet.eu> | 2019-07-10 17:18:26 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-07-10 17:18:26 +0200 |
commit | 4a36d64f15f898854bb8a76be86ac9a8c536b291 (patch) | |
tree | 2ff1344fb2f1e9859ba15cd56c461d40683359f9 /src/core/Radar.cpp | |
parent | Merge pull request #128 from erorcun/erorcun (diff) | |
download | re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.gz re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.bz2 re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.lz re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.xz re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.tar.zst re3-4a36d64f15f898854bb8a76be86ac9a8c536b291.zip |
Diffstat (limited to 'src/core/Radar.cpp')
-rw-r--r-- | src/core/Radar.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp index a071b96b..b634e4f5 100644 --- a/src/core/Radar.cpp +++ b/src/core/Radar.cpp @@ -469,8 +469,8 @@ void CRadar::DrawRadarMask() // Then generate a quarter of the circle for (int j = 0; j < 7; j++) { - in.x = corners[i].x * cos(j * (PI / 2.0f / 6.0f)); - in.y = corners[i].y * sin(j * (PI / 2.0f / 6.0f)); + in.x = corners[i].x * Cos(j * (PI / 2.0f / 6.0f)); + in.y = corners[i].y * Sin(j * (PI / 2.0f / 6.0f)); TransformRadarPointToScreenSpace(out[j + 1], in); }; @@ -562,8 +562,8 @@ void CRadar::DrawRotatingRadarSprite(CSprite2d* sprite, float x, float y, float for (uint32 i = 0; i < 4; i++) { oldPosn[i] = curPosn[i]; - curPosn[i].x = x + (oldPosn[i].x - x) * cosf(angle) + (oldPosn[i].y - y) * sinf(angle); - curPosn[i].y = y - (oldPosn[i].x - x) * sinf(angle) + (oldPosn[i].y - y) * cosf(angle); + curPosn[i].x = x + (oldPosn[i].x - x) * Cos(angle) + (oldPosn[i].y - y) * Sin(angle); + curPosn[i].y = y - (oldPosn[i].x - x) * Sin(angle) + (oldPosn[i].y - y) * Cos(angle); } sprite->Draw(curPosn[2].x, curPosn[2].y, curPosn[3].x, curPosn[3].y, curPosn[0].x, curPosn[0].y, curPosn[1].x, curPosn[1].y, CRGBA(255, 255, 255, alpha)); @@ -869,7 +869,7 @@ void CRadar::TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D float s, c; s = -sin(TheCamera.GetForward().Heading()); - c = cos(TheCamera.GetForward().Heading()); + c = Cos(TheCamera.GetForward().Heading()); if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN1 || TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWNPED) { s = 0.0f; @@ -886,7 +886,7 @@ void CRadar::TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D forward = TheCamera.Cams[TheCamera.ActiveCam].CamTargetEntity->GetPosition() - TheCamera.Cams[TheCamera.ActiveCam].SourceBeforeLookBehind; s = -sin(forward.Heading()); - c = cos(forward.Heading()); + c = Cos(forward.Heading()); } out.x = s * in.y + c * in.x; @@ -915,8 +915,8 @@ void CRadar::TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D c = 1.0f; } else if (TheCamera.GetLookDirection() == LOOKING_FORWARD) { - s = sin(TheCamera.GetForward().Heading()); - c = cos(TheCamera.GetForward().Heading()); + s = Sin(TheCamera.GetForward().Heading()); + c = Cos(TheCamera.GetForward().Heading()); } else { CVector forward; @@ -928,8 +928,8 @@ void CRadar::TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D else forward = TheCamera.Cams[TheCamera.ActiveCam].CamTargetEntity->GetPosition() - TheCamera.Cams[TheCamera.ActiveCam].SourceBeforeLookBehind; - s = sin(forward.Heading()); - c = cos(forward.Heading()); + s = Sin(forward.Heading()); + c = Cos(forward.Heading()); } float x = (in.x - vec2DRadarOrigin.x) * (1.0f / m_RadarRange); |