Weiter am Menü und an der Vollbildproblematik gearbeitet

This commit is contained in:
2026-07-12 22:27:22 +02:00
parent f109241e1f
commit 6cf8f52faf
41 changed files with 1848 additions and 748 deletions

View File

@@ -7330,6 +7330,11 @@ public class EditorApp extends Application {
private void startGameProcess() {
final boolean isNewGame = pendingNewGame;
pendingNewGame = false;
// Editor minimieren, damit das GLFW-Vollbild-Fenster keinen Focus-Konkurrenten hat.
// GLFW_AUTO_ICONIFY würde das Vollbild-Fenster sonst sofort minimieren, weil der
// Editor beim Starten noch den Fokus hat. Der JVM-Start des Spiels dauert mehrere
// Sekunden das Fenster ist längst minimiert, bevor GLFW das Fenster anlegt.
Platform.runLater(() -> { if (primaryStage != null) primaryStage.setIconified(true); });
new Thread(() -> {
try {
String javaExe = Paths.get(System.getProperty("java.home"), "bin", "java").toString();
@@ -7387,9 +7392,10 @@ public class EditorApp extends Application {
consoleBuffer.offer(line);
}
}
// Spiel beendet → Buttons freigeben
// Spiel beendet → Buttons freigeben und Editor wiederherstellen
consoleBuffer.offer("--- Spiel beendet ---");
Platform.runLater(() -> {
if (primaryStage != null) primaryStage.setIconified(false);
if (gamePlayBtn != null) { gamePlayBtn.setText("▶ Spielen"); gamePlayBtn.setDisable(false); }
if (gameNewBtn != null) { gameNewBtn.setText("🆕 Neues Spiel"); gameNewBtn.setDisable(false); }
});
@@ -8863,7 +8869,7 @@ public class EditorApp extends Application {
Spinner<Double> spRX = new Spinner<>(-360.0, 360.0, initRX, 1.0);
Spinner<Double> spRY = new Spinner<>(-360.0, 360.0, initRY, 1.0);
Spinner<Double> spRZ = new Spinner<>(-360.0, 360.0, initRZ, 1.0);
for (Spinner<Double> sp : new Spinner[]{spTX, spTY, spTZ, spRX, spRY, spRZ}) {
for (Spinner<Double> sp : java.util.List.of(spTX, spTY, spTZ, spRX, spRY, spRZ)) {
sp.setEditable(true);
sp.setMaxWidth(Double.MAX_VALUE);
}

View File

@@ -262,6 +262,7 @@ public class JmeEditorApp extends SimpleApplication {
// ── Framebuffer-Verwaltung ────────────────────────────────────────────────
@SuppressWarnings("deprecation")
private void buildFrameBuffer(int w, int h, WritableImage image) {
Texture2D colorTex = new Texture2D(w, h, Image.Format.RGBA8);
FrameBuffer fb = new FrameBuffer(w, h, 1);

View File

@@ -37,6 +37,7 @@ public class LegacyAssetRedirectLocator implements AssetLocator {
}
@Override
@SuppressWarnings("rawtypes")
public AssetInfo locate(AssetManager manager, AssetKey key) {
String name = key.getName();
for (var entry : PREFIXES.entrySet()) {
@@ -55,6 +56,7 @@ public class LegacyAssetRedirectLocator implements AssetLocator {
return null;
}
@SuppressWarnings("rawtypes")
private AssetInfo tryFile(AssetManager manager, AssetKey key, String rel) {
Path p = root.resolve(rel);
if (!Files.exists(p)) return null;

View File

@@ -454,6 +454,7 @@ public class AnimPreviewState extends BaseAppState {
input.skeletalPaths.set(Collections.unmodifiableSet(result));
}
@SuppressWarnings("deprecation")
private boolean hasSkeleton(Spatial s) {
if (s.getControl(AnimComposer.class) != null) return true;
// Fallback auf altes AnimControl (Legacy-Modelle)
@@ -775,6 +776,7 @@ public class AnimPreviewState extends BaseAppState {
// ── Framebuffer ───────────────────────────────────────────────────────────
@SuppressWarnings("deprecation")
private FrameBuffer buildFrameBuffer(int w, int h) {
FrameBuffer fb = new FrameBuffer(w, h, 1);
fb.addColorTexture(new Texture2D(w, h, Image.Format.RGBA8));
@@ -1023,6 +1025,7 @@ public class AnimPreviewState extends BaseAppState {
* Hält jeden Root-Joint an seiner lokalen Bind-Pose-Transform → SC-Matrix = I → T-Pose.
* Gibt null zurück wenn das Armature keine Root-Joints hat.
*/
@SuppressWarnings("rawtypes")
private static AnimClip buildTPoseClip(com.jme3.anim.Armature armature) {
int jointCount = armature.getJointCount();
if (jointCount == 0) return null;

View File

@@ -383,6 +383,7 @@ public class EzTreeState extends BaseAppState {
// ── Phase 2: Impostor-Capture (4-Richtungen) ─────────────────────────────
@SuppressWarnings("deprecation")
private void startCapturePass(int pass, Node treeNode, BoundingBox bb) {
BoundingBox safeBb = bb != null ? bb : new BoundingBox(Vector3f.ZERO, 5f, 10f, 5f);
Texture2D capTex = new Texture2D(IMPOSTOR_SIZE, IMPOSTOR_SIZE, Image.Format.RGBA8);

View File

@@ -86,7 +86,7 @@ public class GrassVertexState extends BaseAppState {
private Material[] seedMaterials = new Material[0];
private Material seedStalkMaterial;
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})
private final List<GrassVertexBlade>[] chunkBlades = new List[CHUNK_COUNT];
private final Node[] chunkNodes = new Node[CHUNK_COUNT];
private final boolean[] dirtyChunks = new boolean[CHUNK_COUNT];

View File

@@ -155,6 +155,7 @@ public class PalmGeneratorState extends BaseAppState {
// ── Phase 2: Capture ─────────────────────────────────────────────────────
@SuppressWarnings("deprecation")
private void startCapturePass(int pass) {
Texture2D capTex = new Texture2D(IMPOSTOR_SIZE, IMPOSTOR_SIZE, Image.Format.RGBA8);
captureFB = new FrameBuffer(IMPOSTOR_SIZE, IMPOSTOR_SIZE, 1);

View File

@@ -72,7 +72,7 @@ public class PlacedObjectState extends BaseAppState {
private Node grassNode;
private final Map<Integer, Material> slotMaterials = new LinkedHashMap<>();
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})
private final List<GrassTuft>[] chunkTufts = new List[CHUNK_COUNT];
private final Node[] chunkNodes = new Node[CHUNK_COUNT];
private final boolean[] dirtyChunks = new boolean[CHUNK_COUNT];

View File

@@ -1368,6 +1368,7 @@ public class SceneObjectState extends BaseAppState {
// ── Modell-Konvertierung ──────────────────────────────────────────────────
@SuppressWarnings("deprecation")
private void convertModel(SharedInput.ModelConvertRequest req) {
setStatus("Konvertiere " + req.assetPath() + "");
try {

View File

@@ -495,7 +495,7 @@ public class SculptedMeshEditorState extends BaseAppState {
}
private static int[][] buildNeighbors(int wCount, int[] indices) {
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})
Set<Integer>[] sets = new Set[wCount];
for (int i = 0; i < wCount; i++) sets[i] = new HashSet<>();
for (int i = 0; i < indices.length; i += 3) {

View File

@@ -57,7 +57,7 @@ public class StoneEditorState extends BaseAppState {
private Node rootNode;
private Node stoneRoot;
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})
private final List<PlacedStone>[] chunkStones = new List[CHUNK_COUNT];
/** Pro Chunk: Node mit LOD0-Geometrien. */
private final Node[] lod0Nodes = new Node[CHUNK_COUNT];

View File

@@ -23,6 +23,7 @@ import com.jme3.terrain.geomipmap.TerrainQuad;
import com.jme3.texture.Image;
import com.jme3.texture.Texture;
import com.jme3.texture.Texture2D;
import com.jme3.texture.image.ColorSpace;
import com.jme3.util.BufferUtils;
import com.jme3.util.SkyFactory;
import de.blight.common.EmitterIO;
@@ -492,7 +493,7 @@ public class TerrainEditorState extends BaseAppState {
splatBuf.put(splatR[i]).put(splatG[i]).put(splatB[i]).put(splatA[i]);
}
splatBuf.flip();
splatImage = new Image(Image.Format.RGBA8, SPLAT_SIZE, SPLAT_SIZE, splatBuf);
splatImage = new Image(Image.Format.RGBA8, SPLAT_SIZE, SPLAT_SIZE, splatBuf, ColorSpace.Linear);
splatTex = new Texture2D(splatImage);
splatTex.setWrap(Texture.WrapMode.EdgeClamp);
splatTex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
@@ -503,7 +504,7 @@ public class TerrainEditorState extends BaseAppState {
upperSplatBuf.put(upperSplatR[i]).put(upperSplatG[i]).put(upperSplatB[i]).put(upperSplatA[i]);
}
upperSplatBuf.flip();
upperSplatImage = new Image(Image.Format.RGBA8, SPLAT_SIZE, SPLAT_SIZE, upperSplatBuf);
upperSplatImage = new Image(Image.Format.RGBA8, SPLAT_SIZE, SPLAT_SIZE, upperSplatBuf, ColorSpace.Linear);
upperSplatTex = new Texture2D(upperSplatImage);
upperSplatTex.setWrap(Texture.WrapMode.EdgeClamp);
upperSplatTex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
@@ -514,7 +515,7 @@ public class TerrainEditorState extends BaseAppState {
thirdSplatBuf.put(thirdSplatR[i]).put(thirdSplatG[i]).put(thirdSplatB[i]).put(thirdSplatA[i]);
}
thirdSplatBuf.flip();
thirdSplatImage = new Image(Image.Format.RGBA8, SPLAT_SIZE, SPLAT_SIZE, thirdSplatBuf);
thirdSplatImage = new Image(Image.Format.RGBA8, SPLAT_SIZE, SPLAT_SIZE, thirdSplatBuf, ColorSpace.Linear);
thirdSplatTex = new Texture2D(thirdSplatImage);
thirdSplatTex.setWrap(Texture.WrapMode.EdgeClamp);
thirdSplatTex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
@@ -617,13 +618,13 @@ public class TerrainEditorState extends BaseAppState {
if (path != null && !path.isEmpty()) {
try {
ByteBuffer buf = loadTextureToRGBA8(path, size);
images.add(new Image(Image.Format.RGBA8, size, size, buf));
images.add(new Image(Image.Format.RGBA8, size, size, buf, ColorSpace.Linear));
continue;
} catch (Exception e) {
log.warn("[TerrainArray] Slot {} nicht ladbar ({}): {}", i, path, e.getMessage());
}
}
images.add(new Image(Image.Format.RGBA8, size, size, solidColorLayer(fb, size)));
images.add(new Image(Image.Format.RGBA8, size, size, solidColorLayer(fb, size), ColorSpace.Linear));
}
com.jme3.texture.TextureArray texArr = new com.jme3.texture.TextureArray(images);
@@ -1769,6 +1770,7 @@ public class TerrainEditorState extends BaseAppState {
return g;
}
@SuppressWarnings("deprecation")
private void addGizmoLabel(Node parent, Vector3f pos, String text, ColorRGBA color) {
try {
com.jme3.font.BitmapFont font = assets.loadFont("Interface/Fonts/Default.fnt");

View File

@@ -159,6 +159,7 @@ public final class ThumbnailRenderer {
// ── Intern ───────────────────────────────────────────────────────────────
@SuppressWarnings("deprecation")
private static byte[] renderToFramebuffer(Node scene, Camera cam,
RenderManager rm, Renderer renderer) {
Texture2D colorTex = new Texture2D(SIZE, SIZE, Image.Format.RGBA8);

View File

@@ -224,6 +224,7 @@ public class TreeGeneratorState extends BaseAppState {
// ── Framebuffer-Helpers ───────────────────────────────────────────────────
@SuppressWarnings("deprecation")
private FrameBuffer buildFrameBuffer(int w, int h) {
FrameBuffer fb = new FrameBuffer(w, h, 1);
fb.addColorTexture(new Texture2D(w, h, Image.Format.RGBA8));
@@ -429,7 +430,7 @@ public class TreeGeneratorState extends BaseAppState {
return atlas;
}
/** Startet einen einzelnen Capture-Durchlauf für die gegebene Richtung (Pass 0..3). */
@SuppressWarnings("deprecation")
private void startCapturePass(int pass) {
captureTex = new Texture2D(IMPOSTOR_SIZE, IMPOSTOR_SIZE, Image.Format.RGBA8);
captureFB = new FrameBuffer(IMPOSTOR_SIZE, IMPOSTOR_SIZE, 1);

View File

@@ -1565,7 +1565,8 @@ public class VoxelEditorState extends BaseAppState {
buf.put((byte) rgb[0]).put((byte) rgb[1]).put((byte) rgb[2]).put((byte) 255);
buf.flip();
com.jme3.texture.Texture2D tex = new com.jme3.texture.Texture2D(
new com.jme3.texture.Image(com.jme3.texture.Image.Format.RGBA8, 1, 1, buf));
new com.jme3.texture.Image(com.jme3.texture.Image.Format.RGBA8, 1, 1, buf,
com.jme3.texture.image.ColorSpace.Linear));
tex.setWrap(Texture.WrapMode.Repeat);
return tex;
}

View File

@@ -71,7 +71,9 @@ public class LocalizationEditorView extends BorderPane {
table.setEditable(true);
table.setStyle("-fx-background-color: #1a1a2a; -fx-control-inner-background: #1a1a2a;");
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
@SuppressWarnings("deprecation")
var policy = TableView.CONSTRAINED_RESIZE_POLICY;
table.setColumnResizePolicy(policy);
TableColumn<String[], String> keyCol = new TableColumn<>("Schlüssel");
keyCol.setCellValueFactory(cd -> new SimpleStringProperty(cd.getValue()[0]));