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

This commit is contained in:
erorcun
2020-12-09 06:34:04 +03:00
59 changed files with 73623 additions and 350 deletions

View File

@ -3621,6 +3621,8 @@ CCamera::LoadPathSplines(int file)
m_arrPathArray[i].m_arr_PathData[j] = atof(token);
i++;
j = 0;
if (i == MAX_NUM_OF_SPLINETYPES)
reading = false;
memset(token, 0, 32);
n = 0;
}

View File

@ -10,7 +10,7 @@ enum eWastedBustedState
WBSTATE_FAILED_CRITICAL_MISSION,
};
enum eBustedAudioState : uint8
enum eBustedAudioState
{
BUSTEDAUDIO_NONE,
BUSTEDAUDIO_LOADING,
@ -82,7 +82,7 @@ public:
bool m_bGetOutOfJailFree;
bool m_bGetOutOfHospitalFree;
bool m_bDriveByAllowed;
eBustedAudioState m_nBustedAudioStatus;
uint8 m_nBustedAudioStatus;
int16 m_nCurrentBustedAudio;
char m_aSkinName[32];
RwTexture *m_pSkinTexture;

View File

@ -35,7 +35,7 @@
CColPoint gaTempSphereColPoints[MAX_COLLISION_POINTS];
CPtrList CWorld::ms_bigBuildingsList[4];
CPtrList CWorld::ms_bigBuildingsList[NUM_LEVELS];
CPtrList CWorld::ms_listMovingEntityPtrs;
CSector CWorld::ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
uint16 CWorld::ms_nCurrentScanCode;
@ -1164,8 +1164,8 @@ CWorld::FindObjectsIntersectingCube(const CVector &vecStartPos, const CVector &v
const int32 nEndX = Min(GetSectorIndexX(vecStartPos.x), NUMSECTORS_X - 1);
const int32 nEndY = Min(GetSectorIndexY(vecStartPos.y), NUMSECTORS_Y - 1);
#else
const int32 nEndX = Min(GetSectorIndexX(vecSectorPos.x), NUMSECTORS_X);
const int32 nEndY = Min(GetSectorIndexY(vecSectorPos.y), NUMSECTORS_Y);
const int32 nEndX = Min(GetSectorIndexX(vecStartPos.x), NUMSECTORS_X);
const int32 nEndY = Min(GetSectorIndexY(vecStartPos.y), NUMSECTORS_Y);
#endif
for(int32 y = nStartY; y <= nEndY; y++) {
for(int32 x = nStartX; x <= nEndX; x++) {
@ -1580,7 +1580,7 @@ CWorld::CallOffChaseForAreaSectorListVehicles(CPtrList &list, float x1, float y1
if(pVehicle->m_scanCode != GetCurrentScanCode()) {
pVehicle->m_scanCode = GetCurrentScanCode();
const CVector &vehiclePos = pVehicle->GetPosition();
eCarMission carMission = pVehicle->AutoPilot.m_nCarMission;
uint8 carMission = pVehicle->AutoPilot.m_nCarMission;
if(pVehicle != FindPlayerVehicle() && vehiclePos.x > fStartX && vehiclePos.x < fEndX &&
vehiclePos.y > fStartY && vehiclePos.y < fEndY && pVehicle->bIsLawEnforcer &&
(carMission == MISSION_RAMPLAYER_FARAWAY || carMission == MISSION_RAMPLAYER_CLOSE ||
@ -1781,21 +1781,29 @@ CWorld::ShutDown(void)
CWorld::Remove(pEntity);
delete pEntity;
}
#ifndef FIX_BUGS
pSector->m_lists[ENTITYLIST_BUILDINGS].Flush();
pSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP].Flush();
pSector->m_lists[ENTITYLIST_DUMMIES].Flush();
pSector->m_lists[ENTITYLIST_DUMMIES_OVERLAP].Flush();
#endif
}
for(int32 i = 0; i < 4; i++) {
for(CPtrNode *pNode = GetBigBuildingList((eLevelName)i).first; pNode; pNode = pNode->next) {
for(int32 i = 0; i < NUM_LEVELS; i++) {
for(CPtrNode *pNode = ms_bigBuildingsList[i].first; pNode; pNode = pNode->next) {
CEntity *pEntity = (CEntity *)pNode->item;
// Maybe remove from world here?
delete pEntity;
}
GetBigBuildingList((eLevelName)i).Flush();
ms_bigBuildingsList[i].Flush();
}
for(int i = 0; i < NUMSECTORS_X * NUMSECTORS_Y; i++) {
CSector *pSector = GetSector(i % NUMSECTORS_X, i / NUMSECTORS_Y);
#ifdef FIX_BUGS
pSector->m_lists[ENTITYLIST_BUILDINGS].Flush();
pSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP].Flush();
pSector->m_lists[ENTITYLIST_DUMMIES].Flush();
pSector->m_lists[ENTITYLIST_DUMMIES_OVERLAP].Flush();
#endif
if(pSector->m_lists[ENTITYLIST_BUILDINGS].first) {
sprintf(gString, "Building list %d,%d not empty\n", i % NUMSECTORS_X, i / NUMSECTORS_Y);
pSector->m_lists[ENTITYLIST_BUILDINGS].Flush();

View File

@ -55,7 +55,7 @@ struct CStoredCollPoly;
class CWorld
{
static CPtrList ms_bigBuildingsList[4];
static CPtrList ms_bigBuildingsList[NUM_LEVELS];
static CPtrList ms_listMovingEntityPtrs;
static CSector ms_aSectors[NUMSECTORS_Y][NUMSECTORS_X];
static uint16 ms_nCurrentScanCode;

View File

@ -311,6 +311,12 @@ enum Config {
#define USE_DEBUG_SCRIPT_LOADER // Loads main.scm by default. Hold R for main_freeroam.scm and D for main_d.scm
#define USE_MEASUREMENTS_IN_METERS // makes game use meters instead of feet in script
#define USE_PRECISE_MEASUREMENT_CONVERTION // makes game convert feet to meeters more precisely
#define SUPPORT_JAPANESE_SCRIPT
//#define SUPPORT_XBOX_SCRIPT
//#define SUPPORT_MOBILE_SCRIPT
#if (defined SUPPORT_XBOX_SCRIPT && defined SUPPORT_MOBILE_SCRIPT)
static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually exclusive");
#endif
#ifdef PC_MENU
//#define MISSION_REPLAY // mobile feature
#endif

View File

@ -124,12 +124,18 @@ public:
(T*)&m_entries[handle >> 8] : nil;
}
int GetIndex(T *entry){
int i = GetJustIndex(entry);
int i = GetJustIndex_NoFreeAssert(entry);
return m_flags[i].u + (i<<8);
}
int GetJustIndex(T *entry){
// TODO: the cast is unsafe
return (int)((U*)entry - m_entries);
int index = GetJustIndex_NoFreeAssert(entry);
assert(!IsFreeSlot(index));
return index;
}
int GetJustIndex_NoFreeAssert(T* entry){
int index = ((U*)entry - m_entries);
assert((U*)entry == (U*)&m_entries[index]); // cast is unsafe - check required
return index;
}
int GetNoOfUsedSpaces(void) const {
int i;