mirror of
https://github.com/GTAmodding/re3.git
synced 2025-10-15 13:50:34 +00:00
Merge branch 'miami' into lcs
# Conflicts: # README.md # gamefiles/TEXT/american.gxt # gamefiles/TEXT/french.gxt # gamefiles/TEXT/german.gxt # gamefiles/TEXT/italian.gxt # gamefiles/TEXT/spanish.gxt # src/audio/AudioLogic.cpp # src/core/config.h # src/vehicles/Automobile.cpp # utils/gxt/american.txt # utils/gxt/french.txt # utils/gxt/german.txt # utils/gxt/italian.txt # utils/gxt/spanish.txt
This commit is contained in:
commit
d7e764d519
34 changed files with 1071 additions and 438 deletions
|
@ -268,7 +268,7 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
|
|||
SET_EMITTING_VOLUME(emittingVol);
|
||||
RESET_LOOP_OFFSETS
|
||||
m_sQueueSample.m_fSpeedMultiplier = 4.0f;
|
||||
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
|
||||
m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
|
||||
m_sQueueSample.m_bReverbFlag = TRUE;
|
||||
m_sQueueSample.m_bRequireReflection = FALSE;
|
||||
|
@ -297,7 +297,7 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
|
|||
SET_EMITTING_VOLUME(emittingVol);
|
||||
SET_LOOP_OFFSETS(m_sQueueSample.m_nSampleIndex)
|
||||
m_sQueueSample.m_fSpeedMultiplier = 4.0f;
|
||||
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
|
||||
m_sQueueSample.m_SoundIntensity = CollisionSoundIntensity;
|
||||
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
|
||||
m_sQueueSample.m_nReleasingVolumeDivider = 5;
|
||||
m_sQueueSample.m_bReverbFlag = TRUE;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -697,7 +697,6 @@ cAudioManager::AddDetailsToRequestedOrderList(uint8 sample)
|
|||
m_abSampleQueueIndexTable[m_nActiveSampleQueue][i] = sample;
|
||||
}
|
||||
|
||||
#ifdef GTA_PC
|
||||
void
|
||||
cAudioManager::AddReflectionsToRequestedQueue()
|
||||
{
|
||||
|
@ -719,7 +718,7 @@ cAudioManager::AddReflectionsToRequestedQueue()
|
|||
} else {
|
||||
emittingVolume = (9 * m_sQueueSample.m_nVolume) / 16;
|
||||
}
|
||||
m_sQueueSample.m_fSoundIntensity /= 2.f;
|
||||
m_sQueueSample.m_SoundIntensity /= 2.f;
|
||||
|
||||
int halfOldFreq = oldFreq >> 1;
|
||||
|
||||
|
@ -728,12 +727,12 @@ cAudioManager::AddReflectionsToRequestedQueue()
|
|||
m_afReflectionsDistances[i] = (m_anRandomTable[i % 4] % 3) * 100.f / 8.f;
|
||||
|
||||
reflectionDistance = m_afReflectionsDistances[i];
|
||||
if (reflectionDistance > 0.0f && reflectionDistance < 100.f && reflectionDistance < m_sQueueSample.m_fSoundIntensity) {
|
||||
if (reflectionDistance > 0.0f && reflectionDistance < 100.f && reflectionDistance < m_sQueueSample.m_SoundIntensity) {
|
||||
m_sQueueSample.m_nLoopsRemaining = CTimer::GetIsSlowMotionActive() ? (reflectionDistance * 800.f / 1029.f) : (reflectionDistance * 500.f / 1029.f);
|
||||
if (m_sQueueSample.m_nLoopsRemaining > 3) {
|
||||
m_sQueueSample.m_fDistance = m_afReflectionsDistances[i];
|
||||
SET_EMITTING_VOLUME(emittingVolume);
|
||||
m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_fSoundIntensity, m_sQueueSample.m_fDistance);
|
||||
m_sQueueSample.m_nVolume = ComputeVolume(emittingVolume, m_sQueueSample.m_SoundIntensity, m_sQueueSample.m_fDistance);
|
||||
|
||||
if (m_sQueueSample.m_nVolume > emittingVolume / 16) {
|
||||
m_sQueueSample.m_nCounter = oldCounter + (i + 1) * 256;
|
||||
|
@ -762,43 +761,87 @@ cAudioManager::AddReflectionsToRequestedQueue()
|
|||
void
|
||||
cAudioManager::UpdateReflections()
|
||||
{
|
||||
CVector camPos = TheCamera.GetPosition();
|
||||
CVector camPos;
|
||||
CColPoint colpoint;
|
||||
CEntity *ent;
|
||||
|
||||
#if GTA_VERSION < GTAVC_PC_10
|
||||
if (m_FrameCounter % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
m_avecReflectionsPos[0] = camPos;
|
||||
m_avecReflectionsPos[0].y += 50.0f;
|
||||
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[0], colpoint, ent, true, false, false, true, false, true, true))
|
||||
m_afReflectionsDistances[0] = Distance(camPos, colpoint.point);
|
||||
else
|
||||
m_afReflectionsDistances[0] = 50.0f;
|
||||
} else if ((m_FrameCounter + 1) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
m_avecReflectionsPos[1] = camPos;
|
||||
m_avecReflectionsPos[1].y -= 50.0f;
|
||||
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[1], colpoint, ent, true, false, false, true, false, true, true))
|
||||
m_afReflectionsDistances[1] = Distance(camPos, colpoint.point);
|
||||
else
|
||||
m_afReflectionsDistances[1] = 50.0f;
|
||||
} else if ((m_FrameCounter + 2) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
m_avecReflectionsPos[2] = camPos;
|
||||
m_avecReflectionsPos[2].x -= 50.0f;
|
||||
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[2], colpoint, ent, true, false, false, true, false, true, true))
|
||||
m_afReflectionsDistances[2] = Distance(camPos, colpoint.point);
|
||||
else
|
||||
m_afReflectionsDistances[2] = 50.0f;
|
||||
} else if ((m_FrameCounter + 3) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
m_avecReflectionsPos[3] = camPos;
|
||||
m_avecReflectionsPos[3].x += 50.0f;
|
||||
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[3], colpoint, ent, true, false, false, true, false, true, true))
|
||||
m_afReflectionsDistances[3] = Distance(camPos, colpoint.point);
|
||||
else
|
||||
m_afReflectionsDistances[3] = 50.0f;
|
||||
} else if ((m_FrameCounter + 4) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
m_avecReflectionsPos[4] = camPos;
|
||||
m_avecReflectionsPos[4].z += 50.0f;
|
||||
if (CWorld::ProcessVerticalLine(camPos, m_avecReflectionsPos[4].z, colpoint, ent, true, false, false, false, true, false, nil))
|
||||
m_afReflectionsDistances[4] = colpoint.point.z - camPos.z;
|
||||
else
|
||||
m_afReflectionsDistances[4] = 50.0f;
|
||||
}
|
||||
#else
|
||||
if (m_FrameCounter % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
m_avecReflectionsPos[0] = camPos;
|
||||
m_avecReflectionsPos[0].y += 100.f;
|
||||
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[0], colpoint, ent, true, false, false, true, false, true, true))
|
||||
m_afReflectionsDistances[0] = Distance(camPos, colpoint.point);
|
||||
else
|
||||
m_afReflectionsDistances[0] = 100.0f;
|
||||
|
||||
} else if ((m_FrameCounter + 1) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
m_avecReflectionsPos[1] = camPos;
|
||||
m_avecReflectionsPos[1].y -= 100.0f;
|
||||
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[1], colpoint, ent, true, false, false, true, false, true, true))
|
||||
m_afReflectionsDistances[1] = Distance(camPos, colpoint.point);
|
||||
else
|
||||
m_afReflectionsDistances[1] = 100.0f;
|
||||
|
||||
} else if ((m_FrameCounter + 2) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
m_avecReflectionsPos[2] = camPos;
|
||||
m_avecReflectionsPos[2].x -= 100.0f;
|
||||
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[2], colpoint, ent, true, false, false, true, false, true, true))
|
||||
m_afReflectionsDistances[2] = Distance(camPos, colpoint.point);
|
||||
else
|
||||
m_afReflectionsDistances[2] = 100.0f;
|
||||
|
||||
} else if ((m_FrameCounter + 3) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
m_avecReflectionsPos[3] = camPos;
|
||||
m_avecReflectionsPos[3].x += 100.0f;
|
||||
if (CWorld::ProcessLineOfSight(camPos, m_avecReflectionsPos[3], colpoint, ent, true, false, false, true, false, true, true))
|
||||
m_afReflectionsDistances[3] = Distance(camPos, colpoint.point);
|
||||
else
|
||||
m_afReflectionsDistances[3] = 100.0f;
|
||||
|
||||
} else if ((m_FrameCounter + 4) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
camPos.y += 1.0f;
|
||||
m_avecReflectionsPos[4] = camPos;
|
||||
m_avecReflectionsPos[4].z += 100.0f;
|
||||
|
@ -806,8 +849,8 @@ cAudioManager::UpdateReflections()
|
|||
m_afReflectionsDistances[4] = colpoint.point.z - camPos.z;
|
||||
else
|
||||
m_afReflectionsDistances[4] = 100.0f;
|
||||
|
||||
} else if ((m_FrameCounter + 5) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
camPos.y -= 1.0f;
|
||||
m_avecReflectionsPos[5] = camPos;
|
||||
m_avecReflectionsPos[5].z += 100.0f;
|
||||
|
@ -815,8 +858,8 @@ cAudioManager::UpdateReflections()
|
|||
m_afReflectionsDistances[5] = colpoint.point.z - camPos.z;
|
||||
else
|
||||
m_afReflectionsDistances[5] = 100.0f;
|
||||
|
||||
} else if ((m_FrameCounter + 6) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
camPos.x -= 1.0f;
|
||||
m_avecReflectionsPos[6] = camPos;
|
||||
m_avecReflectionsPos[6].z += 100.0f;
|
||||
|
@ -824,8 +867,8 @@ cAudioManager::UpdateReflections()
|
|||
m_afReflectionsDistances[6] = colpoint.point.z - camPos.z;
|
||||
else
|
||||
m_afReflectionsDistances[6] = 100.0f;
|
||||
|
||||
} else if ((m_FrameCounter + 7) % 8 == 0) {
|
||||
camPos = TheCamera.GetPosition();
|
||||
camPos.x += 1.0f;
|
||||
m_avecReflectionsPos[7] = camPos;
|
||||
m_avecReflectionsPos[7].z += 100.0f;
|
||||
|
@ -834,8 +877,8 @@ cAudioManager::UpdateReflections()
|
|||
else
|
||||
m_afReflectionsDistances[7] = 100.0f;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // GTA_PC
|
||||
|
||||
void
|
||||
cAudioManager::AddReleasingSounds()
|
||||
|
@ -863,7 +906,7 @@ cAudioManager::AddReleasingSounds()
|
|||
}
|
||||
}
|
||||
if (!toProcess[i]) {
|
||||
if (sample.m_nCounter <= 255 || !sample.m_nLoopsRemaining) {
|
||||
if (sample.m_nCounter <= 255 || sample.m_nLoopsRemaining == 0) {
|
||||
if (sample.m_nReleasingVolumeDivider == 0)
|
||||
continue;
|
||||
if (sample.m_nLoopCount == 0) {
|
||||
|
@ -1005,7 +1048,7 @@ cAudioManager::ProcessActiveQueues()
|
|||
TranslateEntity(&sample.m_vecPos, &position);
|
||||
#ifdef EXTERNAL_3D_SOUND
|
||||
SampleManager.SetChannel3DPosition(j, position.x, position.y, position.z);
|
||||
SampleManager.SetChannel3DDistances(j, sample.m_fSoundIntensity, 0.25f * sample.m_fSoundIntensity);
|
||||
SampleManager.SetChannel3DDistances(j, sample.m_SoundIntensity, 0.25f * sample.m_SoundIntensity);
|
||||
#else
|
||||
sample.m_nOffset = ComputePan(sample.m_fDistance, &position);
|
||||
SampleManager.SetChannelPan(j, sample.m_nOffset);
|
||||
|
@ -1094,14 +1137,14 @@ cAudioManager::ProcessActiveQueues()
|
|||
usedX = x;
|
||||
usedY = 0.0f;
|
||||
usedZ = 0.0f;
|
||||
m_asActiveSamples[k].m_fSoundIntensity = 100000.0f;
|
||||
m_asActiveSamples[k].m_SoundIntensity = 100000.0f;
|
||||
} else {
|
||||
usedX = position.x;
|
||||
usedY = position.y;
|
||||
usedZ = position.z;
|
||||
}
|
||||
SampleManager.SetChannel3DPosition(k, usedX, usedY, usedZ);
|
||||
SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_fSoundIntensity, 0.25f * m_asActiveSamples[k].m_fSoundIntensity);
|
||||
SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_SoundIntensity, 0.25f * m_asActiveSamples[k].m_SoundIntensity);
|
||||
#endif
|
||||
SampleManager.StartChannel(k);
|
||||
}
|
||||
|
@ -1150,7 +1193,7 @@ cAudioManager::ClearActiveSamples()
|
|||
m_asActiveSamples[i].m_nLoopEnd = -1;
|
||||
#endif
|
||||
m_asActiveSamples[i].m_fSpeedMultiplier = 0.0f;
|
||||
m_asActiveSamples[i].m_fSoundIntensity = 200.0f;
|
||||
m_asActiveSamples[i].m_SoundIntensity = 200.0f;
|
||||
m_asActiveSamples[i].m_nOffset = 63;
|
||||
m_asActiveSamples[i].m_bReleasingSoundFlag = FALSE;
|
||||
m_asActiveSamples[i].m_nCalculatedVolume = 0;
|
||||
|
@ -1186,7 +1229,7 @@ cAudioManager::AdjustSamplesVolume()
|
|||
tSound *pSample = &m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]];
|
||||
|
||||
if (!pSample->m_bIs2D)
|
||||
pSample->m_nEmittingVolume = ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_fSoundIntensity, pSample->m_fDistance);
|
||||
pSample->m_nEmittingVolume = ComputeEmittingVolume(pSample->m_nEmittingVolume, pSample->m_SoundIntensity, pSample->m_fDistance);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,10 +27,12 @@ public:
|
|||
uint8 m_nEmittingVolume;
|
||||
#endif
|
||||
float m_fSpeedMultiplier;
|
||||
float m_fSoundIntensity;
|
||||
float m_SoundIntensity;
|
||||
bool8 m_bReleasingSoundFlag;
|
||||
CVector m_vecPos;
|
||||
bool8 m_bReverbFlag;
|
||||
#ifndef GTA_PS2
|
||||
bool8 m_bReverbFlag; // TODO: ifdef all the occurrences
|
||||
#endif
|
||||
uint8 m_nLoopsRemaining;
|
||||
bool8 m_bRequireReflection; // Used for oneshots
|
||||
uint8 m_nOffset;
|
||||
|
@ -182,6 +184,24 @@ public:
|
|||
|
||||
VALIDATE_SIZE(cVehicleParams, 0x1C);
|
||||
|
||||
#if GTA_VERSION < GTAVC_PC_10
|
||||
enum {
|
||||
/*
|
||||
REFLECTION_YMAX = 0, top
|
||||
REFLECTION_YMIN = 1, bottom
|
||||
REFLECTION_XMIN = 2, left
|
||||
REFLECTION_XMAX = 3, right
|
||||
REFLECTION_ZMAX = 4,
|
||||
*/
|
||||
|
||||
REFLECTION_TOP = 0,
|
||||
REFLECTION_BOTTOM,
|
||||
REFLECTION_LEFT,
|
||||
REFLECTION_RIGHT,
|
||||
REFLECTION_UP,
|
||||
MAX_REFLECTIONS,
|
||||
};
|
||||
#else
|
||||
enum {
|
||||
REFLECTION_NORTH = 0,
|
||||
REFLECTION_SOUTH,
|
||||
|
@ -193,6 +213,7 @@ enum {
|
|||
REFLECTION_CEIL_EAST,
|
||||
MAX_REFLECTIONS,
|
||||
};
|
||||
#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 };
|
||||
|
@ -219,10 +240,8 @@ 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
|
||||
|
@ -301,10 +320,8 @@ public:
|
|||
void InterrogateAudioEntities(); // inlined
|
||||
void AddSampleToRequestedQueue();
|
||||
void AddDetailsToRequestedOrderList(uint8 sample); // inlined in vc
|
||||
#ifdef GTA_PC
|
||||
void AddReflectionsToRequestedQueue();
|
||||
void UpdateReflections();
|
||||
#endif
|
||||
void AddReleasingSounds();
|
||||
void ProcessActiveQueues();
|
||||
void ClearRequestedQueue(); // inlined in vc
|
||||
|
@ -341,7 +358,7 @@ public:
|
|||
void ProcessVehicleFlatTyre(cVehicleParams ¶ms);
|
||||
bool8 ProcessVehicleRoadNoise(cVehicleParams ¶ms);
|
||||
bool8 ProcessWetRoadNoise(cVehicleParams ¶ms);
|
||||
void ProcessVehicleEngine(cVehicleParams ¶ms);
|
||||
bool8 ProcessVehicleEngine(cVehicleParams ¶ms);
|
||||
void UpdateGasPedalAudio(CVehicle *veh, int vehType);
|
||||
void PlayerJustGotInCar();
|
||||
void PlayerJustLeftCar();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue