OSDN Git Service

Remove the / in the beginning of the texture's filename while loading a model
authorexidl <axel.isouard@epitech.eu>
Fri, 7 Jun 2013 19:19:56 +0000 (21:19 +0200)
committerexidl <axel.isouard@epitech.eu>
Fri, 7 Jun 2013 19:19:56 +0000 (21:19 +0200)
gdx/src/com/badlogic/gdx/graphics/g3d/loader/G3dModelLoader.java

index 7bd4dbf..bfcc9c9 100644 (file)
@@ -210,7 +210,7 @@ public class G3dModelLoader extends ModelLoader<AssetLoaderParameters<Model>> {
                                                String fileName = texture.getString("filename", null);
                                                if(fileName == null)
                                                        throw new GdxRuntimeException("Texture needs filename.");
-                                               jsonTexture.fileName = materialDir + (materialDir.endsWith("/") ? "" : "/") + fileName;
+                                               jsonTexture.fileName = materialDir + (materialDir.length() == 0 || materialDir.endsWith("/") ? "" : "/") + fileName;
                                                
                                                jsonTexture.uvTranslation = readVector2(texture.get("uvTranslation"), 0f, 0f);
                                                jsonTexture.uvScaling = readVector2(texture.get("uvScaling"), 1f, 1f);