From d8c5985a732ef1d0d0ed10eaa87a7fc7304346ec Mon Sep 17 00:00:00 2001 From: shadowislord Date: Tue, 11 Nov 2014 18:18:57 -0500 Subject: [PATCH] Disable SDK build by default (maybe Travis can handle it then) Fix compile error in jme3-android project --- gradle.properties | 4 ++-- .../java/com/jme3/asset/plugins/AndroidLocator.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 04c671737..d4d4c28aa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,13 +6,13 @@ jmeMainVersion = 3.1 jmeVersionTag = snapshot-github # specify if SDK and Native libraries get built -buildSdkProject = true +buildSdkProject = false buildNativeProjects = false buildAutogen = false # Path to android NDK for building native libraries #ndkPath=/Users/normenhansen/Documents/Code-Import/android-ndk-r7 -ndkPath = D:/android/android-ndk-r8e +ndkPath = /opt/android-ndk-r10c # Path for downloading native Bullet bulletUrl = http://bullet.googlecode.com/files/bullet-2.82-r2704.zip diff --git a/jme3-android/src/main/java/com/jme3/asset/plugins/AndroidLocator.java b/jme3-android/src/main/java/com/jme3/asset/plugins/AndroidLocator.java index 16bf7c9c1..4cff53d43 100644 --- a/jme3-android/src/main/java/com/jme3/asset/plugins/AndroidLocator.java +++ b/jme3-android/src/main/java/com/jme3/asset/plugins/AndroidLocator.java @@ -1,9 +1,11 @@ package com.jme3.asset.plugins; +import android.content.res.AssetFileDescriptor; import com.jme3.asset.*; import com.jme3.system.android.JmeAndroidSystem; import java.io.IOException; import java.io.InputStream; +import java.util.logging.Level; import java.util.logging.Logger; public class AndroidLocator implements AssetLocator { @@ -13,7 +15,7 @@ public class AndroidLocator implements AssetLocator { private android.content.res.AssetManager androidManager; private String rootPath = ""; - private class AndroidAssetInfo extends AssetInfo { + public class AndroidAssetInfo extends AssetInfo { private InputStream in; private final String assetPath; @@ -24,6 +26,14 @@ public class AndroidLocator implements AssetLocator { this.in = in; } + public AssetFileDescriptor openFileDescriptor() { + try { + return androidManager.openFd(assetPath); + } catch (IOException ex) { + throw new AssetLoadException("Failed to open asset " + assetPath, ex); + } + } + @Override public InputStream openStream() { if (in != null){