diff options
author | Sergeanur <s.anureev@yandex.ua> | 2019-10-05 16:32:01 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2019-10-05 16:32:01 +0200 |
commit | 365f9e9caff6f61ef08ca67526fd85f9a010d965 (patch) | |
tree | 685c0033f54e2a1210a92ad213e950dceef33940 /src/core | |
parent | Merge pull request #224 from erorcun/erorcun (diff) | |
download | re3-365f9e9caff6f61ef08ca67526fd85f9a010d965.tar re3-365f9e9caff6f61ef08ca67526fd85f9a010d965.tar.gz re3-365f9e9caff6f61ef08ca67526fd85f9a010d965.tar.bz2 re3-365f9e9caff6f61ef08ca67526fd85f9a010d965.tar.lz re3-365f9e9caff6f61ef08ca67526fd85f9a010d965.tar.xz re3-365f9e9caff6f61ef08ca67526fd85f9a010d965.tar.zst re3-365f9e9caff6f61ef08ca67526fd85f9a010d965.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Radar.cpp | 72 | ||||
-rw-r--r-- | src/core/Radar.h | 8 | ||||
-rw-r--r-- | src/core/config.h | 5 |
3 files changed, 84 insertions, 1 deletions
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp index 7eff743a..ebb71f5f 100644 --- a/src/core/Radar.cpp +++ b/src/core/Radar.cpp @@ -335,7 +335,18 @@ void CRadar::DrawBlips() if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_NONE) { DrawRadarSprite(ms_RadarTrace[blipId].m_IconID, out.x, out.y, CalculateBlipAlpha(dist)); } else { +#ifdef TRIANGULAR_BLIPS + CVector &pos = FindPlayerCentreOfWorld_NoSniperShift(); + CVector &blipPos = blipEntity->GetPosition(); + uint8 mode = BLIP_MODE_TRIANGULAR_UP; + if (blipPos.z - pos.z <= 2.0f) {
+ if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
+ else mode = BLIP_MODE_SQUARE;
+ } + ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode); +#else ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255); +#endif } } } @@ -363,7 +374,18 @@ void CRadar::DrawBlips() if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_NONE) { DrawRadarSprite(ms_RadarTrace[blipId].m_IconID, out.x, out.y, CalculateBlipAlpha(dist)); } else { +#ifdef TRIANGULAR_BLIPS + CVector &pos = FindPlayerCentreOfWorld_NoSniperShift(); + CVector &blipPos = ms_RadarTrace[blipId].m_vecPos; + uint8 mode = BLIP_MODE_TRIANGULAR_UP; + if (blipPos.z - pos.z <= 2.0f) {
+ if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
+ else mode = BLIP_MODE_SQUARE;
+ } + ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode); +#else ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255); +#endif } } } @@ -417,7 +439,20 @@ void CRadar::DrawBlips() if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_NONE) DrawRadarSprite(ms_RadarTrace[blipId].m_IconID, out.x, out.y, CalculateBlipAlpha(dist)); else +#ifdef TRIANGULAR_BLIPS + { + CVector &pos = FindPlayerCentreOfWorld_NoSniperShift(); + CVector &blipPos = blipEntity->GetPosition(); + uint8 mode = BLIP_MODE_TRIANGULAR_UP; + if (blipPos.z - pos.z <= 2.0f) {
+ if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
+ else mode = BLIP_MODE_SQUARE;
+ } + ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode); + } +#else ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255); +#endif } } } @@ -453,7 +488,20 @@ void CRadar::DrawBlips() if (ms_RadarTrace[blipId].m_IconID != RADAR_SPRITE_NONE) DrawRadarSprite(ms_RadarTrace[blipId].m_IconID, out.x, out.y, CalculateBlipAlpha(dist)); else +#ifdef TRIANGULAR_BLIPS + { + CVector &pos = FindPlayerCentreOfWorld_NoSniperShift(); + CVector &blipPos = ms_RadarTrace[blipId].m_vecPos; + uint8 mode = BLIP_MODE_TRIANGULAR_UP; + if (blipPos.z - pos.z <= 2.0f) {
+ if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
+ else mode = BLIP_MODE_SQUARE;
+ } + ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode); + } +#else ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255); +#endif } } break; @@ -949,6 +997,30 @@ void CRadar::ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 gree } #endif +void CRadar::ShowRadarTraceWithHeight(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha, uint8 mode) +{ + if (!CHud::m_Wants_To_Draw_Hud || TheCamera.m_WideScreenOn) + return; + + switch (mode) + { + case BLIP_MODE_TRIANGULAR_UP: + // size++; // VC does size + 1 for triangles + CSprite2d::Draw2DPolygon(x + SCREEN_SCALE_X(size + 3.0f), y + SCREEN_SCALE_Y(size + 2.0f), x - (SCREEN_SCALE_X(size + 3.0f)), y + SCREEN_SCALE_Y(size + 2.0f), x, y - (SCREEN_SCALE_Y(size + 3.0f)), x, y - (SCREEN_SCALE_Y(size + 3.0f)), CRGBA(0, 0, 0, alpha)); + CSprite2d::Draw2DPolygon(x + SCREEN_SCALE_X(size + 1.0f), y + SCREEN_SCALE_Y(size + 1.0f), x - (SCREEN_SCALE_X(size + 1.0f)), y + SCREEN_SCALE_Y(size + 1.0f), x, y - (SCREEN_SCALE_Y(size + 1.0f)), x, y - (SCREEN_SCALE_Y(size + 1.0f)), CRGBA(red, green, blue, alpha)); + break; + case BLIP_MODE_TRIANGULAR_DOWN: + // size++; // VC does size + 1 for triangles + CSprite2d::Draw2DPolygon(x, y + SCREEN_SCALE_Y(size + 2.0f), x, y + SCREEN_SCALE_Y(size + 3.0f), x + SCREEN_SCALE_X(size + 3.0f), y - (SCREEN_SCALE_Y(size + 2.0f)), x - (SCREEN_SCALE_X(size + 3.0f)), y - (SCREEN_SCALE_Y(size + 2.0f)), CRGBA(0, 0, 0, alpha)); + CSprite2d::Draw2DPolygon(x, y + SCREEN_SCALE_Y(size + 1.0f), x, y + SCREEN_SCALE_Y(size + 1.0f), x + SCREEN_SCALE_X(size + 1.0f), y - (SCREEN_SCALE_Y(size + 1.0f)), x - (SCREEN_SCALE_X(size + 1.0f)), y - (SCREEN_SCALE_Y(size + 1.0f)), CRGBA(red, green, blue, alpha)); + break; + case BLIP_MODE_SQUARE: + CSprite2d::DrawRect(CRect(x - SCREEN_SCALE_X(size + 1.0f), y - SCREEN_SCALE_Y(size + 1.0f), SCREEN_SCALE_X(size + 1.0f) + x, SCREEN_SCALE_Y(size + 1.0f) + y), CRGBA(0, 0, 0, alpha)); + CSprite2d::DrawRect(CRect(x - SCREEN_SCALE_X(size), y - SCREEN_SCALE_Y(size), SCREEN_SCALE_X(size) + x, SCREEN_SCALE_Y(size) + y), CRGBA(red, green, blue, alpha)); + break; + } +} + #if 1 WRAPPER void CRadar::Shutdown() { EAXJMP(0x4A3F60); } #else 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); diff --git a/src/core/config.h b/src/core/config.h index 520bcc72..767abbe4 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -160,4 +160,7 @@ enum Config { #define ANIMATE_PED_COL_MODEL #define VC_PED_PORTS #define NEW_WALK_AROUND_ALGORITHM -#define CANCELLABLE_CAR_ENTER
\ No newline at end of file +#define CANCELLABLE_CAR_ENTER + +// Blips +#define TRIANGULAR_BLIPS
\ No newline at end of file |