Skip to content

[GEN][ZH] Unify code of GameAudio and MilesAudioManager #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

Merged
merged 3 commits into from
May 1, 2025

Conversation

Mauller
Copy link

@Mauller Mauller commented Apr 29, 2025

Squash and merge

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.

@Mauller Mauller added Gen Relates to Generals ZH Relates to Zero Hour Refactor Edits the code with insignificant behavior changes, is never user facing Unify Unifies code between Generals and Zero Hour labels Apr 29, 2025
@Mauller Mauller changed the title [GEN][ZH] Synchronise SystemAudio and MilesAudio implementations between Generals and ZH [GEN][ZH] Synchronise GameAudio and MilesAudio implementations between Generals and ZH Apr 29, 2025
@Mauller Mauller force-pushed the port-miles-and-sys-audio branch 2 times, most recently from f32af8c to eca7e23 Compare April 29, 2025 19:53
@Mauller Mauller changed the title [GEN][ZH] Synchronise GameAudio and MilesAudio implementations between Generals and ZH [GEN][ZH] Synchronize GameAudio and MilesAudio implementations between Generals and ZH Apr 29, 2025
@Mauller Mauller self-assigned this Apr 30, 2025
@Mauller Mauller force-pushed the port-miles-and-sys-audio branch from eca7e23 to 1e5bfa4 Compare April 30, 2025 19:55
@Mauller
Copy link
Author

Mauller commented Apr 30, 2025

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.

@Mauller Mauller force-pushed the port-miles-and-sys-audio branch from fa2370f to bf0a507 Compare April 30, 2025 20:05
@Mauller
Copy link
Author

Mauller commented Apr 30, 2025

Had to make a small push again to include the removal of calls to stopAllAmbientSoundsBy() since the build pipeline would fail otherwise for the generals build.

There are so few instances where these functions are called that it might as well be a part of this PR.

@xezon
Copy link

xezon commented Apr 30, 2025

Is this change meant to be merged with rebase or not?

Commit number 3 of this change appears to error:

Error: D:\a\GeneralsGameCode\GeneralsGameCode\Generals\Code\GameEngine\Source\GameLogic\Object\Die\FXListDie.cpp(69) : error C2039: 'stopAllAmbientsBy' : is not a member of 'AudioManager'

@Mauller
Copy link
Author

Mauller commented Apr 30, 2025

Is this change meant to be merged with rebase or not?

Commit number 3 of this change appears to error:

Error: D:\a\GeneralsGameCode\GeneralsGameCode\Generals\Code\GameEngine\Source\GameLogic\Object\Die\FXListDie.cpp(69) : error C2039: 'stopAllAmbientsBy' : is not a member of 'AudioManager'

The build of this PR should be fixed with the last commit i made to add removing those calls to stopAllAmbientsBy

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.

@xezon
Copy link

xezon commented Apr 30, 2025

If commit number 3 fails to compile on its own, then it cannot be merged with rebase.

@Mauller Mauller force-pushed the port-miles-and-sys-audio branch from bf0a507 to 0dbc5dc Compare April 30, 2025 22:10
@Mauller
Copy link
Author

Mauller commented Apr 30, 2025

If commit number 3 fails to compile on its own, then it cannot be merged with rebase.

Reordered the commits to break the problematic dependency.

Copy link

@sorcerer86pt sorcerer86pt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -152,10 +152,6 @@ class AudioManager : public SubsystemInterface
virtual void resumeAudio( AudioAffect which ) = 0;
virtual void pauseAmbient( Bool shouldPause ) = 0;

// device dependent stops.
virtual void stopAllAmbientsBy( Object* obj ) = 0;
virtual void stopAllAmbientsBy( Drawable* draw ) = 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are now 3 commits that remove pieces of stopAllAmbientsBy in different places. How about put the removal for stopAllAmbientsBy in one commit? I suggest create one new pull request where this stopAllAmbientsBy stuff is removed first, then we see next steps.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seperated that out and into #793

@Mauller Mauller force-pushed the port-miles-and-sys-audio branch from 0dbc5dc to 5164284 Compare May 1, 2025 16:28
@Mauller
Copy link
Author

Mauller commented May 1, 2025

This will may at the moment till #793 is merged before it.

@xezon
Copy link

xezon commented May 1, 2025

Can we merge this with Squash?

@Mauller
Copy link
Author

Mauller commented May 1, 2025

Can we merge this with Squash?

Yeah should be fine, can encapsulate the changes in one.

@xezon xezon changed the title [GEN][ZH] Synchronize GameAudio and MilesAudio implementations between Generals and ZH [GEN][ZH] Unify code of GameAudio and MilesAudioManager May 1, 2025
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Adjusted the title of this change.

@Mauller Mauller force-pushed the port-miles-and-sys-audio branch from 5164284 to f027046 Compare May 1, 2025 18:01
@Mauller
Copy link
Author

Mauller commented May 1, 2025

Rebased with main so good to go.

@xezon xezon merged commit d2e5d60 into TheSuperHackers:main May 1, 2025
18 checks passed
@xezon xezon deleted the port-miles-and-sys-audio branch May 1, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gen Relates to Generals Refactor Edits the code with insignificant behavior changes, is never user facing Unify Unifies code between Generals and Zero Hour ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants