diff options
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/Locator.java | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java | 19 |
2 files changed, 5 insertions, 16 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Locator.java b/src/jogl/classes/com/jogamp/opengl/util/Locator.java index c524c0888..8dbd7cd93 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/Locator.java +++ b/src/jogl/classes/com/jogamp/opengl/util/Locator.java @@ -33,8 +33,6 @@ package com.jogamp.opengl.util; -import java.util.*; -import java.nio.*; import java.io.*; import java.net.*; diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java index 5dd1b5a3a..1f59318f2 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java @@ -321,22 +321,13 @@ public class ShaderCode { public static String readShaderSource(Class context, String path) { ClassLoader contextCL = (null!=context)?context.getClassLoader():null; - URL url = Locator.getResource(path, contextCL); - if (url == null && null!=context) { - // Try again by scoping the path within the class's package - String className = context.getName().replace('.', '/'); - int lastSlash = className.lastIndexOf('/'); - if (lastSlash >= 0) { - String tmpPath = className.substring(0, lastSlash + 1) + path; - url = Locator.getResource(tmpPath, contextCL); - if (url != null) { - path = tmpPath; - } - } - } + URL url = Locator.getResource(context, path); if (url == null) { return null; - } + } + File pf = new File(url.getPath()); + path = pf.getParent() + "/" ; + StringBuffer result = new StringBuffer(); readShaderSource(contextCL, path, url, result); return result.toString(); |