summaryrefslogtreecommitdiffstats
path: root/src/Radar.cpp
diff options
context:
space:
mode:
author_AG <gennariarmando@outlook.com>2019-06-17 02:10:55 +0200
committer_AG <gennariarmando@outlook.com>2019-06-17 02:11:30 +0200
commitf299e9ebd51cc26d30a40ee5edff7ddf2968b2ec (patch)
treecc2c85e0ccf486546de22074639d0e8fbe032f65 /src/Radar.cpp
parentfixed rebind bug (diff)
downloadre3-f299e9ebd51cc26d30a40ee5edff7ddf2968b2ec.tar
re3-f299e9ebd51cc26d30a40ee5edff7ddf2968b2ec.tar.gz
re3-f299e9ebd51cc26d30a40ee5edff7ddf2968b2ec.tar.bz2
re3-f299e9ebd51cc26d30a40ee5edff7ddf2968b2ec.tar.lz
re3-f299e9ebd51cc26d30a40ee5edff7ddf2968b2ec.tar.xz
re3-f299e9ebd51cc26d30a40ee5edff7ddf2968b2ec.tar.zst
re3-f299e9ebd51cc26d30a40ee5edff7ddf2968b2ec.zip
Diffstat (limited to '')
-rw-r--r--src/Radar.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Radar.cpp b/src/Radar.cpp
index 1c0b0d65..93097e8f 100644
--- a/src/Radar.cpp
+++ b/src/Radar.cpp
@@ -15,7 +15,8 @@ WRAPPER void CRadar::DrawRadarMap() { EAXJMP(0x4A6C20); }
float &CRadar::m_RadarRange = *(float*)0x8E281C;
CVector2D &CRadar::vec2DRadarOrigin = *(CVector2D*)0x6299B8;
-void CRadar::DrawMap() {
+void CRadar::DrawMap()
+{
if (!TheCamera.m_WideScreenOn && CHud::m_Wants_To_Draw_Hud) {
if (FindPlayerVehicle()) {
if (FindPlayerVehicle()->GetSpeed().Magnitude() > 0.3f) {
@@ -24,24 +25,24 @@ void CRadar::DrawMap() {
else
CRadar::m_RadarRange = (FindPlayerVehicle()->GetSpeed().Magnitude() + 0.3f) * 200.0f;
}
- else {
+ else
CRadar::m_RadarRange = 120.0f;
- }
}
- else {
+ else
CRadar::m_RadarRange = 120.0f;
- }
+
vec2DRadarOrigin.x = FindPlayerCentreOfWorld_NoSniperShift().x;
vec2DRadarOrigin.y = FindPlayerCentreOfWorld_NoSniperShift().y;
CRadar::DrawRadarMap();
}
}
-void CRadar::TransformRadarPointToScreenSpace(CVector2D *out, CVector2D *in) {
+void CRadar::TransformRadarPointToScreenSpace(CVector2D *out, CVector2D *in)
+{
out->x = in->x * HUD_STRETCH_X(47.0f) + HUD_STRETCH_X(47.0f + 20.0f);
- out->y = (HUD_STRETCH_Y(76.0f)) * 0.5f + SCREEN_HEIGHT - (HUD_STRETCH_Y(123.0f)) - in->y * (HUD_STRETCH_Y(76.0f)) * 0.5f;
+ out->y = (HUD_STRETCH_Y(76.0f)) * 0.5f + SCREEN_HEIGHT - (HUD_STRETCH_Y(123.0f)) - in->y * (HUD_STRETCH_Y(76.0f)) * 0.5f;
}
STARTPATCHES
InjectHook(0x4A5040, CRadar::TransformRadarPointToScreenSpace, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
+ENDPATCHES