Skip to content

Commit c35b057

Browse files
authored
[ZH] Remove WW3D2 dependency from WWAudio (#689)
1 parent 34107c5 commit c35b057

File tree

13 files changed

+15
-25
lines changed

13 files changed

+15
-25
lines changed

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudibleSound.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
#include "AudibleSound.h"
3939
#include "WWAudio.h"
40-
#include "ww3d.h"
4140
#include "wwdebug.h"
4241
#include "SoundBuffer.h"
4342
#include "Utils.h"

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/AudibleSound.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class AudibleSoundClass : public SoundSceneObjClass
153153
//////////////////////////////////////////////////////////////////////
154154
// Update methods
155155
//////////////////////////////////////////////////////////////////////
156-
virtual bool On_Frame_Update (unsigned int milliseconds = 0);
156+
virtual bool On_Frame_Update (unsigned int milliseconds);
157157

158158
//////////////////////////////////////////////////////////////////////
159159
// State control methods

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/LogicalSound.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class LogicalSoundClass : public SoundSceneObjClass
8787
//////////////////////////////////////////////////////////////////////
8888
// Update methods
8989
//////////////////////////////////////////////////////////////////////
90-
virtual bool On_Frame_Update (unsigned int milliseconds = 0);
90+
virtual bool On_Frame_Update (unsigned int milliseconds);
9191

9292
//////////////////////////////////////////////////////////////////////
9393
// Position/direction methods

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/Sound3D.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Sound3DClass::On_Frame_Update (unsigned int milliseconds)
220220
m_PrevTransform = m_Transform;
221221

222222
// Allow the base class to process this call
223-
return AudibleSoundClass::On_Frame_Update ();
223+
return AudibleSoundClass::On_Frame_Update (milliseconds);
224224
}
225225

226226

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/Sound3D.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Sound3DClass : public AudibleSoundClass
172172
//////////////////////////////////////////////////////////////////////
173173
// Update methods
174174
//////////////////////////////////////////////////////////////////////
175-
virtual bool On_Frame_Update (unsigned int milliseconds = 0);
175+
virtual bool On_Frame_Update (unsigned int milliseconds);
176176

177177
//////////////////////////////////////////////////////////////////////
178178
// Handle information

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundPseudo3D.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ SoundPseudo3DClass::On_Frame_Update (unsigned int milliseconds)
278278
}
279279

280280
// Allow the base Sound3DClass to process this call
281-
return Sound3DClass::On_Frame_Update ();
281+
return Sound3DClass::On_Frame_Update (milliseconds);
282282
}
283283

284284

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundPseudo3D.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class SoundPseudo3DClass : public Sound3DClass
140140
//////////////////////////////////////////////////////////////////////
141141
// Update methods
142142
//////////////////////////////////////////////////////////////////////
143-
virtual bool On_Frame_Update (unsigned int milliseconds = 0);
143+
virtual bool On_Frame_Update (unsigned int milliseconds);
144144

145145
//////////////////////////////////////////////////////////////////////
146146
// Handle information

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ SoundSceneClass::Re_Partition
136136
//
137137
////////////////////////////////////////////////////////////////////////////////////////////////
138138
void
139-
SoundSceneClass::Collect_Logical_Sounds (int listener_count)
139+
SoundSceneClass::Collect_Logical_Sounds (unsigned int milliseconds, int listener_count)
140140
{
141141
WWPROFILE ("Collect_Logical_Sounds");
142142

@@ -164,7 +164,7 @@ SoundSceneClass::Collect_Logical_Sounds (int listener_count)
164164
{
165165
LogicalListenerClass::Set_Oldest_Timestamp (listener->Get_Timestamp ());
166166
listener->Set_Timestamp (LogicalListenerClass::Get_New_Timestamp ());
167-
listener->On_Frame_Update ();
167+
listener->On_Frame_Update (milliseconds);
168168

169169
//
170170
// Collect a list of the sounds this listener can hear.

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundScene.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class SoundSceneClass
101101
//////////////////////////////////////////////////////////////////////
102102
// Logical sound methods
103103
//////////////////////////////////////////////////////////////////////
104-
virtual void Collect_Logical_Sounds (int listener_count = -1);
104+
virtual void Collect_Logical_Sounds (unsigned int milliseconds, int listener_count = -1);
105105

106106
//////////////////////////////////////////////////////////////////////
107107
// Listener methods
@@ -166,7 +166,7 @@ class SoundSceneClass
166166
//////////////////////////////////////////////////////////////////////
167167
// Protected methods
168168
//////////////////////////////////////////////////////////////////////
169-
virtual void On_Frame_Update (unsigned int milliseconds = 0);
169+
virtual void On_Frame_Update (unsigned int milliseconds);
170170
virtual void Initialize (void);
171171

172172
virtual bool Is_Logical_Sound_In_Scene (LogicalSoundClass *sound_obj, bool single_shot = false);

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/SoundSceneObj.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class SoundSceneObjClass : public MultiListObjectClass, public PersistClass, pub
123123
//////////////////////////////////////////////////////////////////////
124124
// Update methods
125125
//////////////////////////////////////////////////////////////////////
126-
virtual bool On_Frame_Update (unsigned int milliseconds = 0);
126+
virtual bool On_Frame_Update (unsigned int milliseconds);
127127

128128
//////////////////////////////////////////////////////////////////////
129129
// Event handling

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include "AudibleSound.h"
4646
#include "Sound3D.h"
4747
#include "RAWFILE.H"
48-
#include "ww3d.h"
4948
#include "SoundScene.h"
5049
#include "SoundPseudo3D.h"
5150
#include "ffactory.h"
@@ -1323,17 +1322,9 @@ WWAudioClass::On_Frame_Update (unsigned int milliseconds)
13231322
//
13241323
Free_Completed_Sounds ();
13251324

1326-
//
1327-
// Calculate the time in ms since the last frame
1328-
//
1329-
unsigned int time_delta = milliseconds;
1330-
if (time_delta == 0) {
1331-
time_delta = WW3D::Get_Frame_Time ();
1332-
}
1333-
13341325
if (m_SoundScene != NULL) {
13351326
m_SoundScene->On_Frame_Update (milliseconds);
1336-
m_SoundScene->Collect_Logical_Sounds ();
1327+
m_SoundScene->Collect_Logical_Sounds (milliseconds);
13371328
}
13381329

13391330
//
@@ -1345,7 +1336,7 @@ WWAudioClass::On_Frame_Update (unsigned int milliseconds)
13451336
// Update this sound object
13461337
//
13471338
AudibleSoundClass *sound_obj = m_Playlist[index];
1348-
sound_obj->On_Frame_Update (time_delta);
1339+
sound_obj->On_Frame_Update (milliseconds);
13491340
}
13501341

13511342
return;

GeneralsMD/Code/Libraries/Source/WWVegas/WWAudio/WWAudio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class WWAudioClass
280280
//////////////////////////////////////////////////////////////////////
281281
// Update methods
282282
//////////////////////////////////////////////////////////////////////
283-
void On_Frame_Update (unsigned int milliseconds = 0);
283+
void On_Frame_Update (unsigned int milliseconds);
284284

285285
//////////////////////////////////////////////////////////////////////
286286
// Callback methods

GeneralsMD/Code/Tools/W3DView/GraphicView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ CGraphicView::RepaintView
546546
//
547547
// Let the audio class think
548548
//
549-
WWAudioClass::Get_Instance ()->On_Frame_Update ();
549+
WWAudioClass::Get_Instance ()->On_Frame_Update (WW3D::Get_Frame_Time());
550550

551551
//
552552
// Update the count of particles and polys in the status bar

0 commit comments

Comments
 (0)