mirror of
https://github.com/GTAmodding/re3.git
synced 2025-07-17 06:44:07 +00:00
garages + script
This commit is contained in:
parent
2f085ea5f5
commit
8fae2dcc26
15 changed files with 537 additions and 552 deletions
|
@ -696,8 +696,8 @@ CCamera::CamControl(void)
|
|||
garageDoorPos2.z = 0.0f;
|
||||
#endif
|
||||
}
|
||||
garageCenter.x = (pToGarageWeAreIn->m_fX1 + pToGarageWeAreIn->m_fX2)/2.0f;
|
||||
garageCenter.y = (pToGarageWeAreIn->m_fY1 + pToGarageWeAreIn->m_fY2)/2.0f;
|
||||
garageCenter.x = pToGarageWeAreIn->GetGarageCenterX();
|
||||
garageCenter.y = pToGarageWeAreIn->GetGarageCenterY();
|
||||
garageCenter.z = 0.0f;
|
||||
if(whichDoor == 1)
|
||||
garageCenterToDoor = garageDoorPos1 - garageCenter;
|
||||
|
@ -979,8 +979,8 @@ CCamera::CamControl(void)
|
|||
}
|
||||
|
||||
if(pToGarageWeAreIn){
|
||||
garageCenter.x = (pToGarageWeAreIn->m_fX1 + pToGarageWeAreIn->m_fX2)/2.0f;
|
||||
garageCenter.y = (pToGarageWeAreIn->m_fY1 + pToGarageWeAreIn->m_fY2)/2.0f;
|
||||
garageCenter.x = pToGarageWeAreIn->GetGarageCenterX();
|
||||
garageCenter.y = pToGarageWeAreIn->GetGarageCenterY();
|
||||
garageCenter.z = 0.0f;
|
||||
}else{
|
||||
garageDoorPos1.z = 0.0f;
|
||||
|
@ -1013,8 +1013,8 @@ CCamera::CamControl(void)
|
|||
if(PedZoomIndicator == CAM_ZOOM_TOPDOWN && !stairs){
|
||||
garageCamPos = garageCenter;
|
||||
garageCamPos.z += FindPlayerPed()->GetPosition().z + 2.1f;
|
||||
if(pToGarageWeAreIn && garageCamPos.z > pToGarageWeAreIn->m_fX2) // What?
|
||||
garageCamPos.z = pToGarageWeAreIn->m_fX2;
|
||||
if(pToGarageWeAreIn && garageCamPos.z > pToGarageWeAreIn->m_fSupX) // What?
|
||||
garageCamPos.z = pToGarageWeAreIn->m_fSupX;
|
||||
}else
|
||||
garageCamPos.z = ground + 3.1f;
|
||||
SetCamPositionForFixedMode(garageCamPos, CVector(0.0f, 0.0f, 0.0f));
|
||||
|
|
|
@ -527,21 +527,24 @@ void CRadar::DrawBlips()
|
|||
TransformRealWorldPointToRadarSpace(in, blipEntity->GetPosition());
|
||||
float dist = LimitRadarPoint(in);
|
||||
TransformRadarPointToScreenSpace(out, in);
|
||||
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE) {
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
} else {
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
const CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const 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;
|
||||
if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || CMenuManager::bMenuMapActive) {
|
||||
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE) {
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
}
|
||||
ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode);
|
||||
else {
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
const CVector& pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const 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);
|
||||
ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -566,21 +569,24 @@ void CRadar::DrawBlips()
|
|||
TransformRealWorldPointToRadarSpace(in, ms_RadarTrace[blipId].m_vec2DPos);
|
||||
float dist = LimitRadarPoint(in);
|
||||
TransformRadarPointToScreenSpace(out, in);
|
||||
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE) {
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
} else {
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
const CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const 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;
|
||||
if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || CMenuManager::bMenuMapActive) {
|
||||
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE) {
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
}
|
||||
ShowRadarTraceWithHeight(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255, mode);
|
||||
else {
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
const CVector& pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const 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);
|
||||
ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -632,23 +638,25 @@ void CRadar::DrawBlips()
|
|||
TransformRealWorldPointToRadarSpace(in, blipEntity->GetPosition());
|
||||
float dist = LimitRadarPoint(in);
|
||||
TransformRadarPointToScreenSpace(out, in);
|
||||
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE)
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
else
|
||||
if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || CMenuManager::bMenuMapActive) {
|
||||
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE)
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
else
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
{
|
||||
const CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const 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;
|
||||
{
|
||||
const CVector& pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const 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);
|
||||
}
|
||||
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);
|
||||
ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -681,23 +689,25 @@ void CRadar::DrawBlips()
|
|||
TransformRealWorldPointToRadarSpace(in, ms_RadarTrace[blipId].m_vec2DPos);
|
||||
float dist = LimitRadarPoint(in);
|
||||
TransformRadarPointToScreenSpace(out, in);
|
||||
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE)
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
else
|
||||
if (!ms_RadarTrace[blipId].m_bShortRange || dist <= 1.0f || CMenuManager::bMenuMapActive) {
|
||||
if (ms_RadarTrace[blipId].m_eRadarSprite != RADAR_SPRITE_NONE)
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
else
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
{
|
||||
const CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const 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;
|
||||
{
|
||||
const CVector& pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const 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);
|
||||
}
|
||||
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);
|
||||
ShowRadarTrace(out.x, out.y, ms_RadarTrace[blipId].m_wScale, (uint8)(color >> 24), (uint8)(color >> 16), (uint8)(color >> 8), 255);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -992,6 +1002,7 @@ CRadar::Initialise()
|
|||
ms_RadarTrace[i].m_BlipIndex = 1;
|
||||
SetRadarMarkerState(i, false);
|
||||
ms_RadarTrace[i].m_bInUse = false;
|
||||
ms_RadarTrace[i].m_bShortRange = false;
|
||||
ms_RadarTrace[i].m_eBlipType = BLIP_NONE;
|
||||
ms_RadarTrace[i].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
||||
ms_RadarTrace[i].m_eRadarSprite = RADAR_SPRITE_NONE;
|
||||
|
@ -1102,8 +1113,9 @@ int CRadar::SetCoordBlip(eBlipType type, CVector pos, int32 color, eBlipDisplay
|
|||
}
|
||||
ms_RadarTrace[nextBlip].m_eBlipType = type;
|
||||
ms_RadarTrace[nextBlip].m_nColor = color;
|
||||
ms_RadarTrace[nextBlip].m_bDim = 1;
|
||||
ms_RadarTrace[nextBlip].m_bInUse = 1;
|
||||
ms_RadarTrace[nextBlip].m_bDim = true;
|
||||
ms_RadarTrace[nextBlip].m_bInUse = true;
|
||||
ms_RadarTrace[nextBlip].m_bShortRange = false;
|
||||
ms_RadarTrace[nextBlip].m_Radius = 1.0f;
|
||||
ms_RadarTrace[nextBlip].m_vec2DPos = pos;
|
||||
ms_RadarTrace[nextBlip].m_vecPos = pos;
|
||||
|
@ -1114,6 +1126,15 @@ int CRadar::SetCoordBlip(eBlipType type, CVector pos, int32 color, eBlipDisplay
|
|||
return CRadar::GetNewUniqueBlipIndex(nextBlip);
|
||||
}
|
||||
|
||||
int CRadar::SetShortRangeCoordBlip(eBlipType type, CVector pos, int32 color, eBlipDisplay display)
|
||||
{
|
||||
int index = SetCoordBlip(type, pos, color, display);
|
||||
if (index == -1)
|
||||
return -1;
|
||||
ms_RadarTrace[GetActualBlipArrayIndex(index)].m_bShortRange = true;
|
||||
return index;
|
||||
}
|
||||
|
||||
int CRadar::SetEntityBlip(eBlipType type, int32 handle, int32 color, eBlipDisplay display)
|
||||
{
|
||||
int nextBlip;
|
||||
|
@ -1123,8 +1144,9 @@ int CRadar::SetEntityBlip(eBlipType type, int32 handle, int32 color, eBlipDispla
|
|||
}
|
||||
ms_RadarTrace[nextBlip].m_eBlipType = type;
|
||||
ms_RadarTrace[nextBlip].m_nColor = color;
|
||||
ms_RadarTrace[nextBlip].m_bDim = 1;
|
||||
ms_RadarTrace[nextBlip].m_bInUse = 1;
|
||||
ms_RadarTrace[nextBlip].m_bDim = true;
|
||||
ms_RadarTrace[nextBlip].m_bInUse = true;
|
||||
ms_RadarTrace[nextBlip].m_bShortRange = false;
|
||||
ms_RadarTrace[nextBlip].m_Radius = 1.0f;
|
||||
ms_RadarTrace[nextBlip].m_nEntityHandle = handle;
|
||||
ms_RadarTrace[nextBlip].m_wScale = 1;
|
||||
|
|
|
@ -66,12 +66,12 @@ struct sRadarTrace
|
|||
uint16 m_BlipIndex;
|
||||
bool m_bDim;
|
||||
bool m_bInUse;
|
||||
bool m_bShortRange;
|
||||
float m_Radius;
|
||||
int16 m_wScale;
|
||||
uint16 m_eBlipDisplay; // eBlipDisplay
|
||||
uint16 m_eRadarSprite; // eRadarSprite
|
||||
};
|
||||
static_assert(sizeof(sRadarTrace) == 0x30, "sRadarTrace: error");
|
||||
|
||||
// Values for screen space
|
||||
#define RADAR_LEFT (40.0f)
|
||||
|
@ -149,6 +149,7 @@ public:
|
|||
static void SetBlipSprite(int32 i, int32 icon);
|
||||
static int32 SetCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay);
|
||||
static int32 SetEntityBlip(eBlipType type, int32, int32, eBlipDisplay);
|
||||
static int32 SetShortRangeCoordBlip(eBlipType type, CVector pos, int32, eBlipDisplay);
|
||||
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);
|
||||
|
|
|
@ -58,6 +58,9 @@ int32 CStats::CarsCrushed;
|
|||
int32 CStats::FastestTimes[CStats::TOTAL_FASTEST_TIMES];
|
||||
int32 CStats::HighestScores[CStats::TOTAL_HIGHEST_SCORES];
|
||||
|
||||
int32 CStats::Sprayings;
|
||||
float CStats::AutoPaintingBudget;
|
||||
|
||||
void CStats::Init()
|
||||
{
|
||||
PeopleKilledByOthers = 0;
|
||||
|
@ -113,6 +116,9 @@ void CStats::Init()
|
|||
IndustrialPassed = 0;
|
||||
CommercialPassed = 0;
|
||||
SuburbanPassed = 0;
|
||||
|
||||
Sprayings = 0;
|
||||
AutoPaintingBudget = 0.0f;
|
||||
}
|
||||
|
||||
void CStats::RegisterFastestTime(int32 index, int32 time)
|
||||
|
|
|
@ -62,6 +62,8 @@ public:
|
|||
static int32 CarsCrushed;
|
||||
static int32 FastestTimes[TOTAL_FASTEST_TIMES];
|
||||
static int32 HighestScores[TOTAL_HIGHEST_SCORES];
|
||||
static int32 Sprayings;
|
||||
static float AutoPaintingBudget;
|
||||
|
||||
public:
|
||||
static void Init(void);
|
||||
|
|
|
@ -462,3 +462,10 @@ CWanted::UpdateCrimesQ(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CWanted::Suspend(void)
|
||||
{
|
||||
// TODO(MIAMI)!
|
||||
Reset(); // <- temporary
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ public:
|
|||
void UpdateCrimesQ();
|
||||
void Update();
|
||||
|
||||
void Suspend();
|
||||
|
||||
bool IsIgnored(void) { return m_bIgnoredByCops || m_bIgnoredByEveryone; }
|
||||
|
||||
static int32 WorkOutPolicePresence(CVector posn, float radius);
|
||||
|
|
|
@ -128,7 +128,7 @@ enum Config {
|
|||
NUM_AUDIO_REFLECTIONS = 5,
|
||||
NUM_SCRIPT_MAX_ENTITIES = 40,
|
||||
|
||||
NUM_GARAGE_STORED_CARS = 6,
|
||||
NUM_GARAGE_STORED_CARS = 4,
|
||||
|
||||
NUM_CRANES = 8,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue