Skip to content

Commit

Permalink
feat: upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceh121 committed Aug 7, 2024
1 parent 07679d1 commit daf1240
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,11 @@ allprojects {
version = '1.0'
ext {
appName = "wanderer"
gdxVersion = '1.11.0'
roboVMVersion = '2.3.12'
box2DLightsVersion = '1.5'
ashleyVersion = '1.7.3'
gdxVersion = '1.12.1'
aiVersion = '1.8.2'
gdxControllersVersion = '2.1.0'
jlineVersion = '3.21.0'
log4jVersion = '2.20.0'
gdxControllersVersion = '2.2.3'
jlineVersion = '3.26.3'
log4jVersion = '2.23.1'
}

repositories {
Expand Down
2 changes: 0 additions & 2 deletions core/src/me/vinceh121/wanderer/MainMenu.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package me.vinceh121.wanderer;

import static me.vinceh121.wanderer.i18n.I18N.gettext;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
Expand Down
24 changes: 22 additions & 2 deletions desktop/src/me/vinceh121/wanderer/desktop/audio/OpenAL3DAudio.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.vinceh121.wanderer.desktop.audio;

import static org.lwjgl.openal.AL10.*;
import static org.lwjgl.openal.ALC10.*;
import static org.lwjgl.openal.AL10.AL_PLAYING;
import static org.lwjgl.openal.AL10.AL_STOPPED;

import java.io.IOException;
import java.io.InputStream;
Expand All @@ -10,6 +10,7 @@
import java.nio.IntBuffer;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

Expand All @@ -18,6 +19,9 @@
import org.lwjgl.openal.ALC;
import org.lwjgl.openal.ALC10;
import org.lwjgl.openal.ALCCapabilities;
import org.lwjgl.openal.ALUtil;
import org.lwjgl.openal.EnumerateAllExt;
import org.lwjgl.openal.SOFTReopenDevice;

import com.badlogic.gdx.audio.AudioDevice;
import com.badlogic.gdx.audio.AudioRecorder;
Expand Down Expand Up @@ -254,6 +258,22 @@ public static String sourceStateToString(final int srcState) {
}
}

@Override
public boolean switchOutputDevice(String deviceIdentifier) {
return SOFTReopenDevice.alcReopenDeviceSOFT(this.device, deviceIdentifier, (IntBuffer) null);
}

@Override
public String[] getAvailableOutputDevices() {
final List<String> devices = ALUtil.getStringList(0, EnumerateAllExt.ALC_ALL_DEVICES_SPECIFIER);

if (devices == null) {
return new String[0];
}

return devices.toArray(l -> new String[l]);
}

static {
OpenAL3DAudio.AUDIO_LOADERS.put("ogg", new OggLoader());
OpenAL3DAudio.AUDIO_LOADERS.put("wav", new WavLoader());
Expand Down

0 comments on commit daf1240

Please sign in to comment.