diff options
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/Streaming.cpp | 8 | ||||
-rw-r--r-- | src/core/config.h | 22 |
4 files changed, 104 insertions, 6 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/Streaming.cpp b/src/core/Streaming.cpp index a7bde91e..d15415ea 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -1021,7 +1021,7 @@ CStreaming::RemoveAllUnusedModels(void) for(i = 0; i < MAXVEHICLESLOADED; i++) RemoveLoadedVehicle(); - for(i = NUM_DEFAULT_MODELS; i < MODELINFOSIZE; i++){ + for(i = NUMDEFAULTMODELS; i < MODELINFOSIZE; i++){ if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED && ms_aInfoForModel[i].m_flags & STREAMFLAGS_DONT_REMOVE && CModelInfo::GetModelInfo(i)->m_refCount == 0){ @@ -2408,8 +2408,8 @@ CStreaming::MemoryCardSave(uint8 *buffer, uint32 *length) { int i; - *length = NUM_DEFAULT_MODELS; - for(i = 0; i < NUM_DEFAULT_MODELS; i++) + *length = NUMDEFAULTMODELS; + for(i = 0; i < NUMDEFAULTMODELS; i++) if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED) buffer[i] = ms_aInfoForModel[i].m_flags; else @@ -2421,7 +2421,7 @@ CStreaming::MemoryCardLoad(uint8 *buffer, uint32 length) { uint32 i; - assert(length == NUM_DEFAULT_MODELS); + assert(length == NUMDEFAULTMODELS); for(i = 0; i < length; i++) if(ms_aInfoForModel[i].m_loadState == STREAMSTATE_LOADED) if(buffer[i] != 0xFF) diff --git a/src/core/config.h b/src/core/config.h index 49bef3fa..767abbe4 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -32,6 +32,7 @@ enum Config { NUMDUMMIES = 2802, // 2368 on PS2 NUMAUDIOSCRIPTOBJECTS = 256, NUMCUTSCENEOBJECTS = 50, + NUMDEFAULTMODELS = 200, NUMTEMPOBJECTS = 30, @@ -138,11 +139,28 @@ enum Config { #endif #define FIX_BUGS // fix bugs in the game, TODO: use this more + +// Pad #define KANGAROO_CHEAT + +// Hud #define ASPECT_RATIO_SCALE + +// Script #define USE_DEBUG_SCRIPT_LOADER + +// Vehicles #define EXPLODING_AIRTRAIN // can blow up jumbo jet with rocket launcher -#define ANIMATE_PED_COL_MODEL //#define REMOVE_TREADABLE_PATHFIND + +// Pickups +//#define MONEY_MESSAGES + +// Peds +#define ANIMATE_PED_COL_MODEL #define VC_PED_PORTS -//#define MONEY_MESSAGES
\ No newline at end of file +#define NEW_WALK_AROUND_ALGORITHM +#define CANCELLABLE_CAR_ENTER + +// Blips +#define TRIANGULAR_BLIPS
\ No newline at end of file |