Correct the previous PR a bit
* Support 1D and 3D texture coordinates specified by ogre exporter as well as 2D
This commit is contained in:
parent
29be17fa35
commit
c8a2a7260e
@ -429,7 +429,11 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
|
|||||||
|
|
||||||
int texCoords = parseInt(attribs.getValue("texture_coords"), 0);
|
int texCoords = parseInt(attribs.getValue("texture_coords"), 0);
|
||||||
for (int i = 0; i < texCoords; i++) {
|
for (int i = 0; i < texCoords; i++) {
|
||||||
int dims = parseInt(attribs.getValue("texture_coord_dimensions_" + i).replaceAll("float2", "2"), 2);
|
String dimsStr = attribs.getValue("texture_coord_dimensions_" + i);
|
||||||
|
if (dimsStr.startsWith("float")) {
|
||||||
|
dimsStr = dimsStr.substring("float".length());
|
||||||
|
}
|
||||||
|
int dims = parseInt(dimsStr, 2);
|
||||||
if (dims < 1 || dims > 4) {
|
if (dims < 1 || dims > 4) {
|
||||||
throw new SAXException("Texture coord dimensions must be 1 <= dims <= 4");
|
throw new SAXException("Texture coord dimensions must be 1 <= dims <= 4");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user