summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-01-15 16:57:35 +0100
committerSergeanur <s.anureev@yandex.ua>2021-01-15 16:57:35 +0100
commit4bd7bafd7cef0c2f1238dcbbbf4282e6bc5a684f (patch)
treeecd6628c082ffdd0e12e1ac7616e69f9be0f55ac /src
parentincoming "fuck" commit (diff)
parentFix Jumbo Sound reseting when walking (diff)
downloadre3-4bd7bafd7cef0c2f1238dcbbbf4282e6bc5a684f.tar
re3-4bd7bafd7cef0c2f1238dcbbbf4282e6bc5a684f.tar.gz
re3-4bd7bafd7cef0c2f1238dcbbbf4282e6bc5a684f.tar.bz2
re3-4bd7bafd7cef0c2f1238dcbbbf4282e6bc5a684f.tar.lz
re3-4bd7bafd7cef0c2f1238dcbbbf4282e6bc5a684f.tar.xz
re3-4bd7bafd7cef0c2f1238dcbbbf4282e6bc5a684f.tar.zst
re3-4bd7bafd7cef0c2f1238dcbbbf4282e6bc5a684f.zip
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/audio/AudioLogic.cpp1
-rw-r--r--src/audio/oal/stream.cpp2
-rw-r--r--src/audio/sampman_oal.cpp2
-rw-r--r--src/collision/Collision.cpp15
-rw-r--r--src/control/Script7.cpp4
-rw-r--r--src/control/Script8.cpp6
-rw-r--r--src/core/Cam.cpp10
-rw-r--r--src/core/SurfaceTable.h1
-rw-r--r--src/render/Hud.cpp8
-rw-r--r--src/weapons/Weapon.cpp18
11 files changed, 40 insertions, 29 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dc204d17..ad72eb56 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -36,7 +36,7 @@ target_compile_definitions(${EXECUTABLE}
PRIVATE
$<IF:$<CONFIG:DEBUG>,DEBUG,NDEBUG>
LIBRW
- ${PROJECT}_NO_AUTOLINK
+ CMAKE_NO_AUTOLINK
)
if(LIBRW_PLATFORM_D3D9)
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index cd341eac..1f32890c 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -4106,6 +4106,7 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol)
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_fSpeedMultiplier = 4.0f;
m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY;
+ m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false; // todo port fix to re3
diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp
index 81a78381..19fa4ec4 100644
--- a/src/audio/oal/stream.cpp
+++ b/src/audio/oal/stream.cpp
@@ -4,7 +4,7 @@
#include "stream.h"
#include "sampman.h"
-#ifdef _WIN32
+#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK
#ifdef AUDIO_OAL_USE_SNDFILE
#pragma comment( lib, "libsndfile-1.lib" )
#endif
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index ef070825..f53b1362 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -38,7 +38,7 @@
//TODO: max channels
//TODO: loop count
-#ifdef _WIN32
+#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK
#pragma comment( lib, "OpenAL32.lib" )
#endif
diff --git a/src/collision/Collision.cpp b/src/collision/Collision.cpp
index c90390c4..703804d9 100644
--- a/src/collision/Collision.cpp
+++ b/src/collision/Collision.cpp
@@ -507,12 +507,14 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod
for(i = 0; i < model.numSpheres; i++){
if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue;
+ if(ignoreShootThrough && IsShootThrough(model.spheres[i].surface)) continue;
if(TestLineSphere(*(CColLine*)newline, model.spheres[i]))
return true;
}
for(i = 0; i < model.numBoxes; i++){
if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue;
+ if(ignoreShootThrough && IsShootThrough(model.boxes[i].surface)) continue;
if(TestLineBox(*(CColLine*)newline, model.boxes[i]))
return true;
}
@@ -522,6 +524,7 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod
VuTriangle vutri;
for(i = 0; i < model.numTriangles; i++){
if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+ if(ignoreShootThrough && IsShootThrough(model.triangles[i].surface)) continue;
CColTriangle *tri = &model.triangles[i];
model.vertices[tri->a].Unpack(vutri.v0);
@@ -539,6 +542,7 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod
#endif
for(; i < model.numTriangles; i++){
if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+ if(ignoreShootThrough && IsShootThrough(model.triangles[i].surface)) continue;
CColTriangle *tri = &model.triangles[i];
model.vertices[tri->a].Unpack(vutri.v0);
@@ -1333,6 +1337,7 @@ CCollision::ProcessLineOfSight(const CColLine &line,
float coldist = 1.0f;
for(i = 0; i < model.numSpheres; i++){
if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue;
+ if(ignoreShootThrough && IsShootThrough(model.spheres[i].surface)) continue;
if(ProcessLineSphere(*(CColLine*)newline, model.spheres[i], point, coldist))
point.Set(0, 0, model.spheres[i].surface, model.spheres[i].piece);
}
@@ -1348,6 +1353,7 @@ CCollision::ProcessLineOfSight(const CColLine &line,
CColTriangle *lasttri = nil;
for(i = 0; i < model.numTriangles; i++){
if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+ if(ignoreShootThrough && IsShootThrough(model.triangles[i].surface)) continue;
CColTriangle *tri = &model.triangles[i];
model.vertices[tri->a].Unpack(vutri.v0);
@@ -1367,6 +1373,7 @@ CCollision::ProcessLineOfSight(const CColLine &line,
float dist;
for(; i < model.numTriangles; i++){
if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+ if(ignoreShootThrough && IsShootThrough(model.triangles[i].surface)) continue;
CColTriangle *tri = &model.triangles[i];
model.vertices[tri->a].Unpack(vutri.v0);
@@ -1466,13 +1473,13 @@ CCollision::ProcessVerticalLine(const CColLine &line,
float coldist = 1.0f;
for(i = 0; i < model.numSpheres; i++){
- if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue;
+ if(ignoreSeeThrough && IsSeeThroughVertical(model.spheres[i].surface)) continue;
if(ProcessLineSphere(*(CColLine*)newline, model.spheres[i], point, coldist))
point.Set(0, 0, model.spheres[i].surface, model.spheres[i].piece);
}
for(i = 0; i < model.numBoxes; i++){
- if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue;
+ if(ignoreSeeThrough && IsSeeThroughVertical(model.boxes[i].surface)) continue;
if(ProcessLineBox(*(CColLine*)newline, model.boxes[i], point, coldist))
point.Set(0, 0, model.boxes[i].surface, model.boxes[i].piece);
}
@@ -1484,7 +1491,7 @@ CCollision::ProcessVerticalLine(const CColLine &line,
CColTriangle *lasttri = nil;
VuTriangle vutri;
for(i = 0; i < model.numTriangles; i++){
- if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+ if(ignoreSeeThrough && IsSeeThroughVertical(model.triangles[i].surface)) continue;
CColTriangle *tri = &model.triangles[i];
model.vertices[tri->a].Unpack(vutri.v0);
@@ -1503,7 +1510,7 @@ CCollision::ProcessVerticalLine(const CColLine &line,
CVuVector pnt, normal;
float dist;
for(; i < model.numTriangles; i++){
- if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue;
+ if(ignoreSeeThrough && IsSeeThroughVertical(model.triangles[i].surface)) continue;
CColTriangle *tri = &model.triangles[i];
model.vertices[tri->a].Unpack(vutri.v0);
diff --git a/src/control/Script7.cpp b/src/control/Script7.cpp
index b3f16106..a5c8e717 100644
--- a/src/control/Script7.cpp
+++ b/src/control/Script7.cpp
@@ -95,8 +95,8 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
CollectParameters(&m_nIp, 2);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
script_assert(pPed);
- ScriptParams[0] = pPed->GetWeapon(ScriptParams[1]).m_eWeaponType;
- ScriptParams[1] = pPed->GetWeapon(ScriptParams[1]).m_nAmmoTotal;
+ ScriptParams[0] = pPed->GetWeapon(ScriptParams[1] - 1).m_eWeaponType;
+ ScriptParams[1] = pPed->GetWeapon(ScriptParams[1] - 1).m_nAmmoTotal;
ScriptParams[2] = CPickups::ModelForWeapon((eWeaponType)ScriptParams[0]);
StoreParameters(&m_nIp, 3);
return 0;
diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp
index 2f52b150..afa213f2 100644
--- a/src/control/Script8.cpp
+++ b/src/control/Script8.cpp
@@ -66,7 +66,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
return 0;
case COMMAND_WANTED_STARS_ARE_FLASHING:
{
- CWanted *pWanted = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted;
+ CWanted* pWanted = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted;
UpdateCompareFlag(pWanted->m_nMinWantedLevel - pWanted->m_nWantedLevel > 0);
return 0;
}
@@ -136,7 +136,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
CTheScripts::ReadTextLabelFromScript(&m_nIp, key);
m_nIp += KEY_LENGTH_IN_SCRIPT;
CVector pos = pPlayerInfo->GetPos();
- CZone *infoZone = CTheZones::FindInformationZoneForPosition(&pos);
+ CZone* infoZone = CTheZones::FindInformationZoneForPosition(&pos);
UpdateCompareFlag(strncmp(key, infoZone->name, 8) == 0); // original code doesn't seem to be using strncmp in here and compare 2 ints instead
return 0;
}
@@ -352,7 +352,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
case COMMAND_CREATE_DUST_EFFECT_FOR_CUTSCENE_HELI:
{
CollectParameters(&m_nIp, 3);
- CObject *pHeli = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
+ CObject* pHeli = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
bool found = false;
float waterLevel = -1000.0f;
CVector pos = pHeli->GetPosition();
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 581e219a..bb3a0fbe 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -4350,7 +4350,7 @@ CCam::ProcessArrestCamOne(void)
((CPed*)TheCamera.pTargetEntity)->m_pedIK.GetComponentPosition(TargetPos, PED_MID);
if(FindPlayerPed() && FindPlayerPed()->m_pArrestingCop)
cop = FindPlayerPed()->m_pArrestingCop;
- if(cop && CGeneral::GetRandomNumberInRange(0.0f, 0.1f) > 0.5f){
+ if(cop && CGeneral::GetRandomNumberInRange(0.0f, 1.0f) > 0.5f){
ArrestModes[0] = ARRESTCAM_OVERSHOULDER;
ArrestModes[1] = ARRESTCAM_ALONGGROUND;
ArrestModes[2] = ARRESTCAM_OVERSHOULDER;
@@ -4372,7 +4372,7 @@ CCam::ProcessArrestCamOne(void)
if(FindPlayerPed() && FindPlayerPed()->m_pArrestingCop)
cop = FindPlayerPed()->m_pArrestingCop;
- if(cop && CGeneral::GetRandomNumberInRange(0.0f, 0.1f) > 0.65f){
+ if(cop && CGeneral::GetRandomNumberInRange(0.0f, 1.0f) > 0.65f){
ArrestModes[0] = ARRESTCAM_OVERSHOULDER;
ArrestModes[1] = ARRESTCAM_LAMPPOST;
ArrestModes[2] = ARRESTCAM_ALONGGROUND;
@@ -4442,6 +4442,7 @@ CCam::ProcessArrestCamOne(void)
pStoredCopPed = nil;
}
+ Source = CamSource;
CVector OrigSource = Source;
TheCamera.AvoidTheGeometry(OrigSource, TargetPos, Source, FOV);
Front = TargetPos - Source;
@@ -4468,8 +4469,9 @@ CCam::ProcessArrestCamOne(void)
if(nUsingWhichCamera == ARRESTCAM_OVERSHOULDER && pStoredCopPed){
foundPos = GetLookOverShoulderPos(TheCamera.pTargetEntity, pStoredCopPed, TargetPos, CamSource);
- if(CamSource.z > Source.z + ARRESTCAM_S_ROTATION_UP*CTimer::GetTimeStep())
- CamSource.z = Source.z + ARRESTCAM_S_ROTATION_UP*CTimer::GetTimeStep();
+ float newZ = Source.z + ARRESTCAM_S_ROTATION_UP*CTimer::GetTimeStep();
+ if(CamSource.z > newZ)
+ CamSource.z = newZ;
}else if(nUsingWhichCamera >= ARRESTCAM_ALONGGROUND_RIGHT && nUsingWhichCamera <= ARRESTCAM_ALONGGROUND_LEFT_UP){
CamSource = Source;
Front = TargetPos - CamSource;
diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h
index cd08c843..8ff43106 100644
--- a/src/core/SurfaceTable.h
+++ b/src/core/SurfaceTable.h
@@ -81,6 +81,7 @@ inline bool
IsShootThrough(uint8 surfType)
{
switch(surfType)
+ case SURFACE_TRANSPARENT_CLOTH:
case SURFACE_METAL_CHAIN_FENCE:
case SURFACE_TRANSPARENT_STONE:
case SURFACE_SCAFFOLD_POLE:
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 350e8c45..f3181fa8 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -449,10 +449,10 @@ void CHud::Draw()
}
if (m_WeaponState != FADED_OUT) {
CWeapon *weapon = playerPed->GetWeapon();
- uint32 AmmoAmount = CWeaponInfo::GetWeaponInfo((eWeaponType)WeaponType)->m_nAmountofAmmunition;
- uint32 AmmoInClip = weapon->m_nAmmoInClip;
- uint32 TotalAmmo = weapon->m_nAmmoTotal;
- uint32 Ammo, Clip;
+ int32 AmmoAmount = CWeaponInfo::GetWeaponInfo((eWeaponType)WeaponType)->m_nAmountofAmmunition;
+ int32 AmmoInClip = weapon->m_nAmmoInClip;
+ int32 TotalAmmo = weapon->m_nAmmoTotal;
+ int32 Ammo, Clip;
if (AmmoAmount <= 1 || AmmoAmount >= 1000)
sprintf(sTemp, "%d", TotalAmmo);
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index e2213399..940a6b98 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -911,7 +911,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
CWorld::bIncludeDeadPeds = true;
CWorld::bIncludeBikers = true;
- CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true);
+ ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false);
CWorld::bIncludeDeadPeds = false;
CWorld::bIncludeBikers = false;
}
@@ -924,7 +924,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
shooterPed->TransformToNode(target, PED_HANDR);
CWorld::bIncludeBikers = true;
- CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true);
+ ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false);
CWorld::bIncludeBikers = false;
}
}
@@ -935,7 +935,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
CWorld::bIncludeBikers = true;
CWorld::bIncludeDeadPeds = true;
CWorld::bIncludeCarTyres = true;
- CWorld::ProcessLineOfSight(source, target, point, victim, true, true, true, true, true, false, false, true);
+ ProcessLineOfSight(source, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false);
CWorld::bIncludeBikers = false;
CWorld::bIncludeDeadPeds = false;
CWorld::bIncludeCarTyres = false;
@@ -981,7 +981,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
target *= info->m_fRange;
target += *fireSource;
CWorld::pIgnoreEntity = shooter;
- CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true);
+ ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, true, false);
CWorld::pIgnoreEntity = nil;
int32 rotSpeed = 1;
@@ -1014,7 +1014,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
}
CWorld::bIncludeBikers = true;
- CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true);
+ ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false);
CWorld::bIncludeBikers = false;
int32 rotSpeed = 1;
@@ -1683,7 +1683,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
CWorld::bIncludeCarTyres = true;
CWorld::bIncludeBikers = true;
CWorld::bIncludeDeadPeds = true;
- CWorld::ProcessLineOfSight(source, target, point, victim, true, true, true, true, true, false, false, true);
+ ProcessLineOfSight(source, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false);
CWorld::bIncludeDeadPeds = false;
CWorld::bIncludeCarTyres = false;
}
@@ -1716,7 +1716,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
CWorld::bIncludeDeadPeds = true;
CWorld::bIncludeBikers = true;
- CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true);
+ ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false);
CWorld::bIncludeDeadPeds = false;
}
CWorld::bIncludeBikers = false;
@@ -2329,7 +2329,7 @@ CWeapon::FireM16_1stPerson(CEntity *shooter)
CVector source = cam->Source;
CVector target = cam->Front*info->m_fRange + source;
- if (CWorld::ProcessLineOfSight(source, target, point, victim, true, true, true, true, true, false, false, true)) {
+ if (ProcessLineOfSight(source, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, true, false)) {
CheckForShootingVehicleOccupant(&victim, &point, m_eWeaponType, source, target);
}
CWorld::pIgnoreEntity = nil;
@@ -3176,7 +3176,7 @@ CPed::IsPedDoingDriveByShooting(void)
bool
CWeapon::ProcessLineOfSight(CVector const &point1, CVector const &point2, CColPoint &point, CEntity *&entity, eWeaponType type, CEntity *shooter, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects)
{
- return CWorld::ProcessLineOfSight(point1, point2, point, entity, checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, ignoreSeeThrough, ignoreSomeObjects);
+ return CWorld::ProcessLineOfSight(point1, point2, point, entity, checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, false, ignoreSomeObjects, true);
}