summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/FileLoader.cpp6
-rw-r--r--src/core/Fire.cpp2
-rw-r--r--src/core/Frontend.cpp15
-rw-r--r--src/core/MenuScreens.cpp2
-rw-r--r--src/core/MenuScreensCustom.cpp2
-rw-r--r--src/core/Radar.cpp93
-rw-r--r--src/core/Radar.h4
-rw-r--r--src/core/World.cpp8
-rw-r--r--src/core/common.h2
-rw-r--r--src/core/config.h21
-rw-r--r--src/core/re3.cpp4
11 files changed, 128 insertions, 31 deletions
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index cc2b402b..afa2a66f 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -1135,12 +1135,12 @@ CFileLoader::LoadMLO(const char *line)
char smth[8];
char name[24];
int modelIndex;
- float someFloat;
+ float drawDist;
- sscanf(line, "%s %s %d %f", smth, name, &modelIndex, &someFloat);
+ sscanf(line, "%s %s %d %f", smth, name, &modelIndex, &drawDist);
CMloModelInfo *minfo = CModelInfo::AddMloModel(modelIndex);
minfo->SetModelName(name);
- minfo->field_34 = someFloat;
+ minfo->drawDist = drawDist;
int instId = CModelInfo::GetMloInstanceStore().allocPtr;
minfo->firstInstance = instId;
minfo->lastInstance = instId;
diff --git a/src/core/Fire.cpp b/src/core/Fire.cpp
index 984b21bb..8b184622 100644
--- a/src/core/Fire.cpp
+++ b/src/core/Fire.cpp
@@ -396,7 +396,7 @@ CFireManager::StartScriptFire(const CVector &pos, CEntity *target, float strengt
if (target) {
if (target->IsPed()) {
ped->m_pFire = fire;
- if (target != (CVehicle *)FindPlayerPed()) {
+ if (target != FindPlayerPed()) {
CVector2D pos = target->GetPosition();
ped->SetFlee(pos, 10000);
ped->SetMoveAnim();
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 0f4218a4..666774fe 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -451,7 +451,7 @@ CMenuManager::ThingsToDoBeforeGoingBack()
if ((m_nCurrScreen == MENUPAGE_SKIN_SELECT) && strcmp(m_aSkinName, m_PrefsSkinFile) != 0) {
CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
#ifdef CUSTOM_FRONTEND_OPTIONS
- } else if (ScreenHasOption(m_nCurrScreen, "FEA_3DH")) {
+ } else if (ScreenHasOption(m_nCurrScreen, "FEA_RSS")) {
#else
} else if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) {
#endif
@@ -3820,9 +3820,6 @@ CMenuManager::LoadSettings()
if (LoadINISettings()) {
LoadINIControllerSettings();
}
- // if no re3.ini, create it, or update it with new values
- SaveINISettings();
- SaveINIControllerSettings();
#endif
m_PrefsVsync = m_PrefsVsyncDisp;
@@ -4183,14 +4180,14 @@ CMenuManager::Process(void)
if (m_nCurrScreen == MENUPAGE_LOADING_IN_PROGRESS) {
#ifdef MISSION_REPLAY
if (doingMissionRetry) {
- RetryMission(2, 0);
+ RetryMission(MISSION_RETRY_TYPE_BEGIN_RESTARTING);
m_nCurrSaveSlot = SLOT_COUNT;
doingMissionRetry = false;
}
#endif
if (CheckSlotDataValid(m_nCurrSaveSlot)) {
#ifdef USE_DEBUG_SCRIPT_LOADER
- scriptToLoad = 0;
+ CTheScripts::ScriptToLoad = 0;
#endif
#ifdef PC_PLAYER_CONTROLS
TheCamera.m_bUseMouse3rdPerson = m_ControlMethod == CONTROL_STANDARD;
@@ -4320,12 +4317,12 @@ CMenuManager::ProcessButtonPresses(void)
#ifdef USE_DEBUG_SCRIPT_LOADER
if (m_nCurrScreen == MENUPAGE_START_MENU || m_nCurrScreen == MENUPAGE_NEW_GAME || m_nCurrScreen == MENUPAGE_NEW_GAME_RELOAD) {
if (CPad::GetPad(0)->GetChar('R')) {
- scriptToLoad = 1;
+ CTheScripts::ScriptToLoad = 1;
DoSettingsBeforeStartingAGame();
return;
}
if (CPad::GetPad(0)->GetChar('D')) {
- scriptToLoad = 2;
+ CTheScripts::ScriptToLoad = 2;
DoSettingsBeforeStartingAGame();
return;
}
@@ -5194,7 +5191,7 @@ CMenuManager::ProcessButtonPresses(void)
case MENUACTION_UNK114:
doingMissionRetry = false;
RequestFrontEndShutDown();
- RetryMission(2, 0);
+ RetryMission(MISSION_RETRY_TYPE_BEGIN_RESTARTING);
return;
#endif
#ifdef CUSTOM_FRONTEND_OPTIONS
diff --git a/src/core/MenuScreens.cpp b/src/core/MenuScreens.cpp
index 3bd9adf4..0a149f27 100644
--- a/src/core/MenuScreens.cpp
+++ b/src/core/MenuScreens.cpp
@@ -40,8 +40,10 @@ CMenuScreen aScreens[MENUPAGES] = {
{ "FET_AUD", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 1, 1,
MENUACTION_MUSICVOLUME, "FEA_MUS", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_SFXVOLUME, "FEA_SFX", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
+#ifdef EXTERNAL_3D_SOUND
MENUACTION_AUDIOHW, "FEA_3DH", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_SPEAKERCONF, "FEA_SPK", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
+#endif
MENUACTION_DYNAMICACOUSTIC, "FET_DAM", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_RADIO, "FEA_RSS", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp
index 586b51fa..5eecd841 100644
--- a/src/core/MenuScreensCustom.cpp
+++ b/src/core/MenuScreensCustom.cpp
@@ -435,8 +435,10 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
{ "FET_AUD", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, nil, nil,
MENUACTION_MUSICVOLUME, "FEA_MUS", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS },
MENUACTION_SFXVOLUME, "FEA_SFX", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS },
+#ifdef EXTERNAL_3D_SOUND
MENUACTION_AUDIOHW, "FEA_3DH", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS },
MENUACTION_SPEAKERCONF, "FEA_SPK", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS },
+#endif
MENUACTION_DYNAMICACOUSTIC, "FET_DAM", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS },
MENUACTION_RADIO, "FEA_RSS", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS },
MENUACTION_RESTOREDEF, "FET_DEF", { nil, SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS },
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 77d6cc7f..d74ce007 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -45,6 +45,9 @@ CSprite2d CRadar::SaveSprite;
CSprite2d CRadar::SpraySprite;
CSprite2d CRadar::TonySprite;
CSprite2d CRadar::WeaponSprite;
+#ifdef MENU_MAP
+CSprite2d CRadar::WaypointSprite;
+#endif
CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = {
nil,
@@ -67,7 +70,10 @@ CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = {
&SaveSprite,
&SpraySprite,
&TonySprite,
- &WeaponSprite
+ &WeaponSprite,
+#ifdef MENU_MAP
+ &WaypointSprite
+#endif
};
// Why this doesn't coincide with world coordinates i don't know
@@ -441,7 +447,7 @@ void CRadar::Draw3dMarkers()
CEntity *entity = CPools::GetVehiclePool()->GetAt(ms_RadarTrace[i].m_nEntityHandle);
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
CVector pos = entity->GetPosition();
- pos.z += 1.2f * CModelInfo::GetModelInfo(entity->GetModelIndex())->GetColModel()->boundingBox.max.z + 2.5f;
+ pos.z += 1.2f * CModelInfo::GetColModel(entity->GetModelIndex())->boundingBox.max.z + 2.5f;
C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), MARKERTYPE_ARROW, pos, 2.5f, 0, 128, 255, 255, 1024, 0.2f, 5);
}
break;
@@ -465,7 +471,7 @@ void CRadar::Draw3dMarkers()
CEntity *entity = CPools::GetObjectPool()->GetAt(ms_RadarTrace[i].m_nEntityHandle);
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
CVector pos = entity->GetPosition();
- pos.z += CModelInfo::GetModelInfo(entity->GetModelIndex())->GetColModel()->boundingBox.max.z + 1.0f + 1.0f;
+ pos.z += CModelInfo::GetColModel(entity->GetModelIndex())->boundingBox.max.z + 1.0f + 1.0f;
C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), MARKERTYPE_ARROW, pos, 1.0f, 0, 128, 255, 255, 1024, 0.2f, 5);
}
break;
@@ -485,7 +491,11 @@ void CRadar::Draw3dMarkers()
void CRadar::DrawBlips()
{
- if (!TheCamera.m_WideScreenOn && CHud::m_Wants_To_Draw_Hud) {
+ if ((!TheCamera.m_WideScreenOn && CHud::m_Wants_To_Draw_Hud)
+#ifdef MENU_MAP
+ || CMenuManager::bMenuMapActive
+#endif
+ ) {
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
@@ -913,6 +923,9 @@ void CRadar::DrawRadarSection(int32 x, int32 y)
void CRadar::DrawRadarSprite(uint16 sprite, float x, float y, uint8 alpha)
{
+#ifdef MENU_MAP
+ if(sprite == RADAR_SPRITE_WAYPOINT) alpha = 255;
+#endif
RadarSprites[sprite]->Draw(CRect(x - SCREEN_SCALE_X(8.0f), y - SCREEN_SCALE_Y(8.0f), x + SCREEN_SCALE_X(8.0f), y + SCREEN_SCALE_Y(8.0f)), CRGBA(255, 255, 255, alpha));
}
@@ -1018,6 +1031,10 @@ const char* gRadarTexNames[] = {
void
CRadar::Initialise()
{
+#ifdef MENU_MAP
+ TargetMarkerId = -1;
+#endif
+
for (int i = 0; i < NUMRADARBLIPS; i++) {
ms_RadarTrace[i].m_BlipIndex = 1;
SetRadarMarkerState(i, false);
@@ -1086,6 +1103,43 @@ CRadar::LoadTextures()
SpraySprite.SetTexture("radar_spray");
TonySprite.SetTexture("radar_tony");
WeaponSprite.SetTexture("radar_weapon");
+#ifdef MENU_MAP
+ WaypointSprite.SetTexture("radar_waypoint");
+ if(!WaypointSprite.m_pTexture) {
+ // create the texture if it's missing in TXD
+#define WAYPOINT_R (255)
+#define WAYPOINT_G (72)
+#define WAYPOINT_B (77)
+
+ RwRaster *raster = RwRasterCreate(16, 16, 0, rwRASTERTYPETEXTURE | rwRASTERFORMAT8888);
+
+ RwUInt32 *pixels = (RwUInt32 *)RwRasterLock(raster, 0, rwRASTERLOCKWRITE);
+ for(int x = 0; x < 16; x++)
+ for(int y = 0; y < 16; y++)
+ {
+ int x2 = x < 8 ? x : 7 - (x & 7);
+ int y2 = y < 8 ? y : 7 - (y & 7);
+ if ((y2 >= 4 && x2 >= 4) // square in the center is transparent
+ || (x2 < 2 && y2 == 0) // two pixels on each side of first/last line are transparent
+ || (x2 < 1 && y2 == 1)) // one pixel on each side of second to first/last line is transparent
+ pixels[x + y * 16] = 0;
+ else if((x2 == 2 && y2 >= 2)|| (y2 == 2 && x2 >= 2) )// colored square inside
+#ifdef RW_GL3
+ pixels[x + y * 16] = WAYPOINT_R | (WAYPOINT_G << 8) | (WAYPOINT_B << 16) | (255 << 24);
+#else
+ pixels[x + y * 16] = WAYPOINT_B | (WAYPOINT_G << 8) | (WAYPOINT_R << 16) | (255 << 24);
+#endif
+ else
+ pixels[x + y * 16] = 0xFF000000; // black
+ }
+ RwRasterUnlock(raster);
+ WaypointSprite.m_pTexture = RwTextureCreate(raster);
+ RwTextureSetFilterMode(WaypointSprite.m_pTexture, rwFILTERLINEAR);
+#undef WAYPOINT_R
+#undef WAYPOINT_G
+#undef WAYPOINT_B
+ }
+#endif
CTxdStore::PopCurrentTxd();
}
@@ -1103,15 +1157,23 @@ INITSAVEBUF
WriteSaveHeader(buf, 'R', 'D', 'R', '\0', *size - SAVE_HEADER_SIZE);
#ifdef MENU_MAP
+ bool bWaypointDeleted = false;
if (TargetMarkerId != -1) {
ClearBlip(TargetMarkerId);
TargetMarkerId = -1;
+ bWaypointDeleted = true;
}
#endif
for (int i = 0; i < NUMRADARBLIPS; i++)
WriteSaveBuf(buf, ms_RadarTrace[i]);
+
+#ifdef MENU_MAP
+ if(bWaypointDeleted)
+ ToggleTargetMarker(TargetMarkerPos.x, TargetMarkerPos.y);
+#endif
+
VALIDATESAVEBUF(*size);
}
@@ -1216,7 +1278,11 @@ void CRadar::ShowRadarMarker(CVector pos, uint32 color, float radius) {
void CRadar::ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 green, uint8 blue, uint8 alpha)
{
- if (!CHud::m_Wants_To_Draw_Hud || TheCamera.m_WideScreenOn)
+ if ((TheCamera.m_WideScreenOn || !CHud::m_Wants_To_Draw_Hud)
+#ifdef MENU_MAP
+ && !CMenuManager::bMenuMapActive
+#endif
+ )
return;
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));
@@ -1225,7 +1291,11 @@ void CRadar::ShowRadarTrace(float x, float y, uint32 size, uint8 red, uint8 gree
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)
+ if ((TheCamera.m_WideScreenOn || !CHud::m_Wants_To_Draw_Hud)
+#ifdef MENU_MAP
+ && !CMenuManager::bMenuMapActive
+#endif
+ )
return;
switch (mode)
@@ -1269,6 +1339,9 @@ void CRadar::Shutdown()
SpraySprite.Delete();
TonySprite.Delete();
WeaponSprite.Delete();
+#ifdef MENU_MAP
+ WaypointSprite.Delete();
+#endif
RemoveRadarSections();
}
@@ -1464,12 +1537,12 @@ CRadar::ToggleTargetMarker(float x, float y)
{
if (TargetMarkerId == -1) {
int nextBlip;
- for (nextBlip = 0; nextBlip < NUMRADARBLIPS; nextBlip++) {
+ for (nextBlip = NUMRADARBLIPS-1; nextBlip >= 0; nextBlip--) {
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
#ifdef FIX_BUGS
- if (nextBlip == NUMRADARBLIPS)
+ if (nextBlip == 0)
return;
#endif
ms_RadarTrace[nextBlip].m_eBlipType = BLIP_COORD;
@@ -1477,14 +1550,14 @@ CRadar::ToggleTargetMarker(float x, float y)
ms_RadarTrace[nextBlip].m_bDim = 0;
ms_RadarTrace[nextBlip].m_bInUse = 1;
ms_RadarTrace[nextBlip].m_Radius = 1.0f;
- CVector pos(x, y, CWorld::FindGroundZForCoord(x,y));
+ CVector pos(x, y, 0.0f/*CWorld::FindGroundZForCoord(x,y)*/);
TargetMarkerPos = pos;
ms_RadarTrace[nextBlip].m_vec2DPos = pos;
ms_RadarTrace[nextBlip].m_vecPos = pos;
ms_RadarTrace[nextBlip].m_nEntityHandle = 0;
ms_RadarTrace[nextBlip].m_wScale = 5;
ms_RadarTrace[nextBlip].m_eBlipDisplay = BLIP_DISPLAY_BLIP_ONLY;
- ms_RadarTrace[nextBlip].m_eRadarSprite = RADAR_SPRITE_NONE;
+ ms_RadarTrace[nextBlip].m_eRadarSprite = RADAR_SPRITE_WAYPOINT;
TargetMarkerId = CRadar::GetNewUniqueBlipIndex(nextBlip);
} else {
ClearBlip(TargetMarkerId);
diff --git a/src/core/Radar.h b/src/core/Radar.h
index 5b38d350..ae87d0fa 100644
--- a/src/core/Radar.h
+++ b/src/core/Radar.h
@@ -47,6 +47,9 @@ enum eRadarSprite
RADAR_SPRITE_SPRAY,
RADAR_SPRITE_TONY,
RADAR_SPRITE_WEAPON,
+#ifdef MENU_MAP
+ RADAR_SPRITE_WAYPOINT,
+#endif
RADAR_SPRITE_COUNT
};
@@ -144,6 +147,7 @@ public:
static float cachedCos;
static float cachedSin;
#ifdef MENU_MAP
+ static CSprite2d WaypointSprite;
static int TargetMarkerId;
static CVector TargetMarkerPos;
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 6e8314f4..1c34a633 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -358,7 +358,7 @@ CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColP
} else
colmodel = nil;
} else if(e->bUsesCollision)
- colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
+ colmodel = CModelInfo::GetColModel(e->GetModelIndex());
if(colmodel && CCollision::ProcessLineOfSight(line, e->GetMatrix(), *colmodel, point, mindist,
ignoreSeeThrough))
@@ -444,7 +444,7 @@ CWorld::ProcessVerticalLineSectorList(CPtrList &list, const CColLine &line, CCol
if(e->m_scanCode != GetCurrentScanCode() && e->bUsesCollision) {
e->m_scanCode = GetCurrentScanCode();
- colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
+ colmodel = CModelInfo::GetColModel(e->GetModelIndex());
if(CCollision::ProcessVerticalLine(line, e->GetMatrix(), *colmodel, point, mindist,
ignoreSeeThrough, poly))
entity = e;
@@ -645,7 +645,7 @@ CWorld::GetIsLineOfSightSectorListClear(CPtrList &list, const CColLine &line, bo
if(e != pIgnoreEntity && !(ignoreSomeObjects && CameraToIgnoreThisObject(e))) {
- colmodel = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
+ colmodel = CModelInfo::GetColModel(e->GetModelIndex());
if(CCollision::TestLineOfSight(line, e->GetMatrix(), *colmodel, ignoreSeeThrough))
return false;
@@ -955,7 +955,7 @@ CWorld::TestSphereAgainstSectorList(CPtrList &list, CVector spherePos, float rad
float distance = diff.Magnitude();
if(e->GetBoundRadius() + radius > distance) {
- CColModel *eCol = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel();
+ CColModel *eCol = CModelInfo::GetColModel(e->GetModelIndex());
int collidedSpheres =
CCollision::ProcessColModels(sphereMat, OurColModel, e->GetMatrix(), *eCol,
gaTempSphereColPoints, nil, nil);
diff --git a/src/core/common.h b/src/core/common.h
index 31aab2b3..0d0528b1 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -296,6 +296,8 @@ extern wchar *AllocUnicode(const char*src);
#define Clamp(v, low, high) ((v)<(low) ? (low) : (v)>(high) ? (high) : (v))
+#define Clamp2(v, center, radius) ((v) > (center) ? Min(v, center + radius) : Max(v, center - radius))
+
inline float sq(float x) { return x*x; }
#define SQR(x) ((x) * (x))
diff --git a/src/core/config.h b/src/core/config.h
index 8171f987..d26f9546 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -132,7 +132,6 @@ enum Config {
NUM_SOUNDS_SAMPLES_BANKS = 2,
NUM_AUDIOENTITIES = 200,
- NUM_AUDIO_REFLECTIONS = 5,
NUM_SCRIPT_MAX_ENTITIES = 40,
NUM_GARAGE_STORED_CARS = 6,
@@ -171,6 +170,7 @@ enum Config {
# define ANIM_COMPRESSION
# define PS2_MENU
#elif defined GTA_PC
+# define EXTERNAL_3D_SOUND
# ifndef GTA_HANDHELD
# define PC_PLAYER_CONTROLS // mouse player/cam mode
# endif
@@ -266,12 +266,15 @@ enum Config {
#define FIX_BUGS // fixes bugs that we've came across during reversing. You can undefine this only on release builds.
#define MORE_LANGUAGES // Add more translations to the game
-#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible, and keeps saves compatible between platforms
+#define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible, and keeps saves compatible between platforms, needs to be enabled on 64bit builds!
#define FIX_INCOMPATIBLE_SAVES // try to fix incompatible saves, requires COMPATIBLE_SAVES
#define LOAD_INI_SETTINGS // as the name suggests. fundamental for CUSTOM_FRONTEND_OPTIONS
#define NO_MOVIES // add option to disable intro videos
+#define EXTENDED_OFFSCREEN_DESPAWN_RANGE // Use onscreen despawn range for offscreen peds and vehicles to avoid them despawning in the distance when you look
+ // away
+
#if defined(__LP64__) || defined(_WIN64)
#define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build
#endif
@@ -416,7 +419,7 @@ enum Config {
// #define VC_PED_PORTS // various ports from VC's CPed, mostly subtle
// #define NEW_WALK_AROUND_ALGORITHM // to make walking around vehicles/objects less awkward
#define CANCELLABLE_CAR_ENTER
-//#define PEDS_REPORT_CRIMES_ON_PHONE, requires COMPATIBLE_SAVES
+//#define PEDS_REPORT_CRIMES_ON_PHONE // requires COMPATIBLE_SAVES
// Camera
//#define PS2_CAM_TRANSITION // old way of transitioning between cam modes
@@ -424,10 +427,12 @@ enum Config {
#define FREE_CAM // Rotating cam
// Audio
+#define EXTERNAL_3D_SOUND // use external engine to simulate 3d audio spatialization. OpenAL would not work without it (because it works in a 3d space
+ // originally and making it work in 2d only requires more resource). Will not work on PS2
#define RADIO_SCROLL_TO_PREV_STATION
#define AUDIO_CACHE
#define PS2_AUDIO_CHANNELS // increases the maximum number of audio channels to PS2 value of 44 (PC has 28 originally)
-//#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds)
+#define PS2_AUDIO_PATHS // changes audio paths for cutscenes and radio to PS2 paths (needs vbdec on MSS builds)
//#define AUDIO_OAL_USE_SNDFILE // use libsndfile to decode WAVs instead of our internal decoder
#define AUDIO_OAL_USE_MPG123 // use mpg123 to support mp3 files
#define PAUSE_RADIO_IN_FRONTEND // pause radio when game is paused
@@ -457,6 +462,7 @@ enum Config {
#undef PS2_ALPHA_TEST
#undef NO_ISLAND_LOADING
#undef PS2_AUDIO_CHANNELS
+ #undef EXTENDED_OFFSCREEN_DESPAWN_RANGE
#define PC_PARTICLE
#define VC_PED_PORTS // To not process collisions always. But should be tested if that's really beneficial
#define VC_RAIN_NERF // Reduces number of rain particles
@@ -477,3 +483,10 @@ enum Config {
#endif
#endif // VANILLA_DEFINES
+
+#if defined(AUDIO_OAL) && !defined(EXTERNAL_3D_SOUND)
+#error AUDIO_OAL cannot work without EXTERNAL_3D_SOUND
+#endif
+#if defined(GTA_PS2) && defined(EXTERNAL_3D_SOUND)
+#error EXTERNAL_3D_SOUND cannot work on PS2
+#endif
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 40be153a..980ec845 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -491,8 +491,10 @@ bool LoadINISettings()
ReadIniIfExists("Audio", "SfxVolume", &FrontEndMenuManager.m_PrefsSfxVolume);
ReadIniIfExists("Audio", "MusicVolume", &FrontEndMenuManager.m_PrefsMusicVolume);
ReadIniIfExists("Audio", "Radio", &FrontEndMenuManager.m_PrefsRadioStation);
+#ifdef EXTERNAL_3D_SOUND
ReadIniIfExists("Audio", "SpeakerType", &FrontEndMenuManager.m_PrefsSpeakers);
ReadIniIfExists("Audio", "Provider", &FrontEndMenuManager.m_nPrefsAudio3DProviderIndex);
+#endif
ReadIniIfExists("Audio", "DynamicAcoustics", &FrontEndMenuManager.m_PrefsDMA);
ReadIniIfExists("Display", "Brightness", &FrontEndMenuManager.m_PrefsBrightness);
ReadIniIfExists("Display", "DrawDistance", &FrontEndMenuManager.m_PrefsLOD);
@@ -591,8 +593,10 @@ void SaveINISettings()
StoreIni("Audio", "SfxVolume", FrontEndMenuManager.m_PrefsSfxVolume);
StoreIni("Audio", "MusicVolume", FrontEndMenuManager.m_PrefsMusicVolume);
StoreIni("Audio", "Radio", FrontEndMenuManager.m_PrefsRadioStation);
+#ifdef EXTERNAL_3D_SOUND
StoreIni("Audio", "SpeakerType", FrontEndMenuManager.m_PrefsSpeakers);
StoreIni("Audio", "Provider", FrontEndMenuManager.m_nPrefsAudio3DProviderIndex);
+#endif
StoreIni("Audio", "DynamicAcoustics", FrontEndMenuManager.m_PrefsDMA);
StoreIni("Display", "Brightness", FrontEndMenuManager.m_PrefsBrightness);
StoreIni("Display", "DrawDistance", FrontEndMenuManager.m_PrefsLOD);