summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-08-08 14:34:02 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-08-08 14:34:02 +0200
commit88b4c7b50b032f06510fec278babe7502cd85d64 (patch)
treea3696b405ab314eb845766c57f4c3e941753c3d5
parentMerge pull request #1266 from Nick007J/miami (diff)
parentCVehicle fixes and cleanup (diff)
downloadre3-88b4c7b50b032f06510fec278babe7502cd85d64.tar
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.gz
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.bz2
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.lz
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.xz
re3-88b4c7b50b032f06510fec278babe7502cd85d64.tar.zst
re3-88b4c7b50b032f06510fec278babe7502cd85d64.zip
-rw-r--r--cmake/FindMilesSDK.cmake2
-rw-r--r--cmake/Findmpg123.cmake2
-rw-r--r--src/audio/AudioCollision.cpp5
-rw-r--r--src/audio/AudioLogic.cpp5
-rw-r--r--src/audio/AudioManager.h5
-rw-r--r--src/audio/oal/aldlist.h2
-rw-r--r--src/audio/sampman_miles.cpp16
-rw-r--r--src/audio/sampman_oal.cpp5
-rw-r--r--src/control/Pickups.cpp1
-rw-r--r--src/control/Restart.cpp1
-rw-r--r--src/control/Script5.cpp1
-rw-r--r--src/core/Cam.cpp2
-rw-r--r--src/core/Camera.cpp2
-rw-r--r--src/core/Camera.h2
-rw-r--r--src/core/FrontendTriggers.h4
-rw-r--r--src/core/Pools.cpp1
-rw-r--r--src/core/Radar.cpp1
-rw-r--r--src/core/Radar.h1
-rw-r--r--src/core/common.h7
-rw-r--r--src/core/re3.cpp4
-rw-r--r--src/fakerw/fake.cpp1
-rw-r--r--src/renderer/Draw.cpp2
-rw-r--r--src/renderer/Font.cpp2
-rw-r--r--src/renderer/Font.h2
-rw-r--r--src/renderer/Sprite.cpp4
-rw-r--r--src/rw/RwHelper.cpp1
-rw-r--r--src/vehicles/Automobile.cpp2
-rw-r--r--src/weapons/Weapon.cpp4
28 files changed, 58 insertions, 29 deletions
diff --git a/cmake/FindMilesSDK.cmake b/cmake/FindMilesSDK.cmake
index 57da3a6e..dcf4da33 100644
--- a/cmake/FindMilesSDK.cmake
+++ b/cmake/FindMilesSDK.cmake
@@ -28,7 +28,7 @@ find_package_handle_standard_args(MilesSDK DEFAULT_MSG MilesSDK_LIBRARIES MilesS
if(NOT TARGET MilesSDK::MilesSDK)
add_library(MilesSDK::MilesSDK UNKNOWN IMPORTED)
set_target_properties(MilesSDK::MilesSDK PROPERTIES
- IMPORTED_LOCATION "${MilesSDK_LIBRARIES}
+ IMPORTED_LOCATION "${MilesSDK_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${MilesSDK_INCLUDE_DIR}"
)
endif()
diff --git a/cmake/Findmpg123.cmake b/cmake/Findmpg123.cmake
index c6fe56bb..aa59ad82 100644
--- a/cmake/Findmpg123.cmake
+++ b/cmake/Findmpg123.cmake
@@ -18,7 +18,7 @@ find_path(mpg123_INCLUDE_DIR mpg123.h
PATH_SUFFIXES include
)
-find_library(mpg123_LIBRARIES NAMES mpg123 mpg123-0
+find_library(mpg123_LIBRARIES NAMES mpg123 mpg123-0 libmpg123-0
HINTS ${PKG_MPG123_LIBRARIES}
PATHS "${mpg123_DIR}"
PATH_SUFFIXES lib
diff --git a/src/audio/AudioCollision.cpp b/src/audio/AudioCollision.cpp
index ed705b7d..d94d99ea 100644
--- a/src/audio/AudioCollision.cpp
+++ b/src/audio/AudioCollision.cpp
@@ -178,9 +178,8 @@ static const int32 gOneShotCol[] = {SFX_COL_TARMAC_1,
void
cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
{
-
- int16 s1;
- int16 s2;
+ uint16 s1;
+ uint16 s2;
int32 emittingVol;
float ratio;
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 56463be0..c547007c 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -47,9 +47,6 @@
#define CHANNEL_PLAYER_VEHICLE_ENGINE m_nActiveSamples
#endif
-enum PLAY_STATUS { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING, PLAY_STATUS_FINISHED };
-enum LOADING_STATUS { LOADING_STATUS_NOT_LOADED = 0, LOADING_STATUS_LOADED, LOADING_STATUS_FAILED };
-
void
cAudioManager::PreInitialiseGameSpecificSetup()
{
@@ -4082,7 +4079,7 @@ cAudioManager::SetupJumboRumbleSound(uint8 emittingVol)
m_sQueueSample.m_nCounter = 6;
m_sQueueSample.m_nSampleIndex = SFX_JUMBO_RUMBLE;
m_sQueueSample.m_nFrequency += 200;
- m_sQueueSample.m_nOffset = MAX_VOLUME;
+ m_sQueueSample.m_nOffset = 127;
AddSampleToRequestedQueue();
}
return TRUE;
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index ff42af33..df978d5b 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -192,6 +192,9 @@ enum {
MAX_REFLECTIONS,
};
+enum PLAY_STATUS { PLAY_STATUS_STOPPED = 0, PLAY_STATUS_PLAYING, PLAY_STATUS_FINISHED };
+enum LOADING_STATUS { LOADING_STATUS_NOT_LOADED = 0, LOADING_STATUS_LOADED, LOADING_STATUS_FAILED };
+
class cAudioManager
{
public:
@@ -214,8 +217,10 @@ public:
tAudioEntity m_asAudioEntities[NUM_AUDIOENTITIES];
int32 m_anAudioEntityIndices[NUM_AUDIOENTITIES];
int32 m_nAudioEntitiesTotal;
+#ifdef GTA_PC
CVector m_avecReflectionsPos[NUM_AUDIO_REFLECTIONS];
float m_afReflectionsDistances[NUM_AUDIO_REFLECTIONS];
+#endif
cAudioScriptObjectManager m_sAudioScriptObjectManager;
// miami
diff --git a/src/audio/oal/aldlist.h b/src/audio/oal/aldlist.h
index bebb6791..3ed12d84 100644
--- a/src/audio/oal/aldlist.h
+++ b/src/audio/oal/aldlist.h
@@ -38,7 +38,7 @@ struct ALDEVICEINFO {
{
delete[] strDeviceName;
strDeviceName = NULL;
- }
+ }
void SetName(const char *name)
{
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp
index f94768cb..95a094ba 100644
--- a/src/audio/sampman_miles.cpp
+++ b/src/audio/sampman_miles.cpp
@@ -1025,11 +1025,20 @@ cSampleManager::Initialise(void)
if ( GetDriveType(m_szCDRomRootPath) == DRIVE_CDROM )
{
+ FILE *f;
+#ifdef PS2_AUDIO_PATHS
strcpy(filepath, m_szCDRomRootPath);
- strcat(filepath, StreamedNameTable[0]);
-
- FILE *f = fopen(filepath, "rb");
+ strcat(filepath, PS2StreamedNameTable[0]);
+ f = fopen(filepath, "rb");
+
+ if ( !f )
+#endif
+ {
+ strcpy(filepath, m_szCDRomRootPath);
+ strcat(filepath, StreamedNameTable[0]);
+ f = fopen(filepath, "rb");
+ }
if ( f )
{
fclose(f);
@@ -1410,6 +1419,7 @@ cSampleManager::CheckForAnAudioFileOnCD(void)
{
#if !defined(NO_CDCHECK) // TODO: check steam, probably GTAVC_STEAM_PATCH needs to be added
char filepath[MAX_PATH];
+ FILE *f;
strcpy(filepath, m_MiscomPath);
strcat(filepath, StreamedNameTable[STREAMED_SOUND_MISSION_COMPLETED4]);
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index 3441c202..8a9379ea 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -178,7 +178,7 @@ add_providers()
SampleManager.Set3DProviderName(n, providers[n].name);
n++;
}
-
+
if ( alGetEnumValue("AL_EFFECT_EAXREVERB") != 0
|| pDeviceList->IsExtensionSupported(i, ADEXT_EAX2)
|| pDeviceList->IsExtensionSupported(i, ADEXT_EAX3)
@@ -930,8 +930,7 @@ cSampleManager::Initialise(void)
aStream[0]->Close();
nStreamLength[i] = tatalms;
- }
- else
+ } else
USERERROR("Can't open '%s'\n", StreamedNameTable[i]);
}
#ifdef AUDIO_CACHE
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index ab3e0c7c..f6b1a9b9 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -23,6 +23,7 @@
#ifdef FIX_BUGS
#include "Replay.h"
#endif
+#include "SaveBuf.h"
#include "Script.h"
#include "Shadows.h"
#include "SpecialFX.h"
diff --git a/src/control/Restart.cpp b/src/control/Restart.cpp
index 39c9a234..af38537d 100644
--- a/src/control/Restart.cpp
+++ b/src/control/Restart.cpp
@@ -1,6 +1,7 @@
#include "common.h"
#include "Restart.h"
+#include "SaveBuf.h"
#include "Zones.h"
#include "PathFind.h"
#include "SaveBuf.h"
diff --git a/src/control/Script5.cpp b/src/control/Script5.cpp
index fc258f0c..87260603 100644
--- a/src/control/Script5.cpp
+++ b/src/control/Script5.cpp
@@ -12,6 +12,7 @@
#include "Pools.h"
#include "Population.h"
#include "RpAnimBlend.h"
+#include "SaveBuf.h"
#include "Shadows.h"
#include "SpecialFX.h"
#include "World.h"
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index cafbd340..89a48438 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -226,7 +226,7 @@ CCam::Process(void)
break;
case MODE_CAM_ON_A_STRING:
#ifdef FREE_CAM
- if(CCamera::bFreeCam)
+ if(CCamera::bFreeCam && !CVehicle::bCheat5)
Process_FollowCar_SA(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
else
#endif
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index e7cd65a0..3ebd52f2 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -4076,7 +4076,7 @@ CCamera::IsPointVisible(const CVector &center, const CMatrix *mat)
}
bool
-CCamera::IsSphereVisible(const CVector &center, float radius, const CMatrix *mat)
+CCamera::IsSphereVisible(const CVector &center, float radius, Const CMatrix *mat)
{
#ifdef GTA_PS2
CVuVector c;
diff --git a/src/core/Camera.h b/src/core/Camera.h
index 39ecb760..7612b937 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -631,7 +631,7 @@ public:
CVector &GetGameCamPosition(void) { return m_vecGameCamPos; }
void CalculateDerivedValues(void);
bool IsPointVisible(const CVector &center, const CMatrix *mat);
- bool IsSphereVisible(const CVector &center, float radius, const CMatrix *mat);
+ bool IsSphereVisible(const CVector &center, float radius, Const CMatrix *mat);
bool IsSphereVisible(const CVector &center, float radius);
bool IsBoxVisible(CVUVECTOR *box, const CMatrix *mat);
};
diff --git a/src/core/FrontendTriggers.h b/src/core/FrontendTriggers.h
index bbafb4be..44bae54f 100644
--- a/src/core/FrontendTriggers.h
+++ b/src/core/FrontendTriggers.h
@@ -792,12 +792,12 @@ TriggerAudio_StereoMono(CMenuMultiChoiceTriggered *widget)
{
if (widget->GetMenuSelection() == 1)
{
- DMAudio.SetMonoMode(true);
+ DMAudio.SetMonoMode(TRUE);
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MONO, 0);
}
else
{
- DMAudio.SetMonoMode(false);
+ DMAudio.SetMonoMode(FALSE);
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_STEREO, 0);
}
}
diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp
index c4b4d3b0..e601b3c8 100644
--- a/src/core/Pools.cpp
+++ b/src/core/Pools.cpp
@@ -10,6 +10,7 @@
#endif
#include "Population.h"
#include "ProjectileInfo.h"
+#include "SaveBuf.h"
#include "Streaming.h"
#include "Wanted.h"
#include "World.h"
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index f58f4687..0792008a 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -16,6 +16,7 @@
#include "Script.h"
#include "TxdStore.h"
#include "World.h"
+#include "SaveBuf.h"
#include "Streaming.h"
#include "SpecialFX.h"
#include "Font.h"
diff --git a/src/core/Radar.h b/src/core/Radar.h
index 0829dda6..b01a5d04 100644
--- a/src/core/Radar.h
+++ b/src/core/Radar.h
@@ -1,5 +1,6 @@
#pragma once
#include "Sprite2d.h"
+#include "Draw.h"
#define CARBLIP_MARKER_COLOR_R 252
#define CARBLIP_MARKER_COLOR_G 138
diff --git a/src/core/common.h b/src/core/common.h
index 6f6acd49..9d3bca67 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -372,8 +372,11 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function
#define _TODO(x)
#define _TODOCONST(x) (x)
-#ifdef CHECK_STRUCT_SIZES
-#define VALIDATE_SIZE(struc, size) static_assert(sizeof(struc) == size, "Invalid structure size of " #struc)
+#ifdef CHECK_STRUCT_SIZES
+template<int s, int t> struct check_size {
+ static_assert(s == t, "Invalid structure size");
+};
+#define VALIDATE_SIZE(struc, size) check_size<sizeof(struc), size> struc ## Check
#else
#define VALIDATE_SIZE(struc, size)
#endif
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index b80830c0..b0183408 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -130,7 +130,7 @@ void LangJapSelect(int8 action)
void
CustomFrontendOptionsPopulate(void)
{
- // Moved to an array in MenuScreensCustom.cpp, but APIs are still available. see frontendoption.h
+ // Most of custom options are done statically in MenuScreensCustom.cpp, we add them here only if they're dependent to extra files
int fd;
// These work only if we have neo folder, so they're dynamically added
@@ -1271,7 +1271,9 @@ void re3_trace(const char *filename, unsigned int lineno, const char *func, cons
OutputDebugString(buff);
}
+#endif
+#ifndef MASTER
void re3_usererror(const char *format, ...)
{
va_list va;
diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp
index 1faf6ee6..e51a0821 100644
--- a/src/fakerw/fake.cpp
+++ b/src/fakerw/fake.cpp
@@ -16,7 +16,6 @@ using namespace rw;
RwUInt8 RwObjectGetType(const RwObject *obj) { return obj->type; }
RwFrame* rwObjectGetParent(const RwObject *obj) { return (RwFrame*)obj->parent; }
-
void *RwMalloc(size_t size) { return engine->memfuncs.rwmalloc(size, 0); }
void *RwCalloc(size_t numObj, size_t sizeObj) {
void *mem = RwMalloc(numObj*sizeObj);
diff --git a/src/renderer/Draw.cpp b/src/renderer/Draw.cpp
index 9c5921c3..a5e7504b 100644
--- a/src/renderer/Draw.cpp
+++ b/src/renderer/Draw.cpp
@@ -110,4 +110,4 @@ float CDraw::ScaleY(float y)
{
return ms_bProperScaling ? y : y * ((float)DEFAULT_SCREEN_HEIGHT/SCREEN_HEIGHT_NTSC);
}
-#endif \ No newline at end of file
+#endif \ No newline at end of file
diff --git a/src/renderer/Font.cpp b/src/renderer/Font.cpp
index 9c499248..6ae10011 100644
--- a/src/renderer/Font.cpp
+++ b/src/renderer/Font.cpp
@@ -49,7 +49,7 @@ UnicodeMakeUpperCase(wchar *dst, const wchar *src) //idk what to do with it, see
}
CFontDetails CFont::Details;
-int16 CFont::NewLine;
+bool16 CFont::NewLine;
CSprite2d CFont::Sprite[MAX_FONTS];
CFontRenderState CFont::RenderState;
diff --git a/src/renderer/Font.h b/src/renderer/Font.h
index 42eb7b4c..02e7df3b 100644
--- a/src/renderer/Font.h
+++ b/src/renderer/Font.h
@@ -129,7 +129,7 @@ class CFont
#else
static int16 Size[MAX_FONTS][210];
#endif
- static int16 NewLine;
+ static bool16 NewLine;
public:
static CSprite2d Sprite[MAX_FONTS];
static CFontDetails Details;
diff --git a/src/renderer/Sprite.cpp b/src/renderer/Sprite.cpp
index 58b29ea9..ecfd3fdc 100644
--- a/src/renderer/Sprite.cpp
+++ b/src/renderer/Sprite.cpp
@@ -5,6 +5,10 @@
#include "Camera.h"
#include "Sprite.h"
+#ifdef ASPECT_RATIO_SCALE
+#include "Frontend.h"
+#endif
+
float CSprite::m_f2DNearScreenZ;
float CSprite::m_f2DFarScreenZ;
float CSprite::m_fRecipNearClipPlane;
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp
index 69f57933..25cd2eef 100644
--- a/src/rw/RwHelper.cpp
+++ b/src/rw/RwHelper.cpp
@@ -1,5 +1,6 @@
#define WITHD3D
#include "common.h"
+#include <rpskin.h>
#include "Timecycle.h"
#include "skeleton.h"
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 5e2b0c10..9395ded8 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -3877,7 +3877,7 @@ CAutomobile::DoDriveByShootings(void)
lookingLeft = true;
if(TheCamera.Cams[TheCamera.ActiveCam].LookingRight)
lookingRight = true;
- }
+ }
AnimationId rightAnim = ANIM_STD_CAR_DRIVEBY_RIGHT;
AnimationId leftAnim = ANIM_STD_CAR_DRIVEBY_LEFT;
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 8328067f..c0319a11 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -3163,7 +3163,11 @@ CWeapon::HitsGround(CEntity *holder, CVector *fireSource, CEntity *aimingTo)
void
CWeapon::BlowUpExplosiveThings(CEntity *thing)
{
+#ifdef FIX_BUGS
+ if ( thing && thing->IsObject() )
+#else
if ( thing )
+#endif
{
CObject *object = (CObject*)thing;
int32 mi = object->GetModelIndex();