[0.9.9]
+- added classpath files support for gwt backend (limited)
- moved AndroidWallpaperListener to Android Backend
- added new VertexAttribute Usage flags, bone weight, tangent, binormal. previously encoded as Usage.Generic. Also
added field "unit" to VertexAttribute, used by texture coordinates and bone weights to specify index/unit.
private final FileType type;
protected GwtFileHandle (Preloader preloader, String fileName, FileType type) {
- if (type != FileType.Internal) throw new GdxRuntimeException("FileType '" + type + "' Not supported in GWT backend");
+ if (type != FileType.Internal && type != FileType.Classpath) throw new GdxRuntimeException("FileType '" + type + "' Not supported in GWT backend");
this.preloader = preloader;
this.file = fileName.replace('\\', '/');
this.type = type;
package com.badlogic.gdx.backends.gwt.preloader;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
import java.io.PrintWriter;
import java.net.URLConnection;
import java.util.ArrayList;
+import java.util.List;
import com.badlogic.gdx.backends.gwt.preloader.AssetFilter.AssetType;
import com.badlogic.gdx.utils.GdxRuntimeException;
ArrayList<Asset> assets = new ArrayList<Asset>();
copyDirectory(source, target, assetFilter, assets);
+ // Now collect classpath files and copy to assets
+ List<String> classpathFiles = getClasspathFiles(context);
+ for (String classpathFile : classpathFiles) {
+ if (assetFilter.accept(classpathFile, false)) {
+ try {
+ InputStream is = context.getClass().getClassLoader().getResourceAsStream(classpathFile);
+ FileWrapper dest = target.child(classpathFile);
+ dest.write(is, false);
+ assets.add(new Asset(dest, assetFilter.getType(dest.path())));
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
StringBuffer buffer = new StringBuffer();
for (Asset asset : assets) {
String path = asset.file.path().replace('\\', '/').replace(assetOutputPath + "assets/", "").replaceFirst("assets", "");
}
}
+ private List<String> getClasspathFiles(GeneratorContext context) {
+ List<String> classpathFiles = new ArrayList<String>();
+ try {
+ ConfigurationProperty prop = context.getPropertyOracle().getConfigurationProperty("gdx.files.classpath");
+ for (String value : prop.getValues()) {
+ classpathFiles.add(value);
+ }
+ } catch (BadPropertyValueException e) {
+ // Ignore
+ }
+ return classpathFiles;
+ }
+
private String createDummyClass (TreeLogger logger, GeneratorContext context) {
String packageName = "com.badlogic.gdx.backends.gwt.preloader";
String className = "PreloaderBundleImpl";
<include name="utils/compression/rangecoder/Encoder.java"/>
</source>
+
+ <define-configuration-property name="gdx.files.classpath" is-multi-valued="true" />
+ <extend-configuration-property name="gdx.files.classpath" value="com/badlogic/gdx/graphics/g3d/shaders/default.fragment.glsl" />
+ <extend-configuration-property name="gdx.files.classpath" value="com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl" />
+ <extend-configuration-property name="gdx.files.classpath" value="com/badlogic/gdx/utils/arial-15.fnt" />
+ <extend-configuration-property name="gdx.files.classpath" value="com/badlogic/gdx/utils/arial-15.png" />
</module>
\ No newline at end of file