mirror of
https://github.com/halpz/re3.git
synced 2025-01-08 20:25:28 +00:00
Merge branch 'miami' into lcs
# Conflicts: # src/audio/AudioLogic.cpp # src/audio/MusicManager.cpp
This commit is contained in:
commit
92679555b9
|
@ -3032,7 +3032,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams& params)
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_GLASS_CRACK;
|
m_sQueueSample.m_nSampleIndex = SFX_GLASS_CRACK;
|
||||||
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
|
m_sQueueSample.m_nBankIndex = SFX_BANK_0;
|
||||||
m_sQueueSample.m_nCounter = 68;
|
m_sQueueSample.m_nCounter = 68;
|
||||||
emittingVol = m_anRandomTable[1] % 30 + 80; //GetRandomNumberInRange(1, 80, 109)
|
emittingVol = m_anRandomTable[1] % 30 + 80;
|
||||||
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_CRACK);
|
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_GLASS_CRACK);
|
||||||
m_sQueueSample.m_nReleasingVolumeModificator = 5;
|
m_sQueueSample.m_nReleasingVolumeModificator = 5;
|
||||||
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
|
m_sQueueSample.m_fSpeedMultiplier = 0.0f;
|
||||||
|
@ -3827,8 +3827,8 @@ uint8 gJumboVolOffsetPercentage;
|
||||||
void
|
void
|
||||||
DoJumboVolOffset()
|
DoJumboVolOffset()
|
||||||
{
|
{
|
||||||
if (!(AudioManager.GetFrameCounter() % (AudioManager.GetRandomNumber(0) % 6 + 3)))
|
if (!(AudioManager.m_FrameCounter % (AudioManager.m_anRandomTable[0] % 6 + 3)))
|
||||||
gJumboVolOffsetPercentage = AudioManager.GetRandomNumber(1) % 60;
|
gJumboVolOffsetPercentage = AudioManager.m_anRandomTable[1] % 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -674,7 +674,7 @@ cAudioManager::AddReflectionsToRequestedQueue()
|
||||||
|
|
||||||
for (uint32 i = 0; i < ARRAY_SIZE(m_afReflectionsDistances); i++) {
|
for (uint32 i = 0; i < ARRAY_SIZE(m_afReflectionsDistances); i++) {
|
||||||
if ( CTimer::GetIsSlowMotionActive() )
|
if ( CTimer::GetIsSlowMotionActive() )
|
||||||
m_afReflectionsDistances[i] = GetRandomNumberInRange(i % 4, 0, 2) * 100.f / 8.f;
|
m_afReflectionsDistances[i] = (m_anRandomTable[i % 4] % 3) * 100.f / 8.f;
|
||||||
|
|
||||||
reflectionDistance = m_afReflectionsDistances[i];
|
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_fSoundIntensity) {
|
||||||
|
|
|
@ -251,10 +251,6 @@ public:
|
||||||
~cAudioManager();
|
~cAudioManager();
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
uint32 GetFrameCounter() const { return m_FrameCounter; }
|
|
||||||
float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; }
|
|
||||||
int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; }
|
|
||||||
int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; }
|
|
||||||
bool8 IsMissionAudioSamplePlaying(uint8 slot); // { return m_sMissionAudio.m_nPlayStatus == 1; }
|
bool8 IsMissionAudioSamplePlaying(uint8 slot); // { return m_sMissionAudio.m_nPlayStatus == 1; }
|
||||||
bool8 ShouldDuckMissionAudio(uint8 slot);
|
bool8 ShouldDuckMissionAudio(uint8 slot);
|
||||||
|
|
||||||
|
|
|
@ -132,23 +132,23 @@ cMusicManager::SetStartingTrackPositions(bool8 isNewGameTimer)
|
||||||
if (IsInitialised()) {
|
if (IsInitialised()) {
|
||||||
time_t timevalue = time(0);
|
time_t timevalue = time(0);
|
||||||
if (timevalue == -1) {
|
if (timevalue == -1) {
|
||||||
pos = AudioManager.GetRandomNumber(0);
|
pos = AudioManager.m_anRandomTable[0];
|
||||||
} else {
|
} else {
|
||||||
tm* pTm = localtime(&timevalue);
|
tm* pTm = localtime(&timevalue);
|
||||||
if (pTm->tm_sec == 0)
|
if (pTm->tm_sec == 0)
|
||||||
pTm->tm_sec = AudioManager.GetRandomNumber(0);
|
pTm->tm_sec = AudioManager.m_anRandomTable[0];
|
||||||
if (pTm->tm_min == 0)
|
if (pTm->tm_min == 0)
|
||||||
pTm->tm_min = AudioManager.GetRandomNumber(1);
|
pTm->tm_min = AudioManager.m_anRandomTable[1];
|
||||||
if (pTm->tm_hour == 0)
|
if (pTm->tm_hour == 0)
|
||||||
pTm->tm_hour = AudioManager.GetRandomNumber(2);
|
pTm->tm_hour = AudioManager.m_anRandomTable[2];
|
||||||
if (pTm->tm_mday == 0)
|
if (pTm->tm_mday == 0)
|
||||||
pTm->tm_mday = AudioManager.GetRandomNumber(3);
|
pTm->tm_mday = AudioManager.m_anRandomTable[3];
|
||||||
if (pTm->tm_mon == 0)
|
if (pTm->tm_mon == 0)
|
||||||
pTm->tm_mon = AudioManager.GetRandomNumber(4);
|
pTm->tm_mon = AudioManager.m_anRandomTable[4];
|
||||||
if (pTm->tm_year == 0)
|
if (pTm->tm_year == 0)
|
||||||
pTm->tm_year = AudioManager.GetRandomNumber(3);
|
pTm->tm_year = AudioManager.m_anRandomTable[3];
|
||||||
if (pTm->tm_wday == 0)
|
if (pTm->tm_wday == 0)
|
||||||
pTm->tm_wday = AudioManager.GetRandomNumber(2);
|
pTm->tm_wday = AudioManager.m_anRandomTable[2];
|
||||||
pos = pTm->tm_yday
|
pos = pTm->tm_yday
|
||||||
* pTm->tm_wday
|
* pTm->tm_wday
|
||||||
* pTm->tm_year
|
* pTm->tm_year
|
||||||
|
@ -1171,7 +1171,7 @@ cMusicManager::GetCarTuning()
|
||||||
if (UsesPoliceRadio(veh)) return STREAMED_SOUND_RADIO_POLICE;
|
if (UsesPoliceRadio(veh)) return STREAMED_SOUND_RADIO_POLICE;
|
||||||
if (UsesTaxiRadio(veh)) return STREAMED_SOUND_RADIO_TAXI;
|
if (UsesTaxiRadio(veh)) return STREAMED_SOUND_RADIO_TAXI;
|
||||||
if (veh->m_nRadioStation == USERTRACK && !SampleManager.IsMP3RadioChannelAvailable())
|
if (veh->m_nRadioStation == USERTRACK && !SampleManager.IsMP3RadioChannelAvailable())
|
||||||
veh->m_nRadioStation = AudioManager.GetRandomNumber(2) % USERTRACK;
|
veh->m_nRadioStation = AudioManager.m_anRandomTable[2] % USERTRACK;
|
||||||
return veh->m_nRadioStation;
|
return veh->m_nRadioStation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1383,7 +1383,7 @@ cSampleManager::Initialise(void)
|
||||||
|
|
||||||
int32 randval;
|
int32 randval;
|
||||||
if ( bUseRandomTable )
|
if ( bUseRandomTable )
|
||||||
randval = AudioManager.GetRandomNumber(1);
|
randval = AudioManager.m_anRandomTable[1];
|
||||||
else
|
else
|
||||||
randval = localtm->tm_sec * localtm->tm_min;
|
randval = localtm->tm_sec * localtm->tm_min;
|
||||||
|
|
||||||
|
@ -1394,7 +1394,7 @@ cSampleManager::Initialise(void)
|
||||||
randmp3 = randmp3->pNext;
|
randmp3 = randmp3->pNext;
|
||||||
|
|
||||||
if ( bUseRandomTable )
|
if ( bUseRandomTable )
|
||||||
_CurMP3Pos = AudioManager.GetRandomNumber(0) % randmp3->nTrackLength;
|
_CurMP3Pos = AudioManager.m_anRandomTable[0] % randmp3->nTrackLength;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( localtm->tm_sec > 0 )
|
if ( localtm->tm_sec > 0 )
|
||||||
|
@ -1403,7 +1403,7 @@ cSampleManager::Initialise(void)
|
||||||
_CurMP3Pos = s*s*s*s*s*s*s*s % randmp3->nTrackLength;
|
_CurMP3Pos = s*s*s*s*s*s*s*s % randmp3->nTrackLength;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_CurMP3Pos = AudioManager.GetRandomNumber(0) % randmp3->nTrackLength;
|
_CurMP3Pos = AudioManager.m_anRandomTable[0] % randmp3->nTrackLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1732,7 +1732,7 @@ cSampleManager::UpdateReverb(void)
|
||||||
if ( !usingEAX )
|
if ( !usingEAX )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ( AudioManager.GetFrameCounter() & 15 )
|
if ( AudioManager.m_FrameCounter & 15 )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
float fRatio = 0.0f;
|
float fRatio = 0.0f;
|
||||||
|
@ -1740,13 +1740,13 @@ cSampleManager::UpdateReverb(void)
|
||||||
#define MIN_DIST 0.5f
|
#define MIN_DIST 0.5f
|
||||||
#define CALCULATE_RATIO(value, maxDist, maxRatio) (value > MIN_DIST && value < maxDist ? value / maxDist * maxRatio : 0)
|
#define CALCULATE_RATIO(value, maxDist, maxRatio) (value > MIN_DIST && value < maxDist ? value / maxDist * maxRatio : 0)
|
||||||
|
|
||||||
fRatio += CALCULATE_RATIO(AudioManager.GetReflectionsDistance(REFLECTION_CEIL_NORTH), 10.0f, 1/2.f);
|
fRatio += CALCULATE_RATIO(AudioManager.m_afReflectionsDistances[REFLECTION_CEIL_NORTH], 10.0f, 1/2.f);
|
||||||
fRatio += CALCULATE_RATIO(AudioManager.GetReflectionsDistance(REFLECTION_CEIL_SOUTH), 10.0f, 1/2.f);
|
fRatio += CALCULATE_RATIO(AudioManager.m_afReflectionsDistances[REFLECTION_CEIL_SOUTH], 10.0f, 1/2.f);
|
||||||
fRatio += CALCULATE_RATIO(AudioManager.GetReflectionsDistance(REFLECTION_CEIL_WEST), 10.0f, 1/2.f);
|
fRatio += CALCULATE_RATIO(AudioManager.m_afReflectionsDistances[REFLECTION_CEIL_WEST], 10.0f, 1/2.f);
|
||||||
fRatio += CALCULATE_RATIO(AudioManager.GetReflectionsDistance(REFLECTION_CEIL_EAST), 10.0f, 1/2.f);
|
fRatio += CALCULATE_RATIO(AudioManager.m_afReflectionsDistances[REFLECTION_CEIL_EAST], 10.0f, 1/2.f);
|
||||||
|
|
||||||
fRatio += CALCULATE_RATIO((AudioManager.GetReflectionsDistance(REFLECTION_NORTH) + AudioManager.GetReflectionsDistance(REFLECTION_SOUTH)) / 2.f, 4.0f, 1/3.f);
|
fRatio += CALCULATE_RATIO((AudioManager.m_afReflectionsDistances[REFLECTION_NORTH] + AudioManager.m_afReflectionsDistances[REFLECTION_SOUTH]) / 2.f, 4.0f, 1/3.f);
|
||||||
fRatio += CALCULATE_RATIO((AudioManager.GetReflectionsDistance(REFLECTION_WEST) + AudioManager.GetReflectionsDistance(REFLECTION_EAST)) / 2.f, 4.0f, 1/3.f);
|
fRatio += CALCULATE_RATIO((AudioManager.m_afReflectionsDistances[REFLECTION_WEST] + AudioManager.m_afReflectionsDistances[REFLECTION_EAST]) / 2.f, 4.0f, 1/3.f);
|
||||||
|
|
||||||
#undef CALCULATE_RATIO
|
#undef CALCULATE_RATIO
|
||||||
#undef MIN_DIST
|
#undef MIN_DIST
|
||||||
|
|
|
@ -1107,7 +1107,7 @@ cSampleManager::Initialise(void)
|
||||||
|
|
||||||
int32 randval;
|
int32 randval;
|
||||||
if ( bUseRandomTable )
|
if ( bUseRandomTable )
|
||||||
randval = AudioManager.GetRandomNumber(1);
|
randval = AudioManager.m_anRandomTable[1];
|
||||||
else
|
else
|
||||||
randval = localtm->tm_sec * localtm->tm_min;
|
randval = localtm->tm_sec * localtm->tm_min;
|
||||||
|
|
||||||
|
@ -1118,7 +1118,7 @@ cSampleManager::Initialise(void)
|
||||||
randmp3 = randmp3->pNext;
|
randmp3 = randmp3->pNext;
|
||||||
|
|
||||||
if ( bUseRandomTable )
|
if ( bUseRandomTable )
|
||||||
_CurMP3Pos = AudioManager.GetRandomNumber(0) % randmp3->nTrackLength;
|
_CurMP3Pos = AudioManager.m_anRandomTable[0] % randmp3->nTrackLength;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( localtm->tm_sec > 0 )
|
if ( localtm->tm_sec > 0 )
|
||||||
|
@ -1127,7 +1127,7 @@ cSampleManager::Initialise(void)
|
||||||
_CurMP3Pos = s*s*s*s*s*s*s*s % randmp3->nTrackLength;
|
_CurMP3Pos = s*s*s*s*s*s*s*s % randmp3->nTrackLength;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_CurMP3Pos = AudioManager.GetRandomNumber(0) % randmp3->nTrackLength;
|
_CurMP3Pos = AudioManager.m_anRandomTable[0] % randmp3->nTrackLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1470,7 +1470,7 @@ bool8 cSampleManager::UpdateReverb(void)
|
||||||
if ( !usingEAX && !_usingEFX )
|
if ( !usingEAX && !_usingEFX )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ( AudioManager.GetFrameCounter() & 15 )
|
if ( AudioManager.m_FrameCounter & 15 )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
float fRatio = 0.0f;
|
float fRatio = 0.0f;
|
||||||
|
@ -1478,13 +1478,13 @@ bool8 cSampleManager::UpdateReverb(void)
|
||||||
#define MIN_DIST 0.5f
|
#define MIN_DIST 0.5f
|
||||||
#define CALCULATE_RATIO(value, maxDist, maxRatio) (value > MIN_DIST && value < maxDist ? value / maxDist * maxRatio : 0)
|
#define CALCULATE_RATIO(value, maxDist, maxRatio) (value > MIN_DIST && value < maxDist ? value / maxDist * maxRatio : 0)
|
||||||
|
|
||||||
fRatio += CALCULATE_RATIO(AudioManager.GetReflectionsDistance(REFLECTION_CEIL_NORTH), 10.0f, 1/2.f);
|
fRatio += CALCULATE_RATIO(AudioManager.m_afReflectionsDistances[REFLECTION_CEIL_NORTH], 10.0f, 1/2.f);
|
||||||
fRatio += CALCULATE_RATIO(AudioManager.GetReflectionsDistance(REFLECTION_CEIL_SOUTH), 10.0f, 1/2.f);
|
fRatio += CALCULATE_RATIO(AudioManager.m_afReflectionsDistances[REFLECTION_CEIL_SOUTH], 10.0f, 1/2.f);
|
||||||
fRatio += CALCULATE_RATIO(AudioManager.GetReflectionsDistance(REFLECTION_CEIL_WEST), 10.0f, 1/2.f);
|
fRatio += CALCULATE_RATIO(AudioManager.m_afReflectionsDistances[REFLECTION_CEIL_WEST], 10.0f, 1/2.f);
|
||||||
fRatio += CALCULATE_RATIO(AudioManager.GetReflectionsDistance(REFLECTION_CEIL_EAST), 10.0f, 1/2.f);
|
fRatio += CALCULATE_RATIO(AudioManager.m_afReflectionsDistances[REFLECTION_CEIL_EAST], 10.0f, 1/2.f);
|
||||||
|
|
||||||
fRatio += CALCULATE_RATIO((AudioManager.GetReflectionsDistance(REFLECTION_NORTH) + AudioManager.GetReflectionsDistance(REFLECTION_SOUTH)) / 2.f, 4.0f, 1/3.f);
|
fRatio += CALCULATE_RATIO((AudioManager.m_afReflectionsDistances[REFLECTION_NORTH] + AudioManager.m_afReflectionsDistances[REFLECTION_SOUTH]) / 2.f, 4.0f, 1/3.f);
|
||||||
fRatio += CALCULATE_RATIO((AudioManager.GetReflectionsDistance(REFLECTION_WEST) + AudioManager.GetReflectionsDistance(REFLECTION_EAST)) / 2.f, 4.0f, 1/3.f);
|
fRatio += CALCULATE_RATIO((AudioManager.m_afReflectionsDistances[REFLECTION_WEST] + AudioManager.m_afReflectionsDistances[REFLECTION_EAST]) / 2.f, 4.0f, 1/3.f);
|
||||||
|
|
||||||
#undef CALCULATE_RATIO
|
#undef CALCULATE_RATIO
|
||||||
#undef MIN_DIST
|
#undef MIN_DIST
|
||||||
|
|
Loading…
Reference in a new issue