Merge branch 'miami' of https://github.com/GTAmodding/re3 into miami

This commit is contained in:
eray orçunus 2020-09-30 02:44:02 +03:00
commit f740588780
26 changed files with 638 additions and 169 deletions

View File

@ -14,7 +14,7 @@ such that we have a working game at all times.
## How can I try it? ## How can I try it?
- re3 requires game assets to work, so you **must** own a copy of GTA III. - re3 requires game assets to work, so you **must** own [a copy of GTA III](https://store.steampowered.com/app/12100/Grand_Theft_Auto_III/).
- Build re3 or download it from one of the above links (Debug or Release). - Build re3 or download it from one of the above links (Debug or Release).
- (Optional) If you want to use optional features like Russian language or menu map, copy the files in /gamefiles folder to your game root folder. - (Optional) If you want to use optional features like Russian language or menu map, copy the files in /gamefiles folder to your game root folder.
- Move re3.exe to GTA 3 directory and run it. - Move re3.exe to GTA 3 directory and run it.

View File

@ -47,6 +47,8 @@ function getarch(a)
return 'amd64' return 'amd64'
elseif a == 'ARM' then elseif a == 'ARM' then
return 'arm' return 'arm'
elseif a == 'ARM64' then
return 'arm64'
end end
return a return a
end end
@ -75,6 +77,7 @@ workspace "reVC"
"linux-x86-librw_gl3_glfw-oal", "linux-x86-librw_gl3_glfw-oal",
"linux-amd64-librw_gl3_glfw-oal", "linux-amd64-librw_gl3_glfw-oal",
"linux-arm-librw_gl3_glfw-oal", "linux-arm-librw_gl3_glfw-oal",
"linux-arm64-librw_gl3_glfw-oal",
} }
filter { "system:bsd" } filter { "system:bsd" }

View File

@ -139,4 +139,5 @@ public:
static void LoadAnimFile(RwStream *stream, bool compress, char (*somename)[32] = nil); static void LoadAnimFile(RwStream *stream, bool compress, char (*somename)[32] = nil);
static void CreateAnimAssocGroups(void); static void CreateAnimAssocGroups(void);
static void RemoveLastAnimFile(void); static void RemoveLastAnimFile(void);
static CAnimBlendAssocGroup* GetAnimAssocGroups(void) { return ms_aAnimAssocGroups; }
}; };

View File

@ -3646,7 +3646,7 @@ cAudioManager::SetupJumboTaxiSound(uint8 vol)
} }
bool bool
cAudioManager::SetupJumboWhineSound(uint8 emittingVol, int32 freq) cAudioManager::SetupJumboWhineSound(uint8 emittingVol, uint32 freq)
{ {
const float SOUND_INTENSITY = 170.0f; const float SOUND_INTENSITY = 170.0f;
@ -3678,7 +3678,7 @@ cAudioManager::SetupJumboWhineSound(uint8 emittingVol, int32 freq)
} }
bool bool
cAudioManager::SetupJumboEngineSound(uint8 vol, int32 freq) cAudioManager::SetupJumboEngineSound(uint8 vol, uint32 freq)
{ {
const float SOUND_INTENSITY = 180.0f; const float SOUND_INTENSITY = 180.0f;
if (m_sQueueSample.m_fDistance >= SOUND_INTENSITY) if (m_sQueueSample.m_fDistance >= SOUND_INTENSITY)

View File

@ -811,7 +811,11 @@ cAudioManager::ProcessActiveQueues()
if (sample.m_nFrequency != m_asActiveSamples[j].m_nFrequency) { if (sample.m_nFrequency != m_asActiveSamples[j].m_nFrequency) {
int32 freq; int32 freq;
if (sample.m_nFrequency <= m_asActiveSamples[j].m_nFrequency) { if (sample.m_nFrequency <= m_asActiveSamples[j].m_nFrequency) {
freq = Max(sample.m_nFrequency, m_asActiveSamples[j].m_nFrequency - 6000); #ifdef FIX_BUGS
freq = Max((int32)sample.m_nFrequency, (int32)m_asActiveSamples[j].m_nFrequency - 6000);
#else
freq = Max((int32)sample.m_nFrequency, int32(m_asActiveSamples[j].m_nFrequency - 6000));
#endif
} else { } else {
freq = Min(sample.m_nFrequency, m_asActiveSamples[j].m_nFrequency + 6000); freq = Min(sample.m_nFrequency, m_asActiveSamples[j].m_nFrequency + 6000);
} }

View File

@ -405,11 +405,11 @@ public:
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter);
void SetUpOneShotCollisionSound(const cAudioCollision &col); void SetUpOneShotCollisionSound(const cAudioCollision &col);
bool SetupCrimeReport(); bool SetupCrimeReport();
bool SetupJumboEngineSound(uint8 vol, int32 freq); bool SetupJumboEngineSound(uint8 vol, uint32 freq);
bool SetupJumboFlySound(uint8 emittingVol); bool SetupJumboFlySound(uint8 emittingVol);
bool SetupJumboRumbleSound(uint8 emittingVol); bool SetupJumboRumbleSound(uint8 emittingVol);
bool SetupJumboTaxiSound(uint8 vol); bool SetupJumboTaxiSound(uint8 vol);
bool SetupJumboWhineSound(uint8 emittingVol, int32 freq); bool SetupJumboWhineSound(uint8 emittingVol, uint32 freq);
void SetupPedComments(cPedParams *params, uint32 sound); void SetupPedComments(cPedParams *params, uint32 sound);
void SetupSuspectLastSeenReport(); void SetupSuspectLastSeenReport();

View File

@ -6,7 +6,7 @@
cSampleManager SampleManager; cSampleManager SampleManager;
bool _bSampmanInitialised = false; bool _bSampmanInitialised = false;
uint32 BankStartOffset[MAX_SAMPLEBANKS]; uint32 BankStartOffset[MAX_SFX_BANKS];
uint32 nNumMP3s; uint32 nNumMP3s;
cSampleManager::cSampleManager(void) cSampleManager::cSampleManager(void)
@ -136,20 +136,20 @@ cSampleManager::SetMonoMode(uint8 nMode)
bool bool
cSampleManager::LoadSampleBank(uint8 nBank) cSampleManager::LoadSampleBank(uint8 nBank)
{ {
ASSERT( nBank < MAX_SAMPLEBANKS ); ASSERT( nBank < MAX_SFX_BANKS );
return false; return false;
} }
void void
cSampleManager::UnloadSampleBank(uint8 nBank) cSampleManager::UnloadSampleBank(uint8 nBank)
{ {
ASSERT( nBank < MAX_SAMPLEBANKS ); ASSERT( nBank < MAX_SFX_BANKS );
} }
bool bool
cSampleManager::IsSampleBankLoaded(uint8 nBank) cSampleManager::IsSampleBankLoaded(uint8 nBank)
{ {
ASSERT( nBank < MAX_SAMPLEBANKS ); ASSERT( nBank < MAX_SFX_BANKS );
return false; return false;
} }
@ -179,7 +179,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
int32 int32
cSampleManager::GetBankContainingSound(uint32 offset) cSampleManager::GetBankContainingSound(uint32 offset)
{ {
return SAMPLEBANK_INVALID; return INVALID_SFX_BANK;
} }
int32 int32

View File

@ -1819,7 +1819,13 @@ CVehicle* CStoredCar::RestoreCar()
#ifdef FIX_BUGS #ifdef FIX_BUGS
if (pVehicle->IsCar()) if (pVehicle->IsCar())
#endif #endif
{
((CAutomobile*)pVehicle)->m_bombType = m_nCarBombType; ((CAutomobile*)pVehicle)->m_bombType = m_nCarBombType;
#ifdef FIX_BUGS
if (m_nCarBombType != CARBOMB_NONE)
((CAutomobile*)pVehicle)->m_pBombRigger = FindPlayerPed();
#endif
}
pVehicle->bHasBeenOwnedByPlayer = true; pVehicle->bHasBeenOwnedByPlayer = true;
pVehicle->m_nDoorLock = CARLOCK_UNLOCKED; pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
pVehicle->bBulletProof = m_bBulletproof; pVehicle->bBulletProof = m_bBulletproof;

View File

@ -300,5 +300,6 @@ private:
static bool IsThisGarageTypeSafehouse(eGarageType type) { return FindSafeHouseIndexForGarageType(type) >= 0; } static bool IsThisGarageTypeSafehouse(eGarageType type) { return FindSafeHouseIndexForGarageType(type) >= 0; }
friend class cAudioManager; friend class cAudioManager;
friend class CReplay;
friend class CGarage; friend class CGarage;
}; };

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@
#include "Pools.h" #include "Pools.h"
#include "World.h" #include "World.h"
#include "WeaponEffects.h"
#include "ParticleType.h" #include "ParticleType.h"
#ifdef FIX_BUGS #ifdef FIX_BUGS
@ -25,14 +26,17 @@ struct CStoredAnimationState
uint8 animId; uint8 animId;
uint8 time; uint8 time;
uint8 speed; uint8 speed;
uint8 groupId;
uint8 secAnimId; uint8 secAnimId;
uint8 secTime; uint8 secTime;
uint8 secSpeed; uint8 secSpeed;
uint8 secGroupId;
uint8 blendAmount; uint8 blendAmount;
uint8 partAnimId; uint8 partAnimId;
uint8 partAnimTime; uint8 partAnimTime;
uint8 partAnimSpeed; uint8 partAnimSpeed;
uint8 partBlendAmount; uint8 partBlendAmount;
uint8 partGroupId;
}; };
enum { enum {
@ -46,20 +50,18 @@ struct CStoredDetailedAnimationState
uint8 aCurTime[NUM_MAIN_ANIMS_IN_REPLAY]; uint8 aCurTime[NUM_MAIN_ANIMS_IN_REPLAY];
uint8 aSpeed[NUM_MAIN_ANIMS_IN_REPLAY]; uint8 aSpeed[NUM_MAIN_ANIMS_IN_REPLAY];
uint8 aBlendAmount[NUM_MAIN_ANIMS_IN_REPLAY]; uint8 aBlendAmount[NUM_MAIN_ANIMS_IN_REPLAY];
#ifdef FIX_REPLAY_BUGS
int8 aBlendDelta[NUM_MAIN_ANIMS_IN_REPLAY]; int8 aBlendDelta[NUM_MAIN_ANIMS_IN_REPLAY];
#endif
uint8 aFunctionCallbackID[NUM_MAIN_ANIMS_IN_REPLAY]; uint8 aFunctionCallbackID[NUM_MAIN_ANIMS_IN_REPLAY];
uint16 aFlags[NUM_MAIN_ANIMS_IN_REPLAY]; uint16 aFlags[NUM_MAIN_ANIMS_IN_REPLAY];
uint8 aGroupId[NUM_MAIN_ANIMS_IN_REPLAY];
uint8 aAnimId2[NUM_PARTIAL_ANIMS_IN_REPLAY]; uint8 aAnimId2[NUM_PARTIAL_ANIMS_IN_REPLAY];
uint8 aCurTime2[NUM_PARTIAL_ANIMS_IN_REPLAY]; uint8 aCurTime2[NUM_PARTIAL_ANIMS_IN_REPLAY];
uint8 aSpeed2[NUM_PARTIAL_ANIMS_IN_REPLAY]; uint8 aSpeed2[NUM_PARTIAL_ANIMS_IN_REPLAY];
uint8 aBlendAmount2[NUM_PARTIAL_ANIMS_IN_REPLAY]; uint8 aBlendAmount2[NUM_PARTIAL_ANIMS_IN_REPLAY];
#ifdef FIX_REPLAY_BUGS
int8 aBlendDelta2[NUM_PARTIAL_ANIMS_IN_REPLAY]; int8 aBlendDelta2[NUM_PARTIAL_ANIMS_IN_REPLAY];
#endif
uint8 aFunctionCallbackID2[NUM_PARTIAL_ANIMS_IN_REPLAY]; uint8 aFunctionCallbackID2[NUM_PARTIAL_ANIMS_IN_REPLAY];
uint16 aFlags2[NUM_PARTIAL_ANIMS_IN_REPLAY]; uint16 aFlags2[NUM_PARTIAL_ANIMS_IN_REPLAY];
uint8 aGroupId2[NUM_PARTIAL_ANIMS_IN_REPLAY];
}; };
void PlayReplayFromHD(void); void PlayReplayFromHD(void);
@ -73,21 +75,24 @@ class CReplay
enum { enum {
REPLAYCAMMODE_ASSTORED = 0, REPLAYCAMMODE_ASSTORED = 0,
REPLAYCAMMODE_TOPDOWN = 1, REPLAYCAMMODE_TOPDOWN,
REPLAYCAMMODE_FIXED = 2 REPLAYCAMMODE_FIXED
}; };
enum { enum {
REPLAYPACKET_END = 0, REPLAYPACKET_END = 0,
REPLAYPACKET_VEHICLE = 1, REPLAYPACKET_VEHICLE,
REPLAYPACKET_PED_HEADER = 2, REPLAYPACKET_BIKE,
REPLAYPACKET_PED_UPDATE = 3, REPLAYPACKET_PED_HEADER,
REPLAYPACKET_GENERAL = 4, REPLAYPACKET_PED_UPDATE,
REPLAYPACKET_CLOCK = 5, REPLAYPACKET_GENERAL,
REPLAYPACKET_WEATHER = 6, REPLAYPACKET_CLOCK,
REPLAYPACKET_ENDOFFRAME = 7, REPLAYPACKET_WEATHER,
REPLAYPACKET_TIMER = 8, REPLAYPACKET_ENDOFFRAME,
REPLAYPACKET_BULLET_TRACES = 9 REPLAYPACKET_TIMER,
REPLAYPACKET_BULLET_TRACES,
REPLAYPACKET_PARTICLE,
REPLAYPACKET_MISC
}; };
enum { enum {
@ -176,8 +181,9 @@ class CReplay
int8 vehicle_index; int8 vehicle_index;
CStoredAnimationState anim_state; CStoredAnimationState anim_state;
CCompressedMatrixNotAligned matrix; CCompressedMatrixNotAligned matrix;
int8 assoc_group_id;
uint16 weapon_model; uint16 weapon_model;
int8 assoc_group_id;
bool is_visible;
}; };
VALIDATE_SIZE(tPedUpdatePacket, 40); VALIDATE_SIZE(tPedUpdatePacket, 40);
@ -203,8 +209,64 @@ class CReplay
uint8 door_status; uint8 door_status;
uint8 primary_color; uint8 primary_color;
uint8 secondary_color; uint8 secondary_color;
bool render_scorched;
int8 skimmer_speed;
int8 vehicle_type;
}; };
VALIDATE_SIZE(tVehicleUpdatePacket, 48); VALIDATE_SIZE(tVehicleUpdatePacket, 52);
struct tBikeUpdatePacket
{
uint8 type;
uint8 index;
uint8 health;
uint8 acceleration;
CCompressedMatrixNotAligned matrix;
int8 door_angles[2];
uint16 mi;
int8 velocityX;
int8 velocityY;
int8 velocityZ;
int8 wheel_state;
uint8 wheel_susp_dist[4];
uint8 wheel_rotation[4];
uint8 primary_color;
uint8 secondary_color;
int8 lean_angle;
int8 wheel_angle;
};
VALIDATE_SIZE(tBikeUpdatePacket, 44);
struct tParticlePacket
{
uint8 type;
uint8 particle_type;
int8 dir_x;
int8 dir_y;
int8 dir_z;
uint8 r;
uint8 g;
uint8 b;
uint8 a;
int16 pos_x;
int16 pos_y;
int16 pos_z;
float size;
};
VALIDATE_SIZE(tParticlePacket, 20);
struct tMiscPacket
{
uint8 type;
uint32 cam_shake_start;
float cam_shake_strength;
uint8 cur_area;
uint8 special_fx_flags;
};
VALIDATE_SIZE(tMiscPacket, 16);
private: private:
static uint8 Mode; static uint8 Mode;
@ -269,6 +331,31 @@ private:
static float fDistanceLookAroundCam; static float fDistanceLookAroundCam;
static float fAlphaAngleLookAroundCam; static float fAlphaAngleLookAroundCam;
static float fBetaAngleLookAroundCam; static float fBetaAngleLookAroundCam;
static int ms_nNumCivMale_Stored;
static int ms_nNumCivFemale_Stored;
static int ms_nNumCop_Stored;
static int ms_nNumEmergency_Stored;
static int ms_nNumGang1_Stored;
static int ms_nNumGang2_Stored;
static int ms_nNumGang3_Stored;
static int ms_nNumGang4_Stored;
static int ms_nNumGang5_Stored;
static int ms_nNumGang6_Stored;
static int ms_nNumGang7_Stored;
static int ms_nNumGang8_Stored;
static int ms_nNumGang9_Stored;
static int ms_nNumDummy_Stored;
static int ms_nTotalCarPassengerPeds_Stored;
static int ms_nTotalCivPeds_Stored;
static int ms_nTotalGangPeds_Stored;
static int ms_nTotalPeds_Stored;
static int ms_nTotalMissionPeds_Stored;
static uint8* pGarages;
static CFire* FireArray;
static uint32 NumOfFires;
static uint8* paProjectileInfo;
static uint8* paProjectiles;
static uint8 CurrArea;
#ifdef FIX_BUGS #ifdef FIX_BUGS
static int nHandleOfPlayerPed[NUMPLAYERS]; static int nHandleOfPlayerPed[NUMPLAYERS];
#endif #endif
@ -288,8 +375,7 @@ public:
static bool IsPlayingBack() { return Mode == MODE_PLAYBACK; } static bool IsPlayingBack() { return Mode == MODE_PLAYBACK; }
static bool IsPlayingBackFromFile() { return bPlayingBackFromFile; } static bool IsPlayingBackFromFile() { return bPlayingBackFromFile; }
static void RecordParticle(tParticleType type, CVector const &vecPos, CVector const &vecDir, float fSize, RwRGBA const&color) static void RecordParticle(tParticleType type, CVector const& vecPos, CVector const& vecDir, float fSize, RwRGBA const& color);
{ } //TODO
private: private:
static void RecordThisFrame(void); static void RecordThisFrame(void);
static void StorePedUpdate(CPed *ped, int id); static void StorePedUpdate(CPed *ped, int id);
@ -302,7 +388,9 @@ private:
static void TriggerPlaybackLastCoupleOfSeconds(uint32, uint8, float, float, float, uint32); static void TriggerPlaybackLastCoupleOfSeconds(uint32, uint8, float, float, float, uint32);
static bool FastForwardToTime(uint32); static bool FastForwardToTime(uint32);
static void StoreCarUpdate(CVehicle *vehicle, int id); static void StoreCarUpdate(CVehicle *vehicle, int id);
static void StoreBikeUpdate(CVehicle* vehicle, int id);
static void ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressInReplayBuffer *buffer); static void ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressInReplayBuffer *buffer);
static void ProcessBikeUpdate(CVehicle* vehicle, float interpolation, CAddressInReplayBuffer* buffer);
static bool PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, float interpolation, uint32 *pTimer); static bool PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, float interpolation, uint32 *pTimer);
static void ProcessReplayCamera(void); static void ProcessReplayCamera(void);
static void StoreStuffInMem(void); static void StoreStuffInMem(void);
@ -314,6 +402,7 @@ private:
static void FindFirstFocusCoordinate(CVector *coord); static void FindFirstFocusCoordinate(CVector *coord);
static void ProcessLookAroundCam(void); static void ProcessLookAroundCam(void);
static size_t FindSizeOfPacket(uint8); static size_t FindSizeOfPacket(uint8);
static void GoToNextBlock(void);
/* Absolute nonsense, but how could this function end up being outside of class? */ /* Absolute nonsense, but how could this function end up being outside of class? */
friend void PlayReplayFromHD(void); friend void PlayReplayFromHD(void);

View File

@ -10098,11 +10098,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
model = CStreaming::ms_vehiclesLoaded[index]; model = CStreaming::ms_vehiclesLoaded[index];
if (model == -1) if (model == -1)
continue; continue;
// desperatly want to believe this was inlined :| if (CModelInfo::IsCarModel(model) || CModelInfo::IsBikeModel(model)) {
CBaseModelInfo* pInfo = CModelInfo::GetModelInfo(model);
script_assert(pInfo->GetModelType() == MITYPE_VEHICLE);
CVehicleModelInfo* pVehicleInfo = (CVehicleModelInfo*)pInfo;
if (pVehicleInfo->m_vehicleType != VEHICLE_TYPE_CAR) {
switch (model) { switch (model) {
case MI_LANDSTAL: case MI_LANDSTAL:
case MI_LINERUN: case MI_LINERUN:

View File

@ -107,11 +107,13 @@ CdStreamInit(int32 numChannels)
_gdwCdStreamFlags = 0; _gdwCdStreamFlags = 0;
#ifndef FIX_BUGS // this just slows down streaming
if ( BytesPerSector <= CDSTREAM_SECTOR_SIZE ) if ( BytesPerSector <= CDSTREAM_SECTOR_SIZE )
{ {
_gdwCdStreamFlags |= FILE_FLAG_NO_BUFFERING; _gdwCdStreamFlags |= FILE_FLAG_NO_BUFFERING;
debug("Using no buffered loading for streaming\n"); debug("Using no buffered loading for streaming\n");
} }
#endif
_gbCdStreamOverlapped = TRUE; _gbCdStreamOverlapped = TRUE;

View File

@ -230,7 +230,11 @@ CEventList::ReportCrimeForEvent(eEventType type, size_t crimeId, bool copsDontCa
if(crime == CRIME_NONE) if(crime == CRIME_NONE)
return; return;
#ifdef FIX_BUGS
CVector playerPedCoors = FindPlayerCoors();
#else
CVector playerPedCoors = FindPlayerPed()->GetPosition(); CVector playerPedCoors = FindPlayerPed()->GetPosition();
#endif
CVector playerCoors = FindPlayerCoors(); CVector playerCoors = FindPlayerCoors();
if(CWanted::WorkOutPolicePresence(playerCoors, 14.0f) != 0 || if(CWanted::WorkOutPolicePresence(playerCoors, 14.0f) != 0 ||

View File

@ -1151,6 +1151,10 @@ int CRadar::SetCoordBlip(eBlipType type, CVector pos, int32 color, eBlipDisplay
if (!ms_RadarTrace[nextBlip].m_bInUse) if (!ms_RadarTrace[nextBlip].m_bInUse)
break; break;
} }
#ifdef FIX_BUGS
if (nextBlip == NUMRADARBLIPS)
return -1;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = type; ms_RadarTrace[nextBlip].m_eBlipType = type;
ms_RadarTrace[nextBlip].m_nColor = color; ms_RadarTrace[nextBlip].m_nColor = color;
ms_RadarTrace[nextBlip].m_bDim = true; ms_RadarTrace[nextBlip].m_bDim = true;
@ -1182,6 +1186,10 @@ int CRadar::SetEntityBlip(eBlipType type, int32 handle, int32 color, eBlipDispla
if (!ms_RadarTrace[nextBlip].m_bInUse) if (!ms_RadarTrace[nextBlip].m_bInUse)
break; break;
} }
#ifdef FIX_BUGS
if (nextBlip == NUMRADARBLIPS)
return -1;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = type; ms_RadarTrace[nextBlip].m_eBlipType = type;
ms_RadarTrace[nextBlip].m_nColor = color; ms_RadarTrace[nextBlip].m_nColor = color;
ms_RadarTrace[nextBlip].m_bDim = true; ms_RadarTrace[nextBlip].m_bDim = true;
@ -1526,6 +1534,10 @@ CRadar::ToggleTargetMarker(float x, float y)
if (!ms_RadarTrace[nextBlip].m_bInUse) if (!ms_RadarTrace[nextBlip].m_bInUse)
break; break;
} }
#ifdef FIX_BUGS
if (nextBlip == NUMRADARBLIPS)
return;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = BLIP_COORD; ms_RadarTrace[nextBlip].m_eBlipType = BLIP_COORD;
ms_RadarTrace[nextBlip].m_nColor = 0x333333FF; ms_RadarTrace[nextBlip].m_nColor = 0x333333FF;
ms_RadarTrace[nextBlip].m_bDim = 1; ms_RadarTrace[nextBlip].m_bDim = 1;

View File

@ -50,7 +50,7 @@ void tbInit()
#endif #endif
} }
void tbStartTimer(int32 unk, char *name) void tbStartTimer(int32 unk, Const char *name)
{ {
strcpy(TimerBar.Timers[TimerBar.count].name, name); strcpy(TimerBar.Timers[TimerBar.count].name, name);
TimerBar.Timers[TimerBar.count].unk = unk; TimerBar.Timers[TimerBar.count].unk = unk;
@ -58,7 +58,7 @@ void tbStartTimer(int32 unk, char *name)
TimerBar.count++; TimerBar.count++;
} }
void tbEndTimer(char* name) void tbEndTimer(Const char* name)
{ {
uint32 n = 1500; uint32 n = 1500;
for (uint32 i = 0; i < TimerBar.count; i++) { for (uint32 i = 0; i < TimerBar.count; i++) {

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
void tbInit(); void tbInit();
void tbStartTimer(int32, char*); void tbStartTimer(int32, Const char*);
void tbEndTimer(char*); void tbEndTimer(Const char*);
void tbDisplay(); void tbDisplay();

View File

@ -1261,7 +1261,11 @@ void CParticle::Update()
{ {
if ( CTimer::GetFrameCounter() & 10 ) if ( CTimer::GetFrameCounter() & 10 )
{ {
#ifdef FIX_BUGS
if ( FindPlayerPed() && FindPlayerPed()->GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN )
#else
if ( FindPlayerPed()->GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN ) if ( FindPlayerPed()->GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN )
#endif
{ {
AddParticle(PARTICLE_HEATHAZE, particle->m_vecPosition, CVector(0.0f, 0.0f, 0.0f)); AddParticle(PARTICLE_HEATHAZE, particle->m_vecPosition, CVector(0.0f, 0.0f, 0.0f));
} }

View File

@ -2745,7 +2745,11 @@ CWaterLevel::RenderSeaBirds()
void void
CWaterLevel::RenderShipsOnHorizon() CWaterLevel::RenderShipsOnHorizon()
{ {
#ifdef FIX_BUGS
CVector cur_pos = FindPlayerCoors();
#else
CVector cur_pos = FindPlayerPed()->GetPosition(); CVector cur_pos = FindPlayerPed()->GetPosition();
#endif
static CVector prev_pos(0.0f, 0.0f, 0.0f); static CVector prev_pos(0.0f, 0.0f, 0.0f);
static CVector prev_front(0.0f, 0.0f, 0.0f); static CVector prev_front(0.0f, 0.0f, 0.0f);
@ -2847,7 +2851,11 @@ CWaterLevel::HandleSeaLifeForms()
void void
CWaterLevel::HandleBeachToysStuff(void) CWaterLevel::HandleBeachToysStuff(void)
{ {
#ifdef FIX_BUGS
CVector cur_pos = FindPlayerCoors();
#else
CVector cur_pos = FindPlayerPed()->GetPosition(); CVector cur_pos = FindPlayerPed()->GetPosition();
#endif
static bool bBeachBallInit = true; static bool bBeachBallInit = true;
static CVector FirstBeachBallPos = cur_pos; static CVector FirstBeachBallPos = cur_pos;

View File

@ -1099,8 +1099,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT ) if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks); _InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L; return 0L;
#endif
} }
case WM_KEYUP: case WM_KEYUP:
@ -1113,7 +1116,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT ) if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks); _InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L; return 0L;
#endif
} }
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
@ -1126,7 +1133,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT ) if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks); _InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L; return 0L;
#endif
} }
case WM_SYSKEYUP: case WM_SYSKEYUP:
@ -1139,7 +1150,11 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
if ( wParam == VK_SHIFT ) if ( wParam == VK_SHIFT )
_InputTranslateShiftKeyUpDown(&ks); _InputTranslateShiftKeyUpDown(&ks);
#ifdef FIX_BUGS
break;
#else
return 0L; return 0L;
#endif
} }
case WM_ACTIVATEAPP: case WM_ACTIVATEAPP:

View File

@ -132,7 +132,11 @@ CBoat::ProcessControl(void)
if(bRenderScorched) if(bRenderScorched)
m_fBuoyancy *= 0.99f; m_fBuoyancy *= 0.99f;
#ifdef FIX_BUGS
if(FindPlayerPed() && FindPlayerPed()->m_pWanted->m_nWantedLevel > 0 && GetModelIndex() == MI_PREDATOR){
#else
if(FindPlayerPed()->m_pWanted->m_nWantedLevel > 0 && GetModelIndex() == MI_PREDATOR){ if(FindPlayerPed()->m_pWanted->m_nWantedLevel > 0 && GetModelIndex() == MI_PREDATOR){
#endif
CVehicle *playerVeh = FindPlayerVehicle(); CVehicle *playerVeh = FindPlayerVehicle();
if(playerVeh && playerVeh->GetVehicleAppearance() == VEHICLE_APPEARANCE_BOAT && if(playerVeh && playerVeh->GetVehicleAppearance() == VEHICLE_APPEARANCE_BOAT &&
(AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY || (AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY ||

View File

@ -34,7 +34,7 @@ void CCarGenerator::SwitchOff()
void CCarGenerator::SwitchOn() void CCarGenerator::SwitchOn()
{ {
m_nUsesRemaining = 255; m_nUsesRemaining = UINT16_MAX;
m_nTimer = CalcNextGen(); m_nTimer = CalcNextGen();
++CTheCarGenerators::CurrentActiveCount; ++CTheCarGenerators::CurrentActiveCount;
} }
@ -141,10 +141,10 @@ void CCarGenerator::DoInternalProcessing()
m_nVehicleHandle = CPools::GetVehiclePool()->GetIndex(pVehicle); m_nVehicleHandle = CPools::GetVehiclePool()->GetIndex(pVehicle);
/* I don't think this is a correct comparasion */ /* I don't think this is a correct comparasion */
#ifdef FIX_BUGS #ifdef FIX_BUGS
if (m_nUsesRemaining != 0) if (m_nUsesRemaining < UINT16_MAX)
--m_nUsesRemaining; --m_nUsesRemaining;
#else #else
if (m_nUsesRemaining < -1) if (m_nUsesRemaining < ~0)
--m_nUsesRemaining; --m_nUsesRemaining;
#endif #endif
m_nTimer = CalcNextGen(); m_nTimer = CalcNextGen();

View File

@ -48,8 +48,10 @@ CDamageManager::FuckCarCompletely(void)
#endif #endif
} }
// Why set to no damage? // Why set to no damage?
#ifndef FIX_BUGS
m_lightStatus = 0; m_lightStatus = 0;
m_panelStatus = 0; m_panelStatus = 0;
#endif
SetEngineStatus(250); SetEngineStatus(250);
} }

View File

@ -31,6 +31,16 @@ void
CExplosion::Initialise() CExplosion::Initialise()
{ {
debug("Initialising CExplosion...\n"); debug("Initialising CExplosion...\n");
ClearAllExplosions();
AudioHandle = DMAudio.CreateEntity(AUDIOTYPE_EXPLOSION, (void*)1);
if (AudioHandle >= 0)
DMAudio.SetEntityStatus(AudioHandle, true);
debug("CExplosion ready\n");
}
void
CExplosion::ClearAllExplosions()
{
for (int i = 0; i < ARRAY_SIZE(gaExplosion); i++) { for (int i = 0; i < ARRAY_SIZE(gaExplosion); i++) {
gaExplosion[i].m_ExplosionType = EXPLOSION_GRENADE; gaExplosion[i].m_ExplosionType = EXPLOSION_GRENADE;
gaExplosion[i].m_vecPosition = CVector(0.0f, 0.0f, 0.0f); gaExplosion[i].m_vecPosition = CVector(0.0f, 0.0f, 0.0f);
@ -44,10 +54,6 @@ CExplosion::Initialise()
gaExplosion[i].m_fStartTime = 0.0f; gaExplosion[i].m_fStartTime = 0.0f;
gaExplosion[i].m_bIsBoat = false; gaExplosion[i].m_bIsBoat = false;
} }
AudioHandle = DMAudio.CreateEntity(AUDIOTYPE_EXPLOSION, (void*)1);
if (AudioHandle >= 0)
DMAudio.SetEntityStatus(AudioHandle, true);
debug("CExplosion ready\n");
} }
void void

View File

@ -37,6 +37,7 @@ class CExplosion
float m_fZshift; float m_fZshift;
public: public:
static void Initialise(); static void Initialise();
static void ClearAllExplosions();
static void Shutdown(); static void Shutdown();
static int8 GetExplosionActiveCounter(uint8 id); static int8 GetExplosionActiveCounter(uint8 id);
static void ResetExplosionActiveCounter(uint8 id); static void ResetExplosionActiveCounter(uint8 id);

2
vendor/opusfile vendored

@ -1 +1 @@
Subproject commit 6452e838e68e8f4fc0b3599523c760ac6276ce89 Subproject commit f94a1764b0dcdd84ee8c13c040de9f4c1a67e4df