|
1 | 1 | /* |
2 | | - * Copyright (c) 2009-2023 jMonkeyEngine |
| 2 | + * Copyright (c) 2009-2025 jMonkeyEngine |
3 | 3 | * All rights reserved. |
4 | 4 | * |
5 | 5 | * Redistribution and use in source and binary forms, with or without |
@@ -57,7 +57,7 @@ public class VertexBuffer extends NativeObject implements Savable, Cloneable { |
57 | 57 | /** |
58 | 58 | * Type of buffer. Specifies the actual attribute it defines. |
59 | 59 | */ |
60 | | - public static enum Type { |
| 60 | + public enum Type { |
61 | 61 | /** |
62 | 62 | * Position of the vertex (3 floats) |
63 | 63 | */ |
@@ -233,7 +233,7 @@ public static enum Type { |
233 | 233 | * is used. This can determine if a vertex buffer is placed in VRAM |
234 | 234 | * or held in video memory, but no guarantees are made- it's only a hint. |
235 | 235 | */ |
236 | | - public static enum Usage { |
| 236 | + public enum Usage { |
237 | 237 | /** |
238 | 238 | * Mesh data is sent once and very rarely updated. |
239 | 239 | */ |
@@ -261,7 +261,7 @@ public static enum Usage { |
261 | 261 | * For the {@link Format#Half} type, {@link ByteBuffer}s should |
262 | 262 | * be used. |
263 | 263 | */ |
264 | | - public static enum Format { |
| 264 | + public enum Format { |
265 | 265 | /** |
266 | 266 | * Half precision floating point. 2 bytes, signed. |
267 | 267 | */ |
@@ -1130,6 +1130,7 @@ public void write(JmeExporter ex) throws IOException { |
1130 | 1130 | oc.write(offset, "offset", 0); |
1131 | 1131 | oc.write(stride, "stride", 0); |
1132 | 1132 | oc.write(instanceSpan, "instanceSpan", 0); |
| 1133 | + oc.write(name, "name", null); |
1133 | 1134 |
|
1134 | 1135 | String dataName = "data" + format.name(); |
1135 | 1136 | Buffer roData = getDataReadOnly(); |
@@ -1166,6 +1167,8 @@ public void read(JmeImporter im) throws IOException { |
1166 | 1167 | offset = ic.readInt("offset", 0); |
1167 | 1168 | stride = ic.readInt("stride", 0); |
1168 | 1169 | instanceSpan = ic.readInt("instanceSpan", 0); |
| 1170 | + name = ic.readString("name", null); |
| 1171 | + |
1169 | 1172 | componentsLength = components * format.getComponentSize(); |
1170 | 1173 |
|
1171 | 1174 | String dataName = "data" + format.name(); |
|
0 commit comments