Skip to content

Commit

Permalink
Back-port software workarounds from Sodium 0.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
jellysquid3 committed Feb 21, 2025
1 parent 3a8ea43 commit 608a5d0
Show file tree
Hide file tree
Showing 50 changed files with 970 additions and 525 deletions.
16 changes: 14 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,20 @@ sourceSets {
val main = getByName("main")
val api = create("api")
val desktop = create("desktop")
val workarounds = create("workarounds")

api.apply {
java {
compileClasspath += main.compileClasspath
}
}

workarounds.apply {
java {
compileClasspath += main.compileClasspath
}
}

desktop.apply {
java {
srcDir("src/desktop/java")
Expand All @@ -58,7 +65,9 @@ sourceSets {
main.apply {
java {
compileClasspath += api.output
compileClasspath += workarounds.output
runtimeClasspath += api.output
runtimeClasspath += workarounds.output
}
}
}
Expand Down Expand Up @@ -89,8 +98,7 @@ tasks {
}

jar {
from("${rootProject.projectDir}/COPYING")
from("${rootProject.projectDir}/COPYING.LESSER")
from("${rootProject.projectDir}/LICENSE.md")

val api = sourceSets.getByName("api")
from(api.output.classesDirs)
Expand All @@ -100,6 +108,10 @@ tasks {
from(desktop.output.classesDirs)
from(desktop.output.resourcesDir)

val workarounds = sourceSets.getByName("workarounds")
from(workarounds.output.classesDirs)
from(workarounds.output.resourcesDir)

manifest.attributes["Main-Class"] = "net.caffeinemc.mods.sodium.desktop.LaunchWarn"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package me.jellysquid.mods.sodium.client;

import me.jellysquid.mods.sodium.client.compatibility.checks.PreLaunchChecks;
import me.jellysquid.mods.sodium.client.compatibility.workarounds.Workarounds;
import me.jellysquid.mods.sodium.client.compatibility.environment.probe.GraphicsAdapterProbe;
import net.caffeinemc.mods.sodium.client.compatibility.checks.PreLaunchChecks;
import net.caffeinemc.mods.sodium.client.compatibility.environment.probe.GraphicsAdapterProbe;
import net.caffeinemc.mods.sodium.client.compatibility.workarounds.Workarounds;
import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;

public class SodiumPreLaunch implements PreLaunchEntrypoint {
@Override
public void onPreLaunch() {
PreLaunchChecks.beforeLWJGLInit();
PreLaunchChecks.checkEnvironment();
GraphicsAdapterProbe.findAdapters();
PreLaunchChecks.onGameInit();
Workarounds.init();
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 608a5d0

Please sign in to comment.