2019-06-12 14:07:37 -04:00
|
|
|
#pragma once
|
2019-06-14 19:34:19 -04:00
|
|
|
#include "Sprite2d.h"
|
2019-06-12 14:07:37 -04:00
|
|
|
|
|
|
|
enum eBlipType
|
|
|
|
{
|
|
|
|
BLIP_NONE,
|
|
|
|
BLIP_CAR,
|
|
|
|
BLIP_CHAR,
|
|
|
|
BLIP_OBJECT,
|
|
|
|
BLIP_COORD,
|
|
|
|
BLIP_CONTACT_POINT
|
|
|
|
};
|
|
|
|
|
2019-06-19 20:31:03 -04:00
|
|
|
enum eBlipDisplay
|
|
|
|
{
|
|
|
|
BLIP_DISPLAY_NEITHER = 0,
|
|
|
|
BLIP_DISPLAY_MARKER_ONLY = 1,
|
|
|
|
BLIP_DISPLAY_BLIP_ONLY = 2,
|
|
|
|
BLIP_DISPLAY_BOTH = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eRadarSprite
|
|
|
|
{
|
2020-04-04 07:39:58 -04:00
|
|
|
#ifdef MENU_MAP
|
|
|
|
RADAR_SPRITE_ENTITY_BLIP = -2,
|
|
|
|
RADAR_SPRITE_COORD_BLIP = -1,
|
|
|
|
#endif
|
2019-06-19 20:31:03 -04:00
|
|
|
RADAR_SPRITE_NONE = 0,
|
2020-05-17 16:24:23 -04:00
|
|
|
RADAR_SPRITE_ASUKA,
|
|
|
|
RADAR_SPRITE_BOMB,
|
|
|
|
RADAR_SPRITE_CAT,
|
|
|
|
RADAR_SPRITE_CENTRE,
|
|
|
|
RADAR_SPRITE_COPCAR,
|
|
|
|
RADAR_SPRITE_DON,
|
|
|
|
RADAR_SPRITE_EIGHT,
|
|
|
|
RADAR_SPRITE_EL,
|
|
|
|
RADAR_SPRITE_ICE,
|
|
|
|
RADAR_SPRITE_JOEY,
|
|
|
|
RADAR_SPRITE_KENJI,
|
|
|
|
RADAR_SPRITE_LIZ,
|
|
|
|
RADAR_SPRITE_LUIGI,
|
|
|
|
RADAR_SPRITE_NORTH,
|
|
|
|
RADAR_SPRITE_RAY,
|
|
|
|
RADAR_SPRITE_SAL,
|
|
|
|
RADAR_SPRITE_SAVE,
|
|
|
|
RADAR_SPRITE_SPRAY,
|
|
|
|
RADAR_SPRITE_TONY,
|
|
|
|
RADAR_SPRITE_WEAPON,
|
|
|
|
RADAR_SPRITE_COUNT
|
2019-06-19 20:31:03 -04:00
|
|
|
};
|
|
|
|
|
2020-10-18 12:16:37 -04:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
RADAR_TRACE_RED,
|
|
|
|
RADAR_TRACE_GREEN,
|
|
|
|
RADAR_TRACE_LIGHT_BLUE,
|
|
|
|
RADAR_TRACE_GRAY,
|
|
|
|
RADAR_TRACE_YELLOW,
|
|
|
|
RADAR_TRACE_MAGENTA,
|
|
|
|
RADAR_TRACE_CYAN
|
|
|
|
};
|
|
|
|
|
2019-10-05 10:32:01 -04:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
BLIP_MODE_TRIANGULAR_UP = 0,
|
|
|
|
BLIP_MODE_TRIANGULAR_DOWN,
|
|
|
|
BLIP_MODE_SQUARE,
|
|
|
|
};
|
|
|
|
|
2020-04-08 23:20:44 -04:00
|
|
|
struct sRadarTrace
|
2019-06-19 20:31:03 -04:00
|
|
|
{
|
2019-10-03 18:19:07 -04:00
|
|
|
uint32 m_nColor;
|
2019-10-29 19:18:01 -04:00
|
|
|
uint32 m_eBlipType; // eBlipType
|
2019-06-19 20:31:03 -04:00
|
|
|
int32 m_nEntityHandle;
|
|
|
|
CVector2D m_vec2DPos;
|
|
|
|
CVector m_vecPos;
|
2020-03-12 12:26:47 -04:00
|
|
|
uint16 m_BlipIndex;
|
2019-06-23 07:11:41 -04:00
|
|
|
bool m_bDim;
|
|
|
|
bool m_bInUse;
|
2019-06-19 20:31:03 -04:00
|
|
|
float m_Radius;
|
|
|
|
int16 m_wScale;
|
2019-10-03 18:19:07 -04:00
|
|
|
uint16 m_eBlipDisplay; // eBlipDisplay
|
2020-04-06 19:15:55 -04:00
|
|
|
uint16 m_eRadarSprite; // eRadarSprite
|
2019-06-19 20:31:03 -04:00
|
|
|
};
|
2020-05-10 11:49:33 -04:00
|
|
|
VALIDATE_SIZE(sRadarTrace, 0x30);
|
2019-06-19 20:31:03 -04:00
|
|
|
|
2019-06-23 07:11:41 -04:00
|
|
|
// Values for screen space
|
|
|
|
#define RADAR_LEFT (40.0f)
|
|
|
|
#define RADAR_BOTTOM (47.0f)
|
|
|
|
#define RADAR_WIDTH (94.0f)
|
|
|
|
#define RADAR_HEIGHT (76.0f)
|
|
|
|
|
2019-06-12 14:07:37 -04:00
|
|
|
class CRadar
|
|
|
|
{
|
2019-06-14 19:34:19 -04:00
|
|
|
public:
|
2020-04-16 15:19:56 -04:00
|
|
|
static float m_radarRange;
|
|
|
|
static sRadarTrace ms_RadarTrace[NUMRADARBLIPS];
|
2020-03-12 12:26:47 -04:00
|
|
|
static CSprite2d AsukaSprite;
|
|
|
|
static CSprite2d BombSprite;
|
|
|
|
static CSprite2d CatSprite;
|
|
|
|
static CSprite2d CentreSprite;
|
|
|
|
static CSprite2d CopcarSprite;
|
|
|
|
static CSprite2d DonSprite;
|
|
|
|
static CSprite2d EightSprite;
|
|
|
|
static CSprite2d ElSprite;
|
|
|
|
static CSprite2d IceSprite;
|
|
|
|
static CSprite2d JoeySprite;
|
|
|
|
static CSprite2d KenjiSprite;
|
|
|
|
static CSprite2d LizSprite;
|
|
|
|
static CSprite2d LuigiSprite;
|
|
|
|
static CSprite2d NorthSprite;
|
|
|
|
static CSprite2d RaySprite;
|
|
|
|
static CSprite2d SalSprite;
|
|
|
|
static CSprite2d SaveSprite;
|
|
|
|
static CSprite2d SpraySprite;
|
|
|
|
static CSprite2d TonySprite;
|
|
|
|
static CSprite2d WeaponSprite;
|
2020-05-17 16:24:23 -04:00
|
|
|
static CSprite2d *RadarSprites[RADAR_SPRITE_COUNT];
|
2020-04-04 07:39:58 -04:00
|
|
|
static float cachedCos;
|
|
|
|
static float cachedSin;
|
|
|
|
#ifdef MENU_MAP
|
2020-04-06 19:15:55 -04:00
|
|
|
static int TargetMarkerId;
|
2020-04-16 15:19:56 -04:00
|
|
|
static CVector TargetMarkerPos;
|
2019-06-14 19:34:19 -04:00
|
|
|
|
2020-04-04 07:39:58 -04:00
|
|
|
static void InitFrontEndMap();
|
2020-04-06 19:15:55 -04:00
|
|
|
static void DrawYouAreHereSprite(float, float);
|
|
|
|
static void ToggleTargetMarker(float, float);
|
2020-04-04 07:39:58 -04:00
|
|
|
#endif
|
2019-10-03 18:19:07 -04:00
|
|
|
static uint8 CalculateBlipAlpha(float dist);
|
2019-06-24 20:34:29 -04:00
|
|
|
static void ChangeBlipBrightness(int32 i, int32 bright);
|
2019-08-03 09:01:13 -04:00
|
|
|
static void ChangeBlipColour(int32 i, int32);
|
2019-10-03 18:19:07 -04:00
|
|
|
static void ChangeBlipDisplay(int32 i, eBlipDisplay display);
|
|
|
|
static void ChangeBlipScale(int32 i, int32 scale);
|
2019-06-24 20:34:29 -04:00
|
|
|
static void ClearBlip(int32 i);
|
2019-10-03 18:19:07 -04:00
|
|
|
static void ClearBlipForEntity(eBlipType type, int32 id);
|
2019-06-23 13:59:58 -04:00
|
|
|
static int ClipRadarPoly(CVector2D *out, const CVector2D *in);
|
2019-06-24 20:34:29 -04:00
|
|
|
static bool DisplayThisBlip(int32 i);
|
|
|
|
static void Draw3dMarkers();
|
2019-06-14 19:34:19 -04:00
|
|
|
static void DrawBlips();
|
2019-06-24 20:34:29 -04:00
|
|
|
static void DrawMap();
|
2019-06-14 19:34:19 -04:00
|
|
|
static void DrawRadarMap();
|
2019-06-24 20:34:29 -04:00
|
|
|
static void DrawRadarMask();
|
|
|
|
static void DrawRadarSection(int32 x, int32 y);
|
2019-10-03 18:19:07 -04:00
|
|
|
static void DrawRadarSprite(uint16 sprite, float x, float y, uint8 alpha);
|
2019-06-24 20:34:29 -04:00
|
|
|
static void DrawRotatingRadarSprite(CSprite2d* sprite, float x, float y, float angle, int32 alpha);
|
2019-08-03 09:01:13 -04:00
|
|
|
static int32 GetActualBlipArrayIndex(int32 i);
|
2019-06-24 20:34:29 -04:00
|
|
|
static int32 GetNewUniqueBlipIndex(int32 i);
|
2019-10-03 18:19:07 -04:00
|
|
|
static uint32 GetRadarTraceColour(uint32 color, bool bright);
|
2019-06-24 20:34:29 -04:00
|
|
|
static void Initialise();
|
2019-06-23 07:11:41 -04:00
|
|
|
static float LimitRadarPoint(CVector2D &point);
|
2020-03-12 12:26:47 -04:00
|
|
|
static void LoadAllRadarBlips(uint8 *buf, uint32 size);
|
2019-06-24 20:34:29 -04:00
|
|
|
static void LoadTextures();
|
|
|
|
static void RemoveRadarSections();
|
2020-03-12 12:26:47 -04:00
|
|
|
static void SaveAllRadarBlips(uint8*, uint32*);
|
2019-06-24 20:34:29 -04:00
|
|
|
static void SetBlipSprite(int32 i, int32 icon);
|
2019-10-03 18:19:07 -04:00
|
|
|
static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay);
|
2019-08-03 09:01:13 -04:00
|
|
|
static int32 SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay);
|
2019-10-03 18:19:07 -04:00
|
|
|
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);
|
2019-10-05 10:32:01 -04:00
|
|
|
static void ShowRadarTraceWithHeight(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha, uint8 mode);
|
2019-06-24 20:34:29 -04:00
|
|
|
static void Shutdown();
|
2019-06-27 08:17:42 -04:00
|
|
|
static void StreamRadarSections(const CVector &posn);
|
2019-06-24 20:34:29 -04:00
|
|
|
static void StreamRadarSections(int32 x, int32 y);
|
|
|
|
static void TransformRealWorldToTexCoordSpace(CVector2D &out, const CVector2D &in, int32 x, int32 y);
|
2019-06-23 07:11:41 -04:00
|
|
|
static void TransformRadarPointToRealWorldSpace(CVector2D &out, const CVector2D &in);
|
|
|
|
static void TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &in);
|
|
|
|
static void TransformRealWorldPointToRadarSpace(CVector2D &out, const CVector2D &in);
|
2019-06-23 13:59:58 -04:00
|
|
|
|
2020-04-08 23:20:44 -04:00
|
|
|
// no in CRadar in the game:
|
2020-04-04 07:39:58 -04:00
|
|
|
static void CalculateCachedSinCos();
|
2019-06-12 14:07:37 -04:00
|
|
|
};
|