cAudioManager::ProcessFrontEnd done
This commit is contained in:
parent
93b318cfdf
commit
a520243563
@ -5546,18 +5546,21 @@ cAudioManager::ProcessFrontEnd()
|
|||||||
bool stereo;
|
bool stereo;
|
||||||
bool processedPickup;
|
bool processedPickup;
|
||||||
bool processedMission;
|
bool processedMission;
|
||||||
bool frontendBank;
|
bool staticFreq;
|
||||||
|
bool center;
|
||||||
int16 sample;
|
int16 sample;
|
||||||
|
|
||||||
static uint8 iSound = 0;
|
static uint8 iSound = 0;
|
||||||
static uint32 cPickupNextFrame = 0;
|
static uint32 cPickupNextFrame = 0;
|
||||||
static uint32 cPartMisComNextFrame = 0;
|
static uint32 cPartMisComNextFrame = 0;
|
||||||
|
static uint32 radioDial = SFX_RADIO_DIAL_1;
|
||||||
|
|
||||||
for (uint32 i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) {
|
for (uint32 i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) {
|
||||||
|
staticFreq = false;
|
||||||
processedPickup = false;
|
processedPickup = false;
|
||||||
stereo = false;
|
center = false;
|
||||||
processedMission = false;
|
processedMission = false;
|
||||||
frontendBank = false;
|
stereo = false;
|
||||||
switch (m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i]) {
|
switch (m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i]) {
|
||||||
case SOUND_WEAPON_SNIPER_SHOT_NO_ZOOM:
|
case SOUND_WEAPON_SNIPER_SHOT_NO_ZOOM:
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_ERROR_FIRE_RIFLE;
|
m_sQueueSample.m_nSampleIndex = SFX_ERROR_FIRE_RIFLE;
|
||||||
@ -5565,102 +5568,124 @@ cAudioManager::ProcessFrontEnd()
|
|||||||
case SOUND_WEAPON_ROCKET_SHOT_NO_ZOOM:
|
case SOUND_WEAPON_ROCKET_SHOT_NO_ZOOM:
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_ERROR_FIRE_ROCKET_LAUNCHER;
|
m_sQueueSample.m_nSampleIndex = SFX_ERROR_FIRE_ROCKET_LAUNCHER;
|
||||||
break;
|
break;
|
||||||
//case SOUND_GARAGE_NO_MONEY:
|
case SOUND_GARAGE_NO_MONEY:
|
||||||
//case SOUND_GARAGE_BAD_VEHICLE:
|
case SOUND_GARAGE_BAD_VEHICLE:
|
||||||
//case SOUND_GARAGE_BOMB_ALREADY_SET:
|
case SOUND_GARAGE_BOMB_ALREADY_SET:
|
||||||
// m_sQueueSample.m_nSampleIndex = SFX_PICKUP_ERROR_LEFT;
|
m_sQueueSample.m_nSampleIndex = SFX_WEAPON_LEFT;
|
||||||
// stereo = true;
|
stereo = true;
|
||||||
// break;
|
staticFreq = true;
|
||||||
//case SOUND_GARAGE_OPENING:
|
center = true;
|
||||||
//case SOUND_GARAGE_BOMB1_SET:
|
break;
|
||||||
//case SOUND_GARAGE_BOMB2_SET:
|
case SOUND_GARAGE_OPENING:
|
||||||
//case SOUND_GARAGE_BOMB3_SET:
|
case SOUND_71: //case SOUND_41:
|
||||||
//case SOUND_41:
|
case SOUND_GARAGE_VEHICLE_DECLINED:
|
||||||
//case SOUND_GARAGE_VEHICLE_DECLINED:
|
case SOUND_GARAGE_VEHICLE_ACCEPTED:
|
||||||
//case SOUND_GARAGE_VEHICLE_ACCEPTED:
|
case SOUND_EVIDENCE_PICKUP:
|
||||||
//case SOUND_PICKUP_HEALTH:
|
case SOUND_UNLOAD_GOLD:
|
||||||
//case SOUND_4B:
|
stereo = true;
|
||||||
//case SOUND_PICKUP_ADRENALINE:
|
processedPickup = true;
|
||||||
//case SOUND_PICKUP_ARMOUR:
|
m_sQueueSample.m_nSampleIndex = SFX_MONEY_LEFT;
|
||||||
//case SOUND_EVIDENCE_PICKUP:
|
break;
|
||||||
//case SOUND_UNLOAD_GOLD:
|
case SOUND_GARAGE_BOMB1_SET:
|
||||||
// m_sQueueSample.m_nSampleIndex = SFX_PICKUP_2_LEFT;
|
case SOUND_GARAGE_BOMB2_SET:
|
||||||
// processedPickup = true;
|
case SOUND_GARAGE_BOMB3_SET:
|
||||||
// stereo = true;
|
center = true;
|
||||||
// break;
|
processedPickup = true;
|
||||||
//case SOUND_PICKUP_WEAPON_BOUGHT:
|
m_sQueueSample.m_nSampleIndex = SFX_WEAPON_LEFT;
|
||||||
//case SOUND_PICKUP_WEAPON:
|
stereo = true;
|
||||||
// m_sQueueSample.m_nSampleIndex = SFX_PICKUP_1_LEFT;
|
break;
|
||||||
// processedPickup = true;
|
case SOUND_PICKUP_HEALTH:
|
||||||
// stereo = true;
|
case SOUND_81: //case SOUND_4B:
|
||||||
// break;
|
case SOUND_PICKUP_ADRENALINE:
|
||||||
//case SOUND_PICKUP_ERROR:
|
case SOUND_PICKUP_ARMOUR:
|
||||||
// m_sQueueSample.m_nSampleIndex = SFX_PICKUP_ERROR_LEFT;
|
stereo = true;
|
||||||
// processedPickup = true;
|
processedPickup = true;
|
||||||
// stereo = true;
|
m_sQueueSample.m_nSampleIndex = SFX_MONEY_LEFT;
|
||||||
// break;
|
break;
|
||||||
//case SOUND_PICKUP_BONUS:
|
case SOUND_80:
|
||||||
//case SOUND_PICKUP_MONEY:
|
stereo = true;
|
||||||
//case SOUND_PICKUP_HIDDEN_PACKAGE:
|
processedPickup = true;
|
||||||
//case SOUND_PICKUP_PACMAN_PILL:
|
m_sQueueSample.m_nSampleIndex = SFX_WEAPON_LEFT;
|
||||||
//case SOUND_PICKUP_PACMAN_PACKAGE:
|
center = true;
|
||||||
//case SOUND_PICKUP_FLOAT_PACKAGE:
|
staticFreq = true;
|
||||||
// m_sQueueSample.m_nSampleIndex = SFX_PICKUP_3_LEFT;
|
break;
|
||||||
// processedPickup = true;
|
case SOUND_PICKUP_BONUS:
|
||||||
// stereo = true;
|
case SOUND_FRONTEND_MENU_STARTING:
|
||||||
// break;
|
case SOUND_HUD_SOUND:
|
||||||
//case SOUND_PAGER:
|
stereo = true;
|
||||||
// m_sQueueSample.m_nSampleIndex = SFX_PAGER;
|
m_sQueueSample.m_nSampleIndex = SFX_INFO_LEFT;
|
||||||
// break;
|
center = true;
|
||||||
|
break;
|
||||||
|
case SOUND_PICKUP_MONEY:
|
||||||
|
stereo = true;
|
||||||
|
processedPickup = true;
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_MONEY_LEFT;
|
||||||
|
break;
|
||||||
|
case SOUND_PICKUP_HIDDEN_PACKAGE:
|
||||||
|
case SOUND_PICKUP_PACMAN_PILL:
|
||||||
|
case SOUND_PICKUP_PACMAN_PACKAGE:
|
||||||
|
case SOUND_PICKUP_FLOAT_PACKAGE:
|
||||||
|
center = true;
|
||||||
|
processedPickup = true;
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_PART_MISSION_COMPLETE_LEFT;
|
||||||
|
stereo = true;
|
||||||
|
break;
|
||||||
case SOUND_RACE_START_3:
|
case SOUND_RACE_START_3:
|
||||||
case SOUND_RACE_START_2:
|
case SOUND_RACE_START_2:
|
||||||
case SOUND_RACE_START_1:
|
case SOUND_RACE_START_1:
|
||||||
case SOUND_CLOCK_TICK:
|
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_TIMER_BEEP;
|
|
||||||
break;
|
|
||||||
case SOUND_RACE_START_GO:
|
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_PART_MISSION_COMPLETE_LEFT;
|
|
||||||
break;
|
|
||||||
case SOUND_PART_MISSION_COMPLETE:
|
case SOUND_PART_MISSION_COMPLETE:
|
||||||
|
stereo = true;
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_PART_MISSION_COMPLETE_LEFT;
|
m_sQueueSample.m_nSampleIndex = SFX_PART_MISSION_COMPLETE_LEFT;
|
||||||
processedMission = true;
|
processedMission = true;
|
||||||
|
center = true;
|
||||||
break;
|
break;
|
||||||
case SOUND_FRONTEND_MENU_STARTING:
|
case SOUND_RACE_START_GO:
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT;
|
|
||||||
stereo = true;
|
stereo = true;
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_GO_LEFT;
|
||||||
|
center = true;
|
||||||
break;
|
break;
|
||||||
case SOUND_FRONTEND_MENU_NEW_PAGE:
|
case SOUND_CLOCK_TICK:
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT;
|
m_sQueueSample.m_nSampleIndex = SFX_TIMER;
|
||||||
stereo = true;
|
|
||||||
frontendBank = true;
|
|
||||||
frontendBank = true;
|
|
||||||
break;
|
|
||||||
case SOUND_FRONTEND_MENU_SETTING_CHANGE:
|
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_FE_SELECT_LEFT;
|
|
||||||
stereo = true;
|
|
||||||
frontendBank = true;
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
//case SOUND_FRONTEND_EXIT:
|
|
||||||
// m_sQueueSample.m_nSampleIndex = SFX_SUB_MENU_BACK_LEFT;
|
|
||||||
// stereo = true;
|
|
||||||
// break;
|
|
||||||
//case SOUND_FRONTEND_AUDIO_TEST:
|
|
||||||
// m_sQueueSample.m_nSampleIndex = m_anRandomTable[0] % 3 + SFX_NOISE_BURST_1;
|
|
||||||
// break;
|
|
||||||
case SOUND_FRONTEND_FAIL:
|
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_FE_ERROR_LEFT;
|
|
||||||
frontendBank = true;
|
|
||||||
stereo = true;
|
|
||||||
break;
|
break;
|
||||||
case SOUND_FRONTEND_NO_RADIO:
|
case SOUND_FRONTEND_NO_RADIO:
|
||||||
case SOUND_FRONTEND_RADIO_CHANGE:
|
case SOUND_FRONTEND_RADIO_CHANGE:
|
||||||
m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK;
|
m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK;
|
||||||
break;
|
break;
|
||||||
//case SOUND_HUD_SOUND:
|
case SOUND_FRONTEND_RADIO_CHANGE_2:
|
||||||
// m_sQueueSample.m_nSampleIndex = SFX_INFO;
|
m_sQueueSample.m_nSampleIndex = SFX_HURRICANE_MA;
|
||||||
// break;
|
break;
|
||||||
|
case SOUND_BULLETTRACE_1:
|
||||||
|
case SOUND_BULLETTRACE_2:
|
||||||
|
m_sQueueSample.m_nSampleIndex = (m_anRandomTable[0] % 2) + SFX_BULLET_PASS_1;
|
||||||
|
break;
|
||||||
|
case SOUND_AMMUNATION_IMRAN_ARM_BOMB:
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_ARM_BOMB;
|
||||||
|
break;
|
||||||
|
case SOUND_194:
|
||||||
|
m_sQueueSample.m_nSampleIndex = (m_anRandomTable[1] % 2) ? radioDial + 1 : radioDial + 2;
|
||||||
|
if (m_sQueueSample.m_nSampleIndex > SFX_RADIO_DIAL_12)
|
||||||
|
m_sQueueSample.m_nSampleIndex -= 12;
|
||||||
|
radioDial = m_sQueueSample.m_nSampleIndex;
|
||||||
|
break;
|
||||||
|
case SOUND_FRONTEND_MENU_NEW_PAGE:
|
||||||
|
stereo = true;
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT;
|
||||||
|
break;
|
||||||
|
case SOUND_FRONTEND_FAIL:
|
||||||
|
stereo = true;
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_FE_SELECT_LEFT;
|
||||||
|
break;
|
||||||
|
case SOUND_FRONTEND_MENU_SETTING_CHANGE:
|
||||||
|
stereo = true;
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_FE_BACK_LEFT;
|
||||||
|
break;
|
||||||
|
case SOUND_FRONTEND_MENU_BACK:
|
||||||
|
stereo = true;
|
||||||
|
m_sQueueSample.m_nSampleIndex = SFX_FE_ERROR_LEFT;
|
||||||
|
break;
|
||||||
|
case SOUND_FRONTEND_AUDIO_TEST:
|
||||||
|
m_sQueueSample.m_nSampleIndex = m_anRandomTable[0] % 3 + SFX_FE_NOISE_BURST_1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -5676,37 +5701,64 @@ cAudioManager::ProcessFrontEnd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
sample = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i];
|
sample = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i];
|
||||||
if (sample == SFX_RAIN) {
|
|
||||||
|
if (sample == SOUND_FRONTEND_NO_RADIO)
|
||||||
m_sQueueSample.m_nFrequency = 28509;
|
m_sQueueSample.m_nFrequency = 28509;
|
||||||
/*} else if (sample == SFX_PICKUP_1_LEFT) {
|
else if (sample == SOUND_FRONTEND_RADIO_CHANGE)
|
||||||
if (m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i] == 1.0f)
|
|
||||||
m_sQueueSample.m_nFrequency = 32000;
|
m_sQueueSample.m_nFrequency = 32000;
|
||||||
else
|
else if (sample == SOUND_BULLETTRACE_1 || sample == SOUND_BULLETTRACE_2) {
|
||||||
m_sQueueSample.m_nFrequency = 48000;*/
|
|
||||||
} else {
|
|
||||||
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex);
|
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex);
|
||||||
}
|
m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32);
|
||||||
m_sQueueSample.m_nVolume = 110;
|
} else if (staticFreq)
|
||||||
|
m_sQueueSample.m_nFrequency = 5382;
|
||||||
|
else
|
||||||
|
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex);
|
||||||
|
|
||||||
|
m_sQueueSample.m_nVolume = 127;
|
||||||
|
if (m_sQueueSample.m_nSampleIndex == SFX_HURRICANE_MA && CWeather::Wind > 1.0f)
|
||||||
|
m_sQueueSample.m_nVolume = (CWeather::Wind - 1.0f) * m_sQueueSample.m_nVolume;
|
||||||
m_sQueueSample.m_nCounter = iSound++;
|
m_sQueueSample.m_nCounter = iSound++;
|
||||||
m_sQueueSample.m_nLoopCount = 1;
|
m_sQueueSample.m_nLoopCount = 1;
|
||||||
m_sQueueSample.m_bReleasingSoundFlag = true;
|
m_sQueueSample.m_bReleasingSoundFlag = true;
|
||||||
m_sQueueSample.m_nBankIndex = frontendBank ? SFX_BANK_FRONT_END_MENU : SFX_BANK_0;
|
m_sQueueSample.m_nBankIndex = SFX_BANK_FRONT_END_MENU;
|
||||||
m_sQueueSample.m_nReleasingVolumeModificator = 0;
|
m_sQueueSample.m_nReleasingVolumeModificator = 0;
|
||||||
m_sQueueSample.m_bIs2D = true;
|
m_sQueueSample.m_bIs2D = true;
|
||||||
m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume;
|
m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume;
|
||||||
m_sQueueSample.m_nLoopStart = 0;
|
m_sQueueSample.m_nLoopStart = 0;
|
||||||
m_sQueueSample.m_nLoopEnd = -1;
|
m_sQueueSample.m_nLoopEnd = -1;
|
||||||
|
m_sQueueSample.m_fDistance = 1.0f;
|
||||||
if (stereo)
|
if (stereo)
|
||||||
m_sQueueSample.m_nOffset = m_anRandomTable[0] & 31;
|
m_sQueueSample.m_nOffset = 0;
|
||||||
else
|
else {
|
||||||
|
sample = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i];
|
||||||
|
if (sample == SOUND_BULLETTRACE_1) {
|
||||||
|
m_sQueueSample.m_nOffset = 20;
|
||||||
|
m_sQueueSample.m_nVolume = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i];
|
||||||
|
m_sQueueSample.m_nReleasingVolumeModificator = 10;
|
||||||
|
m_sQueueSample.m_fDistance = 100.0f;
|
||||||
|
}
|
||||||
|
if (sample == SOUND_BULLETTRACE_2) {
|
||||||
|
m_sQueueSample.m_nOffset = 107;
|
||||||
|
m_sQueueSample.m_nVolume = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i];
|
||||||
|
m_sQueueSample.m_nReleasingVolumeModificator = 10;
|
||||||
|
m_sQueueSample.m_fDistance = 100.0f;
|
||||||
|
}
|
||||||
m_sQueueSample.m_nOffset = 63;
|
m_sQueueSample.m_nOffset = 63;
|
||||||
|
}
|
||||||
m_sQueueSample.m_bReverbFlag = false;
|
m_sQueueSample.m_bReverbFlag = false;
|
||||||
m_sQueueSample.m_bRequireReflection = false;
|
m_sQueueSample.m_bRequireReflection = false;
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
if (stereo) {
|
if (stereo) {
|
||||||
++m_sQueueSample.m_nSampleIndex;
|
++m_sQueueSample.m_nSampleIndex;
|
||||||
m_sQueueSample.m_nCounter = iSound++;
|
m_sQueueSample.m_nCounter = iSound++;
|
||||||
m_sQueueSample.m_nOffset = MAX_VOLUME - m_sQueueSample.m_nOffset;
|
m_sQueueSample.m_nOffset = 127 - m_sQueueSample.m_nOffset;
|
||||||
|
AddSampleToRequestedQueue();
|
||||||
|
}
|
||||||
|
if (center) {
|
||||||
|
++m_sQueueSample.m_nSampleIndex;
|
||||||
|
m_sQueueSample.m_nCounter = iSound++;
|
||||||
|
m_sQueueSample.m_nOffset = 63;
|
||||||
|
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex);
|
||||||
AddSampleToRequestedQueue();
|
AddSampleToRequestedQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ public:
|
|||||||
void ProcessExplosions(int32 explosion); // done
|
void ProcessExplosions(int32 explosion); // done
|
||||||
void ProcessFireHydrant(); // done
|
void ProcessFireHydrant(); // done
|
||||||
void ProcessFires(int32 entity); //
|
void ProcessFires(int32 entity); //
|
||||||
void ProcessFrontEnd(); //
|
void ProcessFrontEnd(); // done
|
||||||
void ProcessGarages(); //
|
void ProcessGarages(); //
|
||||||
void ProcessCarHeli(cVehicleParams* params); // done
|
void ProcessCarHeli(cVehicleParams* params); // done
|
||||||
void ProcessVehicleFlatTyre(cVehicleParams* params); // done
|
void ProcessVehicleFlatTyre(cVehicleParams* params); // done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user