Check / compile (pull_request) Successful in 16m19s
Adds 26.3 as a Stonecutter version, the last step of #39. Input: 26.3 replaces GLFW with SDL, which numbers keys (scancodes), modifiers and mouse buttons differently. Saturn keeps GLFW's numbers, which common uses and the config's keybinds store, so saved keybinds stay valid. The new Keys class converts at the boundary: key events, modifiers and mouse buttons coming into Saturn's screens, and key codes going to InputConstants. Its table pairs GLFW's codes with 26.3's InputConstants of the same name. Key names come from the game on 26.3, and version-specific code uses InputConstants' key constants rather than GLFW's. Rendering: Blaze3D's API moved to renderpearl, which Stonecutter replacements cover. PoseStack's quaternion mulPose became rotate, and TextureTarget takes a depth format instead of a flag. 26.3 compiles shaders through SPIR-V and reorders the transforms block, so glass.fsh takes explicit locations and the new order behind defines that GlassRenderer sets, and the unlit cosmetics pipeline declares its color target, which 26.3 requires. OptionsScreen no longer takes whether a world is open. Co-Authored-By: Claude Opus 5.5 <[email protected]>
37 lines
1.3 KiB
Java
37 lines
1.3 KiB
Java
package org.saturnclient.impl.provider;
|
|
|
|
// 26.3 uses SDL, not GLFW; Keys converts Saturn's GLFW key codes to its own.
|
|
//? if >=26.3 {
|
|
/*import com.mojang.blaze3d.platform.InputConstants;
|
|
*///?} else
|
|
import org.lwjgl.glfw.GLFW;
|
|
import org.saturnclient.common.provider.GLFWProvider;
|
|
import org.saturnclient.impl.ui.Screens;
|
|
import org.saturnclient.saturnclient.SaturnClient;
|
|
|
|
public class GLFWProviderImpl implements GLFWProvider {
|
|
@Override
|
|
public boolean isKeyPressed(int key) {
|
|
//? if >=26.3 {
|
|
/*int gameKey = Keys.toGame(key);
|
|
return gameKey >= 0 && InputConstants.isKeyDown(gameKey) && Screens.current() == null;
|
|
*///?} else {
|
|
//? if >=1.21.9 {
|
|
long window = SaturnClient.client.getWindow().handle();
|
|
//?} else
|
|
//long window = SaturnClient.client.getWindow().getWindow();
|
|
return GLFW.glfwGetKey(window, key) == GLFW.GLFW_PRESS
|
|
&& Screens.current() == null;
|
|
//?}
|
|
}
|
|
|
|
@Override
|
|
public String getKeyName(int key) {
|
|
//? if >=26.3 {
|
|
/*int gameKey = Keys.toGame(key);
|
|
return gameKey < 0 ? null : InputConstants.Type.KEYBOARD.getOrCreate(gameKey).getDisplayName().getString();
|
|
*///?} else
|
|
return GLFW.glfwGetKeyName(key, GLFW.glfwGetKeyScancode(key));
|
|
}
|
|
}
|