From d30fbc0f36c5d8be6a371b46df1b442c5c3beaab Mon Sep 17 00:00:00 2001 From: iobyte Date: Fri, 23 Jun 2023 01:34:50 +0000 Subject: [PATCH] trackeditor: warn about ac3d files with material names with spaces in them git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9034 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 294bfda40519ae35c6b9f7b284f611b04d881a3a Former-commit-id: ba2e31cfc4317aea42584eb244ff15b3df95ab13 --- src/tools/trackeditor/gui/CheckDialog.java | 27 +++++++++++++++++++++ src/tools/trackeditor/utils/Properties.java | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/tools/trackeditor/gui/CheckDialog.java b/src/tools/trackeditor/gui/CheckDialog.java index 42f5e878d..5d337be58 100644 --- a/src/tools/trackeditor/gui/CheckDialog.java +++ b/src/tools/trackeditor/gui/CheckDialog.java @@ -26,6 +26,7 @@ import utils.SegmentVector; import utils.TrackData; import utils.ac3d.Ac3d; import utils.ac3d.Ac3dException; +import utils.ac3d.Ac3dMaterial; import utils.ac3d.Ac3dObject; import utils.ac3d.Ac3dSurface; import utils.circuit.Curve; @@ -487,6 +488,19 @@ public class CheckDialog extends JDialog { ac3dFile.read(file); + for (Ac3dMaterial material : ac3dFile.getMaterials()) + { + String name = material.getName(); + + if (name != null && !name.isEmpty()) + { + if (name.contains(" ")) + { + textArea.append("Relief file " + file.toString() + " : material \"" + name + "\" has space in name\n"); + } + } + } + Ac3dObject root = ac3dFile.getRoot(); if (root != null && "world".equals(root.getType())) @@ -820,6 +834,19 @@ public class CheckDialog extends JDialog try { ac3dFile.read(file); + + for (Ac3dMaterial material : ac3dFile.getMaterials()) + { + String name = material.getName(); + + if (name != null && !name.isEmpty()) + { + if (name.contains(" ")) + { + textArea.append("Object file " + file.toString() + " : material \"" + name + "\" has space in name\n"); + } + } + } Ac3dObject root = ac3dFile.getRoot(); diff --git a/src/tools/trackeditor/utils/Properties.java b/src/tools/trackeditor/utils/Properties.java index 6c6c71bc1..6ca2e8711 100644 --- a/src/tools/trackeditor/utils/Properties.java +++ b/src/tools/trackeditor/utils/Properties.java @@ -34,7 +34,7 @@ public class Properties private static Properties instance = new Properties(); private Vector propertiesListeners = new Vector(); public final String title = "sd2-trackeditor"; - public final String version = "1.2.51"; + public final String version = "1.2.52"; private String path; private double imageScale = 1;