Merge remote-tracking branch 'upstream/miami' into miami

This commit is contained in:
Roman Masanin 2020-09-26 21:38:37 +03:00
commit bb2e601e13
18 changed files with 917 additions and 487 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
sdk/* linguist-vendored
vendor/* linguist-vendored

View File

@ -88,7 +88,7 @@ cMusicManager::ResetMusicAfterReload()
field_3995 = false; field_3995 = false;
field_3996 = false; field_3996 = false;
field_3997 = false; field_3997 = false;
field_3998 = -1; nFramesSinceCutsceneEnded = -1;
field_3999 = false; field_3999 = false;
field_399A = false; field_399A = false;
field_399C = false; field_399C = false;
@ -195,7 +195,7 @@ cMusicManager::Initialise()
field_3995 = false; field_3995 = false;
field_3996 = false; field_3996 = false;
field_3997 = false; field_3997 = false;
field_3998 = -1; nFramesSinceCutsceneEnded = -1;
field_3999 = false; field_3999 = false;
field_399A = false; field_399A = false;
m_nMusicModeToBeSet = MUSICMODE_DISABLED; m_nMusicModeToBeSet = MUSICMODE_DISABLED;
@ -507,7 +507,7 @@ cMusicManager::ServiceGameMode()
} }
if (!field_3996) { if (!field_3996) {
field_3998 = -1; nFramesSinceCutsceneEnded = -1;
gNumRetunePresses = 0; gNumRetunePresses = 0;
gRetuneCounter = 0; gRetuneCounter = 0;
field_2 = false; field_2 = false;
@ -867,7 +867,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
{ {
static bool bRadioStatsRecorded = false; static bool bRadioStatsRecorded = false;
static bool bRadioStatsRecorded2 = false; static bool bRadioStatsRecorded2 = false;
uint8 AmbienceVol; uint8 volume;
if (!field_398F) if (!field_398F)
m_nStreamedTrack = m_nFrontendTrack; m_nStreamedTrack = m_nFrontendTrack;
if (gRetuneCounter != 0 || field_2) { if (gRetuneCounter != 0 || field_2) {
@ -920,8 +920,8 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
} }
else else
{ {
ComputeAmbienceVol(true, AmbienceVol); ComputeAmbienceVol(true, volume);
SampleManager.SetStreamedVolumeAndPan(AmbienceVol, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
} }
if (m_nStreamedTrack < STREAMED_SOUND_CITY_AMBIENT) if (m_nStreamedTrack < STREAMED_SOUND_CITY_AMBIENT)
m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode(); m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
@ -952,8 +952,8 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT) if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
{ {
ComputeAmbienceVol(false, AmbienceVol); ComputeAmbienceVol(false, volume);
SampleManager.SetStreamedVolumeAndPan(AmbienceVol, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
return; return;
} }
if (CTimer::GetIsSlowMotionActive()) if (CTimer::GetIsSlowMotionActive())
@ -967,57 +967,51 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
} }
else if (DistToTargetSq >= SQR(10.0f)) else if (DistToTargetSq >= SQR(10.0f))
{ {
AmbienceVol = (45.0f - (Sqrt(DistToTargetSq) - 10.0f)) / 45.0f * m_nCurrentVolume; volume = (45.0f - (Sqrt(DistToTargetSq) - 10.0f)) / 45.0f * m_nCurrentVolume;
if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1)) if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1))
AmbienceVol /= 4; volume /= 4;
uint8 pan = 0; uint8 pan = 0;
if (AmbienceVol > 0) if (volume > 0)
{ {
CVector panVec; CVector panVec;
AudioManager.TranslateEntity(&TheCamera.pTargetEntity->GetPosition(), &panVec); AudioManager.TranslateEntity(&TheCamera.pTargetEntity->GetPosition(), &panVec);
pan = AudioManager.ComputePan(55.0f, &panVec); pan = AudioManager.ComputePan(55.0f, &panVec);
} }
if (gRetuneCounter != 0) if (gRetuneCounter != 0)
AmbienceVol = 0; volume = 0;
SampleManager.SetStreamedVolumeAndPan(AmbienceVol, pan, 0, 0); SampleManager.SetStreamedVolumeAndPan(volume, pan, 0, 0);
}
else if (!AudioManager.ShouldDuckMissionAudio(0) && !AudioManager.ShouldDuckMissionAudio(1))
{
if (gRetuneCounter == 0)
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
else
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
} }
else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1))
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
else if (gRetuneCounter != 0)
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
else else
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
} }
} } else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1)) {
else SampleManager.SetStreamedVolumeAndPan(Min(m_nCurrentVolume, 25), 63, 0, 0);
{ } else {
if (!AudioManager.ShouldDuckMissionAudio(0) && !AudioManager.ShouldDuckMissionAudio(1)) { if (nFramesSinceCutsceneEnded == -1)
if (field_3998 == -1) volume = m_nCurrentVolume;
AmbienceVol = m_nCurrentVolume; else if (nFramesSinceCutsceneEnded < 20)
else if (field_3998 < 20) {
{ volume = Min(m_nCurrentVolume, 25);
AmbienceVol = Min(m_nCurrentVolume, 25); nFramesSinceCutsceneEnded++;
field_3998++; }
} else if (nFramesSinceCutsceneEnded < 40)
else if (field_3998 < 40) {
{ volume = Min(m_nCurrentVolume, 3 * (nFramesSinceCutsceneEnded - 20) + 25);
AmbienceVol = Min(m_nCurrentVolume, 3 * (field_3998 - 20) + 25); nFramesSinceCutsceneEnded++;
field_3998++; }
} else
else {
{ volume = m_nCurrentVolume;
AmbienceVol = m_nCurrentVolume; nFramesSinceCutsceneEnded = -1;
field_3998 = -1; }
} if (gRetuneCounter != 0)
if (gRetuneCounter != 0) volume = 0;
AmbienceVol = 0; SampleManager.SetStreamedVolumeAndPan(volume, 63, 0, 0);
SampleManager.SetStreamedVolumeAndPan(AmbienceVol, 63, 0, 0);
} else
SampleManager.SetStreamedVolumeAndPan(Min(m_nCurrentVolume, 25), 63, 0, 0);
} }
if (m_nVolumeLatency > 0) if (m_nVolumeLatency > 0)
m_nVolumeLatency--; m_nVolumeLatency--;
@ -1115,7 +1109,8 @@ cMusicManager::GetListenTimeArray()
return aListenTimeArray; return aListenTimeArray;
} }
uint32 cMusicManager::GetTrackStartPos(uint32 track) uint32
cMusicManager::GetTrackStartPos(uint32 track)
{ {
if (!IsInitialised()) return 0; if (!IsInitialised()) return 0;

View File

@ -42,7 +42,7 @@ public:
bool field_3995; bool field_3995;
bool field_3996; bool field_3996;
bool field_3997; bool field_3997;
int8 field_3998; int8 nFramesSinceCutsceneEnded;
bool field_3999; bool field_3999;
bool field_399A; bool field_399A;
uint8 m_nMusicModeToBeSet; uint8 m_nMusicModeToBeSet;
@ -110,4 +110,4 @@ VALIDATE_SIZE(cMusicManager, 0x95C);
extern cMusicManager MusicManager; extern cMusicManager MusicManager;
extern bool g_bAnnouncementReadPosAlready; // we have a symbol of this so it was declared in .h extern bool g_bAnnouncementReadPosAlready; // we have a symbol of this so it was declared in .h
float GetHeightScale(); float GetHeightScale();

View File

@ -2239,7 +2239,6 @@ void CTheScripts::Init()
StoreVehicleWasRandom = true; StoreVehicleWasRandom = true;
OnAMissionFlag = 0; OnAMissionFlag = 0;
LastMissionPassedTime = (uint32)-1; LastMissionPassedTime = (uint32)-1;
NextFreeCollectiveIndex = 0;
LastRandomPedId = -1; LastRandomPedId = -1;
for (int i = 0; i < MAX_NUM_USED_OBJECTS; i++){ for (int i = 0; i < MAX_NUM_USED_OBJECTS; i++){
memset(&UsedObjectArray[i].name, 0, sizeof(UsedObjectArray[i].name)); memset(&UsedObjectArray[i].name, 0, sizeof(UsedObjectArray[i].name));
@ -16138,7 +16137,7 @@ void CTheScripts::ReadMultiScriptFileOffsetsFromScript()
MainScriptSize = Read4BytesFromScript(&ip); MainScriptSize = Read4BytesFromScript(&ip);
LargestMissionScriptSize = Read4BytesFromScript(&ip); LargestMissionScriptSize = Read4BytesFromScript(&ip);
NumberOfMissionScripts = Read2BytesFromScript(&ip); NumberOfMissionScripts = Read2BytesFromScript(&ip);
ip += 2; NumberOfExclusiveMissionScripts = Read2BytesFromScript(&ip);
for (int i = 0; i < NumberOfMissionScripts; i++) { for (int i = 0; i < NumberOfMissionScripts; i++) {
MultiScriptArray[i] = Read4BytesFromScript(&ip); MultiScriptArray[i] = Read4BytesFromScript(&ip);
} }

View File

@ -37,7 +37,7 @@ struct intro_script_rectangle
VALIDATE_SIZE(intro_script_rectangle, 0x18); VALIDATE_SIZE(intro_script_rectangle, 0x18);
enum { enum {
SCRIPT_TEXT_MAX_LENGTH = 500 SCRIPT_TEXT_MAX_LENGTH = 100
}; };
struct intro_text_line struct intro_text_line
@ -227,7 +227,11 @@ enum {
}; };
enum { enum {
#ifdef PS2
SIZE_MAIN_SCRIPT = 205512,
#else
SIZE_MAIN_SCRIPT = 225512, SIZE_MAIN_SCRIPT = 225512,
#endif
SIZE_MISSION_SCRIPT = 35000, SIZE_MISSION_SCRIPT = 35000,
SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT
}; };

View File

@ -89,6 +89,10 @@ bool CPad::IsAffectedByController = false;
_TODO("gbFastTime"); _TODO("gbFastTime");
extern bool gbFastTime; extern bool gbFastTime;
#ifdef WALLCLIMB_CHEAT
extern bool gGravityCheat;
#endif
void WeaponCheat1() void WeaponCheat1()
{ {
CHud::SetHelpMessage(TheText.Get("CHEAT2"), true); CHud::SetHelpMessage(TheText.Get("CHEAT2"), true);
@ -554,6 +558,22 @@ void AltDodoCheat(void)
} }
#endif #endif
#ifdef WALLCLIMB_CHEAT
void WallClimbingCheat(void)
{
wchar* string;
if (gGravityCheat) {
string = TheText.Get("CHEATOF");
gGravityCheat = false;
}
else {
string = TheText.Get("CHEAT1");
gGravityCheat = true;
}
CHud::SetHelpMessage(string, true);
}
#endif
void FlyingFishCheat(void) void FlyingFishCheat(void)
{ {
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true); CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
@ -1430,6 +1450,12 @@ void CPad::AddToPCCheatString(char c)
AltDodoCheat(); AltDodoCheat();
#endif #endif
#ifdef WALLCLIMB_CHEAT
// "SPIDERCAR"
if (!_CHEATCMP("RACREDIPS"))
WallClimbingCheat();
#endif
#if !defined(PC_WATER) && defined(WATER_CHEATS) #if !defined(PC_WATER) && defined(WATER_CHEATS)
// SEABEDCHEAT // SEABEDCHEAT
if (!_CHEATCMP("TAEHCDEBAESON")) if (!_CHEATCMP("TAEHCDEBAESON"))

View File

@ -252,6 +252,7 @@ enum Config {
#define KANGAROO_CHEAT #define KANGAROO_CHEAT
#define ALLCARSHELI_CHEAT #define ALLCARSHELI_CHEAT
#define ALT_DODO_CHEAT #define ALT_DODO_CHEAT
#define WALLCLIMB_CHEAT
#define REGISTER_START_BUTTON #define REGISTER_START_BUTTON
//#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls //#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls

View File

@ -740,12 +740,14 @@ DisplayGameDebugText()
static bool bDisplayRate = false; static bool bDisplayRate = false;
static bool bDisplayCheatStr = false; static bool bDisplayCheatStr = false;
#ifndef FINAL
{ {
SETTWEAKPATH("GameDebugText"); SETTWEAKPATH("GameDebugText");
TWEAKBOOL(bDisplayPosn); TWEAKBOOL(bDisplayPosn);
TWEAKBOOL(bDisplayRate); TWEAKBOOL(bDisplayRate);
TWEAKBOOL(bDisplayCheatStr); TWEAKBOOL(bDisplayCheatStr);
} }
#endif
char str[200]; char str[200];
@ -1091,6 +1093,7 @@ Idle(void *arg)
#endif #endif
#ifdef FIX_BUGS #ifdef FIX_BUGS
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); // TODO: temp? this fixes OpenGL render but there should be a better place for this
// This has to be done BEFORE RwCameraBeginUpdate // This has to be done BEFORE RwCameraBeginUpdate
RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip()); RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip());
RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart()); RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());

View File

@ -23,6 +23,11 @@
//--MIAMI: file done //--MIAMI: file done
#ifdef WALLCLIMB_CHEAT
bool gGravityCheat;
#endif
CPhysical::CPhysical(void) CPhysical::CPhysical(void)
{ {
int i; int i;
@ -521,8 +526,29 @@ CPhysical::ApplySpringDampening(float damping, CVector &springDir, CVector &poin
void void
CPhysical::ApplyGravity(void) CPhysical::ApplyGravity(void)
{ {
if(bAffectedByGravity) if (!bAffectedByGravity)
m_vecMoveSpeed.z -= GRAVITY * CTimer::GetTimeStep(); return;
#ifdef WALLCLIMB_CHEAT
if (gGravityCheat && this == FindPlayerVehicle()) {
static CVector v1(0.0f, 0.0f, 1.0f), v2(0.0f, 0.0f, 1.0f);
CVector prop = GetPosition() - (GetUp() + GetUp());
CColPoint point;
CEntity* entity;
if (CWorld::ProcessLineOfSight(GetPosition(), prop, point, entity, true, false, false, false, false, false))
v2 = point.normal;
else
v2 = CVector(0.0f, 0.0f, 1.0f);
float coef = clamp(CTimer::GetTimeStep() * 0.5f, 0.05f, 0.8f);
v1 = v1 * (1.0f - coef) + v2 * coef;
if (v1.MagnitudeSqr() < 0.1f)
v1 = CVector(0.0f, 0.0f, 1.0f);
else
v1.Normalise();
m_vecMoveSpeed -= GRAVITY * CTimer::GetTimeStep() * v1;
return;
}
#endif
m_vecMoveSpeed.z -= GRAVITY * CTimer::GetTimeStep();
} }
void void

View File

@ -351,6 +351,18 @@ enum
MI_BLOODRA, MI_BLOODRA,
MI_BLOODRB, MI_BLOODRB,
MI_VICECHEE, MI_VICECHEE,
// 3 available vehicle slots in here
MI_LAST_VEHICLE = 239,
MI_CAR_DOOR = 240,
MI_CAR_BUMPER,
MI_CAR_PANEL,
MI_CAR_BONNET,
MI_CAR_BOOT,
MI_CAR_WHEEL,
MI_BODYPARTA,
MI_BODYPARTB,
// HACK // HACK
MI_TRAIN = -1, MI_TRAIN = -1,
MI_DODO = -2, MI_DODO = -2,
@ -398,15 +410,6 @@ enum
MI_CUTOBJ04, MI_CUTOBJ04,
MI_CUTOBJ05, MI_CUTOBJ05,
MI_CAR_DOOR = 240,
MI_CAR_BUMPER,
MI_CAR_PANEL,
MI_CAR_BONNET,
MI_CAR_BOOT,
MI_CAR_WHEEL,
MI_BODYPARTA,
MI_BODYPARTB,
MI_AIRTRAIN_VLO = 257, MI_AIRTRAIN_VLO = 257,
MI_MOBILE = 258, MI_MOBILE = 258,

View File

@ -12,13 +12,33 @@
#include "Weather.h" #include "Weather.h"
#include "PedAttractor.h" #include "PedAttractor.h"
#include "Object.h" #include "Object.h"
#include "CarCtrl.h"
#ifndef _WIN32
#include <float.h>
#endif
// --MIAMI: Done
CCivilianPed::CCivilianPed(ePedType pedtype, uint32 mi) : CPed(pedtype) CCivilianPed::CCivilianPed(ePedType pedtype, uint32 mi) : CPed(pedtype)
{ {
SetModelIndex(mi); SetModelIndex(mi);
for (int i = 0; i < ARRAY_SIZE(m_nearPeds); i++) { for (int i = 0; i < ARRAY_SIZE(m_nearPeds); i++) {
m_nearPeds[i] = nil; m_nearPeds[i] = nil;
} }
m_bLookForVacantCars = false;
if (pedtype == PEDTYPE_CRIMINAL)
m_bLookForVacantCars = true;
m_nLookForVacantCarsCounter = 0;
m_bJustStoleACar = false;
m_bStealCarEvenIfThereIsSomeoneInIt = false;
for (int i = 0; i < ARRAY_SIZE(m_nStealWishList); i++) {
uint32 randomCarModel = CGeneral::GetRandomNumberInRange(MI_LANDSTAL, MI_LAST_VEHICLE + 1);
if (CModelInfo::IsCarModel(randomCarModel) || CModelInfo::IsBikeModel(randomCarModel))
m_nStealWishList[i] = randomCarModel;
else
m_nStealWishList[i] = MI_CHEETAH;
}
m_nAttractorCycleState = 0; m_nAttractorCycleState = 0;
m_bAttractorUnk = (CGeneral::GetRandomNumberInRange(0.0f, 1.0f) < 1.25f); m_bAttractorUnk = (CGeneral::GetRandomNumberInRange(0.0f, 1.0f) < 1.25f);
} }
@ -384,7 +404,7 @@ CCivilianPed::ProcessControl(void)
CivilianAI(); CivilianAI();
if (CharCreatedBy == RANDOM_CHAR) { if (CharCreatedBy == RANDOM_CHAR) {
// TODO(Miami): EnterVacantNearbyCars(); EnterVacantNearbyCars();
UseNearbyAttractors(); UseNearbyAttractors();
} }
@ -483,3 +503,83 @@ bool CCivilianPed::IsAttractedTo(int8 type)
} }
return false; return false;
} }
// --MIAMI: Done
void
CCivilianPed::EnterVacantNearbyCars(void)
{
if (!m_bLookForVacantCars)
return;
if (m_bJustStoleACar && bInVehicle && m_carInObjective == m_pMyVehicle) {
m_bJustStoleACar = false;
m_pMyVehicle->SetStatus(STATUS_PHYSICS);
m_pMyVehicle->AutoPilot.m_nCarMission = MISSION_CRUISE;
m_pMyVehicle->AutoPilot.m_nCruiseSpeed = 10;
m_pMyVehicle->bEngineOn = true;
} else if (!bHasAlreadyStoleACar) {
if (m_nLookForVacantCarsCounter == 8) {
m_nLookForVacantCarsCounter = 0;
if (IsPedInControl() && m_objective == OBJECTIVE_NONE) {
CVehicle *foundCar = nil;
float closestDist = FLT_MAX;
int minX = CWorld::GetSectorIndexX(GetPosition().x - 10.0f);
if (minX < 0) minX = 0;
int minY = CWorld::GetSectorIndexY(GetPosition().y - 10.0f);
if (minY < 0) minY = 0;
int maxX = CWorld::GetSectorIndexX(GetPosition().x + 10.0f);
if (maxX > NUMSECTORS_X - 1) maxX = NUMSECTORS_X - 1;
int maxY = CWorld::GetSectorIndexY(GetPosition().y + 10.0f);
if (maxY > NUMSECTORS_Y - 1) maxY = NUMSECTORS_Y - 1;
for (int curY = minY; curY <= maxY; curY++) {
for (int curX = minX; curX <= maxX; curX++) {
CSector* sector = CWorld::GetSector(curX, curY);
for (CPtrNode* node = sector->m_lists[ENTITYLIST_VEHICLES].first; node; node = node->next) {
CVehicle* veh = (CVehicle*)node->item;
if (veh && veh->IsCar()) {
// Looks like PARKED_VEHICLE condition isn't there in Mobile.
if (veh->VehicleCreatedBy == RANDOM_VEHICLE || veh->VehicleCreatedBy == PARKED_VEHICLE) {
if (IsOnStealWishList(veh->GetModelIndex()) && !veh->IsLawEnforcementVehicle()
&& (m_bStealCarEvenIfThereIsSomeoneInIt || !veh->pDriver && !veh->m_nNumPassengers)
&& !veh->m_nNumGettingIn && !veh->m_nGettingInFlags && !veh->m_nGettingOutFlags
&& !veh->m_pCarFire && veh->m_fHealth > 800.0f
&& !veh->IsUpsideDown() && !veh->IsOnItsSide() && veh->CanPedEnterCar()) {
float dist = (GetPosition() - veh->GetPosition()).MagnitudeSqr();
if (dist < sq(10.0f) && dist < closestDist && veh->IsClearToDriveAway()) {
foundCar = veh;
closestDist = dist;
}
}
}
}
}
}
}
if (foundCar) {
m_bJustStoleACar = true;
bHasAlreadyStoleACar = true;
CCarCtrl::JoinCarWithRoadSystem(foundCar);
SetObjective(OBJECTIVE_ENTER_CAR_AS_DRIVER, foundCar);
SetObjectiveTimer(10000);
}
}
} else {
++m_nLookForVacantCarsCounter;
}
}
}
bool
CCivilianPed::IsOnStealWishList(int32 model)
{
for (int i = 0; i < ARRAY_SIZE(m_nStealWishList); i++) {
if (model == m_nStealWishList[i]) {
return true;
}
}
return false;
}

View File

@ -4,6 +4,11 @@
class CCivilianPed : public CPed class CCivilianPed : public CPed
{ {
bool m_bLookForVacantCars;
uint32 m_nLookForVacantCarsCounter;
bool m_bStealCarEvenIfThereIsSomeoneInIt; // unused
bool m_bJustStoleACar;
uint32 m_nStealWishList[16];
bool m_bAttractorUnk; bool m_bAttractorUnk;
int32 m_nAttractorCycleState; int32 m_nAttractorCycleState;
public: public:
@ -15,6 +20,8 @@ public:
void UseNearbyAttractors(void); void UseNearbyAttractors(void);
void FindNearbyAttractorsSectorList(CPtrList&, float&, C2dEffect*&, CEntity*&); void FindNearbyAttractorsSectorList(CPtrList&, float&, C2dEffect*&, CEntity*&);
bool IsAttractedTo(int8); bool IsAttractedTo(int8);
void EnterVacantNearbyCars(void);
bool IsOnStealWishList(int32);
}; };
#ifndef PED_SKIN #ifndef PED_SKIN
VALIDATE_SIZE(CCivilianPed, 0x53C); VALIDATE_SIZE(CCivilianPed, 0x53C);

File diff suppressed because it is too large Load Diff

View File

@ -458,7 +458,7 @@ public:
uint32 bTurnedAroundOnAttractor : 1; uint32 bTurnedAroundOnAttractor : 1;
uint32 bHasAlreadyUsedAttractor : 1; uint32 bHasAlreadyUsedAttractor : 1;
uint32 b155_2 : 1; uint32 bHasAlreadyStoleACar : 1;
uint32 bCarPassenger : 1; uint32 bCarPassenger : 1;
uint32 bFleeWhenStanding : 1; uint32 bFleeWhenStanding : 1;
uint32 bGotUpOfMyOwnAccord : 1; uint32 bGotUpOfMyOwnAccord : 1;
@ -468,7 +468,7 @@ public:
uint32 bIsDrowning : 1; uint32 bIsDrowning : 1;
uint32 bDrownsInWater : 1; uint32 bDrownsInWater : 1;
uint32 b156_4 : 1; uint32 bWaitForLeaderToComeCloser : 1;
uint32 bHeldHostageInCar : 1; uint32 bHeldHostageInCar : 1;
uint32 bIsPlayerFriend : 1; uint32 bIsPlayerFriend : 1;
uint32 bHeadStuckInCollision : 1; uint32 bHeadStuckInCollision : 1;
@ -809,7 +809,6 @@ public:
void GetNearestDoor(CVehicle*, CVector&); void GetNearestDoor(CVehicle*, CVector&);
bool GetNearestPassengerDoor(CVehicle*, CVector&); bool GetNearestPassengerDoor(CVehicle*, CVector&);
int GetNextPointOnRoute(void); int GetNextPointOnRoute(void);
uint8 GetPedRadioCategory(uint32);
int GetWeaponSlot(eWeaponType); int GetWeaponSlot(eWeaponType);
bool CanWeRunAndFireWithWeapon(void); bool CanWeRunAndFireWithWeapon(void);
void GoToNearestDoor(CVehicle*); void GoToNearestDoor(CVehicle*);
@ -966,6 +965,8 @@ public:
void Dress(void); void Dress(void);
int32 KillCharOnFootMelee(CVector&, CVector&, CVector&); int32 KillCharOnFootMelee(CVector&, CVector&, CVector&);
int32 KillCharOnFootArmed(CVector&, CVector&, CVector&); int32 KillCharOnFootArmed(CVector&, CVector&, CVector&);
void SetLook(CEntity* to);
void SetLook(float direction);
bool HasWeaponSlot(uint8 slot) { return m_weapons[slot].m_eWeaponType != WEAPONTYPE_UNARMED; } bool HasWeaponSlot(uint8 slot) { return m_weapons[slot].m_eWeaponType != WEAPONTYPE_UNARMED; }
CWeapon& GetWeapon(uint8 slot) { return m_weapons[slot]; } CWeapon& GetWeapon(uint8 slot) { return m_weapons[slot]; }

View File

@ -16,7 +16,7 @@ enum ePedType
PEDTYPE_GANG4, PEDTYPE_GANG4,
PEDTYPE_GANG5, PEDTYPE_GANG5,
PEDTYPE_GANG6, PEDTYPE_GANG6,
PEDTYPE_GANG7, PEDTYPE_GANG7, // Vercetti gang
PEDTYPE_GANG8, PEDTYPE_GANG8,
PEDTYPE_GANG9, PEDTYPE_GANG9,
PEDTYPE_EMERGENCY, PEDTYPE_EMERGENCY,

View File

@ -490,7 +490,11 @@ CCoronas::RenderReflections(void)
int intensity = distanceFade*heightFade * 230.0 * CWeather::WetRoads; int intensity = distanceFade*heightFade * 230.0 * CWeather::WetRoads;
CSprite::RenderBufferedOneXLUSprite( CSprite::RenderBufferedOneXLUSprite(
#ifdef FIX_BUGS
spriteCoors.x, spriteCoors.y, spriteCoors.z,
#else
spriteCoors.x, spriteCoors.y, RwIm2DGetNearScreenZ(), spriteCoors.x, spriteCoors.y, RwIm2DGetNearScreenZ(),
#endif
spritew * aCoronas[i].size * 0.75f, spritew * aCoronas[i].size * 0.75f,
spriteh * aCoronas[i].size * 2.0f, spriteh * aCoronas[i].size * 2.0f,
(intensity * CCoronas::aCoronas[i].red)>>8, (intensity * CCoronas::aCoronas[i].red)>>8,

View File

@ -1,5 +1,15 @@
#if defined RW_GL3 && !defined LIBRW_SDL2 #if defined RW_GL3 && !defined LIBRW_SDL2
#ifdef _WIN32
#include <windows.h>
#include <mmsystem.h>
#include <shellapi.h>
#include <windowsx.h>
#include <basetsd.h>
#include <regstr.h>
#include <shlobj.h>
#endif
#define WITHWINDOWS #define WITHWINDOWS
#include "common.h" #include "common.h"
@ -1195,7 +1205,11 @@ void resizeCB(GLFWwindow* window, int width, int height) {
* memory things don't work. * memory things don't work.
*/ */
/* redraw window */ /* redraw window */
if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER)) if (RwInitialised && (gGameState == GS_PLAYING_GAME
#ifndef MASTER
|| gGameState == GS_ANIMVIEWER
#endif
))
{ {
RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void*)TRUE); RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void*)TRUE);
} }
@ -1625,6 +1639,72 @@ main(int argc, char *argv[])
break; break;
} }
case GS_INIT_LOGO_MPEG:
{
//if (!startupDeactivate)
// PlayMovieInWindow(cmdShow, "movies\\Logo.mpg");
gGameState = GS_LOGO_MPEG;
TRACE("gGameState = GS_LOGO_MPEG;");
break;
}
case GS_LOGO_MPEG:
{
// CPad::UpdatePads();
// if (startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0)
++gGameState;
// else if (CPad::GetPad(0)->GetLeftMouseJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetEnterJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetCharJustDown(' '))
// ++gGameState;
// else if (CPad::GetPad(0)->GetAltJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetTabJustDown())
// ++gGameState;
break;
}
case GS_INIT_INTRO_MPEG:
{
//#ifndef NO_MOVIES
// CloseClip();
// CoUninitialize();
//#endif
//
// if (CMenuManager::OS_Language == LANG_FRENCH || CMenuManager::OS_Language == LANG_GERMAN)
// PlayMovieInWindow(cmdShow, "movies\\GTAtitlesGER.mpg");
// else
// PlayMovieInWindow(cmdShow, "movies\\GTAtitles.mpg");
gGameState = GS_INTRO_MPEG;
TRACE("gGameState = GS_INTRO_MPEG;");
break;
}
case GS_INTRO_MPEG:
{
// CPad::UpdatePads();
//
// if (startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0)
++gGameState;
// else if (CPad::GetPad(0)->GetLeftMouseJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetEnterJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetCharJustDown(' '))
// ++gGameState;
// else if (CPad::GetPad(0)->GetAltJustDown())
// ++gGameState;
// else if (CPad::GetPad(0)->GetTabJustDown())
// ++gGameState;
break;
}
case GS_INIT_ONCE: case GS_INIT_ONCE:
{ {
//CoUninitialize(); //CoUninitialize();
@ -1833,8 +1913,10 @@ main(int argc, char *argv[])
{ {
if ( gGameState == GS_PLAYING_GAME ) if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown(); CGame::ShutDown();
#ifndef MASTER
else if ( gGameState == GS_ANIMVIEWER ) else if ( gGameState == GS_ANIMVIEWER )
CAnimViewer::Shutdown(); CAnimViewer::Shutdown();
#endif
CTimer::Stop(); CTimer::Stop();
@ -1858,8 +1940,10 @@ main(int argc, char *argv[])
if ( gGameState == GS_PLAYING_GAME ) if ( gGameState == GS_PLAYING_GAME )
CGame::ShutDown(); CGame::ShutDown();
#ifndef MASTER
else if ( gGameState == GS_ANIMVIEWER ) else if ( gGameState == GS_ANIMVIEWER )
CAnimViewer::Shutdown(); CAnimViewer::Shutdown();
#endif
DMAudio.Terminate(); DMAudio.Terminate();

View File

@ -134,7 +134,23 @@ public:
void ReduceHornCounter(void); void ReduceHornCounter(void);
}; };
// These functions and function names are made up
inline int8 GetBikeDoorFlag(int32 carnode) { inline int8 GetBikeDoorFlag(int32 carnode) {
switch (carnode) {
case CAR_DOOR_RR:
case CAR_DOOR_LR:
return CAR_DOOR_FLAG_RR | CAR_DOOR_FLAG_LR;
case CAR_DOOR_RF:
case CAR_DOOR_LF:
return CAR_DOOR_FLAG_RF | CAR_DOOR_FLAG_LF;
default:
return CAR_DOOR_FLAG_UNKNOWN;
}
}
// for m_nGettingOutFlags
inline int8 GetBikeDoorFlagInclJumpInFromFront(int32 carnode) {
switch (carnode) { switch (carnode) {
case CAR_DOOR_RR: case CAR_DOOR_RR:
case CAR_DOOR_LR: case CAR_DOOR_LR: