Skip to content
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

Remove uses of Autohook from audio.cpp #777

Merged
merged 11 commits into from
Aug 28, 2024

Conversation

ASpoonPlaysGames
Copy link
Contributor

@ASpoonPlaysGames ASpoonPlaysGames commented Aug 25, 2024

Trying to move towards manual hooks over macro hell, one file at a time.

Requires:

Code review:

  • The original function is prefixed with o_p so any times where the old AUTOHOOK was calling the original function it should now be calling that instead.
  • The hook function is prefixed with h_ so any times where we would be wanting to call the hooked function from other functions should now be calling that instead

Testing:

  • Check logs to make sure that all of the changed hooks are being created properly
  • Load an audio mod and see if it still works I guess?

@ASpoonPlaysGames ASpoonPlaysGames added needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code labels Aug 25, 2024
@GeckoEidechse
Copy link
Member

Part of #778

@GeckoEidechse GeckoEidechse changed the title Remove uses of Autohook from audio.cpp Remove uses of Autohook from audio.cpp Aug 25, 2024
Copy link
Member

@F1F7Y F1F7Y left a comment

Choose a reason for hiding this comment

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

Changes look ok, however this isnt going to work in testing as mileswin64.dll is imported by client.dll and we only run callbacks for LoadLibrary* calls. ( See this change in primedev: F1F7Y@368f660#diff-54ccaa9ecaf9f49dd1e7d51bfe382cb5025349aee6cd4a3003282314a99d19ad )

@F1F7Y
Copy link
Member

F1F7Y commented Aug 26, 2024

(Approved because this'll fail when testing, meh)

Copy link
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

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

As @F1F7Y predicted, this breaks in testing.

Tested with https://thunderstore.io/c/northstar/p/FUZE/Replace_Background_Music_for_The_Lobby_with_Helldivers2_OST/

Without the PR the lobby music was overridden, with the PR it no longer was.

@ASpoonPlaysGames
Copy link
Contributor Author

Now depends on #780

@github-actions github-actions bot added the merge conflicts Blocked by merge conflicts, waiting on the author to resolve label Aug 26, 2024
@github-actions github-actions bot removed the merge conflicts Blocked by merge conflicts, waiting on the author to resolve label Aug 26, 2024
@GeckoEidechse GeckoEidechse requested a review from F1F7Y August 27, 2024 21:35
Copy link
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

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

Confirmed working testing. My death sound audio override mod still worked.

@GeckoEidechse GeckoEidechse added almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge and removed needs testing Changes from the PR still need to be tested labels Aug 27, 2024
Copy link
Member

@F1F7Y F1F7Y left a comment

Choose a reason for hiding this comment

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

No changes to code, fix is already on main. LGTM

@F1F7Y F1F7Y merged commit 39c2ec9 into R2Northstar:main Aug 28, 2024
4 checks passed
@F1F7Y F1F7Y removed needs code review Changes from PR still need to be reviewed in code almost ready to merge Apart from any small remaining other issues addressed by other labels, this would be ready to merge labels Aug 28, 2024
@ASpoonPlaysGames ASpoonPlaysGames deleted the autohook/audio.cpp branch September 5, 2024 12:52
wolf109909 pushed a commit to R2NorthstarCN/NorthstarLauncher that referenced this pull request Sep 8, 2024
Removes AUTOHOOK macros from `audio.cpp` and replaces them with `HookAttach`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants