diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/CMakeLists.txt b/GeneralsMD/Code/Libraries/Source/WWVegas/CMakeLists.txt index 327d1d139f8..780787b19b3 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/CMakeLists.txt +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/CMakeLists.txt @@ -26,6 +26,7 @@ target_include_directories(z_wwcommon INTERFACE wwshade ) +add_subdirectory(WWAudio) add_subdirectory(WWDebug) add_subdirectory(WWLib) add_subdirectory(WWMath) diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudioEvents.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudioEvents.h index 2cb849cb29d..c208e783549 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudioEvents.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudioEvents.h @@ -151,6 +151,7 @@ class AudioCallbackListClass : public SimpleDynVecClass< AUDIO_CALLBACK_STRUCT >::Vector; using SimpleDynVecClass< AUDIO_CALLBACK_STRUCT >::ActiveCount; using SimpleDynVecClass< AUDIO_CALLBACK_STRUCT >::Delete; + using SimpleDynVecClass< AUDIO_CALLBACK_STRUCT >::Add; public: diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/CMakeLists.txt b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/CMakeLists.txt new file mode 100644 index 00000000000..a216c6a5679 --- /dev/null +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/CMakeLists.txt @@ -0,0 +1,54 @@ +set(WWAUDIO_SRC + "AABTreeSoundCullClass.h" + "AudibleSound.cpp" + "AudibleSound.h" + "AudioEvents.h" + "AudioSaveLoad.cpp" + "AudioSaveLoad.h" + "FilteredSound.cpp" + "FilteredSound.h" + "Listener.cpp" + "Listener.h" + "listenerhandle.cpp" + "listenerhandle.h" + "LogicalListener.cpp" + "LogicalListener.h" + "LogicalSound.cpp" + "LogicalSound.h" + "PriorityVector.h" + "sound2dhandle.cpp" + "sound2dhandle.h" + "Sound3D.cpp" + "Sound3D.h" + "sound3dhandle.cpp" + "sound3dhandle.h" + "SoundBuffer.cpp" + "SoundBuffer.h" + "SoundChunkIDs.h" + "SoundCullObj.h" + "soundhandle.cpp" + "soundhandle.h" + "SoundPseudo3D.cpp" + "SoundPseudo3D.h" + "SoundScene.cpp" + "SoundScene.h" + "SoundSceneObj.cpp" + "SoundSceneObj.h" + "soundstreamhandle.cpp" + "soundstreamhandle.h" + "Threads.cpp" + "Threads.h" + "Utils.cpp" + "Utils.h" + "WWAudio.cpp" + "WWAudio.h" +) + +add_library(z_wwaudio STATIC) +set_target_properties(z_wwaudio PROPERTIES OUTPUT_NAME wwaudio) + +target_sources(z_wwaudio PRIVATE ${WWAUDIO_SRC}) + +target_link_libraries(z_wwaudio PRIVATE + z_wwcommon +) \ No newline at end of file diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/PriorityVector.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/PriorityVector.h index 392d8e84185..a09da0c9c24 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/PriorityVector.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/PriorityVector.h @@ -47,6 +47,9 @@ template class PriorityVectorClass : public DynamicVectorClass { + using DynamicVectorClass::Vector; + using DynamicVectorClass::ActiveCount; + public: virtual bool Process_Head (T &object); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.cpp index 784cc50db9a..32f602078f4 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.cpp @@ -278,7 +278,7 @@ SoundSceneClass::Collect_Audible_Sounds float length2 = (pos - listener_pos).Length2 (); if (length2 <= radius2) { - AudibleInfoClass *audible_info = W3DNEW AudibleInfoClass (sound_obj, length2); + AudibleInfoClass *audible_info = new AudibleInfoClass (sound_obj, length2); list.Add (audible_info); // @@ -310,7 +310,7 @@ SoundSceneClass::Collect_Audible_Sounds float length2 = (pos - listener_pos).Length2 (); if (length2 <= radius2) { - AudibleInfoClass *audible_info = W3DNEW AudibleInfoClass (sound_obj, length2); + AudibleInfoClass *audible_info = new AudibleInfoClass (sound_obj, length2); list.Add (audible_info); // diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.h index 5786b433148..03a7bb96127 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.h +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.h @@ -178,6 +178,7 @@ class SoundSceneClass ////////////////////////////////////////////////////////////////////// // Collection methods ////////////////////////////////////////////////////////////////////// + public: class AudibleInfoClass : public MultiListObjectClass, public AutoPoolClass { public: @@ -193,6 +194,7 @@ class SoundSceneClass float distance2; }; + protected: typedef MultiListClass COLLECTED_SOUNDS; virtual void Collect_Audible_Sounds (Listener3DClass *listener, COLLECTED_SOUNDS &list); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp index 423396bd773..117441acfff 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp @@ -1220,7 +1220,8 @@ WWAudioClass::Remove_From_Playlist (AudibleSoundClass *sound_obj) if (sound_obj != NULL) { // Loop through all the entries in the playlist - for (int index = 0; (index < m_Playlist.Count ()) && (retval == false); index ++) { + int index = 0; + for (; (index < m_Playlist.Count ()) && (retval == false); index ++) { // Is this the entry we are looking for? if (sound_obj == m_Playlist[index]) {