aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/launch/ExtractNatives.cpp
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-07-17 10:57:41 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2023-08-15 10:50:38 +0200
commitff67fd10c33fa99423b5a43dcbd30494b4c40dc5 (patch)
tree067fc32fabe8249bdd40cd4a79de5dbcaaaa27d6 /launcher/minecraft/launch/ExtractNatives.cpp
parent7ba1e7d3569fcb04cb49d16247703bf2862172ba (diff)
downloadPrismLauncher-ff67fd10c33fa99423b5a43dcbd30494b4c40dc5.tar.gz
PrismLauncher-ff67fd10c33fa99423b5a43dcbd30494b4c40dc5.tar.bz2
PrismLauncher-ff67fd10c33fa99423b5a43dcbd30494b4c40dc5.zip
feat: implement override for GLFW/OpenAL with split natives
Fixes PrismLauncher/PrismLauncher#513 Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/minecraft/launch/ExtractNatives.cpp')
-rw-r--r--launcher/minecraft/launch/ExtractNatives.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/launcher/minecraft/launch/ExtractNatives.cpp b/launcher/minecraft/launch/ExtractNatives.cpp
index cebeaedd..1aa4dccc 100644
--- a/launcher/minecraft/launch/ExtractNatives.cpp
+++ b/launcher/minecraft/launch/ExtractNatives.cpp
@@ -39,7 +39,7 @@ static QString replaceSuffix(QString target, const QString& suffix, const QStrin
return target + replacement;
}
-static bool unzipNatives(QString source, QString targetFolder, bool applyJnilibHack, bool nativeOpenAL, bool nativeGLFW)
+static bool unzipNatives(QString source, QString targetFolder, bool applyJnilibHack, bool nativeOpenAL)
{
QuaZip zip(source);
if (!zip.open(QuaZip::mdUnzip)) {
@@ -52,9 +52,6 @@ static bool unzipNatives(QString source, QString targetFolder, bool applyJnilibH
do {
QString name = zip.getCurrentFileName();
auto lowercase = name.toLower();
- if (nativeGLFW && name.contains("glfw")) {
- continue;
- }
if (nativeOpenAL && name.contains("openal")) {
continue;
}
@@ -83,14 +80,15 @@ void ExtractNatives::executeTask()
return;
}
auto settings = minecraftInstance->settings();
+
+ // We only need OpenAL here, as modern versions of LWJGL (3+) are handled by JVM args, while older versions (2) didn't have GLFW
bool nativeOpenAL = settings->get("UseNativeOpenAL").toBool();
- bool nativeGLFW = settings->get("UseNativeGLFW").toBool();
auto outputPath = minecraftInstance->getNativePath();
auto javaVersion = minecraftInstance->getJavaVersion();
bool jniHackEnabled = javaVersion.major() >= 8;
for (const auto& source : toExtract) {
- if (!unzipNatives(source, outputPath, jniHackEnabled, nativeOpenAL, nativeGLFW)) {
+ if (!unzipNatives(source, outputPath, jniHackEnabled, nativeOpenAL)) {
const char* reason = QT_TR_NOOP("Couldn't extract native jar '%1' to destination '%2'");
emit logLine(QString(reason).arg(source, outputPath), MessageLevel::Fatal);
emitFailed(tr(reason).arg(source, outputPath));