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
This commit is contained in:
iobyte 2023-06-23 01:34:50 +00:00
parent d45badff26
commit d30fbc0f36
2 changed files with 28 additions and 1 deletions

View file

@ -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();

View file

@ -34,7 +34,7 @@ public class Properties
private static Properties instance = new Properties();
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
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;