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

Fix SoundManager handling when no sound devices exist #173

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

kstvr32
Copy link
Contributor

@kstvr32 kstvr32 commented Sep 13, 2024

Supersedes GTNewHorizons/Hodgepodge#420 as a fix for the SoundManager NPE crashes

Fixes GTNewHorizons/GT-New-Horizons-Modpack#17190
Fixes GTNewHorizons/GT-New-Horizons-Modpack#17190
Fixes GTNewHorizons/GT-New-Horizons-Modpack#16281
Fixes GTNewHorizons/GT-New-Horizons-Modpack#12848
Fixes GTNewHorizons/Hodgepodge#406

Adds null check that is present in LWJGL2 when initializing OpenAL sound.

@@ -64,6 +64,10 @@ public static void create(String deviceArguments, int contextFrequency, int cont

long deviceHandle = org.lwjgl.openal.ALC10.alcOpenDevice(defaultDevice);

if (deviceHandle == 0) {
throw new org.lwjgl.LWJGLException("Could not open ALC device");
Copy link
Member

@eigenraven eigenraven Sep 13, 2024

Choose a reason for hiding this comment

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

The mappings should only throw the lwjglx exceptions, not lwjgl - change this here and remove the double throws clauses above. The class references are remapped from x to no x in an asm transformer later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to lwgjlx variant. I think we still need the throws above because the create calls are chained.

@kstvr32 kstvr32 force-pushed the dev/kstvr/sound-crash-fix branch from ead5107 to e045927 Compare September 13, 2024 17:23
@eigenraven eigenraven enabled auto-merge (squash) September 13, 2024 17:25
@eigenraven eigenraven merged commit 9c10c03 into GTNewHorizons:master Sep 13, 2024
1 check passed
@Edgars-Cirulis
Copy link

Does that commit resumes the sound?

@kstvr32
Copy link
Contributor Author

kstvr32 commented Sep 13, 2024

This changes back to standard 1.7.10 behavior of turning to silent mode.

You can manually reload the sound by pressing F3 + T

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants