Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(milesaudio): stop ducking the battle under unit replies
Olcay Seygan1a256318a2e9
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex feebead71..e4f80116d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1211,7 +1211,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same- Audio is real, through the audio library the retail game ships with.- A death cry plays to the end. So does "construction complete", and the tail of a gun. Telling a sound to stop used to cut it off that frame, where the 2003 game let it finish and only kept it from repeating; our own fix for the audio thread broke that, and it is put back. A looping sound caught in the pause between two plays can be stopped too, instead of carrying on after whatever made it is gone.-- Your units answer you over the battle. A reply plays at whichever of the effects and voice sliders is higher, lifted again on top of that, and while it plays every other sound and the music drop to under a third, then come back when the line is finished. "Moving out" is heard in the middle of an artillery duel. EVA and briefings stay where the voice slider puts them.+- Your units answer you over the battle. A reply plays at whichever of the effects and voice sliders is higher, lifted again on top of that, so "Moving out" is heard in the middle of an artillery duel. Nothing else is turned down to make room for it. EVA and briefings stay where the voice slider puts them.- Movies follow the voice volume slider. The volume was handed to the video before it was ready to take it, so every movie played at full level, and moving the slider while one was playing changed nothing.- A sound at the edge of its range can fade out instead of stopping dead. The volume curve neveractually reaches zero, so a sound you are walking away from was cut off mid-note at the maximumdiff --git a/GeneralsMD/Code/GameEngineDevice/Include/MilesAudioDevice/MilesAudioManager.h b/GeneralsMD/Code/GameEngineDevice/Include/MilesAudioDevice/MilesAudioManager.hindex 28d7e1892..2144e7e77 100644--- a/GeneralsMD/Code/GameEngineDevice/Include/MilesAudioDevice/MilesAudioManager.h+++ b/GeneralsMD/Code/GameEngineDevice/Include/MilesAudioDevice/MilesAudioManager.h@@ -292,8 +292,7 @@ class MilesAudioManager : public AudioManagerH3DSAMPLE getFirst3DSample( AudioEventRTS *event );void adjustPlayingVolume( PlayingAudio *audio );- Bool isAnyVoicePlaying( void ) const;- Real getVoiceMixedVolume( const AudioEventRTS *event, Real sliderVolume ) const; ///< a unit's reply lifted, everything else held under it while one plays+ Real getVoiceMixedVolume( const AudioEventRTS *event, Real sliderVolume ) const; ///< a unit's reply lifted over the sliders, everything else as the sliders sayvoid stopAllSpeech( void );@@ -314,7 +313,6 @@ class MilesAudioManager : public AudioManagerHDIGDRIVER m_digitalHandle;H3DPOBJECT m_listener;HPROVIDER m_delayFilter;- Bool m_voiceDucking; ///< a unit's reply is playing and every other sound is held under it// This is a list of all handles that are forcibly played. They always play as UI sounds.std::list<HAUDIO> m_audioForcePlayed;diff --git a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cppindex ed1ca9ea1..3aad6fa7f 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp@@ -110,7 +110,6 @@ MilesAudioManager::MilesAudioManager() :m_num3DSamples(0),m_numStreams(0),m_delayFilter(NULL),- m_voiceDucking(FALSE),m_binkHandle(NULL),m_pref3DProvider(AsciiString::TheEmptyString),m_prefSpeaker(AsciiString::TheEmptyString)@@ -2160,44 +2159,19 @@ Bool MilesAudioManager::isObjectPlayingVoice( UnsignedInt objID ) constreturn false;}-//--------------------------------------------------------------------------------------------------Bool MilesAudioManager::isAnyVoicePlaying( void ) const-{- std::list<PlayingAudio *>::const_iterator it;- for ( it = m_playingSounds.begin(); it != m_playingSounds.end(); ++it ) {- if ((*it)->isPlaying() && (*it)->m_audioEventRTS->getAudioEventInfo()->m_type & ST_VOICE) {- return true;- }- }-- for ( it = m_playing3DSounds.begin(); it != m_playing3DSounds.end(); ++it ) {- if ((*it)->isPlaying() && (*it)->m_audioEventRTS->getAudioEventInfo()->m_type & ST_VOICE) {- return true;- }- }-- return false;-}-//-------------------------------------------------------------------------------------------------/** A unit's reply is one short line, and in a fight it was lost under the guns. It plays at the- * louder of the effects and voice sliders, lifted again on top of that up to full scale, and while- * one is playing every other sound and the music drop to under a third, so the reply sits in front- * of everything. EVA and briefing speech is left where the voice slider puts it. */+ * louder of the effects and voice sliders, lifted again on top of that up to full scale. Nothing+ * else is turned down for it. EVA and briefing speech is left where the voice slider puts it. */Real MilesAudioManager::getVoiceMixedVolume( const AudioEventRTS *event, Real sliderVolume ) const{static const Real VOICE_BOOST = 1.6f;- static const Real VOICE_DUCK_FACTOR = 0.3f;const Real eventVolume = event->getVolume() * event->getVolumeShift();if (event->getAudioEventInfo()->m_type & ST_VOICE) {return min( 1.0f, eventVolume * max( sliderVolume, m_speechVolume ) * VOICE_BOOST );}- if (m_voiceDucking) {- return eventVolume * sliderVolume * VOICE_DUCK_FACTOR;- }-return eventVolume * sliderVolume;}@@ -2478,13 +2452,6 @@ void MilesAudioManager::processPlayingList( void )std::list<PlayingAudio *>::iterator it;PlayingAudio *playing;- // a reply starting or ending re-levels everything already playing- const Bool voicePlaying = isAnyVoicePlaying();- if (voicePlaying != m_voiceDucking) {- m_voiceDucking = voicePlaying;- m_volumeHasChanged = true;- }-for (it = m_playingSounds.begin(); it != m_playingSounds.end(); ++it) {playing = (*it);if (!playing)