summaryrefslogtreecommitdiffstats
path: root/src/core/Radar.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-04-05 11:47:27 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-04-05 11:47:27 +0200
commit9436b5a8a58307ed859dc7d8528c512316548979 (patch)
treef24bfc3d5c348029acb606a22080d4b45277e7a7 /src/core/Radar.cpp
parentcranes init (diff)
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-9436b5a8a58307ed859dc7d8528c512316548979.tar
re3-9436b5a8a58307ed859dc7d8528c512316548979.tar.gz
re3-9436b5a8a58307ed859dc7d8528c512316548979.tar.bz2
re3-9436b5a8a58307ed859dc7d8528c512316548979.tar.lz
re3-9436b5a8a58307ed859dc7d8528c512316548979.tar.xz
re3-9436b5a8a58307ed859dc7d8528c512316548979.tar.zst
re3-9436b5a8a58307ed859dc7d8528c512316548979.zip
Diffstat (limited to 'src/core/Radar.cpp')
-rw-r--r--src/core/Radar.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 1c634760..f1d8ec96 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -1106,8 +1106,11 @@ void CRadar::TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D
// Radar space goes from -1.0 to 1.0 in x and y, top right is (1.0, 1.0)
void CRadar::TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &in)
{
- // FIX? scale RADAR_LEFT here somehow
+#ifdef FIX_BUGS
+ out.x = (in.x + 1.0f)*0.5f*SCREEN_SCALE_X(RADAR_WIDTH) + SCREEN_SCALE_X(RADAR_LEFT);
+#else
out.x = (in.x + 1.0f)*0.5f*SCREEN_SCALE_X(RADAR_WIDTH) + RADAR_LEFT;
+#endif
out.y = (1.0f - in.y)*0.5f*SCREEN_SCALE_Y(RADAR_HEIGHT) + SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT);
}