From 54f36ad9604190987350a9c38a0f82a0c7b960a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Fri, 4 Oct 2019 01:19:07 +0300 Subject: Fix radar --- src/core/Radar.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/core/Radar.h') diff --git a/src/core/Radar.h b/src/core/Radar.h index 1ec28070..6bb445fd 100644 --- a/src/core/Radar.h +++ b/src/core/Radar.h @@ -47,8 +47,8 @@ enum eRadarSprite struct CBlip { - int32 m_nColor; - int16 m_eBlipType; // eBlipType + uint32 m_nColor; + uint16 m_eBlipType; // eBlipType int32 m_nEntityHandle; CVector2D m_vec2DPos; CVector m_vecPos; @@ -57,8 +57,8 @@ struct CBlip bool m_bInUse; float m_Radius; int16 m_wScale; - int16 m_eBlipDisplay; // eBlipDisplay - int16 m_IconID; // eRadarSprite + uint16 m_eBlipDisplay; // eBlipDisplay + uint16 m_IconID; // eRadarSprite }; static_assert(sizeof(CBlip) == 0x30, "CBlip: error"); @@ -72,7 +72,7 @@ class CRadar { public: static float &m_RadarRange; - static CBlip *ms_RadarTrace; //[NUMRADARBLIPS] + static CBlip (&ms_RadarTrace)[NUMRADARBLIPS]; static CSprite2d *AsukaSprite; static CSprite2d *BombSprite; static CSprite2d *CatSprite; @@ -96,13 +96,13 @@ public: static CSprite2d *RadarSprites[21]; public: - static int CalculateBlipAlpha(float dist); + static uint8 CalculateBlipAlpha(float dist); static void ChangeBlipBrightness(int32 i, int32 bright); static void ChangeBlipColour(int32 i, int32); - static void ChangeBlipDisplay(int32 i, int16 flag); - static void ChangeBlipScale(int32 i, int16 scale); + static void ChangeBlipDisplay(int32 i, eBlipDisplay display); + static void ChangeBlipScale(int32 i, int32 scale); static void ClearBlip(int32 i); - static void ClearBlipForEntity(int16 type, int32 id); + static void ClearBlipForEntity(eBlipType type, int32 id); static int ClipRadarPoly(CVector2D *out, const CVector2D *in); static bool DisplayThisBlip(int32 i); static void Draw3dMarkers(); @@ -111,11 +111,11 @@ public: static void DrawRadarMap(); static void DrawRadarMask(); static void DrawRadarSection(int32 x, int32 y); - static void DrawRadarSprite(int32 sprite, float x, float y, int32 alpha); + static void DrawRadarSprite(uint16 sprite, float x, float y, uint8 alpha); static void DrawRotatingRadarSprite(CSprite2d* sprite, float x, float y, float angle, int32 alpha); static int32 GetActualBlipArrayIndex(int32 i); static int32 GetNewUniqueBlipIndex(int32 i); - static int32 GetRadarTraceColour(int32 color, bool bright); + static uint32 GetRadarTraceColour(uint32 color, bool bright); static void Initialise(); static float LimitRadarPoint(CVector2D &point); static void LoadAllRadarBlips(int32); @@ -125,11 +125,11 @@ public: static void RequestMapSection(int32 x, int32 y); static void SaveAllRadarBlips(int32); static void SetBlipSprite(int32 i, int32 icon); - static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay flag); + static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay); static int32 SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay); - static void SetRadarMarkerState(int32 i, int32 flag); - static void ShowRadarMarker(CVector pos, int16 color, float radius); - static void ShowRadarTrace(float x, float y, uint32 size, uint32 red, uint32 green, uint32 blue, uint32 alpha); + static void SetRadarMarkerState(int32 i, bool flag); + static void ShowRadarMarker(CVector pos, uint32 color, float radius); + static void ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha); static void Shutdown(); static void StreamRadarSections(const CVector &posn); static void StreamRadarSections(int32 x, int32 y); -- cgit v1.2.3 From 365f9e9caff6f61ef08ca67526fd85f9a010d965 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sat, 5 Oct 2019 17:32:01 +0300 Subject: Triangular radar blips --- src/core/Radar.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/Radar.h') diff --git a/src/core/Radar.h b/src/core/Radar.h index 6bb445fd..d6b249db 100644 --- a/src/core/Radar.h +++ b/src/core/Radar.h @@ -45,6 +45,13 @@ enum eRadarSprite RADAR_SPRITE_COUNT = 21, }; +enum +{ + BLIP_MODE_TRIANGULAR_UP = 0, + BLIP_MODE_TRIANGULAR_DOWN, + BLIP_MODE_SQUARE, +}; + struct CBlip { uint32 m_nColor; @@ -130,6 +137,7 @@ public: static void SetRadarMarkerState(int32 i, bool flag); static void ShowRadarMarker(CVector pos, uint32 color, float radius); static void ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha); + static void ShowRadarTraceWithHeight(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha, uint8 mode); static void Shutdown(); static void StreamRadarSections(const CVector &posn); static void StreamRadarSections(int32 x, int32 y); -- cgit v1.2.3