diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2019-06-26 22:34:14 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2019-06-26 22:34:14 +0200 |
commit | 08b053a568e15dd318dcfc46eaa6393af4a5f8c4 (patch) | |
tree | 7e6a0bc15376f347c13029b99f2f0ec1427bf2c1 /src/Radar.h | |
parent | More replay stuff (diff) | |
parent | bla (diff) | |
download | re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.gz re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.bz2 re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.lz re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.xz re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.tar.zst re3-08b053a568e15dd318dcfc46eaa6393af4a5f8c4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Radar.h | 83 |
1 files changed, 52 insertions, 31 deletions
diff --git a/src/Radar.h b/src/Radar.h index 19fc9038..5943498f 100644 --- a/src/Radar.h +++ b/src/Radar.h @@ -53,26 +53,26 @@ struct CBlip CVector2D m_vec2DPos; CVector m_vecPos; int16 m_BlipIndex; - int8 m_bDim; - int8 m_bInUse; + bool m_bDim; + bool m_bInUse; float m_Radius; int16 m_wScale; int16 m_eBlipDisplay; // eBlipDisplay int16 m_IconID; // eRadarSprite - char gap_46[2]; }; - static_assert(sizeof(CBlip) == 0x30, "CBlip: error"); +// Values for screen space +#define RADAR_LEFT (40.0f) +#define RADAR_BOTTOM (47.0f) +#define RADAR_WIDTH (94.0f) +#define RADAR_HEIGHT (76.0f) + class CRadar { - static float cachedSin; - static float cachedCos; - public: static float &m_RadarRange; - static CVector2D &vec2DRadarOrigin; - static CBlip *ms_RadarTrace; + static CBlip *ms_RadarTrace; //[NUMRADARBLIPS] static CSprite2d *AsukaSprite; static CSprite2d *BombSprite; static CSprite2d *CatSprite; @@ -96,30 +96,51 @@ public: static CSprite2d *RadarSprites[21]; public: - static void ClearBlipForEntity(eBlipType type, int32 id); + static int CalculateBlipAlpha(float dist); + static void ChangeBlipBrightness(int32 i, int32 bright); + static void ChangeBlipColour(int32 i); + static void ChangeBlipDisplay(int32 i, int16 flag); + static void ChangeBlipScale(int32 i, int16 scale); + static void ClearBlip(int32 i); + static void ClearBlipForEntity(int16 type, int32 id); + static int ClipRadarPoly(CVector2D *out, const CVector2D *in); + static bool DisplayThisBlip(int32 i); static void Draw3dMarkers(); - static void DrawMap(); - static void StreamRadarSections(int x, int y); - static int ClipRadarPoly(CVector2D *out, CVector2D *in); - static void TransformRealWorldToTexCoordSpace(CVector2D *out, CVector2D *in, int x, int y); - static void TransformRadarPointToRealWorldSpace(CVector2D *out, CVector2D *in); - static void DrawRadarSection(int x, int y); - static void RequestMapSection(int x, int y); - static void RemoveMapSection(int x, int y); - static void TransformRadarPointToScreenSpace(CVector2D * out, CVector2D * in); static void DrawBlips(); - static int CalculateBlipAlpha(float dist); - static CRGBA GetRadarTraceColour(uint32 color, bool bright); + static void DrawMap(); static void DrawRadarMap(); - static void DrawRotatingRadarSprite(CSprite2d* sprite, float x, float y, float angle, int alpha); - static void TransformRealWorldPointToRadarSpace(CVector2D *out, CVector2D *in); - static float LimitRadarPoint(CVector2D *point); - static void DrawRadarSprite(int sprite, float x, float y, int alpha); - static void ShowRadarMarker(CVector pos, CRGBA color, float radius); - static void ShowRadarTrace(float x, float y, uint32 size, uint32 red, uint32 green, uint32 blue, uint32 alpha); static void DrawRadarMask(); - static void SetRadarMarkerState(int counter, int flag); - static bool DisplayThisBlip(int counter); - static void GetTextureCorners(int x, int y, CVector2D * out); - static void ClipRadarTileCoords(int *x, int *y); + static void DrawRadarSection(int32 x, int32 y); + static void DrawRadarSprite(int32 sprite, float x, float y, int32 alpha); + static void DrawRotatingRadarSprite(CSprite2d* sprite, float x, float y, float angle, int32 alpha); + static int32 GetActualBlipArray(int32 i); + static int32 GetNewUniqueBlipIndex(int32 i); + static int32 GetRadarTraceColour(int32 color, bool bright); + static void Initialise(); + static float LimitRadarPoint(CVector2D &point); + static void LoadAllRadarBlips(int32); + static void LoadTextures(); + static void RemoveRadarSections(); + static void RemoveMapSection(int32 x, int32 y); + static void RequestMapSection(int32 x, int32 y); + static void SaveAllRadarBlips(int32); + static void SetBlipSprite(int32 i, int32 icon); + static int SetCoordBlip(int32 type, CVector pos, int32 flag); + static int SetEntityBlip(int32 type, CVector pos, int32 color, int32 flag); + 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 Shutdown(); + static void StreamRadarSections(CVector posn); + static void StreamRadarSections(int32 x, int32 y); + static void TransformRealWorldToTexCoordSpace(CVector2D &out, const CVector2D &in, int32 x, int32 y); + static void TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D &in); + static void TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &in); + static void TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D &in); + + // no in CRadar in the game: + static void GetTextureCorners(int32 x, int32 y, CVector2D *out); + static void ClipRadarTileCoords(int32 &x, int32 &y); + static bool IsPointInsideRadar(const CVector2D &); + static int LineRadarBoxCollision(CVector2D &, const CVector2D &, const CVector2D &); }; |