-
Notifications
You must be signed in to change notification settings - Fork 63
[GEN][ZH] Synchronize GameAudio and MilesAudio implementations between Generals and ZH #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f32af8c
to
eca7e23
Compare
// union | ||
// { | ||
HSAMPLE m_sample; | ||
H3DSAMPLE m_3DSample; | ||
HSTREAM m_stream; | ||
}; | ||
// }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the generals way of handling this might have been better on memory.
Playing audio will only ever be a single type which gets set on m_type
so im not sure where they were going with doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree and suggest removing the commenting out in ZH rather than back porting it to Gen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it looks like it should be a union. The difference is that in Zero Hour these are 0 initialized. But in Generals they are probably also zero initialized because of the Game Memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will revert the zero hour way of doing it and Null initialise one of the members in both.
That should make sure the memory is initialised then.
virtual void stopAllAmbientsBy( Object *objID ); | ||
virtual void stopAllAmbientsBy( Drawable *drawID ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the functionality for these is empty at the moment, it appears that the idea was to use them to stop ambient audio in specific circumstances.
Ambient audio seems to be constantly playing sound effects that occur in the background. These have some code within generals that would have paused them when the in game menu loaded.
The other situation could be that they get paused when out of range etc. But i think audio culling is handled elsewhere.
And since Generals has code that calls these, it's probably better to port them forward to zero hour during the synchronisation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this was just legacy code that was meant to be removed? There are these 2 functions:
Drawable::startAmbientSound
Drawable::stopAmbientSound
I suspect these are all we need to start and stop ambient audio on drawables?
Generals
In Generals there are these 2 calls to stopAllAmbientsBy:
void GameLogic::setGamePaused( Bool paused, Bool pauseMusic )
...
if(paused)
{
...
}
else
{
...
while( drawable )
{
drawable->startAmbientSound();
TheAudio->stopAllAmbientsBy( drawable );
drawable = drawable->getNextDrawable(); // <--- This call makes no sense
}
}
...
void FXListDie::onDie( const DamageInfo *damageInfo )
{
...
if (d->m_defaultDeathFX)
{
// if the object has any ambient sound(s), kill 'em now.
TheAudio->stopAllAmbientsBy(getObject());
if (d->m_orientToObject)
{
...
Zero Hour
void FXListDie::onDie( const DamageInfo *damageInfo )
{
...
if (d->m_defaultDeathFX)
{
if (d->m_orientToObject)
{
...
}
I suggest to remove these virtual functions from Generals because they have no use in both titles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, if we don't think they are useful In the end I will remove them from both variants.
Will then make a followup PR to correct any code that used them.
Will also check the situation with the FXList variant wanting to kill ambient sounds on an object, I don't think Generals or zero hour puts ambient sounds on objects and only puts them on drawables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looks like only drawables have ambient sounds on them.
So the object version of the function would have needed to check if the object had a drawable, then it would have to disable the sound on the drawable if it had one.
Removed the instances of these functions in GameAudio and MilesAudioManager.
eca7e23
to
1e5bfa4
Compare
Updated and addressed the discussed points above, will push a small followup PR to remove the stragling bits of code associated with the removed interface functions from GameAudio. |
fa2370f
to
bf0a507
Compare
Had to make a small push again to include the removal of calls to There are so few instances where these functions are called that it might as well be a part of this PR. |
Is this change meant to be merged with rebase or not? Commit number 3 of this change appears to error:
|
The build of this PR should be fixed with the last commit i made to add removing those calls to since MilesAudioManager inherits from GameAudio, those two commits are kind of interdependent, so i thought it would be better to squash and merge this. But merging by rebase should be okay, i tweaked the PR description above to cover this. |
If commit number 3 fails to compile on its own, then it cannot be merged with rebase. |
…nd FXListDie (#782)
bf0a507
to
0dbc5dc
Compare
Reordered the commits to break the problematic dependency. |
merge by rebase - MilesAudioManager inherits from GameAudio so is dependent if MilesAudioManager ever needs reverting.
This PR makes the changes required to synchronize the audio implementations between Generals and Zero hour.
Most changes are backports to Generals, while some small tweaks are made to zero hour to match generals.
This PR also removes some instances where the empty stopAllAmbientBy functions were being called in gamelogic and fxListDie.