diff --git a/build.sh b/build.sh
index cc7854d17..d8607d463 100755
--- a/build.sh
+++ b/build.sh
@@ -55,7 +55,8 @@ fi
rm -f project/src/Globals.java
}
-[ -z "$GCCVER" ] && GCCVER=4.6
+NDK_TOOLCHAIN_VERSION=$GCCVER
+[ -z "$NDK_TOOLCHAIN_VERSION" ] && NDK_TOOLCHAIN_VERSION=4.6
# Set here your own NDK path if needed
# export PATH=$PATH:~/src/endless_space/android-ndk-r7
@@ -95,46 +96,67 @@ $quick_rebuild || rm -r -f project/bin/* # New Android SDK introduced some lame-
cd ../../../..
}
-cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j$NCPU V=1 && \
- { grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
+strip_libs() {
+ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
echo Stripping libapplication-armeabi.so by hand && \
rm obj/local/armeabi/libapplication.so && \
cp jni/application/src/libapplication-armeabi.so obj/local/armeabi/libapplication.so && \
cp jni/application/src/libapplication-armeabi.so libs/armeabi/libapplication.so && \
- `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${GCCVER}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi/libapplication.so \
- || true ; } && \
- { grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
+ `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi/libapplication.so
+ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
grep "MultiABI=" ../AndroidAppSettings.cfg | grep "y\\|all\\|armeabi-v7a" > /dev/null && \
echo Stripping libapplication-armeabi-v7a.so by hand && \
rm obj/local/armeabi-v7a/libapplication.so && \
cp jni/application/src/libapplication-armeabi-v7a.so obj/local/armeabi-v7a/libapplication.so && \
cp jni/application/src/libapplication-armeabi-v7a.so libs/armeabi-v7a/libapplication.so && \
- `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${GCCVER}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so \
- || true ; } && \
- { grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
+ `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so
+ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
grep "MultiABI=" ../AndroidAppSettings.cfg | grep "armeabi-v7a-hard" > /dev/null && \
echo Stripping libapplication-armeabi-v7a-hard.so by hand && \
rm obj/local/armeabi-v7a-hard/libapplication.so && \
cp jni/application/src/libapplication-armeabi-v7a-hard.so obj/local/armeabi-v7a-hard/libapplication.so && \
cp jni/application/src/libapplication-armeabi-v7a-hard.so libs/armeabi-v7a/libapplication.so && \
- `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${GCCVER}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so \
- || true ; } && \
- { grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
+ `which ndk-build | sed 's@/ndk-build@@'`/toolchains/arm-linux-androideabi-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/arm-linux-androideabi-strip --strip-unneeded libs/armeabi-v7a/libapplication.so
+ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|mips" > /dev/null && \
echo Stripping libapplication-mips.so by hand && \
rm obj/local/mips/libapplication.so && \
cp jni/application/src/libapplication-mips.so obj/local/mips/libapplication.so && \
cp jni/application/src/libapplication-mips.so libs/mips/libapplication.so && \
- `which ndk-build | sed 's@/ndk-build@@'`/toolchains/mipsel-linux-android-${GCCVER}/prebuilt/$MYARCH/bin/mipsel-linux-android-strip --strip-unneeded libs/mips/libapplication.so \
- || true ; } && \
- { grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
+ `which ndk-build | sed 's@/ndk-build@@'`/toolchains/mipsel-linux-android-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/mipsel-linux-android-strip --strip-unneeded libs/mips/libapplication.so
+ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|x86" > /dev/null && \
echo Stripping libapplication-x86.so by hand && \
rm obj/local/x86/libapplication.so && \
cp jni/application/src/libapplication-x86.so obj/local/x86/libapplication.so && \
cp jni/application/src/libapplication-x86.so libs/x86/libapplication.so && \
- `which ndk-build | sed 's@/ndk-build@@'`/toolchains/x86-${GCCVER}/prebuilt/$MYARCH/bin/i686-linux-android-strip --strip-unneeded libs/x86/libapplication.so \
- || true ; } && \
+ `which ndk-build | sed 's@/ndk-build@@'`/toolchains/x86-${NDK_TOOLCHAIN_VERSION}/prebuilt/$MYARCH/bin/i686-linux-android-strip --strip-unneeded libs/x86/libapplication.so
+ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
+ grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|x86_64" > /dev/null && \
+ echo Stripping libapplication-x86_64.so by hand && \
+ rm obj/local/x86_64/libapplication.so && \
+ cp jni/application/src/libapplication-x86_64.so obj/local/x86_64/libapplication.so && \
+ cp jni/application/src/libapplication-x86_64.so libs/x86_64/libapplication.so && \
+ `which ndk-build | sed 's@/ndk-build@@'`/toolchains/x86_64-4.9/prebuilt/$MYARCH/bin/x86_64-linux-android-strip --strip-unneeded libs/x86_64/libapplication.so
+ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
+ grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|arm64-v8a" > /dev/null && \
+ echo Stripping libapplication-arm64-v8a.so by hand && \
+ rm obj/local/arm64-v8a/libapplication.so && \
+ cp jni/application/src/libapplication-arm64-v8a.so obj/local/arm64-v8a/libapplication.so && \
+ cp jni/application/src/libapplication-arm64-v8a.so libs/arm64-v8a/libapplication.so && \
+ `which ndk-build | sed 's@/ndk-build@@'`/toolchains/aarch64-linux-android-4.9/prebuilt/$MYARCH/bin/aarch64-linux-android-strip --strip-unneeded libs/arm64-v8a/libapplication.so
+ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
+ grep "MultiABI=" ../AndroidAppSettings.cfg | grep "all\\|mips64" > /dev/null && \
+ echo Stripping libapplication-mips64.so by hand && \
+ rm obj/local/mips64/libapplication.so && \
+ cp jni/application/src/libapplication-mips64.so obj/local/mips64/libapplication.so && \
+ cp jni/application/src/libapplication-mips64.so libs/mips64/libapplication.so && \
+ `which ndk-build | sed 's@/ndk-build@@'`/toolchains/mips64el-linux-android-4.9/prebuilt/$MYARCH/bin/mips64el-linux-android-strip --strip-unneeded libs/mips64/libapplication.so
+ return 0
+}
+
+cd project && env PATH=$NDKBUILDPATH BUILD_NUM_CPUS=$NCPU nice -n19 ndk-build -j$NCPU V=1 && \
+ strip_libs && \
cd .. && ./copyAssets.sh && cd project && \
{ if $build_release ; then \
$quick_rebuild && { \
diff --git a/changeAppSettings.sh b/changeAppSettings.sh
index 2ed5a9507..f490caa86 100755
--- a/changeAppSettings.sh
+++ b/changeAppSettings.sh
@@ -127,7 +127,7 @@ echo "# If you'll start Description with '!' symbol it will be enabled by defaul
echo "# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped" >> AndroidAppSettings.cfg
echo "# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -" >> AndroidAppSettings.cfg
echo "# these files are put inside .apk package by build system" >> AndroidAppSettings.cfg
-echo "# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS" >> AndroidAppSettings.cfg
+echo "# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file" >> AndroidAppSettings.cfg
echo AppDataDownloadUrl=\"$AppDataDownloadUrl\" >> AndroidAppSettings.cfg
echo >> AndroidAppSettings.cfg
echo "# Reset SDL config when updating application to the new version (y) / (n)" >> AndroidAppSettings.cfg
@@ -321,13 +321,16 @@ echo "# Available menu items:" >> AndroidAppSettings.cfg
echo "# $MenuOptionsAvailable" >> AndroidAppSettings.cfg
echo FirstStartMenuOptions=\'$FirstStartMenuOptions\' >> AndroidAppSettings.cfg
echo >> AndroidAppSettings.cfg
+echo "# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower" >> AndroidAppSettings.cfg
+echo AppMinimumRAM=$AppMinimumRAM >> AndroidAppSettings.cfg
+echo >> AndroidAppSettings.cfg
+echo "# GCC version, 4.6 (default) or 4.8, CLANG is not supported yet" >> AndroidAppSettings.cfg
+echo NDK_TOOLCHAIN_VERSION=$NDK_TOOLCHAIN_VERSION >> AndroidAppSettings.cfg
+echo >> AndroidAppSettings.cfg
echo "# Specify architectures to compile, 'all' or 'y' to compile for all architectures." >> AndroidAppSettings.cfg
echo "# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips" >> AndroidAppSettings.cfg
echo MultiABI=\'$MultiABI\' >> AndroidAppSettings.cfg
echo >> AndroidAppSettings.cfg
-echo "# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower" >> AndroidAppSettings.cfg
-echo AppMinimumRAM=$AppMinimumRAM >> AndroidAppSettings.cfg
-echo >> AndroidAppSettings.cfg
echo "# Optional shared libraries to compile - removing some of them will save space" >> AndroidAppSettings.cfg
echo "# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed" >> AndroidAppSettings.cfg
grep 'Available' project/jni/SettingsTemplate.mk >> AndroidAppSettings.cfg
@@ -837,7 +840,8 @@ cat project/jni/SettingsTemplate.mk | \
sed "s^APPLICATION_SUBDIRS_BUILD :=.*^APPLICATION_SUBDIRS_BUILD := $AppSubdirsBuild^" | \
sed "s^APPLICATION_BUILD_EXCLUDE :=.*^APPLICATION_BUILD_EXCLUDE := $AppBuildExclude^" | \
sed "s^APPLICATION_CUSTOM_BUILD_SCRIPT :=.*^APPLICATION_CUSTOM_BUILD_SCRIPT := $CustomBuildScript^" | \
- sed "s^SDL_VERSION :=.*^SDL_VERSION := $LibSdlVersion^" >> \
+ sed "s^SDL_VERSION :=.*^SDL_VERSION := $LibSdlVersion^" | \
+ sed "s^NDK_TOOLCHAIN_VERSION :=.*^NDK_TOOLCHAIN_VERSION := $NDK_TOOLCHAIN_VERSION^" >> \
project/jni/Settings.mk
echo Patching strings.xml
@@ -856,6 +860,7 @@ if [ "$GooglePlayGameServicesId" = "n" -o -z "$GooglePlayGameServicesId" ] ; the
GooglePlayGameServicesId=""
grep 'google-play-services' project/local.properties > /dev/null && {
$SEDI 's/.*google-play-services.*//g' project/local.properties
+ rm -f project/libs/android-support-v4.jar
}
else
for F in $JAVA_SRC_PATH/googleplaygameservices/*.java; do
@@ -863,7 +868,6 @@ else
echo Patching $F
echo '// DO NOT EDIT THIS FILE - it is automatically generated, edit file under $JAVA_SRC_PATH dir' > project/src/$OUT
cat $F | sed "s/^package .*;/package $AppFullName;/" >> project/src/$OUT
- rm -f project/libs/android-support-v4.jar
done
$SEDI "s/==GOOGLEPLAYGAMESERVICES_APP_ID==/$GooglePlayGameServicesId/g" project/res/values/strings.xml
SDK_DIR=`grep '^sdk.dir' project/local.properties | sed 's/.*=//'`
@@ -877,6 +881,8 @@ else
android update project -p $SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib
fi
+if [ -e project/jni/application/src/project.patch ]; then patch -p1 --no-backup-if-mismatch < project/jni/application/src/project.patch || exit 1 ; fi
+
echo Cleaning up dependencies
rm -rf project/libs/*/* project/gen
for OUT in obj; do
@@ -887,6 +893,8 @@ rm -rf project/$OUT/local/*/objs*/sdl-*/src/*/android
rm -rf project/$OUT/local/*/objs*/sdl-*/src/video/SDL_video.o
rm -rf project/$OUT/local/*/objs*/sdl-*/SDL_renderer_gles.o
rm -rf project/$OUT/local/*/objs*/sdl_*
+rm -rf project/obj/local/*/objs*/lzma/src/XZInputStream.o
+rm -rf project/obj/local/*/objs*/liblzma.so
# Do not rebuild several huge libraries that do not depend on SDL version
for LIB in freetype intl jpeg png lua mad tremor xerces xml2 curl lua mikmod \
boost boost_signals boost_thread boost_filesystem boost_date_time boost_system boost_regex boost_iostreams boost_program_options \
@@ -901,15 +909,6 @@ done
rm -rf project/bin/classes
rm -rf project/bin/res
-rm -rf project/res/drawable-xhdpi/ouya_icon.png project/res/drawable/app_icon.png
-if which convert > /dev/null; then
- mkdir -p project/res/drawable-xhdpi
- convert project/res/drawable/icon.png -resize '732x412!' project/res/drawable-xhdpi/ouya_icon.png
- convert project/res/drawable/icon.png -resize '96x96!' project/res/drawable/app_icon.png
-else
- echo "Install ImageMagick to auto-resize Ouya icon from icon.png"
-fi
-
./copyAssets.sh || exit 1
rm -rf project/jni/android-support
diff --git a/project/AndroidManifestTemplate.xml b/project/AndroidManifestTemplate.xml
index 7506b297e..777b44b78 100644
--- a/project/AndroidManifestTemplate.xml
+++ b/project/AndroidManifestTemplate.xml
@@ -31,7 +31,7 @@
-
+
diff --git a/project/java/DataDownloader.java b/project/java/DataDownloader.java
index 1f1e35fea..c2e16e81a 100644
--- a/project/java/DataDownloader.java
+++ b/project/java/DataDownloader.java
@@ -55,13 +55,11 @@ import java.io.InputStream;
import android.content.Context;
import android.content.res.Resources;
-import java.lang.String;
+import java.util.Arrays;
import android.text.SpannedString;
import android.app.AlertDialog;
import android.content.DialogInterface;
-import org.tukaani.xz.XZInputStream;
-
class CountingInputStream extends BufferedInputStream
{
@@ -284,22 +282,28 @@ class DataDownloader extends Thread
catch( FileNotFoundException e ) {}
catch( IOException e ) {};
- HttpResponse response = null, responseError = null;
HttpGet request;
+ HttpResponse response = null, responseError = null;
long totalLen = 0;
+ long partialDownloadLen = 0;
CountingInputStream stream;
- byte[] buf = new byte[16384];
boolean DoNotUnzip = false;
boolean FileInAssets = false;
+ boolean FileInExpansion = false;
String url = "";
- long partialDownloadLen = 0;
int downloadUrlIndex = 1;
while( downloadUrlIndex < downloadUrls.length )
{
Log.i("SDL", "Processing download " + downloadUrls[downloadUrlIndex]);
- url = new String(downloadUrls[downloadUrlIndex]);
+
DoNotUnzip = false;
+ FileInAssets = false;
+ FileInExpansion = false;
+ partialDownloadLen = 0;
+ totalLen = 0;
+
+ url = new String(downloadUrls[downloadUrlIndex]);
if(url.indexOf(":") == 0)
{
path = getOutFilePath(url.substring( 1, url.indexOf(":", 1) ));
@@ -311,7 +315,26 @@ class DataDownloader extends Thread
partialDownloadLen = partialDownload.length();
}
Status.setText( downloadCount + "/" + downloadTotal + ": " + res.getString(R.string.connecting_to, url) );
- if( url.indexOf("http://") == -1 && url.indexOf("https://") == -1 ) // File inside assets
+ if( url.indexOf("obb:") == 0 ) // APK expansion file provided by Google Play
+ {
+ url = url.substring("obb:".length());
+ url = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/obb/" +
+ Parent.getPackageName() + "/" + url + "." + Parent.getPackageName() + ".obb";
+ InputStream stream1 = null;
+ try {
+ stream1 = new FileInputStream(url);
+ stream1.read();
+ stream1.close();
+ Log.i("SDL", "Fetching file from expansion: " + url);
+ FileInExpansion = true;
+ break;
+ } catch( Exception e ) {
+ Log.i("SDL", "Failed to open file: " + url);
+ downloadUrlIndex++;
+ continue;
+ }
+ }
+ else if( url.indexOf("http://") == -1 && url.indexOf("https://") == -1 ) // File inside assets
{
InputStream stream1 = null;
try {
@@ -346,7 +369,6 @@ class DataDownloader extends Thread
response = client.execute(request);
} catch (IOException e) {
Log.i("SDL", "Failed to connect to " + url);
- downloadUrlIndex++;
};
if( response != null )
{
@@ -356,13 +378,32 @@ class DataDownloader extends Thread
responseError = response;
response = null;
downloadUrlIndex++;
+ continue;
}
- else
- break;
+ break;
+ }
+ else
+ {
+ downloadUrlIndex++;
+ continue;
}
}
}
- if( FileInAssets )
+
+ if( FileInExpansion )
+ {
+ Log.i("SDL", "Count file size: '" + url);
+ try {
+ totalLen = new File(url).length();
+ stream = new CountingInputStream(new FileInputStream(url), 8192);
+ Log.i("SDL", "Count file size: '" + url + " = " + totalLen);
+ } catch( IOException e ) {
+ Log.i("SDL", "Unpacking from filesystem '" + url + "' - error: " + e.toString());
+ Status.setText( res.getString(R.string.error_dl_from, url) );
+ return false;
+ }
+ }
+ else if( FileInAssets )
{
int multipartCounter = 0;
InputStream multipart = null;
@@ -393,7 +434,7 @@ class DataDownloader extends Thread
try {
stream = new CountingInputStream(Parent.getAssets().open(url), 8192);
while( stream.skip(65536) > 0 ) { };
- totalLen += stream.getBytesRead();
+ totalLen = stream.getBytesRead();
stream.close();
stream = new CountingInputStream(Parent.getAssets().open(url), 8192);
} catch( IOException e ) {
@@ -421,9 +462,49 @@ class DataDownloader extends Thread
return false;
}
}
-
+
+ if( !copyUnpackFileStream(stream, path, url, DoNotUnzip, FileInAssets, FileInExpansion, totalLen, partialDownloadLen, response, downloadCount, downloadTotal) )
+ return false;
+
+ OutputStream out = null;
+ path = getOutFilePath(DownloadFlagFileName);
+ try {
+ out = new FileOutputStream( path );
+ out.write(downloadUrls[downloadUrlIndex].getBytes("UTF-8"));
+ out.flush();
+ out.close();
+ } catch( java.io.IOException e ) {
+ Status.setText( res.getString(R.string.error_write, path) + ": " + e.getMessage() );
+ return false;
+ };
+ Status.setText( downloadCount + "/" + downloadTotal + ": " + res.getString(R.string.dl_finished) );
+
+ try {
+ stream.close();
+ if( FileInExpansion )
+ {
+ Writer writer = new OutputStreamWriter(new FileOutputStream(url), "UTF-8");
+ writer.write("Extracted and truncated\n");
+ writer.close();
+ Log.i("SDL", "Truncated file from expansion: " + url);
+ }
+ } catch( java.io.IOException e ) {
+ Log.i("SDL", "Error truncating file from expansion: " + url);
+ };
+
+ return true;
+ };
+
+ // Moved part of code to a separate method, because Android imposes a stupid limit on Java method size
+ private boolean copyUnpackFileStream( CountingInputStream stream, String path, String url,
+ boolean DoNotUnzip, boolean FileInAssets, boolean FileInExpansion,
+ long totalLen, long partialDownloadLen, HttpResponse response,
+ int downloadCount, int downloadTotal)
+ {
long updateStatusTime = 0;
-
+ byte[] buf = new byte[16384];
+ Resources res = Parent.getResources();
+
if(DoNotUnzip)
{
Log.i("SDL", "Saving file '" + path + "'");
@@ -504,6 +585,8 @@ class DataDownloader extends Thread
if (url.endsWith(".zip.xz") || url.endsWith(".zip.xz/download"))
try
{
+ if (!Arrays.asList(Globals.AppLibraries).contains("lzma"))
+ throw new IOException("LZMA support not compiled in - add lzma to CompiledLibraries inside AndroidAppSettings.cfg");
zip = new ZipInputStream(new XZInputStream(stream));
}
catch (Exception eeeee)
@@ -651,30 +734,9 @@ class DataDownloader extends Thread
Log.i("SDL", "Saving file '" + path + "' done");
}
};
-
- OutputStream out = null;
- path = getOutFilePath(DownloadFlagFileName);
- try {
- out = new FileOutputStream( path );
- out.write(downloadUrls[downloadUrlIndex].getBytes("UTF-8"));
- out.flush();
- out.close();
- } catch( FileNotFoundException e ) {
- } catch( SecurityException e ) {
- } catch( java.io.IOException e ) {
- Status.setText( res.getString(R.string.error_write, path) + ": " + e.getMessage() );
- return false;
- };
- Status.setText( downloadCount + "/" + downloadTotal + ": " + res.getString(R.string.dl_finished) );
-
- try {
- stream.close();
- } catch( java.io.IOException e ) {
- };
-
return true;
- };
-
+ }
+
private void initParent()
{
class Callback implements Runnable
diff --git a/project/java/GLSurfaceView_SDL.java b/project/java/GLSurfaceView_SDL.java
index af7ccbd20..e079b8c9a 100644
--- a/project/java/GLSurfaceView_SDL.java
+++ b/project/java/GLSurfaceView_SDL.java
@@ -32,6 +32,8 @@ import javax.microedition.khronos.egl.EGLSurface;
import javax.microedition.khronos.opengles.GL;
import javax.microedition.khronos.opengles.GL10;
+import android.opengl.EGL14; // Android 4.2 or newer
+
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
@@ -919,7 +921,6 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
mEglContext);
-
GL gl = mEglContext.getGL();
if (mGLWrapper != null) {
gl = mGLWrapper.wrap(gl);
diff --git a/project/java/Globals.java b/project/java/Globals.java
index 4bb21aa8b..8943b18ad 100644
--- a/project/java/Globals.java
+++ b/project/java/Globals.java
@@ -80,7 +80,6 @@ class Globals
public static boolean HorizontalOrientation = true;
public static boolean ImmersiveMode = true;
public static boolean DownloadToSdcard = true;
- public static boolean PhoneHasTrackball = false;
public static boolean PhoneHasArrowKeys = false;
public static boolean UseAccelerometerAsArrowKeys = false;
public static boolean UseTouchscreenKeyboard = true;
@@ -92,7 +91,6 @@ class Globals
public static boolean FloatingScreenJoystick = false;
public static int AccelerometerSensitivity = 2;
public static int AccelerometerCenterPos = 2;
- public static int TrackballDampening = 0;
public static int AudioBufferConfig = 0;
public static boolean OptionalDataDownload[] = null;
public static int LeftClickMethod = ForceRelativeMouseMode ? Mouse.LEFT_CLICK_WITH_TAP_OR_TIMEOUT : Mouse.LEFT_CLICK_NORMAL;
diff --git a/project/java/Settings.java b/project/java/Settings.java
index 5d83abf81..12af4bb89 100644
--- a/project/java/Settings.java
+++ b/project/java/Settings.java
@@ -92,13 +92,13 @@ class Settings
out.writeInt(SETTINGS_FILE_VERSION);
out.writeBoolean(Globals.DownloadToSdcard);
out.writeBoolean(Globals.PhoneHasArrowKeys);
- out.writeBoolean(Globals.PhoneHasTrackball);
+ out.writeBoolean(false);
out.writeBoolean(Globals.UseAccelerometerAsArrowKeys);
out.writeBoolean(Globals.UseTouchscreenKeyboard);
out.writeInt(Globals.TouchscreenKeyboardSize);
out.writeInt(Globals.AccelerometerSensitivity);
out.writeInt(Globals.AccelerometerCenterPos);
- out.writeInt(Globals.TrackballDampening);
+ out.writeInt(0);
out.writeInt(Globals.AudioBufferConfig);
out.writeInt(Globals.TouchscreenKeyboardTheme);
out.writeInt(Globals.RightClickMethod);
@@ -274,13 +274,13 @@ class Settings
throw new IOException();
Globals.DownloadToSdcard = settingsFile.readBoolean();
Globals.PhoneHasArrowKeys = settingsFile.readBoolean();
- Globals.PhoneHasTrackball = settingsFile.readBoolean();
+ settingsFile.readBoolean();
Globals.UseAccelerometerAsArrowKeys = settingsFile.readBoolean();
Globals.UseTouchscreenKeyboard = settingsFile.readBoolean();
Globals.TouchscreenKeyboardSize = settingsFile.readInt();
Globals.AccelerometerSensitivity = settingsFile.readInt();
Globals.AccelerometerCenterPos = settingsFile.readInt();
- Globals.TrackballDampening = settingsFile.readInt();
+ settingsFile.readInt();
Globals.AudioBufferConfig = settingsFile.readInt();
Globals.TouchscreenKeyboardTheme = settingsFile.readInt();
Globals.RightClickMethod = settingsFile.readInt();
@@ -546,8 +546,6 @@ class Settings
nativeSetVideoForceSoftwareMode();
if( Globals.SwVideoMode && Globals.MultiThreadedVideo )
nativeSetVideoMultithreaded();
- if( Globals.PhoneHasTrackball )
- nativeSetTrackballUsed();
applyMouseEmulationOptions();
nativeSetJoystickUsed( Globals.AppUsesThirdJoystick ? 3 : (Globals.AppUsesSecondJoystick ? 2 : (Globals.AppUsesJoystick ? 1 : 0)) );
if( Globals.AppUsesAccelerometer )
@@ -555,7 +553,6 @@ class Settings
if( Globals.AppUsesMultitouch )
nativeSetMultitouchUsed();
nativeSetAccelerometerSettings(Globals.AccelerometerSensitivity, Globals.AccelerometerCenterPos);
- nativeSetTrackballDampening(Globals.TrackballDampening);
if( Globals.UseTouchscreenKeyboard )
{
boolean screenKbReallyUsed = false;
@@ -856,8 +853,6 @@ class Settings
return true;
}
- private static native void nativeSetTrackballUsed();
- private static native void nativeSetTrackballDampening(int value);
private static native void nativeSetAccelerometerSettings(int sensitivity, int centerPos);
private static native void nativeSetMouseUsed(int RightClickMethod, int ShowScreenUnderFinger, int LeftClickMethod,
int MoveMouseWithJoystick, int ClickMouseWithDpad, int MaxForce, int MaxRadius,
diff --git a/project/java/Video.java b/project/java/Video.java
index 52318e1a4..b7733aef1 100644
--- a/project/java/Video.java
+++ b/project/java/Video.java
@@ -123,8 +123,6 @@ abstract class DifferentTouchInput
Log.i("SDL", "Device board: " + android.os.Build.BOARD);
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH )
{
- if( DetectCrappyDragonRiseDatexGamepad() )
- return CrappyDragonRiseDatexGamepadInputWhichNeedsItsOwnHandlerBecauseImTooCheapAndStupidToBuyProperGamepad.Holder.sInstance;
//return IcsTouchInput.Holder.sInstance;
return AutoDetectTouchInput.Holder.sInstance;
}
@@ -145,12 +143,6 @@ abstract class DifferentTouchInput
}
}
}
- private static boolean DetectCrappyDragonRiseDatexGamepad()
- {
- if( CrappyDragonRiseDatexGamepadInputWhichNeedsItsOwnHandlerBecauseImTooCheapAndStupidToBuyProperGamepad.Holder.sInstance == null )
- return false;
- return CrappyDragonRiseDatexGamepadInputWhichNeedsItsOwnHandlerBecauseImTooCheapAndStupidToBuyProperGamepad.Holder.sInstance.detect();
- }
private static class SingleTouchInput extends DifferentTouchInput
{
@@ -388,10 +380,6 @@ abstract class DifferentTouchInput
// Joysticks are supported since Honeycomb, but I don't care about it, because very little devices have it
if( (event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) == InputDevice.SOURCE_CLASS_JOYSTICK )
{
- DemoGLSurfaceView.nativeGamepadAnalogJoystickInput(
- event.getAxisValue(MotionEvent.AXIS_X), event.getAxisValue(MotionEvent.AXIS_Y),
- event.getAxisValue(MotionEvent.AXIS_Z), event.getAxisValue(MotionEvent.AXIS_RZ),
- event.getAxisValue(MotionEvent.AXIS_RTRIGGER), event.getAxisValue(MotionEvent.AXIS_LTRIGGER) );
// event.getAxisValue(AXIS_HAT_X) and event.getAxisValue(AXIS_HAT_Y) are joystick arrow keys, on Nvidia Shield and some other joysticks
if( event.getAxisValue(MotionEvent.AXIS_HAT_X) != hatX )
{
@@ -415,6 +403,11 @@ abstract class DifferentTouchInput
else
DemoGLSurfaceView.nativeKey(hatY < 0.0f ? KeyEvent.KEYCODE_DPAD_UP : KeyEvent.KEYCODE_DPAD_DOWN, 1, 0);
}
+ DemoGLSurfaceView.nativeGamepadAnalogJoystickInput(
+ event.getAxisValue(MotionEvent.AXIS_X), event.getAxisValue(MotionEvent.AXIS_Y),
+ event.getAxisValue(MotionEvent.AXIS_Z), event.getAxisValue(MotionEvent.AXIS_RZ),
+ event.getAxisValue(MotionEvent.AXIS_RTRIGGER), event.getAxisValue(MotionEvent.AXIS_LTRIGGER),
+ (hatX == 0.0f && hatY == 0.0f) ? 0 : 1 );
return;
}
// Process mousewheel
@@ -454,36 +447,6 @@ abstract class DifferentTouchInput
super.process(event);
}
}
- private static class CrappyDragonRiseDatexGamepadInputWhichNeedsItsOwnHandlerBecauseImTooCheapAndStupidToBuyProperGamepad extends IcsTouchInput
- {
- private static class Holder
- {
- private static final CrappyDragonRiseDatexGamepadInputWhichNeedsItsOwnHandlerBecauseImTooCheapAndStupidToBuyProperGamepad sInstance = new CrappyDragonRiseDatexGamepadInputWhichNeedsItsOwnHandlerBecauseImTooCheapAndStupidToBuyProperGamepad();
- }
- public void processGenericEvent(final MotionEvent event)
- {
- super.processGenericEvent(event);
- }
- public boolean detect()
- {
- int[] devIds = InputDevice.getDeviceIds();
- for( int id : devIds )
- {
- InputDevice device = InputDevice.getDevice(id);
- if( device == null )
- continue;
- System.out.println("libSDL: input device ID " + id + " type " + device.getSources() + " name " + device.getName() );
- if( (device.getSources() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD &&
- (device.getSources() & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK &&
- device.getName().indexOf("DragonRise Inc") == 0 )
- {
- System.out.println("libSDL: Detected crappy DragonRise gamepad, enabling special hack for it. Please press button labeled 'Analog', otherwise it won't work, because it's cheap and crappy");
- return true;
- }
- }
- return false;
- }
- }
private static class CrappyMtkTabletWithBrokenTouchDrivers extends IcsTouchInput
{
private static class Holder
@@ -1073,7 +1036,7 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL {
public static native void nativeHardwareMouseDetected( int detected );
public static native void nativeMouseButtonsPressed( int buttonId, int pressedState );
public static native void nativeMouseWheel( int scrollX, int scrollY );
- public static native void nativeGamepadAnalogJoystickInput( float stick1x, float stick1y, float stick2x, float stick2y, float rtrigger, float ltrigger );
+ public static native void nativeGamepadAnalogJoystickInput( float stick1x, float stick1y, float stick2x, float stick2y, float rtrigger, float ltrigger, int usingHat );
}
diff --git a/project/java/XZInputStream.java b/project/java/XZInputStream.java
new file mode 100644
index 000000000..2563a190e
--- /dev/null
+++ b/project/java/XZInputStream.java
@@ -0,0 +1,160 @@
+/*
+Simple DirectMedia Layer
+Java source code (C) 2009-2014 Sergii Pylypenko
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+package net.sourceforge.clonekeenplus;
+
+import java.io.InputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.EOFException;
+import android.util.Log;
+
+/**
+ * Decompresses a .xz file in streamed mode (no seeking).
+ * This is a copy of code from http://git.tukaani.org/xz-java.git
+ * but using liblzma and JNI instead of Java, because Java heap
+ * is very limited, and we're hitting memory limit on emulator.
+ */
+public class XZInputStream extends InputStream
+{
+ private long nativeData = 0;
+ private InputStream in = null;
+ private final byte[] inBuf = new byte[8192];
+ private int inOffset = 0;
+ private int inAvailable = 0;
+ private boolean outBufEof = false;
+ private int offsets[] = new int[2];
+
+ private final byte[] tempBuf = new byte[1];
+
+ public XZInputStream(InputStream in) throws IOException
+ {
+ this.in = in;
+ if (in == null)
+ {
+ throw new NullPointerException("InputStream == null");
+ }
+ nativeData = nativeInit();
+ if (nativeData == 0)
+ {
+ throw new OutOfMemoryError("Cannot initialize JNI liblzma object");
+ }
+ }
+
+ @Override
+ public int available() throws IOException
+ {
+ return 0; // Don't care
+ }
+
+ @Override
+ public void close() throws IOException
+ {
+ synchronized (this)
+ {
+ if (nativeData != 0)
+ nativeClose(nativeData);
+ nativeData = 0;
+ if (in != null)
+ {
+ try {
+ in.close();
+ } finally {
+ in = null;
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void finalize() throws IOException
+ {
+ try {
+ close();
+ } finally {
+ try {
+ super.finalize();
+ } catch (Throwable t) {
+ throw new AssertionError(t);
+ }
+ }
+ }
+
+ @Override
+ public int read() throws IOException
+ {
+ return read(tempBuf, 0, 1) == -1 ? -1 : (tempBuf[0] & 0xFF);
+ }
+
+ @Override
+ public int read(byte[] outBuf, int outOffset, int outCount) throws IOException
+ {
+ //Log.i("SDL", "XZInputStream.read: outOffset " + outOffset + " outCount " + outCount + " outBufEof " + outBufEof +
+ // " inOffset " + inOffset + " inAvailable " + inAvailable);
+ if (outBufEof)
+ return -1;
+ if (outCount <= 0)
+ return 0;
+
+ int oldOutOffset = outOffset;
+
+ if (inOffset >= inAvailable && inAvailable != -1)
+ {
+ inAvailable = in.read(inBuf, 0, inBuf.length);
+ inOffset = 0;
+ //Log.i("SDL", "XZInputStream.read: in.read: inOffset " + inOffset + " inAvailable " + inAvailable);
+ }
+
+ offsets[0] = inOffset;
+ offsets[1] = outOffset;
+ int ret = nativeRead(nativeData, inBuf, inAvailable, outBuf, outCount, offsets);
+ inOffset = offsets[0];
+ outOffset = offsets[1];
+ //Log.i("SDL", "XZInputStream.read: nativeRead: outOffset " + outOffset + " outCount " + outCount + " outBufEof " + outBufEof +
+ // " inOffset " + inOffset + " inAvailable " + inAvailable + " ret " + ret);
+
+ if (ret != 0)
+ {
+ if (ret == 1)
+ {
+ if (inOffset < inAvailable)
+ throw new IOException("Garbage at the end of LZMA stream");
+ if (inAvailable != -1)
+ inAvailable = in.read(inBuf, 0, inBuf.length);
+ if (inAvailable != -1)
+ throw new IOException("Garbage at the end of LZMA stream");
+ outBufEof = true;
+ }
+ else
+ {
+ throw new IOException("LZMA error " + ret);
+ }
+ }
+
+ //Log.i("SDL", "XZInputStream.read: returning " + (outOffset - oldOutOffset));
+ return outOffset - oldOutOffset;
+ }
+
+ private native long nativeInit();
+ private native void nativeClose(long nativeData);
+ private native int nativeRead(long nativeData, byte[] inBuf, int inAvailable, byte[] outBuf, int outCount, int[] offsets);
+}
+
diff --git a/project/jni/Application.mk b/project/jni/Application.mk
index dd4e6b12f..ea9e2e0ee 100644
--- a/project/jni/Application.mk
+++ b/project/jni/Application.mk
@@ -6,13 +6,3 @@ APP_STL := gnustl_static
APP_CFLAGS := -O3 -DNDEBUG -g # arm-linux-androideabi-4.4.3 crashes in -O0 mode on SDL sources
APP_PLATFORM := android-14 # Android 4.0, it should be backward compatible to previous versions
APP_PIE := false # This feature makes executables incompatible to Android API 15 or lower
-
-# Global compiler flags
-ifneq ($(filter armeabi-v7a-hard, $(APP_ABI)),)
-# Link-time optimization enabled for optimization junkies. -O999 etc
-#APP_CFLAGS := -flto
-#APP_CXXFLAGS := -flto
-#APP_LDFLAGS := -flto
-# Latest GCC got better LTO support
-#NDK_TOOLCHAIN_VERSION := 4.8
-endif
diff --git a/project/jni/SettingsTemplate.mk b/project/jni/SettingsTemplate.mk
index a6e724b75..5669a5f28 100644
--- a/project/jni/SettingsTemplate.mk
+++ b/project/jni/SettingsTemplate.mk
@@ -46,3 +46,9 @@ SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCO
SDL_VERSION := 1.2
+# Link-time optimization enabled for optimization junkies. -O999 etc
+#APP_CFLAGS := -flto
+#APP_CXXFLAGS := -flto
+#APP_LDFLAGS := -flto
+# Latest GCC got better LTO support
+NDK_TOOLCHAIN_VERSION := 4.6
diff --git a/project/jni/application/ballfield/AndroidAppSettings.cfg b/project/jni/application/ballfield/AndroidAppSettings.cfg
index 2deffa62a..eef046bfd 100644
--- a/project/jni/application/ballfield/AndroidAppSettings.cfg
+++ b/project/jni/application/ballfield/AndroidAppSettings.cfg
@@ -213,7 +213,7 @@ FirstStartMenuOptions='SettingsMenu.DummyMenu'
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
-MultiABI='armeabi-v7a'
+MultiABI='armeabi-v7a armeabi'
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=0
@@ -221,7 +221,7 @@ AppMinimumRAM=0
# Optional shared libraries to compile - removing some of them will save space
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
-CompiledLibraries="sdl_image android_support"
+CompiledLibraries="sdl_image"
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
CustomBuildScript=n
diff --git a/project/jni/application/ballfield/ballfield.cpp b/project/jni/application/ballfield/ballfield.cpp
index 578feda0b..d4feed749 100644
--- a/project/jni/application/ballfield/ballfield.cpp
+++ b/project/jni/application/ballfield/ballfield.cpp
@@ -445,6 +445,7 @@ int main(int argc, char* argv[])
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
SDL_EnableUNICODE(1);
+ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
SDL_Joystick * joysticks[6];
for( i = 0; i < 6; i++ )
joysticks[i] = SDL_JoystickOpen(i);
@@ -555,6 +556,7 @@ int main(int argc, char* argv[])
memset(gamepads, 0, sizeof(gamepads));
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "sizeof(int) %d long %d long long %d size_t %d", sizeof(int), sizeof(long), sizeof(long long), sizeof(size_t));
+ /*
wchar_t ss[256];
const wchar_t *ss2 = L"String 2 ЕНГ ---";
swprintf(ss, 256, L"String ЙЦУК --- %ls", ss2);
@@ -568,6 +570,7 @@ int main(int argc, char* argv[])
sprintf(ss4, "%ls", ss);
}
__android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "swprintf: len %d data %s: %s", wcslen(ss), ss3, ss4);
+ */
__android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "On-screen buttons:");
for(i = 0; i < SDL_ANDROID_SCREENKEYBOARD_BUTTON_NUM; i++)
@@ -746,6 +749,14 @@ int main(int argc, char* argv[])
x_speed = 500.0 * sin(t * 0.37);
y_speed = 500.0 * sin(t * 0.53);
z_speed = 400.0 * sin(t * 0.21);
+ if( SDL_GetKeyState(NULL)[SDLK_LEFT] )
+ x_speed -= 100000 * dt;
+ if( SDL_GetKeyState(NULL)[SDLK_RIGHT] )
+ x_speed += 100000 * dt;
+ if( SDL_GetKeyState(NULL)[SDLK_UP] )
+ y_speed -= 100000 * dt;
+ if( SDL_GetKeyState(NULL)[SDLK_DOWN] )
+ y_speed += 100000 * dt;
ballfield_move(balls, x_speed, y_speed, z_speed);
x_offs -= x_speed;
diff --git a/project/jni/application/guichan-widgets/AndroidAppSettings.cfg b/project/jni/application/guichan-widgets/AndroidAppSettings.cfg
index d80c938de..9eed1b81a 100644
--- a/project/jni/application/guichan-widgets/AndroidAppSettings.cfg
+++ b/project/jni/application/guichan-widgets/AndroidAppSettings.cfg
@@ -23,7 +23,7 @@ InhibitSuspend=n
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
-AppDataDownloadUrl="data file|files.zip"
+AppDataDownloadUrl="!!data file|files.zip"
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
@@ -161,7 +161,7 @@ StartupMenuButtonTimeout=3000
# Menu items to hide from startup menu, available menu items:
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
-HiddenMenuOptions=''
+HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig'
# Menu items to show at startup - this is Java code snippet, leave empty for default
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
@@ -171,7 +171,7 @@ FirstStartMenuOptions=''
# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices,
# but .apk size is 2x bigger (y) / (n) / (x86) / (all)
-MultiABI=all
+MultiABI='armeabi-v7a'
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=256
@@ -191,7 +191,7 @@ DeleteFilesOnUpgrade="%"
# Optional shared libraries to compile - removing some of them will save space
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
-CompiledLibraries="sdl_image guichan"
+CompiledLibraries="sdl_image sdl_ttf guichan"
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
CustomBuildScript=n
diff --git a/project/jni/application/guichan-widgets/AndroidData/files.zip b/project/jni/application/guichan-widgets/AndroidData/files.zip
index 314551ebb..64ef108dc 100644
Binary files a/project/jni/application/guichan-widgets/AndroidData/files.zip and b/project/jni/application/guichan-widgets/AndroidData/files.zip differ
diff --git a/project/jni/application/guichan-widgets/gui.xml b/project/jni/application/guichan-widgets/gui.xml
index 8514f2f4e..39c783775 100644
--- a/project/jni/application/guichan-widgets/gui.xml
+++ b/project/jni/application/guichan-widgets/gui.xml
@@ -1,23 +1,23 @@
-
-
-
-
-
- Item 1
- Item 2
- Item 3
-
-
- Item 1
- Item 2
- Item 3
-
-
-
-
-
-
-
-
+
+
+
+
+
+ Item 1
+ Item 2
+ Item 3
+
+
+ Item 1
+ Item 2
+ Item 3
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project/jni/application/guichan-widgets/sdl.hpp b/project/jni/application/guichan-widgets/sdl.hpp
index 4179da52e..a31bab11e 100644
--- a/project/jni/application/guichan-widgets/sdl.hpp
+++ b/project/jni/application/guichan-widgets/sdl.hpp
@@ -1,120 +1,122 @@
-/*
- * Code that sets up an SDL application with Guichan using the
- * Guichan SDL back end.
- */
-
-#include
-#include
-
-namespace sdl
-{
- bool running = true;
- SDL_Surface* screen;
-
- // All back ends contain objects to make Guichan work on a
- // specific target - in this case SDL - and they are a Graphics
- // object to make Guichan able to draw itself using SDL, an
- // input objec to make Guichan able to get user input using SDL
- // and an ImageLoader object to make Guichan able to load images
- // using SDL.
- gcn::SDLGraphics* graphics;
- gcn::SDLInput* input;
- gcn::SDLImageLoader* imageLoader;
-
- /**
- * Initialises the SDL application. This function creates the global
- * Gui object that can be populated by various examples.
- */
- void init()
- {
- // We simply initialise SDL as we would do with any SDL application.
- SDL_Init(SDL_INIT_VIDEO);
- screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE);
- // We want unicode for the SDLInput object to function properly.
- SDL_EnableUNICODE(1);
- // We also want to enable key repeat.
- SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
-
- // Now it's time to initialise the Guichan SDL back end.
-
- imageLoader = new gcn::SDLImageLoader();
- // The ImageLoader Guichan should use needs to be passed to the Image object
- // using a static function.
- gcn::Image::setImageLoader(imageLoader);
- graphics = new gcn::SDLGraphics();
- // The Graphics object needs a target to draw to, in this case it's the
- // screen surface, but any surface will do, it doesn't have to be the screen.
- graphics->setTarget(screen);
- input = new gcn::SDLInput();
-
- // Now we create the Gui object to be used with this SDL application.
- globals::gui = new gcn::Gui();
- // The Gui object needs a Graphics to be able to draw itself and an Input
- // object to be able to check for user input. In this case we provide the
- // Gui object with SDL implementations of these objects hence making Guichan
- // able to utilise SDL.
- globals::gui->setGraphics(graphics);
- globals::gui->setInput(input);
- }
-
- /**
- * Halts the SDL application.
- */
- void halt()
- {
- delete globals::gui;
-
- delete imageLoader;
- delete input;
- delete graphics;
-
- SDL_Quit();
- }
-
- /**
- * Runs the SDL application.
- */
- void run()
- {
- // The main loop
- while(running)
- {
- // Check user input
- SDL_Event event;
- while(SDL_PollEvent(&event))
- {
- if (event.type == SDL_KEYDOWN)
- {
- if (event.key.keysym.sym == SDLK_ESCAPE)
- {
- running = false;
- }
- if (event.key.keysym.sym == SDLK_f)
- {
- if (event.key.keysym.mod & KMOD_CTRL)
- {
- // Works with X11 only
- SDL_WM_ToggleFullScreen(screen);
- }
- }
- }
- else if(event.type == SDL_QUIT)
- {
- running = false;
- }
-
- // After we have manually checked user input with SDL for
- // any attempt by the user to halt the application we feed
- // the input to Guichan by pushing the input to the Input
- // object.
- input->pushInput(event);
- }
- // Now we let the Gui object perform its logic.
- globals::gui->logic();
- // Now we let the Gui object draw itself.
- globals::gui->draw();
- // Finally we update the screen.
- SDL_Flip(screen);
- }
- }
-}
+/*
+ * Code that sets up an SDL application with Guichan using the
+ * Guichan SDL back end.
+ */
+
+#include
+#include
+#include
+
+namespace sdl
+{
+ bool running = true;
+ SDL_Surface* screen;
+
+ // All back ends contain objects to make Guichan work on a
+ // specific target - in this case SDL - and they are a Graphics
+ // object to make Guichan able to draw itself using SDL, an
+ // input objec to make Guichan able to get user input using SDL
+ // and an ImageLoader object to make Guichan able to load images
+ // using SDL.
+ gcn::SDLGraphics* graphics;
+ gcn::SDLInput* input;
+ gcn::SDLImageLoader* imageLoader;
+
+ /**
+ * Initialises the SDL application. This function creates the global
+ * Gui object that can be populated by various examples.
+ */
+ void init()
+ {
+ // We simply initialise SDL as we would do with any SDL application.
+ SDL_Init(SDL_INIT_VIDEO);
+ screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE);
+ // We want unicode for the SDLInput object to function properly.
+ SDL_EnableUNICODE(1);
+ // We also want to enable key repeat.
+ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
+ TTF_Init();
+
+ // Now it's time to initialise the Guichan SDL back end.
+
+ imageLoader = new gcn::SDLImageLoader();
+ // The ImageLoader Guichan should use needs to be passed to the Image object
+ // using a static function.
+ gcn::Image::setImageLoader(imageLoader);
+ graphics = new gcn::SDLGraphics();
+ // The Graphics object needs a target to draw to, in this case it's the
+ // screen surface, but any surface will do, it doesn't have to be the screen.
+ graphics->setTarget(screen);
+ input = new gcn::SDLInput();
+
+ // Now we create the Gui object to be used with this SDL application.
+ globals::gui = new gcn::Gui();
+ // The Gui object needs a Graphics to be able to draw itself and an Input
+ // object to be able to check for user input. In this case we provide the
+ // Gui object with SDL implementations of these objects hence making Guichan
+ // able to utilise SDL.
+ globals::gui->setGraphics(graphics);
+ globals::gui->setInput(input);
+ }
+
+ /**
+ * Halts the SDL application.
+ */
+ void halt()
+ {
+ delete globals::gui;
+
+ delete imageLoader;
+ delete input;
+ delete graphics;
+
+ SDL_Quit();
+ }
+
+ /**
+ * Runs the SDL application.
+ */
+ void run()
+ {
+ // The main loop
+ while(running)
+ {
+ // Check user input
+ SDL_Event event;
+ while(SDL_PollEvent(&event))
+ {
+ if (event.type == SDL_KEYDOWN)
+ {
+ if (event.key.keysym.sym == SDLK_ESCAPE)
+ {
+ running = false;
+ }
+ if (event.key.keysym.sym == SDLK_f)
+ {
+ if (event.key.keysym.mod & KMOD_CTRL)
+ {
+ // Works with X11 only
+ SDL_WM_ToggleFullScreen(screen);
+ }
+ }
+ }
+ else if(event.type == SDL_QUIT)
+ {
+ running = false;
+ }
+
+ // After we have manually checked user input with SDL for
+ // any attempt by the user to halt the application we feed
+ // the input to Guichan by pushing the input to the Input
+ // object.
+ input->pushInput(event);
+ }
+ // Now we let the Gui object perform its logic.
+ globals::gui->logic();
+ // Now we let the Gui object draw itself.
+ globals::gui->draw();
+ // Finally we update the screen.
+ SDL_Flip(screen);
+ }
+ }
+}
diff --git a/project/jni/application/guichan-widgets/widgets.hpp b/project/jni/application/guichan-widgets/widgets.hpp
index db981e415..c2aef7835 100644
--- a/project/jni/application/guichan-widgets/widgets.hpp
+++ b/project/jni/application/guichan-widgets/widgets.hpp
@@ -1,182 +1,183 @@
-/**
- * Code to populate a global Gui object with all the widgets
- * of Guichan.
- */
-
-namespace widgets
-{
- gcn::ImageFont* font;
- gcn::Container* top;
- gcn::Label* label;
- gcn::Icon* icon;
- gcn::Button* button;
- gcn::TextField* textField;
- gcn::TextBox* textBox;
- gcn::ScrollArea* textBoxScrollArea;
- gcn::ListBox* listBox;
- gcn::DropDown* dropDown;
- gcn::CheckBox* checkBox1;
- gcn::CheckBox* checkBox2;
- gcn::RadioButton* radioButton1;
- gcn::RadioButton* radioButton2;
- gcn::RadioButton* radioButton3;
- gcn::Slider* slider;
- gcn::Image *image;
- gcn::Window *window;
- gcn::Image *darkbitsImage;
- gcn::Icon* darkbitsIcon;
- gcn::TabbedArea* tabbedArea;
- gcn::Button* tabOneButton;
- gcn::CheckBox* tabTwoCheckBox;
-
- /*
- * List boxes and drop downs need an instance of a list model
- * in order to display a list.
- */
- class DemoListModel : public gcn::ListModel
- {
- public:
- int getNumberOfElements()
- {
- return 5;
- }
-
- std::string getElementAt(int i)
- {
- switch(i)
- {
- case 0:
- return std::string("zero");
- case 1:
- return std::string("one");
- case 2:
- return std::string("two");
- case 3:
- return std::string("three");
- case 4:
- return std::string("four");
- default: // Just to keep warnings away
- return std::string("");
- }
- }
- };
-
- DemoListModel demoListModel;
-
- /**
- * Initialises the widgets example by populating the global Gui
- * object.
- */
- void init()
- {
- // We first create a container to be used as the top widget.
- // The top widget in Guichan can be any kind of widget, but
- // in order to make the Gui contain more than one widget we
- // make the top widget a container.
- top = new gcn::Container();
- // We set the dimension of the top container to match the screen.
- top->setDimension(gcn::Rectangle(0, 0, 640, 480));
- // Finally we pass the top widget to the Gui object.
- globals::gui->setTop(top);
-
- // Now we load the font used in this example.
- font = new gcn::ImageFont("fixedfont.bmp", " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
- // Widgets may have a global font so we don't need to pass the
- // font object to every created widget. The global font is static.
- gcn::Widget::setGlobalFont(font);
-
- // Now we create the widgets
-
- label = new gcn::Label("Label");
-
- image = gcn::Image::load("gui-chan.bmp");
- icon = new gcn::Icon(image);
-
- button = new gcn::Button("Button");
-
- textField = new gcn::TextField("Text field");
-
- textBox = new gcn::TextBox("Multiline\nText box");
- textBoxScrollArea = new gcn::ScrollArea(textBox);
- textBoxScrollArea->setWidth(200);
- textBoxScrollArea->setHeight(100);
- textBoxScrollArea->setFrameSize(1);
-
- listBox = new gcn::ListBox(&demoListModel);
- listBox->setFrameSize(1);
- dropDown = new gcn::DropDown(&demoListModel);
-
- checkBox1 = new gcn::CheckBox("Checkbox 1");
- checkBox2 = new gcn::CheckBox("Checkbox 2");
-
- radioButton1 = new gcn::RadioButton("RadioButton 1", "radiogroup", true);
- radioButton2 = new gcn::RadioButton("RadioButton 2", "radiogroup");
- radioButton3 = new gcn::RadioButton("RadioButton 3", "radiogroup");
-
- slider = new gcn::Slider(0, 10);
- slider->setSize(100, 10);
-
- window = new gcn::Window("I am a window Drag me");
- window->setBaseColor(gcn::Color(255, 150, 200, 190));
-
- darkbitsImage = gcn::Image::load("darkbitslogo_by_haiko.bmp");
- darkbitsIcon = new gcn::Icon(darkbitsImage);
- window->add(darkbitsIcon);
- window->resizeToContent();
-
- tabbedArea = new gcn::TabbedArea();
- tabbedArea->setSize(200, 100);
- tabOneButton = new gcn::Button("A button in tab 1");
- tabbedArea->addTab("Tab 1", tabOneButton);
- tabTwoCheckBox = new gcn::CheckBox("A check box in tab 2");
- tabbedArea->addTab("Tab 2", tabTwoCheckBox);
-
- // Now it's time to add the widgets to the top container
- // so they will be conected to the GUI.
-
- top->add(label, 10, 10);
- top->add(icon, 10, 30);
- top->add(button, 200, 10);
- top->add(textField, 250, 10);
- top->add(textBoxScrollArea, 200, 50);
- top->add(listBox, 200, 200);
- top->add(dropDown, 500, 10);
- top->add(checkBox1, 500, 130);
- top->add(checkBox2, 500, 150);
- top->add(radioButton1, 500, 200);
- top->add(radioButton2, 500, 220);
- top->add(radioButton3, 500, 240);
- top->add(slider, 500, 300);
- top->add(window, 50, 350);
- top->add(tabbedArea, 400, 350);
- }
-
- /**
- * Halts the widgets example.
- */
- void halt()
- {
- delete font;
- delete top;
- delete label;
- delete icon;
- delete button;
- delete textField;
- delete textBox;
- delete textBoxScrollArea;
- delete listBox;
- delete dropDown;
- delete checkBox1;
- delete checkBox2;
- delete radioButton1;
- delete radioButton2;
- delete radioButton3;
- delete slider;
- delete window;
- delete darkbitsIcon;
- delete darkbitsImage;
- delete tabbedArea;
- delete tabOneButton;
- delete tabTwoCheckBox;
- }
-}
+/**
+ * Code to populate a global Gui object with all the widgets
+ * of Guichan.
+ */
+
+namespace widgets
+{
+ gcn::Font* font;
+ gcn::Container* top;
+ gcn::Label* label;
+ gcn::Icon* icon;
+ gcn::Button* button;
+ gcn::TextField* textField;
+ gcn::TextBox* textBox;
+ gcn::ScrollArea* textBoxScrollArea;
+ gcn::ListBox* listBox;
+ gcn::DropDown* dropDown;
+ gcn::CheckBox* checkBox1;
+ gcn::CheckBox* checkBox2;
+ gcn::RadioButton* radioButton1;
+ gcn::RadioButton* radioButton2;
+ gcn::RadioButton* radioButton3;
+ gcn::Slider* slider;
+ gcn::Image *image;
+ gcn::Window *window;
+ gcn::Image *darkbitsImage;
+ gcn::Icon* darkbitsIcon;
+ gcn::TabbedArea* tabbedArea;
+ gcn::Button* tabOneButton;
+ gcn::CheckBox* tabTwoCheckBox;
+
+ /*
+ * List boxes and drop downs need an instance of a list model
+ * in order to display a list.
+ */
+ class DemoListModel : public gcn::ListModel
+ {
+ public:
+ int getNumberOfElements()
+ {
+ return 5;
+ }
+
+ std::string getElementAt(int i)
+ {
+ switch(i)
+ {
+ case 0:
+ return std::string("zero");
+ case 1:
+ return std::string("one");
+ case 2:
+ return std::string("two");
+ case 3:
+ return std::string("three");
+ case 4:
+ return std::string("four");
+ default: // Just to keep warnings away
+ return std::string("");
+ }
+ }
+ };
+
+ DemoListModel demoListModel;
+
+ /**
+ * Initialises the widgets example by populating the global Gui
+ * object.
+ */
+ void init()
+ {
+ // We first create a container to be used as the top widget.
+ // The top widget in Guichan can be any kind of widget, but
+ // in order to make the Gui contain more than one widget we
+ // make the top widget a container.
+ top = new gcn::Container();
+ // We set the dimension of the top container to match the screen.
+ top->setDimension(gcn::Rectangle(0, 0, 640, 480));
+ // Finally we pass the top widget to the Gui object.
+ globals::gui->setTop(top);
+
+ // Now we load the font used in this example.
+ //font = new gcn::ImageFont("fixedfont.bmp", " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
+ font = new gcn::contrib::SDLTrueTypeFont("Roboto-Bold.ttf", 10);
+ // Widgets may have a global font so we don't need to pass the
+ // font object to every created widget. The global font is static.
+ gcn::Widget::setGlobalFont(font);
+
+ // Now we create the widgets
+
+ label = new gcn::Label("Label");
+
+ image = gcn::Image::load("gui-chan.bmp");
+ icon = new gcn::Icon(image);
+
+ button = new gcn::Button("Button");
+
+ textField = new gcn::TextField("Text field АбВгЁ");
+
+ textBox = new gcn::TextBox("Multiline\nText box\nАбВгЁ");
+ textBoxScrollArea = new gcn::ScrollArea(textBox);
+ textBoxScrollArea->setWidth(200);
+ textBoxScrollArea->setHeight(100);
+ textBoxScrollArea->setFrameSize(1);
+
+ listBox = new gcn::ListBox(&demoListModel);
+ listBox->setFrameSize(1);
+ dropDown = new gcn::DropDown(&demoListModel);
+
+ checkBox1 = new gcn::CheckBox("Checkbox 1");
+ checkBox2 = new gcn::CheckBox("Checkbox 2");
+
+ radioButton1 = new gcn::RadioButton("RadioButton 1 АбВгЁ", "radiogroup", true);
+ radioButton2 = new gcn::RadioButton("RadioButton 2 АбВгЁ", "radiogroup");
+ radioButton3 = new gcn::RadioButton("RadioButton 3 АбВгЁ", "radiogroup");
+
+ slider = new gcn::Slider(0, 10);
+ slider->setSize(100, 10);
+
+ window = new gcn::Window("I am a window Drag me АбВгЁ");
+ window->setBaseColor(gcn::Color(255, 150, 200, 190));
+
+ darkbitsImage = gcn::Image::load("darkbitslogo_by_haiko.bmp");
+ darkbitsIcon = new gcn::Icon(darkbitsImage);
+ window->add(darkbitsIcon);
+ window->resizeToContent();
+
+ tabbedArea = new gcn::TabbedArea();
+ tabbedArea->setSize(200, 100);
+ tabOneButton = new gcn::Button("A button in tab 1 АбВгЁ");
+ tabbedArea->addTab("Tab 1 АбВгЁ", tabOneButton);
+ tabTwoCheckBox = new gcn::CheckBox("A check box in tab 2 АбВгЁ");
+ tabbedArea->addTab("Tab 2 АбВгЁ", tabTwoCheckBox);
+
+ // Now it's time to add the widgets to the top container
+ // so they will be conected to the GUI.
+
+ top->add(label, 10, 10);
+ top->add(icon, 10, 30);
+ top->add(button, 200, 10);
+ top->add(textField, 250, 10);
+ top->add(textBoxScrollArea, 200, 50);
+ top->add(listBox, 200, 200);
+ top->add(dropDown, 500, 10);
+ top->add(checkBox1, 500, 130);
+ top->add(checkBox2, 500, 150);
+ top->add(radioButton1, 500, 200);
+ top->add(radioButton2, 500, 220);
+ top->add(radioButton3, 500, 240);
+ top->add(slider, 500, 300);
+ top->add(window, 50, 350);
+ top->add(tabbedArea, 400, 350);
+ }
+
+ /**
+ * Halts the widgets example.
+ */
+ void halt()
+ {
+ delete font;
+ delete top;
+ delete label;
+ delete icon;
+ delete button;
+ delete textField;
+ delete textBox;
+ delete textBoxScrollArea;
+ delete listBox;
+ delete dropDown;
+ delete checkBox1;
+ delete checkBox2;
+ delete radioButton1;
+ delete radioButton2;
+ delete radioButton3;
+ delete slider;
+ delete window;
+ delete darkbitsIcon;
+ delete darkbitsImage;
+ delete tabbedArea;
+ delete tabOneButton;
+ delete tabTwoCheckBox;
+ }
+}
diff --git a/project/jni/application/hid-pc-keyboard/project.patch b/project/jni/application/hid-pc-keyboard/project.patch
new file mode 100644
index 000000000..79e7a6f8a
--- /dev/null
+++ b/project/jni/application/hid-pc-keyboard/project.patch
@@ -0,0 +1,11 @@
+--- a/project/AndroidManifest.xml 2014-11-24 19:30:31.003274516 +0200
++++ b/project/AndroidManifest.xml 2014-11-24 19:30:33.547274398 +0200
+@@ -28,7 +28,7 @@
+
+
+
+-
++
+
+
+
diff --git a/project/jni/application/hid-pc-keyboard/src b/project/jni/application/hid-pc-keyboard/src
index df3a7ab02..2f7672c98 160000
--- a/project/jni/application/hid-pc-keyboard/src
+++ b/project/jni/application/hid-pc-keyboard/src
@@ -1 +1 @@
-Subproject commit df3a7ab02f6414f39583f7f599c4cf9f73632898
+Subproject commit 2f7672c98042b2a8c7e1fa72effe6c318aca7268
diff --git a/project/jni/application/jooleem_0.1.4/AndroidAppSettings.cfg b/project/jni/application/jooleem_0.1.4/AndroidAppSettings.cfg
index 9a14dbf7d..c1af69606 100644
--- a/project/jni/application/jooleem_0.1.4/AndroidAppSettings.cfg
+++ b/project/jni/application/jooleem_0.1.4/AndroidAppSettings.cfg
@@ -1,30 +1,265 @@
# The application settings for Android libSDL port
-AppSettingVersion=12
-LibSdlVersion=1.2
+
+# Specify application name (e.x. My Application)
AppName="Jooleem"
+
+# Specify reversed site name of application (e.x. com.mysite.myapp)
AppFullName=net.sourceforge.jooleem
-ScreenOrientation=h
-InhibitSuspend=n
-AppDataDownloadUrl="Data files are 10 Mb|http://sourceforge.net/projects/libsdl-android/files/Jooleem/jooleem_0.1.4_data.zip/download|http://sites.google.com/site/xpelyax/Home/jooleem_0.1.4_data.zip?attredirects=0&d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/jooleem_0.1.4_data.zip"
-SdlVideoResize=y
-SdlVideoResizeKeepAspect=n
-NeedDepthBuffer=n
-AppUsesMouse=y
-AppNeedsArrowKeys=n
-AppUsesJoystick=n
-AppHandlesJoystickSensitivity=n
-AppUsesMultitouch=n
-NonBlockingSwapBuffers=n
-RedefinedKeys=""
-AppTouchscreenKeyboardKeysAmount=0
-AppTouchscreenKeyboardKeysAmountAutoFire=0
-MultiABI=n
-AppVersionCode=01404
-AppVersionName="0.1.4.04"
-CompiledLibraries="sdl_mixer sdl_image sdl_ttf"
-CustomBuildScript=n
-AppCflags='-finline-functions -O2'
-AppLdflags=''
-AppSubdirsBuild=''
-AppUseCrystaXToolchain=n
+
+# Application version code (integer)
+AppVersionCode=01405
+
+# Application user-visible version name (string)
+AppVersionName="0.1.4.05"
+
+# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
+# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
+# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
+# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
+# these files are put inside .apk package by build system
+# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
+AppDataDownloadUrl="!!Data files are 10 Mb|jooleem_0.1.4_data.zip|http://sourceforge.net/projects/libsdl-android/files/Jooleem/jooleem_0.1.4_data.zip/download"
+
+# Reset SDL config when updating application to the new version (y) / (n)
+ResetSdlConfigForThisVersion=y
+
+# Delete application data files when upgrading (specify file/dir paths separated by spaces)
+DeleteFilesOnUpgrade=""
+
+# Here you may type readme text, which will be shown during startup. Format is:
+# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
+
+# libSDL version to use (1.2/1.3/2.0)
+LibSdlVersion=1.2
+
+# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape
+ScreenOrientation=h
+
+# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
+# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
+VideoDepthBpp=16
+
+# Enable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
+NeedDepthBuffer=n
+
+# Enable OpenGL stencil buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
+NeedStencilBuffer=n
+
+# Try to use GLES 2.x context - will revert to GLES 1.X if unsupported by device
+# you need this option only if you're developing 3-d app (y) or (n)
+NeedGles2=n
+
+# Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL,
+# this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n)
+SwVideoMode=y
+
+# Application video output will be resized to fit into native device screen (y)/(n)
+SdlVideoResize=y
+
+# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
+SdlVideoResizeKeepAspect=n
+
+# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
+InhibitSuspend=n
+
+# Create Android service, so the app is less likely to be killed while in background
+CreateService=n
+
+# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
+# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
+CompatibilityHacksForceScreenUpdate=
+
+# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
+# force screen update by moving mouse cursor a little after each click (y) or (n)
+CompatibilityHacksForceScreenUpdateMouseClick=y
+
+# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
+CompatibilityHacksStaticInit=
+
+# On-screen Android soft text input emulates hardware keyboard, this will only work with Hackers Keyboard app (y)/(n)
+CompatibilityHacksTextInputEmulatesHwKeyboard=
+
+# Hack for broken devices: prevent audio chopping, by sleeping a bit after pushing each audio chunk (y)/(n)
+CompatibilityHacksPreventAudioChopping=
+
+# Hack for broken apps: application ignores audio buffer size returned by SDL (y)/(n)
+CompatibilityHacksAppIgnoresAudioBufferSize=
+
+# Hack for VCMI: preload additional shared libraries before aplication start
+CompatibilityHacksAdditionalPreloadedSharedLibraries=""
+
+# Hack for Free Heroes 2, which redraws the screen inside SDL_PumpEvents(): slow and compatible SDL event queue -
+# do not use it with accelerometer/gyroscope, or your app may freeze at random (y)/(n)
+CompatibilityHacksSlowCompatibleEventQueue=
+
+# Save and restore OpenGL state when drawing on-screen keyboard for apps that use SDL_OPENGL
+CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState=
+
+# Application uses SDL_UpdateRects() properly, and does not draw in any region outside those rects.
+# This improves drawing speed, but I know only one application that does that, and it's written by me (y)/(n)
+CompatibilityHacksProperUsageOfSDL_UpdateRects=
+
+# Application uses mouse (y) or (n), this will show mouse emulation dialog to the user
+AppUsesMouse=y
+
+# Application needs two-button mouse, will also enable advanced point-and-click features (y) or (n)
+AppNeedsTwoButtonMouse=n
+
+# Right mouse button can do long-press/drag&drop action, necessary for some games (y) or (n)
+# If you disable it, swiping with two fingers will send mouse wheel events
+RightMouseButtonLongPress=n
+
+# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
+ShowMouseCursor=n
+
+# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n)
+GenerateSubframeTouchEvents=n
+
+# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
+ForceRelativeMouseMode=n
+
+# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
+AppNeedsArrowKeys=n
+
+# On-screen dpad/joystick will appear under finger when it touches the screen (y) or (n)
+# Joystick always follows finger, so moving mouse requires touching the screen with other finger
+FloatingScreenJoystick=
+
+# Application needs text input (y) or (n), enables button for text input on screen
+AppNeedsTextInput=
+
+# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
+# This will disable AppNeedsArrowKeys option
+AppUsesJoystick=n
+
+# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
+AppUsesSecondJoystick=n
+
+# Application uses third on-screen joystick, as SDL joystick 0 axes 20-21 (y)/(n)
+AppUsesThirdJoystick=
+
+# Application uses accelerometer (y) or (n), the accelerometer will be used as joystick 1 axes 0-1 and 5-7
+AppUsesAccelerometer=
+
+# Application uses gyroscope (y) or (n), the gyroscope will be used as joystick 1 axes 2-4
+AppUsesGyroscope=
+
+# Use gyroscope to move mouse cursor (y) or (n), it eats battery, and can be disabled in settings, do not use with AppUsesGyroscope setting
+MoveMouseWithGyroscope=
+
+# Application uses multitouch (y) or (n), multitouch events are passed as SDL_JOYBALLMOTION events for the joystick 0
+AppUsesMultitouch=n
+
+# Application records audio (it will use any available source, such a s microphone)
+# API is defined in file SDL_android.h: int SDL_ANDROID_OpenAudioRecording(SDL_AudioSpec *spec); void SDL_ANDROID_CloseAudioRecording(void);
+# This option will add additional permission to Android manifest (y)/(n)
+AppRecordsAudio=
+
+# Application needs to access SD card. If your data files are bigger than 5 Mb, enable it. (y) / (n)
+AccessSdCard=
+
+# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)
+AccessInternet=
+
+# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
+ImmersiveMode=
+
+# Application implements Android-specific routines to put to background, and will not draw anything to screen
+# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
+# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)
+# This option is reported to be buggy, sometimes failing to restore video state
+NonBlockingSwapBuffers=n
+
+# Redefine common hardware keys to SDL keysyms
+# BACK hardware key is available on all devices, MENU is available on pre-ICS devices, other keys may be absent
+# SEARCH and CALL by default return same keycode as DPAD_CENTER - one of those keys is available on most devices
+# Use word NO_REMAP if you want to preserve native functionality for certain key (volume keys are 3-rd and 4-th)
+# Keys: TOUCHSCREEN (works only when AppUsesMouse=n), DPAD_CENTER/SEARCH, VOLUMEUP, VOLUMEDOWN, MENU, BACK, CAMERA
+RedefinedKeys=""
+
+# Number of virtual keyboard keys (currently 6 is maximum)
+AppTouchscreenKeyboardKeysAmount=0
+
+# Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right)
+RedefinedKeysScreenKb=""
+
+# Names for on-screen keyboard keys, such as Fire, Jump, Run etc, separated by spaces, they are used in SDL config menu
+RedefinedKeysScreenKbNames=""
+
+# On-screen keys theme
+# 0 = Ultimate Droid by Sean Stieber (green, with gamepad joystick)
+# 1 = Simple Theme by Beholder (white, with gamepad joystick)
+# 2 = Sun by Sirea (yellow, with round joystick)
+# 3 = Keen by Gerstrong (multicolor, with round joystick)
+TouchscreenKeysTheme=2
+
+# Redefine gamepad keys to SDL keysyms, button order is:
+# A B X Y L1 R1 L2 R2 LThumb RThumb
+RedefinedKeysGamepad=""
+
+# How long to show startup menu button, in msec, 0 to disable startup menu
+StartupMenuButtonTimeout=0
+
+# Menu items to hide from startup menu, available menu items:
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
+HiddenMenuOptions=''
+
+# Menu items to show at startup - this is Java code snippet, leave empty for default
+# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
+# Available menu items:
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
+FirstStartMenuOptions='SettingsMenu.DummyMenu'
+
+# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
+AppMinimumRAM=0
+
+# GCC version, 4.6 (default) or 4.8, CLANG is not supported yet
+NDK_TOOLCHAIN_VERSION=
+
+# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
+# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
+MultiABI='armeabi armeabi-v7a x86 mips'
+
+# Optional shared libraries to compile - removing some of them will save space
+# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
+# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
+CompiledLibraries="sdl_mixer sdl_image sdl_ttf"
+
+# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
+CustomBuildScript=n
+
+# Aditional CFLAGS for application
+AppCflags='-finline-functions -O2'
+
+# Additional LDFLAGS for application
+AppLdflags=''
+
+# If application has headers with the same name as system headers, this option tries to fix compiler flags to make it compilable
+AppOverlapsSystemHeaders=
+
+# Build only following subdirs (empty will build all dirs, ignored with custom script)
+AppSubdirsBuild=''
+
+# Exclude these files from build
+AppBuildExclude=''
+
+# Application command line parameters, including app name as 0-th param
+AppCmdline=''
+
+# Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens
+# Minimum screen size that application supports: (s)mall / (m)edium / (l)arge
+MinimumScreenSize=
+
+# Your AdMob Publisher ID, (n) if you don't want advertisements
+AdmobPublisherId=
+
+# Your AdMob test device ID, to receive a test ad
+AdmobTestDeviceId=
+
+# Your AdMob banner size (BANNER/FULL_BANNER/LEADERBOARD/MEDIUM_RECTANGLE/SMART_BANNER/WIDE_SKYSCRAPER/FULL_WIDTH:Height/Width:AUTO_HEIGHT/Width:Height)
+AdmobBannerSize=
+
+# Google Play Game Services application ID, required for cloud saves to work
+GooglePlayGameServicesId=
+
diff --git a/project/jni/application/openarena/AndroidAppSettings.cfg b/project/jni/application/openarena/AndroidAppSettings.cfg
index 501cac1e9..c2f74335a 100644
--- a/project/jni/application/openarena/AndroidAppSettings.cfg
+++ b/project/jni/application/openarena/AndroidAppSettings.cfg
@@ -213,7 +213,7 @@ FirstStartMenuOptions=''
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
-MultiABI='armeabi-v7a'
+MultiABI='armeabi-v7a x86 mips'
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=300
diff --git a/project/jni/application/openarena/AndroidBuild.sh b/project/jni/application/openarena/AndroidBuild.sh
index 039af7c4c..7e07a6d65 100755
--- a/project/jni/application/openarena/AndroidBuild.sh
+++ b/project/jni/application/openarena/AndroidBuild.sh
@@ -5,7 +5,6 @@ LOCAL_PATH=`cd $LOCAL_PATH && pwd`
if [ "$1" = "armeabi-v7a" ]; then (
mkdir -p AndroidData
- [ -e libapplication.so ] || ln -s libapplication-armeabi.so libapplication.so
make -j8 -C vm BUILD_MISSIONPACK=0 || exit 1
cd vm/build/release-linux-`uname -m`/baseq3
#rm -f ../../../../AndroidData/binaries.zip ../../../../AndroidData/pak7-android.pk3
diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg
index c9373fb0a..e59e234bc 100644
--- a/project/jni/application/openttd/AndroidAppSettings.cfg
+++ b/project/jni/application/openttd/AndroidAppSettings.cfg
@@ -7,10 +7,10 @@ AppName="OpenTTD"
AppFullName=org.openttd.sdl
# Application version code (integer)
-AppVersionCode=14334
+AppVersionCode=14436
# Application user-visible version name (string)
-AppVersionName="1.4.3.34"
+AppVersionName="1.4.4.36"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
@@ -18,7 +18,7 @@ AppVersionName="1.4.3.34"
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
-AppDataDownloadUrl="!!Data files - 20 Mb|openttd-data-1.4.3.zip.xz|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.4.3.zip.xz^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.30.cfg^!MIDI music support (18 Mb)|timidity.zip.xz|http://sourceforge.net/projects/libsdl-android/files/timidity.zip.xz^!!Internationalization files|icudt52l.zip.xz|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip.xz"
+AppDataDownloadUrl="!!Data files - 20 Mb|openttd-data-1.4.4.zip.xz|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.4.4.zip.xz^!!Config file|:.openttd/openttd.cfg:openttd-1.4.0.30.cfg^!MIDI music support (18 Mb)|timidity.zip.xz|http://sourceforge.net/projects/libsdl-android/files/timidity.zip.xz^!!Internationalization files|icudt52l.zip.xz|http://sourceforge.net/projects/libsdl-android/files/icudt52l.zip.xz"
# Reset SDL config when updating application to the new version (y) / (n)
ResetSdlConfigForThisVersion=n
@@ -213,7 +213,7 @@ FirstStartMenuOptions=''
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
-MultiABI='armeabi-v7a x86'
+MultiABI='armeabi-v7a x86' #armeabi-v7a x86
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=0
diff --git a/project/jni/application/openttd/build-pc.sh b/project/jni/application/openttd/build-pc.sh
index 19512033c..8ad94e10c 100755
--- a/project/jni/application/openttd/build-pc.sh
+++ b/project/jni/application/openttd/build-pc.sh
@@ -7,7 +7,11 @@ mkdir -p openttd-pc openttd-pc/baseset
cd openttd-pc
[ -e bin/baseset ] || cp -a ../src/bin .
+export CFLAGS=-O0
+export CXXFLAGS=-O0
+
[ -e Makefile ] || ../src/configure --enable-debug || exit 1
-make -j8 || exit 1
+make -j8 VERBOSE=1 || exit 1
cd bin
-gdb -ex run ./openttd
+#gdb -ex run --args ./openttd
+./openttd -d 1 -r 854x480 -g opntitle.sav
diff --git a/project/jni/application/openttd/pack-data.sh b/project/jni/application/openttd/pack-data.sh
index 0b6781037..05f426341 100755
--- a/project/jni/application/openttd/pack-data.sh
+++ b/project/jni/application/openttd/pack-data.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-VER=1.4.3
+VER=1.4.4
cd data
rm -f ../AndroidData/openttd-data-*.zip.xz ../AndroidData/openttd-data-*.zip
diff --git a/project/jni/application/openttd/src b/project/jni/application/openttd/src
index 394ab0d64..c0c98b562 160000
--- a/project/jni/application/openttd/src
+++ b/project/jni/application/openttd/src
@@ -1 +1 @@
-Subproject commit 394ab0d648882d912b19525b81322451114fc91d
+Subproject commit c0c98b562ad53b5fa754fa75eafc0b99747ef09f
diff --git a/project/jni/application/setEnvironment-armeabi-v7a-hard.sh b/project/jni/application/setEnvironment-armeabi-v7a-hard.sh
index 5c9bc359e..ca3dc0a4e 100755
--- a/project/jni/application/setEnvironment-armeabi-v7a-hard.sh
+++ b/project/jni/application/setEnvironment-armeabi-v7a-hard.sh
@@ -22,7 +22,7 @@ grep "64.bit" "$NDK/RELEASE.TXT" >/dev/null 2>&1 && MYARCH="${MYARCH}_64"
#echo NDK $NDK
GCCPREFIX=arm-linux-androideabi
-[ -z "$GCCVER" ] && GCCVER=4.6
+[ -z "$NDK_TOOLCHAIN_VERSION" ] && NDK_TOOLCHAIN_VERSION=4.6
[ -z "$PLATFORMVER" ] && PLATFORMVER=android-14
LOCAL_PATH=`dirname $0`
if which realpath > /dev/null ; then
@@ -55,9 +55,9 @@ CFLAGS="\
-fomit-frame-pointer -fno-strict-aliasing -finline-limit=300 \
-DANDROID -Wall -Wno-unused -Wa,--noexecstack -Wformat -Werror=format-security \
-isystem$NDK/platforms/$PLATFORMVER/arch-arm/usr/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include/backward \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include/backward \
-isystem$LOCAL_PATH/../sdl-1.2/include \
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \
$MISSING_INCLUDE $CFLAGS"
@@ -85,7 +85,7 @@ $SHARED \
-L$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib \
-lc -lGLESv1_CM -ldl -llog -lz \
-Wl,--no-warn-mismatch -lm_hard \
--L$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH \
+-L$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH \
-lgnustl_static \
-no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 $UNRESOLVED -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \
-lsupc++ \
@@ -93,17 +93,17 @@ $MISSING_LIB $LDFLAGS"
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
-env PATH=$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
+env PATH=$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
CFLAGS="$CFLAGS" \
CXXFLAGS="$CXXFLAGS $CFLAGS -frtti -fexceptions" \
LDFLAGS="$LDFLAGS" \
-CC="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
-CXX="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-RANLIB="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
-LD="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-AR="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
-CPP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
-NM="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
-AS="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
-STRIP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
+CC="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
+CXX="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+RANLIB="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
+LD="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+AR="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
+CPP="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
+NM="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
+AS="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
+STRIP="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
"$@"
diff --git a/project/jni/application/setEnvironment-armeabi-v7a.sh b/project/jni/application/setEnvironment-armeabi-v7a.sh
index 7725d2223..edc80843a 100755
--- a/project/jni/application/setEnvironment-armeabi-v7a.sh
+++ b/project/jni/application/setEnvironment-armeabi-v7a.sh
@@ -22,7 +22,7 @@ grep "64.bit" "$NDK/RELEASE.TXT" >/dev/null 2>&1 && MYARCH="${MYARCH}_64"
#echo NDK $NDK
GCCPREFIX=arm-linux-androideabi
-[ -z "$GCCVER" ] && GCCVER=4.6
+[ -z "$NDK_TOOLCHAIN_VERSION" ] && NDK_TOOLCHAIN_VERSION=4.6
[ -z "$PLATFORMVER" ] && PLATFORMVER=android-14
LOCAL_PATH=`dirname $0`
if which realpath > /dev/null ; then
@@ -55,9 +55,9 @@ CFLAGS="\
-fomit-frame-pointer -fno-strict-aliasing -finline-limit=300 \
-DANDROID -Wall -Wno-unused -Wa,--noexecstack -Wformat -Werror=format-security \
-isystem$NDK/platforms/$PLATFORMVER/arch-arm/usr/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include/backward \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include/backward \
-isystem$LOCAL_PATH/../sdl-1.2/include \
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \
$MISSING_INCLUDE $CFLAGS"
@@ -84,7 +84,7 @@ $SHARED \
`echo $APP_SHARED_LIBS | sed \"s@\([-a-zA-Z0-9_.]\+\)@$LOCAL_PATH/../../obj/local/$ARCH/lib\1.so@g\"` \
-L$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib \
-lc -lm -lGLESv1_CM -ldl -llog -lz \
--L$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH \
+-L$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH \
-lgnustl_static \
-no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 $UNRESOLVED -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \
-lsupc++ \
@@ -92,17 +92,17 @@ $MISSING_LIB $LDFLAGS"
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
-env PATH=$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
+env PATH=$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
CFLAGS="$CFLAGS" \
CXXFLAGS="$CXXFLAGS $CFLAGS -frtti -fexceptions" \
LDFLAGS="$LDFLAGS" \
-CC="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
-CXX="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-RANLIB="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
-LD="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-AR="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
-CPP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
-NM="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
-AS="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
-STRIP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
+CC="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
+CXX="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+RANLIB="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
+LD="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+AR="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
+CPP="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
+NM="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
+AS="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
+STRIP="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
"$@"
diff --git a/project/jni/application/setEnvironment-mips.sh b/project/jni/application/setEnvironment-mips.sh
index 74cc5da36..2b8241e50 100755
--- a/project/jni/application/setEnvironment-mips.sh
+++ b/project/jni/application/setEnvironment-mips.sh
@@ -22,7 +22,7 @@ grep "64.bit" "$NDK/RELEASE.TXT" >/dev/null 2>&1 && MYARCH="${MYARCH}_64"
#echo NDK $NDK
GCCPREFIX=mipsel-linux-android
-[ -z "$GCCVER" ] && GCCVER=4.6
+[ -z "$NDK_TOOLCHAIN_VERSION" ] && NDK_TOOLCHAIN_VERSION=4.6
[ -z "$PLATFORMVER" ] && PLATFORMVER=android-14
LOCAL_PATH=`dirname $0`
if which realpath > /dev/null ; then
@@ -56,9 +56,9 @@ CFLAGS="\
-funswitch-loops -finline-limit=300 \
-DANDROID -Wall -Wno-unused -Wa,--noexecstack -Wformat -Werror=format-security \
-isystem$NDK/platforms/$PLATFORMVER/arch-mips/usr/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include/backward \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include/backward \
-isystem$LOCAL_PATH/../sdl-1.2/include \
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \
$MISSING_INCLUDE $CFLAGS"
@@ -85,7 +85,7 @@ $SHARED \
`echo $APP_SHARED_LIBS | sed \"s@\([-a-zA-Z0-9_.]\+\)@$LOCAL_PATH/../../obj/local/$ARCH/lib\1.so@g\"` \
-L$NDK/platforms/$PLATFORMVER/arch-mips/usr/lib \
-lc -lm -lGLESv1_CM -ldl -llog -lz \
--L$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH \
+-L$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH \
-lgnustl_static \
-no-canonical-prefixes $UNRESOLVED -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \
-lsupc++ \
@@ -93,17 +93,17 @@ $MISSING_LIB $LDFLAGS"
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
-env PATH=$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
+env PATH=$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
CFLAGS="$CFLAGS" \
CXXFLAGS="$CXXFLAGS $CFLAGS -frtti -fexceptions" \
LDFLAGS="$LDFLAGS" \
-CC="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
-CXX="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-RANLIB="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
-LD="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-AR="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
-CPP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
-NM="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
-AS="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
-STRIP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
+CC="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
+CXX="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+RANLIB="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
+LD="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+AR="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
+CPP="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
+NM="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
+AS="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
+STRIP="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
"$@"
diff --git a/project/jni/application/setEnvironment-x86.sh b/project/jni/application/setEnvironment-x86.sh
index 86c99e08c..7cd883dec 100755
--- a/project/jni/application/setEnvironment-x86.sh
+++ b/project/jni/application/setEnvironment-x86.sh
@@ -22,7 +22,7 @@ grep "64.bit" "$NDK/RELEASE.TXT" >/dev/null 2>&1 && MYARCH="${MYARCH}_64"
#echo NDK $NDK
GCCPREFIX=i686-linux-android
-[ -z "$GCCVER" ] && GCCVER=4.6
+[ -z "$NDK_TOOLCHAIN_VERSION" ] && NDK_TOOLCHAIN_VERSION=4.6
[ -z "$PLATFORMVER" ] && PLATFORMVER=android-14
LOCAL_PATH=`dirname $0`
if which realpath > /dev/null ; then
@@ -49,15 +49,15 @@ MISSING_INCLUDE=
MISSING_LIB=
CFLAGS="\
--ffunction-sections -funwind-tables -no-canonical-prefixes \
+-fpic -ffunction-sections -funwind-tables -no-canonical-prefixes \
-fstack-protector -O2 -g -DNDEBUG \
-fomit-frame-pointer -fstrict-aliasing -funswitch-loops \
-finline-limit=300 \
-DANDROID -Wall -Wno-unused -Wa,--noexecstack -Wformat -Werror=format-security \
-isystem$NDK/platforms/$PLATFORMVER/arch-x86/usr/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include/backward \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include/backward \
-isystem$LOCAL_PATH/../sdl-1.2/include \
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \
$MISSING_INCLUDE $CFLAGS"
@@ -84,7 +84,7 @@ $SHARED \
`echo $APP_SHARED_LIBS | sed \"s@\([-a-zA-Z0-9_.]\+\)@$LOCAL_PATH/../../obj/local/$ARCH/lib\1.so@g\"` \
-L$NDK/platforms/$PLATFORMVER/arch-x86/usr/lib \
-lc -lm -lGLESv1_CM -ldl -llog -lz \
--L$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH \
+-L$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH \
-lgnustl_static \
-no-canonical-prefixes $UNRESOLVED -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \
-lsupc++ \
@@ -92,17 +92,17 @@ $MISSING_LIB $LDFLAGS"
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
-env PATH=$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
+env PATH=$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
CFLAGS="$CFLAGS" \
CXXFLAGS="$CXXFLAGS $CFLAGS -frtti -fexceptions" \
LDFLAGS="$LDFLAGS" \
-CC="$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
-CXX="$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-RANLIB="$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
-LD="$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-AR="$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
-CPP="$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
-NM="$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
-AS="$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
-STRIP="$NDK/toolchains/$ARCH-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
+CC="$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
+CXX="$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+RANLIB="$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
+LD="$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+AR="$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
+CPP="$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
+NM="$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
+AS="$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
+STRIP="$NDK/toolchains/$ARCH-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
"$@"
diff --git a/project/jni/application/setEnvironment.sh b/project/jni/application/setEnvironment.sh
index 233f6c9ad..8eb7dea51 100755
--- a/project/jni/application/setEnvironment.sh
+++ b/project/jni/application/setEnvironment.sh
@@ -22,7 +22,7 @@ grep "64.bit" "$NDK/RELEASE.TXT" >/dev/null 2>&1 && MYARCH="${MYARCH}_64"
#echo NDK $NDK
GCCPREFIX=arm-linux-androideabi
-[ -z "$GCCVER" ] && GCCVER=4.6
+[ -z "$NDK_TOOLCHAIN_VERSION" ] && NDK_TOOLCHAIN_VERSION=4.6
PLATFORMVER=android-14
LOCAL_PATH=`dirname $0`
if which realpath > /dev/null ; then
@@ -55,9 +55,9 @@ CFLAGS="\
-fomit-frame-pointer -fno-strict-aliasing -finline-limit=300 \
-DANDROID -Wall -Wno-unused -Wa,--noexecstack -Wformat -Werror=format-security \
-isystem$NDK/platforms/$PLATFORMVER/arch-arm/usr/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH/include \
--isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include/backward \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH/include \
+-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/include/backward \
-isystem$LOCAL_PATH/../sdl-1.2/include \
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \
$MISSING_INCLUDE $CFLAGS"
@@ -84,7 +84,7 @@ $SHARED \
`echo $APP_SHARED_LIBS | sed \"s@\([-a-zA-Z0-9_.]\+\)@$LOCAL_PATH/../../obj/local/$ARCH/lib\1.so@g\"` \
-L$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib \
-lc -lm -lGLESv1_CM -ldl -llog -lz \
--L$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH \
+-L$NDK/sources/cxx-stl/gnu-libstdc++/$NDK_TOOLCHAIN_VERSION/libs/$ARCH \
-lgnustl_static \
-no-canonical-prefixes $UNRESOLVED -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \
-lsupc++ \
@@ -92,17 +92,17 @@ $MISSING_LIB $LDFLAGS"
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
-env PATH=$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
+env PATH=$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
CFLAGS="$CFLAGS" \
CXXFLAGS="$CXXFLAGS $CFLAGS -frtti -fexceptions" \
LDFLAGS="$LDFLAGS" \
-CC="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
-CXX="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-RANLIB="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
-LD="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
-AR="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
-CPP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
-NM="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
-AS="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
-STRIP="$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
+CC="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-gcc" \
+CXX="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+RANLIB="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ranlib" \
+LD="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-g++" \
+AR="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-ar" \
+CPP="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-cpp $CFLAGS" \
+NM="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-nm" \
+AS="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-as" \
+STRIP="$NDK/toolchains/$GCCPREFIX-$NDK_TOOLCHAIN_VERSION/prebuilt/$MYARCH/bin/$GCCPREFIX-strip" \
"$@"
diff --git a/project/jni/application/supertux/AndroidAppSettings.cfg b/project/jni/application/supertux/AndroidAppSettings.cfg
index a08f311c3..08bd160cb 100644
--- a/project/jni/application/supertux/AndroidAppSettings.cfg
+++ b/project/jni/application/supertux/AndroidAppSettings.cfg
@@ -1,33 +1,44 @@
# The application settings for Android libSDL port
-AppSettingVersion=19
-
-# libSDL version to use (1.2 or 1.3, specify 1.3 for SDL2)
-LibSdlVersion=1.2
-
# Specify application name (e.x. My Application)
AppName="SuperTux"
# Specify reversed site name of application (e.x. com.mysite.myapp)
AppFullName=org.lethargik.supertux2
-# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape
-ScreenOrientation=h
+# Application version code (integer)
+AppVersionCode=3408
-# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
-InhibitSuspend=n
+# Application user-visible version name (string)
+AppVersionName="0.3.4.08"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
-# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
-AppDataDownloadUrl="!Data files|http://sourceforge.net/projects/libsdl-android/files/SuperTux/data-2.zip"
+# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
+AppDataDownloadUrl="!Data files|:data.zip:obb:main.3406|:data.zip:http://sourceforge.net/projects/libsdl-android/files/SuperTux/data-3.zip"
+
+# Reset SDL config when updating application to the new version (y) / (n)
+ResetSdlConfigForThisVersion=y
+
+# Delete application data files when upgrading (specify file/dir paths separated by spaces)
+DeleteFilesOnUpgrade="data data.zip"
+
+# Here you may type readme text, which will be shown during startup. Format is:
+# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/
+ReadmeText='^You may press "Home" now - the data will be downloaded in background'
+
+# libSDL version to use (1.2/1.3/2.0)
+LibSdlVersion=1.2
+
+# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape
+ScreenOrientation=h
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
-VideoDepthBpp=24
+VideoDepthBpp=16
# Enable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
NeedDepthBuffer=n
@@ -41,7 +52,7 @@ NeedGles2=n
# Application uses software video buffer - you're calling SDL_SetVideoMode() without SDL_HWSURFACE and without SDL_OPENGL,
# this will allow small speed optimization. Enable this even when you're using SDL_HWSURFACE. (y) or (n)
-SwVideoMode=y
+SwVideoMode=n
# Application video output will be resized to fit into native device screen (y)/(n)
SdlVideoResize=y
@@ -49,9 +60,19 @@ SdlVideoResize=y
# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
SdlVideoResizeKeepAspect=n
+# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
+InhibitSuspend=n
+
+# Create Android service, so the app is less likely to be killed while in background
+CreateService=n
+
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
-CompatibilityHacks=n
+CompatibilityHacksForceScreenUpdate=n
+
+# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
+# force screen update by moving mouse cursor a little after each click (y) or (n)
+CompatibilityHacksForceScreenUpdateMouseClick=y
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
CompatibilityHacksStaticInit=n
@@ -73,7 +94,11 @@ CompatibilityHacksAdditionalPreloadedSharedLibraries=""
CompatibilityHacksSlowCompatibleEventQueue=n
# Save and restore OpenGL state when drawing on-screen keyboard for apps that use SDL_OPENGL
-CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState=
+CompatibilityHacksTouchscreenKeyboardSaveRestoreOpenGLState=n
+
+# Application uses SDL_UpdateRects() properly, and does not draw in any region outside those rects.
+# This improves drawing speed, but I know only one application that does that, and it's written by me (y)/(n)
+CompatibilityHacksProperUsageOfSDL_UpdateRects=n
# Application uses mouse (y) or (n), this will show mouse emulation dialog to the user
AppUsesMouse=y
@@ -81,30 +106,48 @@ AppUsesMouse=y
# Application needs two-button mouse, will also enable advanced point-and-click features (y) or (n)
AppNeedsTwoButtonMouse=n
+# Right mouse button can do long-press/drag&drop action, necessary for some games (y) or (n)
+# If you disable it, swiping with two fingers will send mouse wheel events
+RightMouseButtonLongPress=n
+
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
ShowMouseCursor=n
+# Generate more touch events, by default SDL generates one event per one video frame, this is useful for drawing apps (y) or (n)
+GenerateSubframeTouchEvents=n
+
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
ForceRelativeMouseMode=n
-# Application needs arrow keys (y) or (n), will show on-screen dpad/joystick (y) or (n)
+# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
AppNeedsArrowKeys=y
+# On-screen dpad/joystick will appear under finger when it touches the screen (y) or (n)
+# Joystick always follows finger, so moving mouse requires touching the screen with other finger
+FloatingScreenJoystick=n
+
# Application needs text input (y) or (n), enables button for text input on screen
AppNeedsTextInput=y
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
+# This will disable AppNeedsArrowKeys option
AppUsesJoystick=n
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
AppUsesSecondJoystick=n
+# Application uses third on-screen joystick, as SDL joystick 0 axes 20-21 (y)/(n)
+AppUsesThirdJoystick=n
+
# Application uses accelerometer (y) or (n), the accelerometer will be used as joystick 1 axes 0-1 and 5-7
AppUsesAccelerometer=n
# Application uses gyroscope (y) or (n), the gyroscope will be used as joystick 1 axes 2-4
AppUsesGyroscope=n
+# Use gyroscope to move mouse cursor (y) or (n), it eats battery, and can be disabled in settings, do not use with AppUsesGyroscope setting
+MoveMouseWithGyroscope=n
+
# Application uses multitouch (y) or (n), multitouch events are passed as SDL_JOYBALLMOTION events for the joystick 0
AppUsesMultitouch=n
@@ -113,6 +156,15 @@ AppUsesMultitouch=n
# This option will add additional permission to Android manifest (y)/(n)
AppRecordsAudio=n
+# Application needs to access SD card. If your data files are bigger than 5 Mb, enable it. (y) / (n)
+AccessSdCard=y
+
+# Application needs Internet access. If you disable it, you'll have to bundle all your data files inside .apk (y) / (n)
+AccessInternet=y
+
+# Immersive mode - Android will hide on-screen Home/Back keys. Looks bad if you invoke Android keyboard. (y) / (n)
+ImmersiveMode=y
+
# Application implements Android-specific routines to put to background, and will not draw anything to screen
# between SDL_ACTIVEEVENT lost / gained notifications - you should check for them
# rigth after SDL_Flip(), if (n) then SDL_Flip() will block till app in background (y) or (n)
@@ -124,81 +176,76 @@ NonBlockingSwapBuffers=n
# SEARCH and CALL by default return same keycode as DPAD_CENTER - one of those keys is available on most devices
# Use word NO_REMAP if you want to preserve native functionality for certain key (volume keys are 3-rd and 4-th)
# Keys: TOUCHSCREEN (works only when AppUsesMouse=n), DPAD_CENTER/SEARCH, VOLUMEUP, VOLUMEDOWN, MENU, BACK, CAMERA
-RedefinedKeys="LALT RETURN NO_REMAP NO_REMAP SPACE"
+RedefinedKeys="LALT RETURN NO_REMAP NO_REMAP NO_REMAP"
# Number of virtual keyboard keys (currently 6 is maximum)
AppTouchscreenKeyboardKeysAmount=2
-# Number of virtual keyboard keys that support autofire (currently 2 is maximum)
-AppTouchscreenKeyboardKeysAmountAutoFire=0
-
# Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right)
RedefinedKeysScreenKb="SPACE LCTRL"
# Names for on-screen keyboard keys, such as Fire, Jump, Run etc, separated by spaces, they are used in SDL config menu
RedefinedKeysScreenKbNames="Jump Action"
+# On-screen keys theme
+# 0 = Ultimate Droid by Sean Stieber (green, with gamepad joystick)
+# 1 = Simple Theme by Beholder (white, with gamepad joystick)
+# 2 = Sun by Sirea (yellow, with round joystick)
+# 3 = Keen by Gerstrong (multicolor, with round joystick)
+TouchscreenKeysTheme=3
+
+# Redefine gamepad keys to SDL keysyms, button order is:
+# A B X Y L1 R1 L2 R2 LThumb RThumb
+RedefinedKeysGamepad="SPACE LCTRL SPACE LCTRL SPACE LCTRL SPACE LCTRL SPACE LCTRL"
+
# How long to show startup menu button, in msec, 0 to disable startup menu
StartupMenuButtonTimeout=3000
# Menu items to hide from startup menu, available menu items:
-# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMouse.DisplaySizeConfig'
# Menu items to show at startup - this is Java code snippet, leave empty for default
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
# Available menu items:
-# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
FirstStartMenuOptions=''
-# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices,
-# but .apk size is 2x bigger (y) / (n) / (x86) / (all)
-MultiABI=y
-
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=0
-# Application version code (integer)
-AppVersionCode=03305
+# GCC version, 4.6 (default) or 4.8, CLANG is not supported yet
+NDK_TOOLCHAIN_VERSION=4.8
-# Application user-visible version name (string)
-AppVersionName="0.3.3.05"
-
-# Reset SDL config when updating application to the new version (y) / (n)
-ResetSdlConfigForThisVersion=y
-
-# Delete application data files when upgrading (specify file/dir paths separated by spaces)
-DeleteFilesOnUpgrade="data"
+# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
+# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
+MultiABI='armeabi-v7a x86 mips'
# Optional shared libraries to compile - removing some of them will save space
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
-CompiledLibraries="sdl_image physfs boost_system curl openal jpeg png vorbis ogg"
+CompiledLibraries="sdl_image physfs curl openal vorbis ogg"
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
CustomBuildScript=n
# Aditional CFLAGS for application
-AppCflags='-include GLES/gl.h -Ijni/openal/include/AL -DHAVE_SDL=1 -frtti -fexceptions'
+AppCflags='-DGL_VERSION_ES_CM_1_0=1 -Ijni/openal/include/AL -Ijni/boost/include -DHAVE_SDL=1 -frtti -fexceptions -std=gnu++11'
# Additional LDFLAGS for application
AppLdflags='-frtti -fexceptions'
# If application has headers with the same name as system headers, this option tries to fix compiler flags to make it compilable
-AppOverlapsSystemHeaders=
+AppOverlapsSystemHeaders=n
# Build only following subdirs (empty will build all dirs, ignored with custom script)
-AppSubdirsBuild='. supertux/src/* supertux/external/tinygettext/tinygettext supertux/external/tinygettext supertux/external/findlocale supertux/external/obstack supertux/external/squirrel/include supertux/external/squirrel/squirrel supertux/external/squirrel/sqstdlib'
+AppSubdirsBuild='. supertux/src/* supertux/external/tinygettext/src supertux/external/tinygettext/include supertux/external/findlocale supertux/external/obstack supertux/external/squirrel/include supertux/external/squirrel/squirrel supertux/external/squirrel/sqstdlib'
# Exclude these files from build
-AppBuildExclude='supertux/external/findlocale/example.c'
+AppBuildExclude='supertux/external/findlocale/example.c supertux/src/video/sdl/sdl_lightmap.cpp supertux/src/video/sdl/sdl_painter.cpp supertux/src/video/sdl/sdl_renderer.cpp supertux/src/video/sdl/sdl_texture.cpp supertux/src/video/sdl/sdl_video_system.cpp supertux/src/control/game_controller_manager.cpp supertux/src/control/joystick_manager.cpp'
# Application command line parameters, including app name as 0-th param
-AppCmdline=''
-
-# Here you may type readme text, which will be shown during startup. Format is:
-# Text in English, use \\\\n to separate lines^de:Text in Deutsch^ru:Text in Russian, and so on (that's four backslashes, nice isn't it?)
-ReadmeText='^You may press "Home" now - the data will be downloaded in background'
+AppCmdline='./supertux2'
# Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens
# Minimum screen size that application supports: (s)mall / (m)edium / (l)arge
@@ -210,6 +257,9 @@ AdmobPublisherId=n
# Your AdMob test device ID, to receive a test ad
AdmobTestDeviceId=
-# Your AdMob banner size (BANNER/IAB_BANNER/IAB_LEADERBOARD/IAB_MRECT/IAB_WIDE_SKYSCRAPER/SMART_BANNER)
+# Your AdMob banner size (BANNER/FULL_BANNER/LEADERBOARD/MEDIUM_RECTANGLE/SMART_BANNER/WIDE_SKYSCRAPER/FULL_WIDTH:Height/Width:AUTO_HEIGHT/Width:Height)
AdmobBannerSize=
+# Google Play Game Services application ID, required for cloud saves to work
+GooglePlayGameServicesId=
+
diff --git a/project/jni/application/supertux/android.diff b/project/jni/application/supertux/android.diff
index 8fcb828fe..83fe57e95 100644
--- a/project/jni/application/supertux/android.diff
+++ b/project/jni/application/supertux/android.diff
@@ -1,27 +1,539 @@
-diff --git a/src/control/joystickkeyboardcontroller.cpp b/src/control/joystickkeyboardcontroller.cpp
-index 6c9e9c0..dbb8a9e 100644
---- a/src/control/joystickkeyboardcontroller.cpp
-+++ b/src/control/joystickkeyboardcontroller.cpp
-@@ -70,7 +70,7 @@ JoystickKeyboardController::JoystickKeyboardController() :
- keymap[SDLK_END] = Controller::PEEK_DOWN;
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9a9dde2..c7e2aad 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -186,7 +186,9 @@ ENDIF(MSVC)
- jump_with_up_joy = false;
-- jump_with_up_kbd = false;
-+ jump_with_up_kbd = true;
+ FILE(GLOB SUPERTUX_SOURCES_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/obstack/*.c external/findlocale/findlocale.c)
- updateAvailableJoysticks();
+-FILE(GLOB SUPERTUX_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/main.cpp src/*/*.cpp src/supertux/menu/*.cpp src/video/sdl/*.cpp)
++FILE(GLOB SUPERTUX_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/main.cpp src/*/*.cpp src/supertux/menu/*.cpp)
++
++LIST(REMOVE_ITEM SUPERTUX_SOURCES_CXX src/control//game_controller_manager.cpp src/control//joystick_manager.cpp)
+
+ FILE(GLOB TINYGETTEXT_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/tinygettext/src/*.cpp)
+ SET_SOURCE_FILES_PROPERTIES(${TINYGETTEXT_SOURCES_CXX} PROPERTIES COMPILE_DEFINITIONS HAVE_SDL)
+diff --git a/configure b/configure
+index b728243..75a4bb4 100755
+--- a/configure
++++ b/configure
+@@ -6,4 +6,4 @@ set -e
+ mkdir -p build
+ cd build
+ cmake .. "$@"
+-
++make -j8
+diff --git a/src/control/controller.cpp b/src/control/controller.cpp
+index 49996e2..6ad4ed8 100644
+--- a/src/control/controller.cpp
++++ b/src/control/controller.cpp
+@@ -16,6 +16,9 @@
+
+ #include "control/controller.hpp"
+
++#include "video/renderer.hpp"
++#include "video/video_system.hpp"
++
+ const char* Controller::controlNames[] = {
+ "left",
+ "right",
+@@ -51,6 +54,8 @@ Controller::reset()
+ controls[i] = false;
+ oldControls[i] = false;
+ }
++ mousePressed = false;
++ mousePos = Vector(0,0);
+ }
+
+ void
+@@ -84,4 +89,23 @@ Controller::update()
+ oldControls[i] = controls[i];
+ }
+
++bool
++Controller::mouse_pressed() const
++{
++ return mousePressed;
++}
++
++Vector
++Controller::mouse_pos() const
++{
++ return mousePos;
++}
++
++void
++Controller::set_mouse(int x, int y, bool pressed)
++{
++ mousePressed = pressed;
++ mousePos = VideoSystem::current()->get_renderer().to_logical(x, y);
++}
++
+ /* EOF */
+diff --git a/src/control/controller.hpp b/src/control/controller.hpp
+index 210159d..eba103a 100644
+--- a/src/control/controller.hpp
++++ b/src/control/controller.hpp
+@@ -17,6 +17,8 @@
+ #ifndef HEADER_SUPERTUX_CONTROL_CONTROLLER_HPP
+ #define HEADER_SUPERTUX_CONTROL_CONTROLLER_HPP
+
++#include "math/vector.hpp"
++
+ class Controller
+ {
+ public:
+@@ -58,6 +60,10 @@ public:
+ /** returns true if the control has just been released this frame */
+ bool released(Control control) const;
+
++ bool mouse_pressed() const;
++ Vector mouse_pos() const;
++ void set_mouse(int x, int y, bool pressed);
++
+ virtual void reset();
+ virtual void update();
+
+@@ -66,6 +72,8 @@ protected:
+ bool controls[CONTROLCOUNT];
+ /** control status at last frame */
+ bool oldControls[CONTROLCOUNT];
++ bool mousePressed;
++ Vector mousePos;
+ };
+
+ #endif
+diff --git a/src/control/game_controller_manager.cpp b/src/control/game_controller_manager.cpp
+index 6680c04..401eacc 100644
+--- a/src/control/game_controller_manager.cpp
++++ b/src/control/game_controller_manager.cpp
+@@ -13,7 +13,6 @@
+ //
+ // You should have received a copy of the GNU General Public License
+ // along with this program. If not, see .
+-
+ #include "control/game_controller_manager.hpp"
+
+ #include
+diff --git a/src/control/input_manager.cpp b/src/control/input_manager.cpp
+index ce612d4..2ab1d85 100644
+--- a/src/control/input_manager.cpp
++++ b/src/control/input_manager.cpp
+@@ -19,8 +19,8 @@
+
+ #include
+
+-#include "control/game_controller_manager.hpp"
+-#include "control/joystick_manager.hpp"
++//#include "control/game_controller_manager.hpp"
++//#include "control/joystick_manager.hpp"
+ #include "control/keyboard_manager.hpp"
+ #include "gui/menu_manager.hpp"
+ #include "lisp/list_iterator.hpp"
+@@ -33,9 +33,9 @@ InputManager::InputManager(KeyboardConfig& keyboard_config,
+ JoystickConfig& joystick_config) :
+ controller(new Controller),
+ m_use_game_controller(true),
+- keyboard_manager(new KeyboardManager(this, keyboard_config)),
+- joystick_manager(new JoystickManager(this, joystick_config)),
+- game_controller_manager(new GameControllerManager(this))
++ keyboard_manager(new KeyboardManager(this, keyboard_config))
++ //joystick_manager(new JoystickManager(this, joystick_config)),
++ //game_controller_manager(new GameControllerManager(this))
+ {
+ }
+
+@@ -71,15 +71,25 @@ void
+ InputManager::process_event(const SDL_Event& event)
+ {
+ switch(event.type) {
+- case SDL_TEXTINPUT:
+- keyboard_manager->process_text_input_event(event.text);
+- break;
++ //case SDL_TEXTINPUT:
++ // keyboard_manager->process_text_input_event(event.text);
++ // break;
+
+ case SDL_KEYUP:
+ case SDL_KEYDOWN:
+ keyboard_manager->process_key_event(event.key);
+ break;
+
++ case SDL_MOUSEBUTTONDOWN:
++ case SDL_MOUSEBUTTONUP:
++ keyboard_manager->process_mouse_event(event.button);
++ break;
++
++ case SDL_MOUSEMOTION:
++ keyboard_manager->process_mouse_event(event.motion);
++ break;
++
++#if 0
+ case SDL_JOYAXISMOTION:
+ if (!m_use_game_controller) joystick_manager->process_axis_event(event.jaxis);
+ break;
+@@ -126,7 +136,7 @@ InputManager::process_event(const SDL_Event& event)
+ case SDL_CONTROLLERDEVICEREMAPPED:
+ log_debug << "SDL_CONTROLLERDEVICEREMAPPED" << std::endl;
+ break;
+-
++#endif
+ default:
+ break;
+ }
+diff --git a/src/control/input_manager.hpp b/src/control/input_manager.hpp
+index d047e53..a87decd 100644
+--- a/src/control/input_manager.hpp
++++ b/src/control/input_manager.hpp
+@@ -68,8 +68,8 @@ private:
+ public:
+ bool m_use_game_controller;
+ std::unique_ptr keyboard_manager;
+- std::unique_ptr joystick_manager;
+- std::unique_ptr game_controller_manager;
++ //std::unique_ptr joystick_manager;
++ //std::unique_ptr game_controller_manager;
+
+ private:
+ InputManager(const InputManager&);
+diff --git a/src/control/keyboard_config.hpp b/src/control/keyboard_config.hpp
+index e848067..fe1b785 100644
+--- a/src/control/keyboard_config.hpp
++++ b/src/control/keyboard_config.hpp
+@@ -25,6 +25,8 @@
+
+ #include "util/writer.hpp"
+
++typedef SDLKey SDL_Keycode;
++
+ class KeyboardConfig
+ {
+ public:
+diff --git a/src/control/keyboard_manager.cpp b/src/control/keyboard_manager.cpp
+index ca4e461..cf67877 100644
+--- a/src/control/keyboard_manager.cpp
++++ b/src/control/keyboard_manager.cpp
+@@ -18,7 +18,7 @@
+ #include "control/keyboard_manager.hpp"
+
+ #include "control/controller.hpp"
+-#include "control/joystick_manager.hpp"
++//#include "control/joystick_manager.hpp"
+ #include "control/keyboard_config.hpp"
+ #include "gui/menu_manager.hpp"
+ #include "lisp/list_iterator.hpp"
+@@ -81,6 +81,7 @@ KeyboardManager::process_key_event(const SDL_KeyboardEvent& event)
+ }
+ }
+
++#if 0
+ void
+ KeyboardManager::process_text_input_event(const SDL_TextInputEvent& event)
+ {
+@@ -91,6 +92,7 @@ KeyboardManager::process_text_input_event(const SDL_TextInputEvent& event)
+ }
+ }
+ }
++#endif
+
+ void
+ KeyboardManager::process_console_key_event(const SDL_KeyboardEvent& event)
+@@ -156,6 +158,7 @@ KeyboardManager::process_menu_key_event(const SDL_KeyboardEvent& event)
+ return;
+ }
+
++#if 0
+ if (m_parent->joystick_manager->wait_for_joystick >= 0)
+ {
+ if (event.keysym.sym == SDLK_ESCAPE)
+@@ -166,6 +169,7 @@ KeyboardManager::process_menu_key_event(const SDL_KeyboardEvent& event)
+ }
+ return;
+ }
++#endif
+
+ Controller::Control control;
+ /* we use default keys when the menu is open (to avoid problems when
+@@ -209,4 +213,18 @@ KeyboardManager::bind_next_event_to(Controller::Control id)
+ wait_for_key = id;
+ }
+
++void
++KeyboardManager::process_mouse_event(const SDL_MouseMotionEvent& event)
++{
++ m_parent->get_controller()->set_mouse(event.x, event.y, event.state & SDL_BUTTON_LMASK);
++}
++
++void
++KeyboardManager::process_mouse_event(const SDL_MouseButtonEvent& event)
++{
++ if (event.button != SDL_BUTTON_LEFT)
++ return;
++ m_parent->get_controller()->set_mouse(event.x, event.y, event.state == SDL_PRESSED);
++}
++
+ /* EOF */
+diff --git a/src/control/keyboard_manager.hpp b/src/control/keyboard_manager.hpp
+index 07885f9..ae02e33 100644
+--- a/src/control/keyboard_manager.hpp
++++ b/src/control/keyboard_manager.hpp
+@@ -41,10 +41,13 @@ public:
+ ~KeyboardManager();
+
+ void process_key_event(const SDL_KeyboardEvent& event);
+- void process_text_input_event(const SDL_TextInputEvent& event);
++ //void process_text_input_event(const SDL_TextInputEvent& event);
+ void process_console_key_event(const SDL_KeyboardEvent& event);
+ void process_menu_key_event(const SDL_KeyboardEvent& event);
+
++ void process_mouse_event(const SDL_MouseMotionEvent& event);
++ void process_mouse_event(const SDL_MouseButtonEvent& event);
++
+ void bind_next_event_to(Controller::Control id);
+
+ private:
+diff --git a/src/gui/dialog.cpp b/src/gui/dialog.cpp
+index e536c9c..55602c0 100644
+--- a/src/gui/dialog.cpp
++++ b/src/gui/dialog.cpp
+@@ -14,6 +14,8 @@
+ // You should have received a copy of the GNU General Public License
+ // along with this program. If not, see .
+
++#include
++
+ #include "gui/dialog.hpp"
+
+ #include "control/controller.hpp"
+diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp
+index fd253e9..adc20ce 100644
+--- a/src/gui/menu.cpp
++++ b/src/gui/menu.cpp
+@@ -625,7 +625,9 @@ Menu::get_item_by_id(int id)
+ }
+ }
+
+- throw std::runtime_error("MenuItem not found: " + std::to_string(id));
++ char c[32];
++ sprintf(c, "%d", id);
++ throw std::runtime_error(std::string("MenuItem not found: ") + c);
+ }
+
+ const MenuItem&
+diff --git a/src/object/player.cpp b/src/object/player.cpp
+index c2bfb0e..f7ddd22 100644
+--- a/src/object/player.cpp
++++ b/src/object/player.cpp
+@@ -148,6 +148,7 @@ Player::Player(PlayerStatus* _player_status, const std::string& name_) :
+ grabbed_object(NULL),
+ sprite(),
+ airarrow(),
++ jumparrow(),
+ floor_normal(),
+ ghost_mode(false),
+ edit_mode(false),
+@@ -164,6 +165,7 @@ Player::Player(PlayerStatus* _player_status, const std::string& name_) :
+ // constructor
+ sprite = SpriteManager::current()->create("images/creatures/tux/tux.sprite");
+ airarrow = Surface::create("images/engine/hud/airarrow.png");
++ jumparrow = Surface::create("images/engine/menu/scroll-down.png");
+ idle_timer.start(IDLE_TIME[0]/1000.0f);
+
+ SoundManager::current()->preload("sounds/bigjump.wav");
+@@ -223,6 +225,12 @@ Player::init()
+
+ climbing = 0;
+
++ jump_helper = false;
++ jump_helper_draw = false;
++ jump_helper_jump = false;
++ jump_helper_move_left = false;
++ jump_helper_move_right = false;
++
+ physic.reset();
+ }
+
+@@ -494,12 +502,14 @@ Player::handle_horizontal_input()
+
+ float dirsign = 0;
+ if(!duck || physic.get_velocity_y() != 0) {
+- if(controller->hold(Controller::LEFT) && !controller->hold(Controller::RIGHT)) {
++ if((controller->hold(Controller::LEFT) && !controller->hold(Controller::RIGHT))
++ || jump_helper_move_left) {
+ old_dir = dir;
+ dir = LEFT;
+ dirsign = -1;
+- } else if(!controller->hold(Controller::LEFT)
+- && controller->hold(Controller::RIGHT)) {
++ } else if((!controller->hold(Controller::LEFT)
++ && controller->hold(Controller::RIGHT))
++ || jump_helper_move_right) {
+ old_dir = dir;
+ dir = RIGHT;
+ dirsign = 1;
+@@ -691,7 +701,7 @@ Player::handle_vertical_input()
+ {
+ // Press jump key
+ if(controller->pressed(Controller::JUMP)) jump_button_timer.start(JUMP_GRACE_TIME);
+- if(controller->hold(Controller::JUMP) && jump_button_timer.started() && can_jump) {
++ if (((controller->hold(Controller::JUMP) && jump_button_timer.started()) || jump_helper_jump) && can_jump) {
+ jump_button_timer.stop();
+ if (duck) {
+ // when running, only jump a little bit; else do a backflip
+@@ -711,7 +721,7 @@ Player::handle_vertical_input()
+ }
+ }
+ // Let go of jump key
+- else if(!controller->hold(Controller::JUMP)) {
++ else if(!(controller->hold(Controller::JUMP) || jump_helper_jump)) {
+ if (!backflipping && jumping && physic.get_velocity_y() < 0) {
+ jumping = false;
+ early_jump_apex();
+@@ -789,6 +799,8 @@ Player::handle_input()
+ /* Handle vertical movement: */
+ handle_vertical_input();
+
++ handle_jump_helper();
++
+ /* Shoot! */
+ if (controller->pressed(Controller::ACTION) && (player_status->bonus == FIRE_BONUS || player_status->bonus == ICE_BONUS)) {
+ if(Sector::current()->add_bullet(
+@@ -1068,6 +1080,13 @@ Player::draw(DrawingContext& context)
+ context.draw_surface(airarrow, Vector(px, py), LAYER_HUD - 1);
+ }
+
++ // Show where Tux will land after using jump helper
++ if (jump_helper_draw && Sector::current() && Sector::current()->camera) {
++ float px = jump_helper_x + (get_bbox().p2.x - get_bbox().p1.x) / 2 - jumparrow.get()->get_width() / 2;
++ float py = get_bbox().p2.y - jumparrow.get()->get_height();
++ context.draw_surface(jumparrow, Vector(px, py), LAYER_HUD - 1);
++ }
++
+ std::string sa_prefix = "";
+ std::string sa_postfix = "";
+
+@@ -1582,4 +1601,65 @@ Player::handle_input_climbing()
+ physic.set_acceleration(0, 0);
+ }
+
++void
++Player::handle_jump_helper()
++{
++ if (!Sector::current() || !Sector::current()->camera)
++ return;
++
++ if (controller->mouse_pressed() && can_jump && !jump_helper)
++ { // Select a target to jump
++ jump_helper_draw = true;
++ jump_helper_x = controller->mouse_pos().x + Sector::current()->camera->get_translation().x;
++ }
++
++ if (!controller->mouse_pressed() && can_jump && !jump_helper && jump_helper_draw)
++ { // Initiate the jump
++ jump_helper = true;
++ jump_helper_x = controller->mouse_pos().x + Sector::current()->camera->get_translation().x;
++ // Do not use scriptiong controller - we need to be able to cancel jump helper mid-jump
++ jump_helper_move_left = false;
++ jump_helper_move_right = false;
++ if (jump_helper_x > get_pos().x)
++ jump_helper_move_right = true;
++ else
++ jump_helper_move_left = true;
++ }
++
++ if (jump_helper)
++ {
++ float friction = WALK_ACCELERATION_X * (on_ice ? ICE_FRICTION_MULTIPLIER : NORMAL_FRICTION_MULTIPLIER);
++ float frictionDistance = physic.get_velocity_x() * physic.get_velocity_x() / friction / 2.0f;
++ if (!jump_helper_jump)
++ { // Start running before jump for long jumps
++ float gravity = Sector::current()->get_gravity();
++ float jumpSpeed = fabs(physic.get_velocity_x()) > MAX_WALK_XM ? 580 : 520;
++ float jumpTime = jumpSpeed / gravity * 2.0f;
++ float maxRunSpeed = speedlimit > 0 ? speedlimit : MAX_RUN_XM;
++ float actualJumpDistance = fabs(physic.get_velocity_x()) * jumpTime / 100.0f;
++ float maxJumpDistance = maxRunSpeed * jumpTime / 100.0f;
++ // Check if we can jump that far at current speed, compensate a bit for velocity we'll gain in the air
++ // Empirical coefficients, we should use WALK_ACCELERATION_X / RUN_ACCELERATION_X here
++ if (fabs(jump_helper_x - get_pos().x) <= actualJumpDistance * 0.4f + maxJumpDistance * 0.6f)
++ jump_helper_jump = true;
++ // Check if we can jump that far without running first
++ if (fabs(jump_helper_x - get_pos().x) <= maxJumpDistance * 0.75f)
++ jump_helper_jump = true;
++ }
++ if (controller->mouse_pressed() // Cancel a jump if user presses any button
++ || controller->pressed(Controller::JUMP) || controller->pressed(Controller::ACTION)
++ || controller->pressed(Controller::DOWN) || controller->pressed(Controller::UP)
++ || controller->pressed(Controller::LEFT) || controller->pressed(Controller::RIGHT)
++ || (jump_helper_x >= get_pos().x - frictionDistance && jump_helper_move_left) // Reached destination - finish the jump
++ || (jump_helper_x <= get_pos().x + frictionDistance && jump_helper_move_right))
++ {
++ jump_helper = false;
++ jump_helper_draw = false;
++ jump_helper_jump = false;
++ jump_helper_move_left = false;
++ jump_helper_move_right = false;
++ }
++ }
++}
++
+ /* EOF */
+diff --git a/src/object/player.hpp b/src/object/player.hpp
+index 3dda1fd..7e57676 100644
+--- a/src/object/player.hpp
++++ b/src/object/player.hpp
+@@ -244,6 +244,7 @@ private:
+
+ void handle_horizontal_input();
+ void handle_vertical_input();
++ void handle_jump_helper();
+
+ void activate();
+ void deactivate();
+@@ -314,6 +315,15 @@ public:
+
+ SurfacePtr airarrow; /**< arrow indicating Tux' position when he's above the camera */
+
++
++ SurfacePtr jumparrow; /**< arrow indicating wherer Tux' will jump */
++ bool jump_helper; /**< Jump helper for touchscreens to perform precise jumps */
++ bool jump_helper_jump;
++ bool jump_helper_move_left;
++ bool jump_helper_move_right;
++ bool jump_helper_draw;
++ float jump_helper_x;
++
+ Vector floor_normal;
+ void position_grabbed_object();
+ void try_grab();
+diff --git a/src/physfs/physfs_sdl.cpp b/src/physfs/physfs_sdl.cpp
+index 277f993..356dae0 100644
+--- a/src/physfs/physfs_sdl.cpp
++++ b/src/physfs/physfs_sdl.cpp
+@@ -24,7 +24,7 @@
+
+ #include "util/log.hpp"
+
+-static Sint64 funcSeek(struct SDL_RWops* context, Sint64 offset, int whence)
++static int funcSeek(struct SDL_RWops* context, int offset, int whence)
+ {
+ PHYSFS_file* file = (PHYSFS_file*) context->hidden.unknown.data1;
+ int res;
+@@ -51,7 +51,7 @@ static Sint64 funcSeek(struct SDL_RWops* context, Sint64 offset, int whence)
+ return (int) PHYSFS_tell(file);
+ }
+
+-static size_t funcRead(struct SDL_RWops* context, void* ptr, size_t size, size_t maxnum)
++static int funcRead(struct SDL_RWops* context, void* ptr, int size, int maxnum)
+ {
+ PHYSFS_file* file = (PHYSFS_file*) context->hidden.unknown.data1;
diff --git a/src/supertux/gameconfig.cpp b/src/supertux/gameconfig.cpp
-index 235198c..6126b25 100644
+index c7d7778..9949e92 100644
--- a/src/supertux/gameconfig.cpp
+++ b/src/supertux/gameconfig.cpp
-@@ -27,11 +27,11 @@
-
- Config::Config() :
- profile(1),
-- fullscreen_size(800, 600),
-+ fullscreen_size(SDL_GetVideoInfo()->current_w, SDL_GetVideoInfo()->current_h),
- window_size(800, 600),
+@@ -34,7 +34,7 @@ Config::Config() :
+ window_size(1280, 800),
aspect_size(0, 0), // auto detect
magnification(0.0f),
- use_fullscreen(false),
@@ -30,54 +542,250 @@ index 235198c..6126b25 100644
try_vsync(true),
show_fps(false),
diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp
-index d89420f..2c80b2b 100644
+index 1cfba9c..f453266 100644
--- a/src/supertux/main.cpp
+++ b/src/supertux/main.cpp
-@@ -20,7 +20,7 @@
+@@ -20,6 +20,9 @@
+ #include
+
#include
- #include
- #include
--#include
-+//#include
- #include
++#include
++#include
++#include
#include
- extern "C" {
-@@ -163,6 +163,7 @@ Main::init_physfs(const char* argv0)
- sourcedir = true;
+ #include
+ #include
+@@ -128,7 +131,7 @@ public:
+ if (!PHYSFS_init(argv0))
+ {
+ std::stringstream msg;
+- msg << "Couldn't initialize physfs: " << PHYSFS_getLastError();
++ msg << "Couldn't initialize physfs: " << PHYSFS_getLastError() << " argv0: " << argv0;
+ throw std::runtime_error(msg.str());
+ }
+ else
+@@ -143,36 +146,9 @@ public:
+
+ void find_datadir()
+ {
+- std::string datadir;
+- if (m_forced_datadir)
++ if (!PHYSFS_addToSearchPath("data.zip", 1))
+ {
+- datadir = *m_forced_datadir;
+- }
+- else if (const char* env_datadir = getenv("SUPERTUX2_DATA_DIR"))
+- {
+- datadir = env_datadir;
+- }
+- else
+- {
+- // check if we run from source dir
+- char* basepath_c = SDL_GetBasePath();
+- std::string basepath = basepath_c;
+- SDL_free(basepath_c);
+-
+- datadir = FileSystem::join(basepath, "data");
+- std::string testfname = FileSystem::join(datadir, "credits.txt");
+- if (!FileSystem::exists(testfname))
+- {
+- // if the game is not run from the source directory, try to find
+- // the global install location
+- datadir = datadir.substr(0, datadir.rfind(INSTALL_SUBDIR_BIN));
+- datadir = FileSystem::join(datadir, INSTALL_SUBDIR_SHARE);
+- }
+- }
+-
+- if (!PHYSFS_addToSearchPath(datadir.c_str(), 1))
+- {
+- log_warning << "Couldn't add '" << datadir << "' to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
++ log_warning << "Couldn't add data.zip to physfs searchpath: " << PHYSFS_getLastError() << std::endl;
}
}
-+ PHYSFS_addToSearchPath("data", 1);
- #ifdef MACOSX
+@@ -238,7 +214,7 @@ class SDLSubsystem
+ public:
+ SDLSubsystem()
{
+- if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER) < 0)
++ if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0)
+ {
+ std::stringstream msg;
+ msg << "Couldn't initialize SDL: " << SDL_GetError();
+@@ -257,7 +233,7 @@ public:
+ void
+ Main::init_video()
+ {
+- SDL_SetWindowTitle(VideoSystem::current()->get_renderer().get_window(), PACKAGE_NAME " " PACKAGE_VERSION);
++ //SDL_SetWindowTitle(VideoSystem::current()->get_renderer().get_window(), PACKAGE_NAME " " PACKAGE_VERSION);
+
+ const char* icon_fname = "images/engine/icons/supertux-256x256.png";
+ SDL_Surface* icon = IMG_Load_RW(get_physfs_SDLRWops(icon_fname), true);
+@@ -267,7 +243,7 @@ Main::init_video()
+ }
+ else
+ {
+- SDL_SetWindowIcon(VideoSystem::current()->get_renderer().get_window(), icon);
++ SDL_WM_SetIcon(icon, NULL);
+ SDL_FreeSurface(icon);
+ }
+ SDL_ShowCursor(0);
+@@ -383,6 +359,14 @@ Main::run(int argc, char** argv)
+ {
+ CommandLineArguments args;
+
++ // Copy over old savegames
++ struct stat st;
++ if (stat(".supertux2/profile1", &st) != 0)
++ {
++ system("mkdir -p .supertux2/profile1");
++ system("cp $SDCARD/app-data/org.lethargik.supertux2/.supertux2/profile1/* .supertux2/profile1/");
++ }
++
+ try
+ {
+ args.parse_args(argc, argv);
+diff --git a/src/supertux/menu/joystick_menu.cpp b/src/supertux/menu/joystick_menu.cpp
+index bd11c9a..a2970bf 100644
+--- a/src/supertux/menu/joystick_menu.cpp
++++ b/src/supertux/menu/joystick_menu.cpp
+@@ -54,6 +54,7 @@ JoystickMenu::recreate_menu()
+ !m_input_manager.use_game_controller())
+ ->set_help(_("Use manual configuration instead of SDL2's automatic GameController support"));
+
++#if 0
+ if (m_input_manager.use_game_controller())
+ {
+ m_joysticks_available = false;
+@@ -84,13 +85,14 @@ JoystickMenu::recreate_menu()
+ add_toggle(MNID_JUMP_WITH_UP, _("Jump with Up"), g_config->joystick_config.jump_with_up_joy);
+ }
+ else
++#endif
+ {
+ m_joysticks_available = false;
+
+ add_inactive(-1, _("No Joysticks found"));
+ add_entry(MNID_SCAN_JOYSTICKS, _("Scan for Joysticks"));
+ }
+- }
++ //}
+
+ add_hl();
+ add_back(_("Back"));
+@@ -118,7 +120,7 @@ JoystickMenu::menu_action(MenuItem* item)
+ if (0 <= item->id && item->id < Controller::CONTROLCOUNT)
+ {
+ item->change_input(_("Press Button"));
+- m_input_manager.joystick_manager->bind_next_event_to(static_cast(item->id));
++ //m_input_manager.joystick_manager->bind_next_event_to(static_cast(item->id));
+ }
+ else if (item->id == MNID_JUMP_WITH_UP)
+ {
+diff --git a/src/supertux/menu/keyboard_menu.cpp b/src/supertux/menu/keyboard_menu.cpp
+index 9b25f8c..2c05d16 100644
+--- a/src/supertux/menu/keyboard_menu.cpp
++++ b/src/supertux/menu/keyboard_menu.cpp
+@@ -82,9 +82,9 @@ KeyboardMenu::get_key_name(SDL_Keycode key)
+ return _("Right Alt");
+ case SDLK_LALT:
+ return _("Left Alt");
+- case SDLK_RGUI:
++ case SDLK_RMETA:
+ return _("Right Command");
+- case SDLK_LGUI:
++ case SDLK_LMETA:
+ return _("Left Command");
+ default:
+ return SDL_GetKeyName(static_cast(key));
+diff --git a/src/supertux/menu/keyboard_menu.hpp b/src/supertux/menu/keyboard_menu.hpp
+index 3230f34..5eedfd8 100644
+--- a/src/supertux/menu/keyboard_menu.hpp
++++ b/src/supertux/menu/keyboard_menu.hpp
+@@ -21,6 +21,8 @@
+ #include "control/input_manager.hpp"
+ #include "gui/menu_item.hpp"
+
++typedef SDLKey SDL_Keycode;
++
+ class KeyboardMenu : public Menu
+ {
+ private:
+diff --git a/src/supertux/menu/options_menu.cpp b/src/supertux/menu/options_menu.cpp
+index 8e1ce9d..183c5f0 100644
+--- a/src/supertux/menu/options_menu.cpp
++++ b/src/supertux/menu/options_menu.cpp
+@@ -103,25 +103,15 @@ OptionsMenu::OptionsMenu(bool complete)
+ }
+ }
+
+- int display_mode_count = SDL_GetNumDisplayModes(0);
+ std::string last_display_mode;
+- for(int i = 0; i < display_mode_count; ++i)
++ for(int i = 0; SDL_ListModes(NULL, 0)[i]; ++i)
+ {
+- SDL_DisplayMode mode;
+- int ret = SDL_GetDisplayMode(0, i, &mode);
+- if (ret != 0)
+- {
+- log_warning << "failed to get display mode: " << SDL_GetError() << std::endl;
+- }
+- else
+- {
+ std::ostringstream out;
+- out << mode.w << "x" << mode.h << "@" << mode.refresh_rate;
++ out << SDL_ListModes(NULL, 0)[i]->w << "x" << SDL_ListModes(NULL, 0)[i]->h << "@60";
+ if(last_display_mode == out.str())
+ continue;
+ last_display_mode = out.str();
+ fullscreen_res->list.push_back(out.str());
+- }
+ }
+ fullscreen_res->list.push_back("Desktop");
+
diff --git a/src/supertux/screen_manager.cpp b/src/supertux/screen_manager.cpp
-index ffd9599..c19c74f 100644
+index 580d875..3197a75 100644
--- a/src/supertux/screen_manager.cpp
+++ b/src/supertux/screen_manager.cpp
-@@ -187,7 +187,7 @@ ScreenManager::update_gamelogic(float elapsed_time)
+@@ -189,7 +189,7 @@ ScreenManager::update_gamelogic(float elapsed_time)
}
void
-ScreenManager::process_events()
+ScreenManager::process_events(DrawingContext &context)
{
- g_jk_controller->update();
- Uint8* keystate = SDL_GetKeyState(NULL);
-@@ -206,8 +206,12 @@ ScreenManager::process_events()
+ InputManager::current()->update();
+ SDL_Event event;
+@@ -205,15 +205,10 @@ ScreenManager::process_events()
+ quit();
break;
-
- case SDL_VIDEORESIZE:
-+ #ifdef ANDROID
-+ context.init_renderer(); // This should re-init GL context and re-upload all textures
-+ #else
- Renderer::instance()->resize(event.resize.w, event.resize.h);
- MenuManager::recalc_pos();
-+ #endif
+
+- case SDL_WINDOWEVENT:
+- switch(event.window.event)
+- {
+- case SDL_WINDOWEVENT_RESIZED:
+- VideoSystem::current()->resize(event.window.data1,
+- event.window.data2);
++ case SDL_VIDEORESIZE:
++ VideoSystem::current()->resize(event.resize.w,
++ event.resize.h);
+ m_menu_manager->on_window_resize();
+- break;
+- }
break;
-
+
case SDL_KEYDOWN:
-@@ -318,7 +322,7 @@ ScreenManager::run(DrawingContext &context)
- timestep *= speed;
+@@ -227,7 +222,7 @@ ScreenManager::process_events()
+ VideoSystem::current()->apply_config();
+ m_menu_manager->on_window_resize();
+ }
+- else if (event.key.keysym.sym == SDLK_PRINTSCREEN ||
++ else if (event.key.keysym.sym == SDLK_PRINT ||
+ event.key.keysym.sym == SDLK_F12)
+ {
+ take_screenshot();
+@@ -362,7 +357,7 @@ ScreenManager::run(DrawingContext &context)
+ timestep *= m_speed;
game_time += timestep;
- process_events();
@@ -86,10 +794,10 @@ index ffd9599..c19c74f 100644
frames += 1;
}
diff --git a/src/supertux/screen_manager.hpp b/src/supertux/screen_manager.hpp
-index d885443..c436f72 100644
+index 59599c8..dd45acb 100644
--- a/src/supertux/screen_manager.hpp
+++ b/src/supertux/screen_manager.hpp
-@@ -59,7 +59,7 @@ private:
+@@ -64,7 +64,7 @@ private:
void draw_fps(DrawingContext& context, float fps);
void draw(DrawingContext& context);
void update_gamelogic(float elapsed_time);
@@ -99,18 +807,21 @@ index d885443..c436f72 100644
private:
diff --git a/src/util/log.cpp b/src/util/log.cpp
-index 6ce6f73..e12edf7 100644
+index de4fb3d..2236626 100644
--- a/src/util/log.cpp
+++ b/src/util/log.cpp
-@@ -18,12 +18,81 @@
+@@ -18,18 +18,94 @@
#include "util/log.hpp"
#include
++#ifdef ANDROID
+#include
++#endif
#include "math/rectf.hpp"
#include "supertux/console.hpp"
++#ifdef ANDROID
+class _android_debugbuf: public std::streambuf
+{
+ public:
@@ -177,69 +888,417 @@ index 6ce6f73..e12edf7 100644
+};
+
+static std::ostream android_logcat(new _android_debugbuf());
++#endif
+
+ LogLevel g_log_level = LOG_WARNING;
+
static std::ostream& get_logging_instance (void)
{
++#ifdef ANDROID
+ return android_logcat;
- if (Console::instance != NULL)
- return (Console::output);
++#else
+ if (ConsoleBuffer::current())
+ return (ConsoleBuffer::output);
else
+ return (std::cerr);
++#endif
+ }
+
+ static std::ostream& log_generic_f (const char *prefix, const char* file, int line)
diff --git a/src/video/gl/gl_lightmap.cpp b/src/video/gl/gl_lightmap.cpp
-index f8a6735..9638b64 100644
+index b5251e0..6248380 100644
--- a/src/video/gl/gl_lightmap.cpp
+++ b/src/video/gl/gl_lightmap.cpp
-@@ -60,7 +60,7 @@ GLLightmap::GLLightmap() :
+@@ -67,7 +67,6 @@ GLLightmap::GLLightmap() :
- lightmap_uv_right = static_cast(lightmap_width) / static_cast(width);
- lightmap_uv_bottom = static_cast(lightmap_height) / static_cast(height);
-- texture_manager->register_texture(lightmap.get());
-+ //texture_manager->register_texture(lightmap.get());
+ m_lightmap_uv_right = static_cast(m_lightmap_width) / static_cast(width);
+ m_lightmap_uv_bottom = static_cast(m_lightmap_height) / static_cast(height);
+- TextureManager::current()->register_texture(m_lightmap.get());
}
GLLightmap::~GLLightmap()
-diff --git a/src/video/gl/gl_renderer.cpp b/src/video/gl/gl_renderer.cpp
-index 0e66433..abf65b8 100644
---- a/src/video/gl/gl_renderer.cpp
-+++ b/src/video/gl/gl_renderer.cpp
-@@ -123,8 +123,8 @@ GLRenderer::draw_surface(const DrawingRequest& request)
+diff --git a/src/video/gl/gl_painter.cpp b/src/video/gl/gl_painter.cpp
+index ecb3cb1..3493ee1 100644
+--- a/src/video/gl/gl_painter.cpp
++++ b/src/video/gl/gl_painter.cpp
+@@ -14,6 +14,9 @@
+ // You should have received a copy of the GNU General Public License
+ // along with this program. If not, see .
+
++#include
++#include
++
+ #include "video/gl/gl_painter.hpp"
+
+ #include "video/drawing_request.hpp"
+@@ -21,6 +24,8 @@
+ #include "video/gl/gl_texture.hpp"
+
+ GLuint GLPainter::s_last_texture = static_cast(-1);
++GLenum GLPainter::s_blend_sfactor = -1;
++GLenum GLPainter::s_blend_dfactor = -1;
+
+ namespace {
+
+@@ -38,7 +43,13 @@ inline void intern_draw(float left, float top, float right, float bottom,
+ if(effect & VERTICAL_FLIP)
+ std::swap(uv_top, uv_bottom);
+
+- glBlendFunc(blend.sfactor, blend.dfactor);
++ bool restoreBlendMode = false;
++ if (blend.sfactor != GL_SRC_ALPHA || blend.dfactor != GL_ONE_MINUS_SRC_ALPHA) {
++ glBlendFunc(blend.sfactor, blend.dfactor);
++ restoreBlendMode = true;
++ //s_blend_sfactor = blend.sfactor;
++ //s_blend_dfactor = blend.dfactor;
++ }
+ glColor4f(color.red, color.green, color.blue, color.alpha * alpha);
+
+ // unrotated blit
+@@ -95,7 +106,8 @@ inline void intern_draw(float left, float top, float right, float bottom,
+
+ // FIXME: find a better way to restore the blend mode
+ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
++ if (restoreBlendMode)
++ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }
+
+ } // namespace
+@@ -125,8 +137,8 @@ GLPainter::draw_surface(const DrawingRequest& request)
glBindTexture(GL_TEXTURE_2D, th);
}
intern_draw(request.pos.x, request.pos.y,
- request.pos.x + surface->get_width(),
- request.pos.y + surface->get_height(),
-+ request.pos.x + (float)surface->get_width() * 1.02f, // There are seams between textures because of floating-point rounding, so we're adding small offset to prevent that
-+ request.pos.y + (float)surface->get_height() * 1.02f,
++ request.pos.x + surface->get_width() * 1.001f, // Avoid seams between background textures
++ request.pos.y + surface->get_height() * 1.001f,
surface_data->get_uv_left(),
surface_data->get_uv_top(),
surface_data->get_uv_right(),
-@@ -159,8 +159,8 @@ GLRenderer::draw_surface_part(const DrawingRequest& request)
- glBindTexture(GL_TEXTURE_2D, th);
+@@ -371,4 +383,11 @@ GLPainter::draw_inverse_ellipse(const DrawingRequest& request)
+ glColor4f(1, 1, 1, 1);
+ }
+
++void GLPainter::reset_last_texture()
++{
++ s_last_texture = static_cast(-1);
++ s_blend_sfactor = -1;
++ s_blend_dfactor = -1;
++}
++
+ /* EOF */
+diff --git a/src/video/gl/gl_painter.hpp b/src/video/gl/gl_painter.hpp
+index bb3dd75..6ac8add 100644
+--- a/src/video/gl/gl_painter.hpp
++++ b/src/video/gl/gl_painter.hpp
+@@ -17,13 +17,18 @@
+ #ifndef HEADER_SUPERTUX_VIDEO_GL_GL_PAINTER_HPP
+ #define HEADER_SUPERTUX_VIDEO_GL_GL_PAINTER_HPP
+
++#ifndef GL_VERSION_ES_CM_1_0
+ #ifdef USE_GLBINDING
+ #include
+ using namespace gl;
+ #else
+ #include
+
+-#include "SDL_opengl.h"
++//#include "SDL_opengl.h"
++#endif
++#else
++#include
++#include
+ #endif
+
+ struct DrawingRequest;
+@@ -32,6 +37,8 @@ class GLPainter
+ {
+ private:
+ static GLuint s_last_texture;
++ static GLenum s_blend_sfactor;
++ static GLenum s_blend_dfactor;
+
+ public:
+ GLPainter();
+@@ -41,6 +48,7 @@ public:
+ static void draw_gradient(const DrawingRequest& request);
+ static void draw_filled_rect(const DrawingRequest& request);
+ static void draw_inverse_ellipse(const DrawingRequest& request);
++ static void reset_last_texture();
+
+ private:
+ GLPainter(const GLPainter&) = delete;
+diff --git a/src/video/gl/gl_renderer.cpp b/src/video/gl/gl_renderer.cpp
+index 8f4a18ee..aa5670a 100644
+--- a/src/video/gl/gl_renderer.cpp
++++ b/src/video/gl/gl_renderer.cpp
+@@ -43,35 +43,13 @@
+ #endif
+
+ GLRenderer::GLRenderer() :
+- m_window(),
+- m_glcontext(),
++ //m_window(),
++ //m_glcontext(),
+ m_viewport(),
+ m_desktop_size(0, 0),
+ m_fullscreen_active(false)
+ {
+- SDL_DisplayMode mode;
+- SDL_GetCurrentDisplayMode(0, &mode);
+- m_desktop_size = Size(mode.w, mode.h);
+-
+- if(g_config->try_vsync) {
+- /* we want vsync for smooth scrolling */
+- if (SDL_GL_SetSwapInterval(-1) != 0)
+- {
+- log_info << "no support for late swap tearing vsync: " << SDL_GetError() << std::endl;
+- if (SDL_GL_SetSwapInterval(1))
+- {
+- log_info << "no support for vsync: " << SDL_GetError() << std::endl;
+- }
+- }
+- }
+-
+- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+-
+- SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
+- SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
+- SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
+-
+- apply_video_mode();
++ m_desktop_size = Size(SDL_GetVideoInfo()->current_w, SDL_GetVideoInfo()->current_h);
+
+ #ifdef USE_GLBINDING
+
+@@ -107,15 +85,6 @@ GLRenderer::GLRenderer() :
+
+ #endif
+
+- // setup opengl state and transform
+- glDisable(GL_DEPTH_TEST);
+- glDisable(GL_CULL_FACE);
+- glEnable(GL_TEXTURE_2D);
+- glEnable(GL_BLEND);
+- glEnableClientState(GL_VERTEX_ARRAY);
+- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+-
+ // Init the projection matrix, viewport and stuff
+ apply_config();
+
+@@ -136,8 +105,8 @@ GLRenderer::GLRenderer() :
+
+ GLRenderer::~GLRenderer()
+ {
+- SDL_GL_DeleteContext(m_glcontext);
+- SDL_DestroyWindow(m_window);
++ //SDL_GL_DeleteContext(m_glcontext);
++ //SDL_DestroyWindow(m_window);
+ }
+
+ void
+@@ -213,7 +182,14 @@ void
+ GLRenderer::flip()
+ {
+ assert_gl("drawing");
+- SDL_GL_SwapWindow(m_window);
++ SDL_GL_SwapBuffers();
++ GLPainter::reset_last_texture();
++ glEnable(GL_TEXTURE_2D);
++ glEnable(GL_BLEND);
++ glEnableClientState(GL_VERTEX_ARRAY);
++ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
++ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
++ glColor4f(1, 1, 1, 1);
+ }
+
+ void
+@@ -229,9 +205,17 @@ GLRenderer::apply_config()
+ {
+ apply_video_mode();
+
+- Size target_size = g_config->use_fullscreen ?
+- ((g_config->fullscreen_size == Size(0, 0)) ? m_desktop_size : g_config->fullscreen_size) :
+- g_config->window_size;
++ // setup opengl state and transform
++ glDisable(GL_DEPTH_TEST);
++ glDisable(GL_CULL_FACE);
++ glEnable(GL_TEXTURE_2D);
++ glEnable(GL_BLEND);
++ glEnableClientState(GL_VERTEX_ARRAY);
++ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
++ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
++
++
++ Size target_size = m_desktop_size;
+
+ float pixel_aspect_ratio = 1.0f;
+ if (g_config->aspect_size != Size(0, 0))
+@@ -264,9 +248,9 @@ GLRenderer::apply_config()
+ {
+ // Clear both buffers so that we get a clean black border without junk
+ glClear(GL_COLOR_BUFFER_BIT);
+- SDL_GL_SwapWindow(m_window);
++ SDL_GL_SwapBuffers();
+ glClear(GL_COLOR_BUFFER_BIT);
+- SDL_GL_SwapWindow(m_window);
++ SDL_GL_SwapBuffers();
}
- intern_draw(request.pos.x, request.pos.y,
-- request.pos.x + surfacepartrequest->size.x,
-- request.pos.y + surfacepartrequest->size.y,
-+ request.pos.x + surfacepartrequest->size.x + 0.001f,
-+ request.pos.y + surfacepartrequest->size.y + 0.001f,
- uv_left,
- uv_top,
- uv_right,
+
+ glViewport(m_viewport.x, m_viewport.y, m_viewport.w, m_viewport.h);
+@@ -285,102 +269,15 @@ GLRenderer::apply_config()
+ void
+ GLRenderer::apply_video_mode()
+ {
+- if (m_window)
+- {
+- if (!g_config->use_fullscreen)
+- {
+- SDL_SetWindowFullscreen(m_window, 0);
+- }
+- else
+- {
+- if (g_config->fullscreen_size.width == 0 &&
+- g_config->fullscreen_size.height == 0)
+- {
+- if (SDL_SetWindowFullscreen(m_window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0)
+- {
+- log_warning << "failed to switch to desktop fullscreen mode: "
+- << SDL_GetError() << std::endl;
+- }
+- else
+- {
+- log_info << "switched to desktop fullscreen mode" << std::endl;
+- }
+- }
+- else
+- {
+- SDL_DisplayMode mode;
+- mode.format = SDL_PIXELFORMAT_RGB888;
+- mode.w = g_config->fullscreen_size.width;
+- mode.h = g_config->fullscreen_size.height;
+- mode.refresh_rate = g_config->fullscreen_refresh_rate;
+- mode.driverdata = 0;
+-
+- if (SDL_SetWindowDisplayMode(m_window, &mode) != 0)
+- {
+- log_warning << "failed to set display mode: "
+- << mode.w << "x" << mode.h << "@" << mode.refresh_rate << ": "
+- << SDL_GetError() << std::endl;
+- }
+- else
+- {
+- if (SDL_SetWindowFullscreen(m_window, SDL_WINDOW_FULLSCREEN) != 0)
+- {
+- log_warning << "failed to switch to fullscreen mode: "
+- << mode.w << "x" << mode.h << "@" << mode.refresh_rate << ": "
+- << SDL_GetError() << std::endl;
+- }
+- else
+- {
+- log_info << "switched to fullscreen mode: "
+- << mode.w << "x" << mode.h << "@" << mode.refresh_rate << std::endl;
+- }
+- }
+- }
+- }
+- }
+- else
+- {
+- int flags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE;
+- Size size;
+- if (g_config->use_fullscreen)
+- {
+- if (g_config->fullscreen_size == Size(0, 0))
+- {
+- flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
+- size = m_desktop_size;
+- }
+- else
+- {
+- flags |= SDL_WINDOW_FULLSCREEN;
+- size.width = g_config->fullscreen_size.width;
+- size.height = g_config->fullscreen_size.height;
+- }
+- }
+- else
+- {
+- size = g_config->window_size;
+- }
+-
+- m_window = SDL_CreateWindow("SuperTux",
+- SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
+- size.width, size.height,
+- flags);
+- if (!m_window)
+- {
+- std::ostringstream msg;
+- msg << "Couldn't set video mode " << size.width << "x" << size.height << ": " << SDL_GetError();
+- throw std::runtime_error(msg.str());
+- }
+- else
+- {
+- m_glcontext = SDL_GL_CreateContext(m_window);
+-
+- SCREEN_WIDTH = size.width;
+- SCREEN_HEIGHT = size.height;
+-
+- m_fullscreen_active = g_config->use_fullscreen;
+- }
+- }
++ //SCREEN_WIDTH = SDL_GetVideoInfo()->current_w;
++ //SCREEN_HEIGHT = SDL_GetVideoInfo()->current_h;
++#ifdef ANDROID
++ SDL_SetVideoMode(m_desktop_size.width, m_desktop_size.height, 16, SDL_OPENGL | SDL_DOUBLEBUF | SDL_FULLSCREEN);
++#else
++ m_desktop_size.width = 1280;
++ m_desktop_size.height = 800;
++ SDL_SetVideoMode(m_desktop_size.width, m_desktop_size.height, 16, SDL_OPENGL | SDL_DOUBLEBUF);
++#endif
+ }
+
+ void
+@@ -433,9 +330,9 @@ GLRenderer::to_logical(int physical_x, int physical_y)
+ void
+ GLRenderer::set_gamma(float gamma)
+ {
+- Uint16 ramp[256];
+- SDL_CalculateGammaRamp(gamma, ramp);
+- SDL_SetWindowGammaRamp(m_window, ramp, ramp, ramp);
++ //Uint16 ramp[256];
++ //SDL_CalculateGammaRamp(gamma, ramp);
++ //SDL_SetWindowGammaRamp(m_window, ramp, ramp, ramp);
+ }
+
+ /* EOF */
diff --git a/src/video/gl/gl_renderer.hpp b/src/video/gl/gl_renderer.hpp
-index d5d9995..4fdacf8 100644
+index 5da04a8..b73eb9d 100644
--- a/src/video/gl/gl_renderer.hpp
+++ b/src/video/gl/gl_renderer.hpp
-@@ -63,8 +63,8 @@ inline void intern_draw(float left, float top, float right, float bottom,
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
- } else {
- // rotated blit
-- float center_x = (left + right) / 2;
-- float center_y = (top + bottom) / 2;
-+ float center_x = (left + right) / 2.0f;
-+ float center_y = (top + bottom) / 2.0f;
+@@ -27,8 +27,8 @@
+ class GLRenderer : public Renderer
+ {
+ private:
+- SDL_Window* m_window;
+- SDL_GLContext m_glcontext;
++ //SDL_Window* m_window;
++ //SDL_GLContext m_glcontext;
+ SDL_Rect m_viewport;
+ Size m_desktop_size;
+ bool m_fullscreen_active;
+@@ -51,7 +51,7 @@ public:
+ Vector to_logical(int physical_x, int physical_y) override;
+ void set_gamma(float gamma) override;
- float sa = sinf(angle/180.0f*M_PI);
- float ca = cosf(angle/180.0f*M_PI);
+- SDL_Window* get_window() const { return m_window; }
++ //SDL_Window* get_window() const { return m_window; }
+
+ private:
+ void apply_video_mode();
diff --git a/src/video/gl/gl_texture.cpp b/src/video/gl/gl_texture.cpp
-index 9e2b70d..a5081e3 100644
+index 443fa01..89c9f5e 100644
--- a/src/video/gl/gl_texture.cpp
+++ b/src/video/gl/gl_texture.cpp
@@ -16,6 +16,8 @@
@@ -249,160 +1308,199 @@ index 9e2b70d..a5081e3 100644
+#include "video/texture_manager.hpp"
+#include "util/log.hpp"
- namespace {
-
-@@ -39,7 +41,8 @@ GLTexture::GLTexture(unsigned int width, unsigned int height) :
- texture_width(),
- texture_height(),
- image_width(),
-- image_height()
-+ image_height(),
-+ pixels(NULL)
+ #ifdef USE_GLBINDING
+ #include
+@@ -45,7 +47,8 @@ GLTexture::GLTexture(unsigned int width, unsigned int height) :
+ m_texture_width(),
+ m_texture_height(),
+ m_image_width(),
+- m_image_height()
++ m_image_height(),
++ m_pixels(NULL)
{
#ifdef GL_VERSION_ES_CM_1_0
assert(is_power_of_2(width));
-@@ -64,6 +67,8 @@ GLTexture::GLTexture(unsigned int width, unsigned int height) :
- glDeleteTextures(1, &handle);
- throw;
- }
-+ if (texture_manager)
-+ texture_manager->register_texture(this);
+@@ -57,19 +60,9 @@ GLTexture::GLTexture(unsigned int width, unsigned int height) :
+ m_image_height = height;
+
+ assert_gl("before creating texture");
+- glGenTextures(1, &m_handle);
+-
+- try {
+- glBindTexture(GL_TEXTURE_2D, m_handle);
+-
+- glTexImage2D(GL_TEXTURE_2D, 0, static_cast(GL_RGBA), m_texture_width,
+- m_texture_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+
+- set_texture_params();
+- } catch(...) {
+- glDeleteTextures(1, &m_handle);
+- throw;
+- }
++ reupload();
++ TextureManager::current()->register_texture(this);
}
GLTexture::GLTexture(SDL_Surface* image) :
-@@ -71,7 +76,8 @@ GLTexture::GLTexture(SDL_Surface* image) :
- texture_width(),
- texture_height(),
- image_width(),
-- image_height()
-+ image_height(),
-+ pixels(NULL)
+@@ -77,7 +70,8 @@ GLTexture::GLTexture(SDL_Surface* image) :
+ m_texture_width(),
+ m_texture_height(),
+ m_image_width(),
+- m_image_height()
++ m_image_height(),
++ m_pixels(NULL)
{
#ifdef GL_VERSION_ES_CM_1_0
- texture_width = next_power_of_two(image->w);
-@@ -108,11 +114,49 @@ GLTexture::GLTexture(SDL_Surface* image) :
+ m_texture_width = next_power_of_two(image->w);
+@@ -107,80 +101,93 @@ GLTexture::GLTexture(SDL_Surface* image) :
+ m_image_width = image->w;
+ m_image_height = image->h;
- SDL_SetAlpha(image, 0, 0);
+-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+- SDL_Surface* convert = SDL_CreateRGBSurface(0,
+- m_texture_width, m_texture_height, 32,
+- 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff);
+-#else
+- SDL_Surface* convert = SDL_CreateRGBSurface(0,
+- m_texture_width, m_texture_height, 32,
+- 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000);
+-#endif
++ SDL_Surface* convert;
++ if (image->flags & SDL_SRCCOLORKEY) {
++ // Palette image with colorkey transparency - RGBA5551
++ convert = SDL_CreateRGBSurface(0,
++ m_image_width, m_image_height, 16,
++ 0x0000f800, 0x000007c0, 0x0000003e, 0x00000001);
++ } else if (image->format->BitsPerPixel == 32) {
++ // 32-bit image with alpha channel - RGBA4444
++ convert = SDL_CreateRGBSurface(0,
++ m_image_width, m_image_height, 16,
++ 0x0000f000, 0x00000f00, 0x000000f0, 0x0000000f);
++ } else {
++ // 24-bit image or palette without transparency - RGB565
++ convert = SDL_CreateRGBSurface(0,
++ m_image_width, m_image_height, 16,
++ 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000);
++ }
+
+ if(convert == 0) {
+ throw std::runtime_error("Couldn't create texture: out of memory");
+ }
+
+- SDL_SetSurfaceBlendMode(image, SDL_BLENDMODE_NONE);
++ SDL_FillRect(convert, NULL, 0x00000000);
++ //SDL_SetColorKey(image, 0, 0); // Some images use colorkey transparency
++ SDL_SetAlpha(image, 0, SDL_ALPHA_OPAQUE);
SDL_BlitSurface(image, 0, convert, 0);
-+ pixels = convert;
-
++ //SDL_Rect r = {m_image_width / 2, m_image_height / 2, 4, 4};
++ //SDL_FillRect(convert, &r, 0xff000000);
++
++ m_pixels = convert;
++
+ reupload();
-+ if (texture_manager)
-+ texture_manager->register_texture(this);
-+}
-+
-+GLTexture::~GLTexture()
-+{
-+ if (texture_manager)
-+ texture_manager->remove_texture(this);
-+ if(pixels)
-+ SDL_FreeSurface(pixels);
-+ glDeleteTextures(1, &handle);
-+}
-+
-+void
-+GLTexture::set_texture_params()
-+{
-+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-+
-+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-+
-+ assert_gl("set texture params");
++ TextureManager::current()->register_texture(this);
+
++ assert_gl("creating texture");
+}
+
+void GLTexture::reupload()
+{
assert_gl("before creating texture");
- glGenTextures(1, &handle);
+ glGenTextures(1, &m_handle);
-- try {
-+ //log_info << "GL texture: reupload: this " << this << " pixels " << pixels << " GL handle " << handle << std::endl;
-+ SDL_Surface* convert = pixels;
-+ if( !convert )
-+ {
-+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture_width,
-+ texture_height, 0, GL_RGBA,
-+ GL_UNSIGNED_BYTE, NULL);
-+ return;
-+ }
-+/*
- GLenum sdl_format;
- if(convert->format->BytesPerPixel == 3)
- sdl_format = GL_RGB;
-@@ -122,7 +166,7 @@ GLTexture::GLTexture(SDL_Surface* image) :
- sdl_format = GL_RGBA;
- assert(false);
+ try {
+- GLenum sdl_format;
+- if(convert->format->BytesPerPixel == 3)
+- sdl_format = GL_RGB;
+- else if(convert->format->BytesPerPixel == 4)
+- sdl_format = GL_RGBA;
+- else {
+- sdl_format = GL_RGBA;
+- assert(false);
++ GLenum sdl_format = GL_RGBA;
++ GLenum pixel_packing = GL_UNSIGNED_BYTE;
++
++ if (m_pixels) {
++ if (m_pixels->format->Amask == 0)
++ sdl_format = GL_RGB;
++ if (m_pixels->format->Gmask == 0x000007c0)
++ pixel_packing = GL_UNSIGNED_SHORT_5_5_5_1;
++ if (m_pixels->format->Gmask == 0x00000f00)
++ pixel_packing = GL_UNSIGNED_SHORT_4_4_4_4;
++ if (m_pixels->format->Gmask == 0x000007e0)
++ pixel_packing = GL_UNSIGNED_SHORT_5_6_5;
}
--
-+*/
- glBindTexture(GL_TEXTURE_2D, handle);
+
+ glBindTexture(GL_TEXTURE_2D, m_handle);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- #ifdef GL_UNPACK_ROW_LENGTH
-@@ -141,14 +185,16 @@ GLTexture::GLTexture(SDL_Surface* image) :
- if (true)
- { // no not use mipmaps
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture_width,
-- texture_height, 0, sdl_format,
-+ texture_height, 0, GL_RGBA,
- GL_UNSIGNED_BYTE, convert->pixels);
- }
- else
- { // build mipmaps
-+#ifndef GL_VERSION_ES_CM_1_0
- gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, texture_width,
- texture_height, sdl_format,
- GL_UNSIGNED_BYTE, convert->pixels);
-+#endif
- }
+ #if defined(GL_UNPACK_ROW_LENGTH) || defined(USE_GLBINDING)
+- glPixelStorei(GL_UNPACK_ROW_LENGTH, convert->pitch/convert->format->BytesPerPixel);
++ //glPixelStorei(GL_UNPACK_ROW_LENGTH, convert->pitch/convert->format->BytesPerPixel);
+ #else
+ /* OpenGL ES doesn't support UNPACK_ROW_LENGTH, let's hope SDL didn't add
+ * padding bytes, otherwise we need some extra code here... */
+- assert(convert->pitch == m_texture_width * convert->format->BytesPerPixel);
++ //assert(convert->pitch == m_texture_width * convert->format->BytesPerPixel);
+ #endif
- if(SDL_MUSTLOCK(convert))
-@@ -159,29 +205,8 @@ GLTexture::GLTexture(SDL_Surface* image) :
- assert_gl("creating texture");
+- if(SDL_MUSTLOCK(convert))
+- {
+- SDL_LockSurface(convert);
+- }
+-
+- glTexImage2D(GL_TEXTURE_2D, 0, static_cast(GL_RGBA),
++ glTexImage2D(GL_TEXTURE_2D, 0, sdl_format,
+ m_texture_width, m_texture_height, 0, sdl_format,
+- GL_UNSIGNED_BYTE, convert->pixels);
+-
+- // no not use mipmaps
+- if(false)
+- {
+- glGenerateMipmap(GL_TEXTURE_2D);
+- }
+-
+- if(SDL_MUSTLOCK(convert))
+- {
+- SDL_UnlockSurface(convert);
+- }
++ pixel_packing, NULL);
+
+- assert_gl("creating texture");
++ if (m_pixels)
++ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_image_width, m_image_height,
++ sdl_format, pixel_packing, m_pixels->pixels);
set_texture_params();
-- } catch(...) {
-- glDeleteTextures(1, &handle);
+ } catch(...) {
+ glDeleteTextures(1, &m_handle);
- SDL_FreeSurface(convert);
-- throw;
-- }
+ throw;
+ }
- SDL_FreeSurface(convert);
--}
-
--GLTexture::~GLTexture()
--{
-- glDeleteTextures(1, &handle);
--}
--
--void
--GLTexture::set_texture_params()
--{
-- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
--
-- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
--
-- assert_gl("set texture params");
-+ set_texture_params();
}
- /* EOF */
+ GLTexture::~GLTexture()
+ {
++ TextureManager::current()->remove_texture(this);
++ if (m_pixels)
++ SDL_FreeSurface(m_pixels);
+ glDeleteTextures(1, &m_handle);
+ }
+
diff --git a/src/video/gl/gl_texture.hpp b/src/video/gl/gl_texture.hpp
-index 4b24d48..699053a 100644
+index 7cb634f..787d702 100644
--- a/src/video/gl/gl_texture.hpp
+++ b/src/video/gl/gl_texture.hpp
@@ -32,6 +32,7 @@ protected:
- unsigned int texture_height;
- unsigned int image_width;
- unsigned int image_height;
-+ SDL_Surface* pixels;
+ unsigned int m_texture_height;
+ unsigned int m_image_width;
+ unsigned int m_image_height;
++ SDL_Surface* m_pixels;
public:
GLTexture(unsigned int width, unsigned int height);
@@ -76,6 +77,8 @@ public:
- image_height = height;
+ m_image_height = height;
}
+ void reupload();
@@ -410,11 +1508,23 @@ index 4b24d48..699053a 100644
private:
void set_texture_params();
};
+diff --git a/src/video/gl/gl_video_system.cpp b/src/video/gl/gl_video_system.cpp
+index 87b0ab7..328a58c 100644
+--- a/src/video/gl/gl_video_system.cpp
++++ b/src/video/gl/gl_video_system.cpp
+@@ -69,6 +69,7 @@ void
+ GLVideoSystem::resize(int w, int h)
+ {
+ m_renderer->resize(w, h);
++ TextureManager::current()->reload_textures();
+ m_lightmap.reset(new GLLightmap);
+ }
+
diff --git a/src/video/glutil.hpp b/src/video/glutil.hpp
-index e51240d..2330b0a 100644
+index 4ead32d..d791bb1 100644
--- a/src/video/glutil.hpp
+++ b/src/video/glutil.hpp
-@@ -76,7 +76,7 @@ static inline void check_gl_error(const char* message)
+@@ -86,7 +86,7 @@ static inline void check_gl_error(const char* message)
msg << "Unknown error (code " << error << ")";
}
@@ -423,37 +1533,24 @@ index e51240d..2330b0a 100644
}
}
-diff --git a/src/video/sdl/sdl_texture.cpp b/src/video/sdl/sdl_texture.cpp
-index b58f7cc..422bec8 100644
---- a/src/video/sdl/sdl_texture.cpp
-+++ b/src/video/sdl/sdl_texture.cpp
-@@ -679,5 +679,9 @@ SDLTexture::get_transform(const Color &color, DrawingEffect effect)
- return cache[effect][color];
- }
+diff --git a/src/video/renderer.hpp b/src/video/renderer.hpp
+index b9d4ec3..2532c65 100644
+--- a/src/video/renderer.hpp
++++ b/src/video/renderer.hpp
+@@ -56,7 +56,7 @@ public:
+ virtual void apply_config() = 0;
+ virtual Vector to_logical(int physical_x, int physical_y) = 0;
+ virtual void set_gamma(float gamma) = 0;
+- virtual SDL_Window* get_window() const = 0;
++ //virtual SDL_Window* get_window() const = 0;
+ };
-+void SDLTexture::reupload()
-+{
-+}
-+
- /* vim: set sw=2 sts=2 et : */
- /* EOF */
-diff --git a/src/video/sdl/sdl_texture.hpp b/src/video/sdl/sdl_texture.hpp
-index 97c38cb..61ceedb 100644
---- a/src/video/sdl/sdl_texture.hpp
-+++ b/src/video/sdl/sdl_texture.hpp
-@@ -136,6 +136,7 @@ public:
- {
- return height;
- }*/
-+ void reupload();
-
- private:
- SDLTexture(const SDLTexture&);
+ #endif
diff --git a/src/video/texture.hpp b/src/video/texture.hpp
-index e814547..710a488 100644
+index 76964a9..86dc631 100644
--- a/src/video/texture.hpp
+++ b/src/video/texture.hpp
-@@ -63,6 +63,7 @@ public:
+@@ -65,6 +65,7 @@ public:
virtual unsigned int get_texture_height() const = 0;
virtual unsigned int get_image_width() const = 0;
virtual unsigned int get_image_height() const = 0;
@@ -462,19 +1559,37 @@ index e814547..710a488 100644
private:
Texture(const Texture&);
diff --git a/src/video/texture_manager.cpp b/src/video/texture_manager.cpp
-index 0c77a5a..378853b 100644
+index e544909..aac5c63 100644
--- a/src/video/texture_manager.cpp
+++ b/src/video/texture_manager.cpp
-@@ -228,6 +228,7 @@ TextureManager::create_dummy_texture()
+@@ -164,12 +164,14 @@ TextureManager::create_image_texture_raw(const std::string& filename, const Rect
+ throw std::runtime_error("SDL_CreateRGBSurfaceFrom() call failed");
+ }
+
+-#ifdef OLD_SDL
+ if (image->format->palette)
+ { // copy the image palette to subimage if present
+- SDL_SetSurfacePalette(subimage.get(), image->format->palette->colors);
++ SDL_SetColors(subimage.get(), image->format->palette->colors, 0, image->format->palette->ncolors);
++ }
++ if (image->flags & SDL_SRCCOLORKEY)
++ { // Some images use colorkey transparency
++ SDL_SetColorKey(subimage.get(), SDL_SRCCOLORKEY, image->format->colorkey);
+ }
+-#endif
+
+ return VideoSystem::current()->new_texture(subimage.get());
+ }
+@@ -240,6 +242,7 @@ TextureManager::create_dummy_texture()
void
TextureManager::save_textures()
{
+#if 0
- #ifdef GL_PACK_ROW_LENGTH
+ #if defined(GL_PACK_ROW_LENGTH) || defined(USE_GLBINDING)
/* all this stuff is not support by OpenGL ES */
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
-@@ -245,11 +246,13 @@ TextureManager::save_textures()
- i != image_textures.end(); ++i) {
+@@ -261,11 +264,13 @@ TextureManager::save_textures()
+ {
save_texture(dynamic_cast(i->second.lock().get()));
}
+#endif
@@ -487,9 +1602,11 @@ index 0c77a5a..378853b 100644
SavedTexture saved_texture;
saved_texture.texture = texture;
glBindTexture(GL_TEXTURE_2D, texture->get_handle());
-@@ -284,11 +287,13 @@ TextureManager::save_texture(GLTexture* texture)
- texture->set_handle(0);
+@@ -298,13 +303,14 @@ TextureManager::save_texture(GLTexture* texture)
+ glDeleteTextures(1, &(texture->get_handle()));
+ texture->set_handle(0);
+-
assert_gl("retrieving texture for save");
+#endif
}
@@ -498,19 +1615,86 @@ index 0c77a5a..378853b 100644
TextureManager::reload_textures()
{
+#if 0
- #ifdef GL_UNPACK_ROW_LENGTH
+ #if defined(GL_UNPACK_ROW_LENGTH) || defined(USE_GLBINDING)
/* OpenGL ES doesn't support these */
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-@@ -329,6 +334,12 @@ TextureManager::reload_textures()
+@@ -345,6 +351,16 @@ TextureManager::reload_textures()
}
- saved_textures.clear();
+ m_saved_textures.clear();
+#endif
-+ for(Textures::iterator i = textures.begin(); i != textures.end(); ++i) {
++ for(Textures::iterator i = m_textures.begin(); i != m_textures.end(); ++i) {
+ //log_info << "Texture manager: reuploading texture " << *i << std::endl;
-+
+ (*i)->reupload();
++ }
++ for(ImageTextures::iterator i = m_image_textures.begin();
++ i != m_image_textures.end(); ++i)
++ {
++ dynamic_cast(i->second.lock().get())->reupload();
+ }
}
#endif
+diff --git a/src/video/util.hpp b/src/video/util.hpp
+index 46be85c..72f7cb8 100644
+--- a/src/video/util.hpp
++++ b/src/video/util.hpp
+@@ -17,7 +17,7 @@
+ #ifndef HEADER_SUPERTUX_VIDEO_UTIL_HPP
+ #define HEADER_SUPERTUX_VIDEO_UTIL_HPP
+
+-#include "SDL_rect.h"
++#include "SDL_video.h"
+
+ class Size;
+ class Vector;
+diff --git a/src/video/video_system.cpp b/src/video/video_system.cpp
+index dd736d0..726c81a 100644
+--- a/src/video/video_system.cpp
++++ b/src/video/video_system.cpp
+@@ -19,7 +19,7 @@
+ #include
+
+ #include "util/log.hpp"
+-#include "video/sdl/sdl_video_system.hpp"
++//#include "video/sdl/sdl_video_system.hpp"
+
+ #ifdef HAVE_OPENGL
+ #include "video/gl/gl_video_system.hpp"
+@@ -31,33 +31,15 @@ VideoSystem::create(VideoSystem::Enum video_system)
+ switch(video_system)
+ {
+ case AUTO_VIDEO:
+-#ifdef HAVE_OPENGL
+- try
+- {
+- return std::unique_ptr(new GLVideoSystem);
+- }
+- catch(std::exception& err)
+- {
+- log_warning << "Error creating GLVideoSystem, using SDL fallback: " << err.what() << std::endl;
+- return std::unique_ptr(new SDLVideoSystem);
+- }
+-#else
+- log_info << "new SDL renderer\n";
+- return std::unique_ptr(new SDLVideoSystem);
+-#endif
+-
+ case OPENGL:
++ case PURE_SDL:
+ #ifdef HAVE_OPENGL
+ return std::unique_ptr(new GLVideoSystem);
+ #else
+- log_warning << "OpenGL requested, but missing using SDL fallback" << std::endl;
+- return std::unique_ptr(new SDLVideoSystem);
++ //log_warning << "OpenGL requested, but missing using SDL fallback" << std::endl;
++ //return std::unique_ptr(new SDLVideoSystem);
+ #endif
+
+- case PURE_SDL:
+- log_info << "new SDL renderer\n";
+- return std::unique_ptr(new SDLVideoSystem);
+-
+ default:
+ assert(!"invalid video system in config");
+ return {};
diff --git a/project/jni/application/supertux/config.h b/project/jni/application/supertux/config.h
index d537c3091..6f9853a01 100644
--- a/project/jni/application/supertux/config.h
+++ b/project/jni/application/supertux/config.h
@@ -9,7 +9,11 @@
#define INSTALL_SUBDIR_BIN "games"
#define INSTALL_SUBDIR_SHARE "share/games/supertux2"
-#define SIZEOF_VOID_P 4
+#ifdef __LP64__
+#define SIZEOF_VOIDP 8
+#else
+#define SIZEOF_VOIDP 4
+#endif
#if SIZEOF_VOID_P == 8
#define _SQ64
#endif
diff --git a/project/jni/application/supertux/version.h b/project/jni/application/supertux/version.h
index ae3692547..2e62ca641 100644
--- a/project/jni/application/supertux/version.h
+++ b/project/jni/application/supertux/version.h
@@ -1,4 +1,4 @@
#ifndef VERSION_H
#define VERSION_H
-#define PACKAGE_VERSION "0.3.3-GIT rexported"
+#define PACKAGE_VERSION "0.3.4-GIT commit '5e32f9729857c1322c2cf7d627f6e1692e15020b' "
#endif
diff --git a/project/jni/application/teeworlds/AndroidAppSettings.cfg b/project/jni/application/teeworlds/AndroidAppSettings.cfg
index 84eb659be..6ea2a6675 100644
--- a/project/jni/application/teeworlds/AndroidAppSettings.cfg
+++ b/project/jni/application/teeworlds/AndroidAppSettings.cfg
@@ -7,17 +7,17 @@ AppName="TeeWorlds"
AppFullName=com.teeworlds
# Application version code (integer)
-AppVersionCode=06219
+AppVersionCode=06220
# Application user-visible version name (string)
-AppVersionName="0.6.2.19"
+AppVersionName="0.6.2.20"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
-# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
+# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
AppDataDownloadUrl="Game data|data.zip"
# Reset SDL config when updating application to the new version (y) / (n)
@@ -28,7 +28,7 @@ DeleteFilesOnUpgrade="%"
# Here you may type readme text, which will be shown during startup. Format is:
# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/
-ReadmeText='Tap left joystick to jump'
+ReadmeText=''
# libSDL version to use (1.2/1.3/2.0)
LibSdlVersion=1.2
@@ -68,7 +68,11 @@ CreateService=
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
-CompatibilityHacks=n
+CompatibilityHacksForceScreenUpdate=n
+
+# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
+# force screen update by moving mouse cursor a little after each click (y) or (n)
+CompatibilityHacksForceScreenUpdateMouseClick=y
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
CompatibilityHacksStaticInit=n
@@ -115,13 +119,18 @@ GenerateSubframeTouchEvents=
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
ForceRelativeMouseMode=n
-# Application needs arrow keys (y) or (n), will show on-screen dpad/joystick (y) or (n)
+# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
AppNeedsArrowKeys=n
+# On-screen dpad/joystick will appear under finger when it touches the screen (y) or (n)
+# Joystick always follows finger, so moving mouse requires touching the screen with other finger
+FloatingScreenJoystick=
+
# Application needs text input (y) or (n), enables button for text input on screen
AppNeedsTextInput=y
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
+# This will disable AppNeedsArrowKeys option
AppUsesJoystick=y
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
@@ -136,6 +145,9 @@ AppUsesAccelerometer=n
# Application uses gyroscope (y) or (n), the gyroscope will be used as joystick 1 axes 2-4
AppUsesGyroscope=n
+# Use gyroscope to move mouse cursor (y) or (n), it eats battery, and can be disabled in settings, do not use with AppUsesGyroscope setting
+MoveMouseWithGyroscope=
+
# Application uses multitouch (y) or (n), multitouch events are passed as SDL_JOYBALLMOTION events for the joystick 0
AppUsesMultitouch=n
@@ -190,22 +202,25 @@ RedefinedKeysGamepad="RETURN PAGEDOWN TAB T SPACE RCTRL RETURN RCTRL SPACE PAGED
StartupMenuButtonTimeout=3000
# Menu items to hide from startup menu, available menu items:
-# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMouse.DisplaySizeConfig'
# Menu items to show at startup - this is Java code snippet, leave empty for default
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
# Available menu items:
-# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
FirstStartMenuOptions=''
-# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices,
-# but .apk size is 2x bigger (y) / (n) / (x86) / (all)
-MultiABI='all'
-
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=0
+# GCC version, 4.6 (default) or 4.8, CLANG is not supported yet
+NDK_TOOLCHAIN_VERSION=
+
+# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
+# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
+MultiABI='armeabi-v7a' # armeabi armeabi-v7a x86 mips
+
# Optional shared libraries to compile - removing some of them will save space
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
@@ -242,6 +257,9 @@ AdmobPublisherId=n
# Your AdMob test device ID, to receive a test ad
AdmobTestDeviceId=
-# Your AdMob banner size (BANNER/IAB_BANNER/IAB_LEADERBOARD/IAB_MRECT/IAB_WIDE_SKYSCRAPER/SMART_BANNER)
+# Your AdMob banner size (BANNER/FULL_BANNER/LEADERBOARD/MEDIUM_RECTANGLE/SMART_BANNER/WIDE_SKYSCRAPER/FULL_WIDTH:Height/Width:AUTO_HEIGHT/Width:Height)
AdmobBannerSize=
+# Google Play Game Services application ID, required for cloud saves to work
+GooglePlayGameServicesId=
+
diff --git a/project/jni/application/teeworlds/icon.png b/project/jni/application/teeworlds/icon.png
index 78936fa81..0e8cb8f62 100644
Binary files a/project/jni/application/teeworlds/icon.png and b/project/jni/application/teeworlds/icon.png differ
diff --git a/project/jni/application/teeworlds/src b/project/jni/application/teeworlds/src
index ffebe7324..18e0e9942 160000
--- a/project/jni/application/teeworlds/src
+++ b/project/jni/application/teeworlds/src
@@ -1 +1 @@
-Subproject commit ffebe73245a2ffe85d08a4891adef261dc1e6e7b
+Subproject commit 18e0e9942e73eb1e480d7d32c4eabbabcef8172e
diff --git a/project/jni/application/xrick/AndroidAppSettings.cfg b/project/jni/application/xrick/AndroidAppSettings.cfg
index 4ad9fff8a..0ed7c9755 100644
--- a/project/jni/application/xrick/AndroidAppSettings.cfg
+++ b/project/jni/application/xrick/AndroidAppSettings.cfg
@@ -7,10 +7,10 @@ AppName="XRick"
AppFullName=net.xrick.sdl
# Application version code (integer)
-AppVersionCode=102121208
+AppVersionCode=102121209
# Application user-visible version name (string)
-AppVersionName="021212.08"
+AppVersionName="021212.09"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
diff --git a/project/jni/application/xrick/xrick-021212/Makefile b/project/jni/application/xrick/xrick-021212/Makefile
index d87bc0ee2..9e366ae34 100644
--- a/project/jni/application/xrick/xrick-021212/Makefile
+++ b/project/jni/application/xrick/xrick-021212/Makefile
@@ -71,8 +71,8 @@ endif
all:
@echo "ROOTDIR=$(ROOTDIR)" > Makefile.global
@echo "XOBJ=$(XOBJ)" >> Makefile.global
- @echo "CFLAGS=-g -ansi -pedantic -Wall -W -O2 -I $(ROOTDIR)/include $(shell sdl-config --cflags)" >> Makefile.global
- @echo "LDFLAGS=-lz $(shell sdl-config --libs)" >> Makefile.global
+ @echo "CFLAGS=-g -ansi -pedantic -Wall -W -O0 -I $(ROOTDIR)/include $(shell sdl-config --cflags) -g" >> Makefile.global
+ @echo "LDFLAGS=-lz $(shell sdl-config --libs) -g" >> Makefile.global
@echo "CC=gcc" >> Makefile.global
@echo "CPP=gcc -E" >> Makefile.global
$(MAKE) -C src all
diff --git a/project/jni/application/xrick/xrick-021212/include/config.h b/project/jni/application/xrick/xrick-021212/include/config.h
index 45b17d2ef..22862756a 100644
--- a/project/jni/application/xrick/xrick-021212/include/config.h
+++ b/project/jni/application/xrick/xrick-021212/include/config.h
@@ -22,7 +22,9 @@
#undef GFXPC
/* joystick support */
+#ifdef __ANDROID__
#define ENABLE_JOYSTICK
+#endif
/* sound support */
#define ENABLE_SOUND
diff --git a/project/jni/application/xrick/xrick-021212/src/e_them.c b/project/jni/application/xrick/xrick-021212/src/e_them.c
index 49cb4cfb6..d07129ead 100644
--- a/project/jni/application/xrick/xrick-021212/src/e_them.c
+++ b/project/jni/application/xrick/xrick-021212/src/e_them.c
@@ -568,7 +568,7 @@ e_them_t3_action2(U8 e)
U8 i;
S16 x, y;
- while (1) {
+ /*while (1)*/ {
/* calc new sprite */
i = ent_sprseq[ent_ents[e].sprbase + ent_ents[e].sproffs];
diff --git a/project/jni/application/xrick/xrick-021212/src/sysarg.c b/project/jni/application/xrick/xrick-021212/src/sysarg.c
index 75b01dbe7..feb33b81f 100644
--- a/project/jni/application/xrick/xrick-021212/src/sysarg.c
+++ b/project/jni/application/xrick/xrick-021212/src/sysarg.c
@@ -158,7 +158,7 @@ sysarg_init(int argc, char **argv)
else if (!strcmp(argv[i], "-speed")) {
if (++i == argc) sysarg_fail("missing speed value");
sysarg_args_period = atoi(argv[i]) - 1;
- if (sysarg_args_period < 0 || sysarg_args_period > 99)
+ if (sysarg_args_period < 0 || sysarg_args_period > 250)
sysarg_fail("invalid speed value");
}
diff --git a/project/jni/application/xserver-debian/AndroidAppSettings.cfg b/project/jni/application/xserver-debian/AndroidAppSettings.cfg
index cddd8df50..33f517229 100644
--- a/project/jni/application/xserver-debian/AndroidAppSettings.cfg
+++ b/project/jni/application/xserver-debian/AndroidAppSettings.cfg
@@ -7,10 +7,10 @@ AppName="Debian"
AppFullName=com.cuntubuntu
# Application version code (integer)
-AppVersionCode=141008
+AppVersionCode=141129
# Application user-visible version name (string)
-AppVersionName="14.10.08"
+AppVersionName="14.11.29"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
@@ -18,7 +18,7 @@ AppVersionName="14.10.08"
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
-AppDataDownloadUrl="!!System image|:data.tar.gz:http://sourceforge.net/projects/libsdl-android/files/ubuntu/14.05.01/dist-debug-wheezy-proot-.tar.gz/download^!!XSDL data files|:data-1.tar.gz:data-1.tgz^!!XSDL fonts|:DroidSansMono.ttf:DroidSansMono.ttf^!!Postinstall script|:postinstall.sh:postinstall2.sh^!!Update|:update1.tar.gz:update1.tgz^!!Update|:update2.tar.gz:update2-.tgz^!!Update|:update3.tar.gz:update3.tgz^!!Update|:update4.tar.gz:update4.tgz"
+AppDataDownloadUrl="!!System image|:data.tar.gz:http://sourceforge.net/projects/libsdl-android/files/ubuntu/14.05.01/dist-debug-wheezy-proot-.tar.gz/download^!!XSDL data files|:data-1.tar.gz:data-1.tgz^!!XSDL fonts|:DroidSansMono.ttf:DroidSansMono.ttf^!!Postinstall script|:postinstall.sh:postinstall2.sh^!!Update|:update1.tar.gz:update1.tgz^!!Update|:update2.tar.gz:update2-.tgz^!!Update|:update3.tar.gz:update3.tgz^!!Update|:update4.tar.gz:update4.tgz^!!Update|:update5.tar.gz:update5-.tgz"
# Reset SDL config when updating application to the new version (y) / (n)
ResetSdlConfigForThisVersion=n
diff --git a/project/jni/application/xserver-debian/AndroidData/update2-armeabi-v7a.tgz b/project/jni/application/xserver-debian/AndroidData/update2-armeabi-v7a.tgz
index 52878fc6e..757c5a0f8 100644
Binary files a/project/jni/application/xserver-debian/AndroidData/update2-armeabi-v7a.tgz and b/project/jni/application/xserver-debian/AndroidData/update2-armeabi-v7a.tgz differ
diff --git a/project/jni/application/xserver-debian/AndroidData/update2-x86.tgz b/project/jni/application/xserver-debian/AndroidData/update2-x86.tgz
index 22da303ae..ac3e546b1 100644
Binary files a/project/jni/application/xserver-debian/AndroidData/update2-x86.tgz and b/project/jni/application/xserver-debian/AndroidData/update2-x86.tgz differ
diff --git a/project/jni/application/xserver-debian/AndroidData/update5-armeabi-v7a.tgz b/project/jni/application/xserver-debian/AndroidData/update5-armeabi-v7a.tgz
new file mode 100644
index 000000000..dd4051d2f
Binary files /dev/null and b/project/jni/application/xserver-debian/AndroidData/update5-armeabi-v7a.tgz differ
diff --git a/project/jni/application/xserver-debian/AndroidData/update5-x86.tgz b/project/jni/application/xserver-debian/AndroidData/update5-x86.tgz
new file mode 100644
index 000000000..f019eb233
Binary files /dev/null and b/project/jni/application/xserver-debian/AndroidData/update5-x86.tgz differ
diff --git a/project/jni/application/xserver-debian/readme.txt b/project/jni/application/xserver-debian/readme.txt
index 117d44fc2..7bf52d95d 100644
--- a/project/jni/application/xserver-debian/readme.txt
+++ b/project/jni/application/xserver-debian/readme.txt
@@ -15,7 +15,7 @@ x11proto-video-dev x11proto-xcmisc-dev \
x11proto-xext-dev x11proto-xf86bigfont-dev \
x11proto-xf86dga-dev x11proto-xf86dri-dev \
x11proto-xf86vidmode-dev x11proto-xinerama-dev \
-libxmuu-dev libxt-dev libsm-dev libice-dev \
+libxmuu-dev libxt-dev libsm-dev libice-dev libudev-dev \
libxrender-dev libxrandr-dev curl autoconf automake libtool
You will need both xcb-proto and python-xcbgen packages
diff --git a/project/jni/application/xserver-debian/xserver b/project/jni/application/xserver-debian/xserver
index 38269b698..58c205cd1 160000
--- a/project/jni/application/xserver-debian/xserver
+++ b/project/jni/application/xserver-debian/xserver
@@ -1 +1 @@
-Subproject commit 38269b6980bccef6340f9c9f04e6e3ec059d07b0
+Subproject commit 58c205cd11d9b14ee48fb613bff7a3cd71519dc5
diff --git a/project/jni/application/xserver-gimp/AndroidAppSettings.cfg b/project/jni/application/xserver-gimp/AndroidAppSettings.cfg
index fa2b3d7ac..190e44519 100644
--- a/project/jni/application/xserver-gimp/AndroidAppSettings.cfg
+++ b/project/jni/application/xserver-gimp/AndroidAppSettings.cfg
@@ -7,18 +7,18 @@ AppName="GIMP Inkscape"
AppFullName=org.gimp.inkscape
# Application version code (integer)
-AppVersionCode=28215
+AppVersionCode=28218
# Application user-visible version name (string)
-AppVersionName="2.8.2.15"
+AppVersionName="2.8.2.18"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
-# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
-AppDataDownloadUrl="!!Data files|:data.tar.gz:http://sourceforge.net/projects/libsdl-android/files/ubuntu/14.05.01/dist-gimp-wheezy-.tar.gz/download^!!XSDL data files|:data-1.tar.gz:data-1.tgz^!!XSDL fonts|:DroidSansMono.ttf:DroidSansMono.ttf^!!Postinstall script|:postinstall.sh:postinstall2.sh^!!Update|:update1.tar.gz:update1.tgz"
+# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
+AppDataDownloadUrl="!!Data files|:data.tar.gz:http://sourceforge.net/projects/libsdl-android/files/ubuntu/14.05.01/dist-gimp-wheezy-.tar.gz/download^!!XSDL data files|:data-1.tar.gz:data-1.tgz^!!XSDL fonts|:DroidSansMono.ttf:DroidSansMono.ttf^!!Postinstall script|:postinstall.sh:postinstall2.sh^!!Update|:update1.tar.gz:update1.tgz^!!Update|:update2.tar.gz:update2-.tgz^!!Update|:update3.tar.gz:update3-.tgz^!!Update|:update4.tar.gz:update4.tgz"
# Reset SDL config when updating application to the new version (y) / (n)
ResetSdlConfigForThisVersion=y
@@ -36,12 +36,6 @@ LibSdlVersion=1.2
# Specify screen orientation: (v)ertical/(p)ortrait or (h)orizontal/(l)andscape
ScreenOrientation=h
-# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
-InhibitSuspend=n
-
-# Create Android service, so the app is less likely to be killed while in background
-CreateService=n
-
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
VideoDepthBpp=16
@@ -66,9 +60,19 @@ SdlVideoResize=y
# Application resizing will keep 4:3 aspect ratio, with black bars at sides (y)/(n)
SdlVideoResizeKeepAspect=n
+# Do not allow device to sleep when the application is in foreground, set this for video players or apps which use accelerometer
+InhibitSuspend=y
+
+# Create Android service, so the app is less likely to be killed while in background
+CreateService=y
+
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
-CompatibilityHacks=n
+CompatibilityHacksForceScreenUpdate=n
+
+# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
+# force screen update by moving mouse cursor a little after each click (y) or (n)
+CompatibilityHacksForceScreenUpdateMouseClick=y
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
CompatibilityHacksStaticInit=n
@@ -102,6 +106,10 @@ AppUsesMouse=y
# Application needs two-button mouse, will also enable advanced point-and-click features (y) or (n)
AppNeedsTwoButtonMouse=y
+# Right mouse button can do long-press/drag&drop action, necessary for some games (y) or (n)
+# If you disable it, swiping with two fingers will send mouse wheel events
+RightMouseButtonLongPress=n
+
# Show SDL mouse cursor, for applications that do not draw cursor at all (y) or (n)
ShowMouseCursor=n
@@ -111,18 +119,26 @@ GenerateSubframeTouchEvents=y
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
ForceRelativeMouseMode=y
-# Application needs arrow keys (y) or (n), will show on-screen dpad/joystick (y) or (n)
+# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
AppNeedsArrowKeys=n
+# On-screen dpad/joystick will appear under finger when it touches the screen (y) or (n)
+# Joystick always follows finger, so moving mouse requires touching the screen with other finger
+FloatingScreenJoystick=
+
# Application needs text input (y) or (n), enables button for text input on screen
AppNeedsTextInput=n
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
+# This will disable AppNeedsArrowKeys option
AppUsesJoystick=n
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
AppUsesSecondJoystick=n
+# Application uses third on-screen joystick, as SDL joystick 0 axes 20-21 (y)/(n)
+AppUsesThirdJoystick=
+
# Application uses accelerometer (y) or (n), the accelerometer will be used as joystick 1 axes 0-1 and 5-7
AppUsesAccelerometer=n
@@ -186,22 +202,25 @@ RedefinedKeysGamepad="LCTRL LALT LSHIFT RETURN SPACE DELETE KP_PLUS KP_MINUS 1 2
StartupMenuButtonTimeout=3000
# Menu items to hide from startup menu, available menu items:
-# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
HiddenMenuOptions='SettingsMenuMisc.OptionalDownloadConfig'
# Menu items to show at startup - this is Java code snippet, leave empty for default
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
# Available menu items:
-# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
FirstStartMenuOptions=''
-# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices,
-# but .apk size is 2x bigger (y) / (n) / (x86) / (all)
-MultiABI='armeabi-v7a x86'
-
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=0
+# GCC version, 4.6 (default) or 4.8, CLANG is not supported yet
+NDK_TOOLCHAIN_VERSION=
+
+# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
+# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
+MultiABI='armeabi-v7a x86'
+
# Optional shared libraries to compile - removing some of them will save space
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
@@ -226,7 +245,7 @@ AppSubdirsBuild=''
AppBuildExclude=''
# Application command line parameters, including app name as 0-th param
-AppCmdline='XSDL -nohelp -screenbuttons -exec $SECURE_STORAGE_DIR/img/proot.sh ./start-gimp.sh'
+AppCmdline='XSDL -nohelp -screenbuttons -exec $SECURE_STORAGE_DIR/usr/bin/xli -onroot -border black -center $SECURE_STORAGE_DIR/loading.gif ; $SECURE_STORAGE_DIR/img/proot.sh ./startx.sh'
# Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens
# Minimum screen size that application supports: (s)mall / (m)edium / (l)arge
@@ -238,9 +257,9 @@ AdmobPublisherId=n
# Your AdMob test device ID, to receive a test ad
AdmobTestDeviceId=
-# Your AdMob banner size (BANNER/IAB_BANNER/IAB_LEADERBOARD/IAB_MRECT/IAB_WIDE_SKYSCRAPER/SMART_BANNER)
+# Your AdMob banner size (BANNER/FULL_BANNER/LEADERBOARD/MEDIUM_RECTANGLE/SMART_BANNER/WIDE_SKYSCRAPER/FULL_WIDTH:Height/Width:AUTO_HEIGHT/Width:Height)
AdmobBannerSize=
-# Right mouse button can do long-press/drag&drop action, necessary for some games (y) or (n)
-# If you disable it, swiping with two fingers will send mouse wheel events
-RightMouseButtonLongPress=n
+# Google Play Game Services application ID, required for cloud saves to work
+GooglePlayGameServicesId=
+
diff --git a/project/jni/application/xserver-gimp/AndroidData/data-1.tgz b/project/jni/application/xserver-gimp/AndroidData/data-1.tgz
new file mode 120000
index 000000000..2a2d243ac
--- /dev/null
+++ b/project/jni/application/xserver-gimp/AndroidData/data-1.tgz
@@ -0,0 +1 @@
+../xserver/data/data-1.tgz
\ No newline at end of file
diff --git a/project/jni/application/xserver-gimp/AndroidData/postinstall2.sh b/project/jni/application/xserver-gimp/AndroidData/postinstall2.sh
new file mode 120000
index 000000000..ac797f4fb
--- /dev/null
+++ b/project/jni/application/xserver-gimp/AndroidData/postinstall2.sh
@@ -0,0 +1 @@
+../../xserver-debian/AndroidData/postinstall2.sh
\ No newline at end of file
diff --git a/project/jni/application/xserver-gimp/AndroidData/update2-armeabi-v7a.tgz b/project/jni/application/xserver-gimp/AndroidData/update2-armeabi-v7a.tgz
new file mode 120000
index 000000000..30f3f962d
--- /dev/null
+++ b/project/jni/application/xserver-gimp/AndroidData/update2-armeabi-v7a.tgz
@@ -0,0 +1 @@
+../../xserver-debian/AndroidData/update2-armeabi-v7a.tgz
\ No newline at end of file
diff --git a/project/jni/application/xserver-gimp/AndroidData/update2-x86.tgz b/project/jni/application/xserver-gimp/AndroidData/update2-x86.tgz
new file mode 120000
index 000000000..ce0925985
--- /dev/null
+++ b/project/jni/application/xserver-gimp/AndroidData/update2-x86.tgz
@@ -0,0 +1 @@
+../../xserver-debian/AndroidData/update2-x86.tgz
\ No newline at end of file
diff --git a/project/jni/application/xserver-gimp/AndroidData/update3-armeabi-v7a.tgz b/project/jni/application/xserver-gimp/AndroidData/update3-armeabi-v7a.tgz
new file mode 120000
index 000000000..c719507c9
--- /dev/null
+++ b/project/jni/application/xserver-gimp/AndroidData/update3-armeabi-v7a.tgz
@@ -0,0 +1 @@
+../../xserver-debian/AndroidData/update5-armeabi-v7a.tgz
\ No newline at end of file
diff --git a/project/jni/application/xserver-gimp/AndroidData/update3-x86.tgz b/project/jni/application/xserver-gimp/AndroidData/update3-x86.tgz
new file mode 120000
index 000000000..101d0f2e2
--- /dev/null
+++ b/project/jni/application/xserver-gimp/AndroidData/update3-x86.tgz
@@ -0,0 +1 @@
+../../xserver-debian/AndroidData/update5-x86.tgz
\ No newline at end of file
diff --git a/project/jni/application/xserver-gimp/AndroidData/update4.tgz b/project/jni/application/xserver-gimp/AndroidData/update4.tgz
new file mode 100644
index 000000000..83fc35f69
Binary files /dev/null and b/project/jni/application/xserver-gimp/AndroidData/update4.tgz differ
diff --git a/project/jni/application/xserver-gimp/xserver b/project/jni/application/xserver-gimp/xserver
index 3cce1acc1..58c205cd1 160000
--- a/project/jni/application/xserver-gimp/xserver
+++ b/project/jni/application/xserver-gimp/xserver
@@ -1 +1 @@
-Subproject commit 3cce1acc1f943ded8491e1be814aebfce6e09023
+Subproject commit 58c205cd11d9b14ee48fb613bff7a3cd71519dc5
diff --git a/project/jni/application/xserver/AndroidAppSettings.cfg b/project/jni/application/xserver/AndroidAppSettings.cfg
index 7315a3190..e32503e11 100644
--- a/project/jni/application/xserver/AndroidAppSettings.cfg
+++ b/project/jni/application/xserver/AndroidAppSettings.cfg
@@ -7,17 +7,17 @@ AppName="XServer XSDL"
AppFullName=x.org.server
# Application version code (integer)
-AppVersionCode=11116
+AppVersionCode=11118
# Application user-visible version name (string)
-AppVersionName="1.11.16"
+AppVersionName="1.11.18"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
# If the URL in in the form ':dir/file.dat:http://URL/' it will be downloaded as binary BLOB to the application dir and not unzipped
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
-# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
+# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version, first associated with the file
AppDataDownloadUrl="!!Data files|:data.tar.gz:data-1.tgz^!!Data files|:DroidSansMono.ttf:DroidSansMono.ttf^Additional fonts (90Mb)|:xfonts.tar.gz:http://sourceforge.net/projects/libsdl-android/files/apk/XServer-XSDL/xfonts.tgz/download"
# Reset SDL config when updating application to the new version (y) / (n)
@@ -68,7 +68,11 @@ CreateService=y
# Application does not call SDL_Flip() or SDL_UpdateRects() appropriately, or draws from non-main thread -
# enabling the compatibility mode will force screen update every 100 milliseconds, which is laggy and inefficient (y) or (n)
-CompatibilityHacks=n
+CompatibilityHacksForceScreenUpdate=n
+
+# Application does not call SDL_Flip() or SDL_UpdateRects() after mouse click (ScummVM and all Amiga emulators do that) -
+# force screen update by moving mouse cursor a little after each click (y) or (n)
+CompatibilityHacksForceScreenUpdateMouseClick=y
# Application initializes SDL audio/video inside static constructors (which is bad, you won't be able to run ndk-gdb) (y)/(n)
CompatibilityHacksStaticInit=n
@@ -115,18 +119,26 @@ GenerateSubframeTouchEvents=n
# Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n)
ForceRelativeMouseMode=y
-# Application needs arrow keys (y) or (n), will show on-screen dpad/joystick (y) or (n)
+# Show on-screen dpad/joystick, that will act as arrow keys (y) or (n)
AppNeedsArrowKeys=n
+# On-screen dpad/joystick will appear under finger when it touches the screen (y) or (n)
+# Joystick always follows finger, so moving mouse requires touching the screen with other finger
+FloatingScreenJoystick=
+
# Application needs text input (y) or (n), enables button for text input on screen
AppNeedsTextInput=n
# Application uses joystick (y) or (n), the on-screen DPAD will be used as joystick 0 axes 0-1
+# This will disable AppNeedsArrowKeys option
AppUsesJoystick=n
# Application uses second on-screen joystick, as SDL joystick 0 axes 2-3 (y)/(n)
AppUsesSecondJoystick=n
+# Application uses third on-screen joystick, as SDL joystick 0 axes 20-21 (y)/(n)
+AppUsesThirdJoystick=
+
# Application uses accelerometer (y) or (n), the accelerometer will be used as joystick 1 axes 0-1 and 5-7
AppUsesAccelerometer=n
@@ -169,9 +181,6 @@ RedefinedKeys="LALT UNDO NO_REMAP NO_REMAP UNDO HELP"
# Number of virtual keyboard keys (currently 6 is maximum)
AppTouchscreenKeyboardKeysAmount=0
-# Number of virtual keyboard keys that support autofire (currently 2 is maximum)
-AppTouchscreenKeyboardKeysAmountAutoFire=0
-
# Redefine on-screen keyboard keys to SDL keysyms - 6 keyboard keys + 4 multitouch gestures (zoom in/out and rotate left/right)
RedefinedKeysScreenKb="LALT RETURN KP_PLUS KP_MINUS SPACE DELETE KP_PLUS KP_MINUS UNDO HELP"
@@ -193,22 +202,25 @@ RedefinedKeysGamepad="LALT RETURN KP_PLUS KP_MINUS SPACE DELETE KP_PLUS KP_MINUS
StartupMenuButtonTimeout=3000
# Menu items to hide from startup menu, available menu items:
-# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
HiddenMenuOptions=''
# Menu items to show at startup - this is Java code snippet, leave empty for default
# new SettingsMenuMisc.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new SettingsMenuMouse.DisplaySizeConfig(true) : new SettingsMenu.DummyMenu()), new SettingsMenuMisc.OptionalDownloadConfig(true), new SettingsMenuMisc.GyroscopeCalibration()
# Available menu items:
-# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout
+# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
FirstStartMenuOptions='SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.OptionalDownloadConfig'
-# Enable multi-ABI binary, with hardware FPU support - it will also work on old devices,
-# but .apk size is 2x bigger (y) / (n) / (x86) / (all)
-MultiABI=all
-
# Minimum amount of RAM application requires, in Mb, SDL will print warning to user if it's lower
AppMinimumRAM=0
+# GCC version, 4.6 (default) or 4.8, CLANG is not supported yet
+NDK_TOOLCHAIN_VERSION=
+
+# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
+# Available architectures: armeabi armeabi-v7a armeabi-v7a-hard x86 mips
+MultiABI='armeabi-v7a x86 mips'
+
# Optional shared libraries to compile - removing some of them will save space
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx sdl_sound intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces curl theora fluidsynth lzma lzo2 mikmod openal timidity zzip bzip2 yaml-cpp python boost_date_time boost_filesystem boost_iostreams boost_program_options boost_regex boost_signals boost_system boost_thread glu avcodec avdevice avfilter avformat avresample avutil swscale swresample bzip2
@@ -245,6 +257,9 @@ AdmobPublisherId=n
# Your AdMob test device ID, to receive a test ad
AdmobTestDeviceId=
-# Your AdMob banner size (BANNER/IAB_BANNER/IAB_LEADERBOARD/IAB_MRECT/IAB_WIDE_SKYSCRAPER/SMART_BANNER)
+# Your AdMob banner size (BANNER/FULL_BANNER/LEADERBOARD/MEDIUM_RECTANGLE/SMART_BANNER/WIDE_SKYSCRAPER/FULL_WIDTH:Height/Width:AUTO_HEIGHT/Width:Height)
AdmobBannerSize=
+# Google Play Game Services application ID, required for cloud saves to work
+GooglePlayGameServicesId=
+
diff --git a/project/jni/application/xserver/gfx.c b/project/jni/application/xserver/gfx.c
index 89f5eed7f..98160d621 100644
--- a/project/jni/application/xserver/gfx.c
+++ b/project/jni/application/xserver/gfx.c
@@ -12,6 +12,7 @@
#include
#include
#include
+#include
#include
#include "gfx.h"
@@ -298,7 +299,10 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
int x = 0, y = 0, i, ii;
SDL_Event event;
int res = -1, dpi = -1;
+ int customX = 1000, customY = 1000;
+ enum { MODE_CUSTOM = 11 };
char native[32] = "0x0", native56[32], native46[32], native36[32], native26[32];
+ char custom[32] = "1000x1000";
int vertical = SDL_ListModes(NULL, 0)[0]->w < SDL_ListModes(NULL, 0)[0]->h;
char cfgpath[PATH_MAX];
FILE * cfgfile;
@@ -317,7 +321,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
{
native, native56, native46, native36,
native26, "1280x1024", "1280x960", "1280x720",
- "1024x768", "800x600", "800x480", "640x480"
+ "1024x768", "800x600", "800x480", custom
};
const int resVal[][2] = {
{*resolutionW, *resolutionH},
@@ -326,7 +330,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
{(*resolutionW * 3 / 6) & ~0x3, (*resolutionH * 3 / 6) & ~0x3},
{(*resolutionW * 2 / 6) & ~0x3, (*resolutionH * 2 / 6) & ~0x3},
{1280,1024}, {1280,960}, {1280,720},
- {1024,768}, {800,600}, {800,480}, {640,480}
+ {1024,768}, {800,600}, {800,480}, {customX,customY}
};
const char * fontsStr[] = {
@@ -355,9 +359,10 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
cfgfile = fopen(cfgpath, "r");
if( cfgfile )
{
- fscanf(cfgfile, "%d %d", &savedRes, &savedDpi);
+ fscanf(cfgfile, "%d %d %d %d", &savedRes, &savedDpi, &customX, &customY);
fclose(cfgfile);
}
+ sprintf(custom, "%dx%d", customX, customY);
int counter = 3000, config = 0;
Uint32 curtime = SDL_GetTicks();
@@ -424,7 +429,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
x = y;
y = z;
}
- i = (y / (VID_Y/2));
+ i = (y / (VID_Y/3));
ii = (x / (VID_X/4));
res = i * 4 + ii;
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Screen coords %d %d res %d\n", x, y, res);
@@ -448,15 +453,71 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
else
renderString(resStr[i*4+ii], VID_X/8 + (ii*VID_X/4), VID_Y/6 + (i*VID_Y/3));
if( i == 0 && ii == 0 && !vertical )
- renderString("native", VID_X/8, VID_Y/6 + VID_Y/12);
+ renderString("native", VID_X/8, VID_Y/6 - VID_Y/12);
+ if( i == 2 && ii == 3 && !vertical )
+ renderString("custom", VID_X/8 + (ii*VID_X/4), VID_Y/6 - VID_Y/12 + (i*VID_Y/3));
}
//SDL_GetMouseState(&x, &y);
//renderString("X", x, y);
SDL_Delay(100);
SDL_Flip(SDL_GetVideoSurface());
+ if (res == MODE_CUSTOM)
+ {
+ __android_log_print(ANDROID_LOG_INFO, "XSDL", "Selected custom display resolution");
+ SDL_ANDROID_ToggleScreenKeyboardWithoutTextInput();
+ customX = 0;
+ customY = 0;
+ custom[0] = 0;
+ while (customX == 0 || customY == 0)
+ {
+ while (SDL_PollEvent(&event))
+ {
+ if (event.type == SDL_KEYDOWN)
+ {
+ switch (event.key.keysym.sym)
+ {
+ case SDLK_HELP:
+ return;
+ case SDLK_RETURN:
+ if (customX == 0)
+ customX = atoi(custom);
+ else
+ customY = atoi(custom);
+ custom[0] = 0;
+ break;
+ case SDLK_BACKSPACE:
+ if (strlen(custom) > 0)
+ custom[strlen(custom) - 1] = 0;
+ break;
+ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
+ custom[strlen(custom) + 1] = 0;
+ custom[strlen(custom)] = event.key.keysym.sym;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ SDL_FillRect(SDL_GetVideoSurface(), NULL, 0);
+ if (customX == 0)
+ renderString("Enter width:", VID_X/8, VID_Y/6);
+ else
+ renderString("Enter height:", VID_X/8, VID_Y/6);
+ renderString("Press Enter when done", VID_X*3/4, VID_Y/6);
+ renderString(custom, VID_X/8 + VID_X/4, VID_Y/6);
+ SDL_Delay(100);
+ SDL_Flip(SDL_GetVideoSurface());
+ }
+ __android_log_print(ANDROID_LOG_INFO, "XSDL", "Selected custom display resolution: %s = %d %d", custom, customX, customY);
+ }
}
*resolutionW = resVal[res][0];
*resolutionH = resVal[res][1];
+ if (res == MODE_CUSTOM)
+ {
+ *resolutionW = customX;
+ *resolutionH = customY;
+ }
while ( dpi < 0 )
{
while (SDL_PollEvent(&event))
@@ -514,7 +575,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
cfgfile = fopen(cfgpath, "w");
if( cfgfile )
{
- fprintf(cfgfile, "%d %d\n", res, dpi);
+ fprintf(cfgfile, "%d %d %d %d\n", res, dpi, customX, customY);
fclose(cfgfile);
}
}
@@ -598,10 +659,10 @@ void XSDL_generateBackground(const char * port, int showHelp, int resolutionW, i
void XSDL_showServerLaunchErrorMessage()
{
- showErrorMessage( "Error: X server failed to launch,\n"
- "because of stale Unix socket with non-existing path.\n\n"
- "Power off your device and power it on,\n"
- "and everything will work again.");
+ showErrorMessage( "Error: X server failed to launch.\n\n"
+ "This may happen because of SELinux,\n"
+ "or because installation was corrupted.\n"
+ "Either way, this app will not work, which is sad.");
}
void showErrorMessage(const char *msg)
diff --git a/project/jni/application/xserver/xserver b/project/jni/application/xserver/xserver
index 3cce1acc1..58c205cd1 160000
--- a/project/jni/application/xserver/xserver
+++ b/project/jni/application/xserver/xserver
@@ -1 +1 @@
-Subproject commit 3cce1acc1f943ded8491e1be814aebfce6e09023
+Subproject commit 58c205cd11d9b14ee48fb613bff7a3cd71519dc5
diff --git a/project/jni/flac/config.h b/project/jni/flac/config.h
index 153558c0d..8ebfd0f62 100644
--- a/project/jni/flac/config.h
+++ b/project/jni/flac/config.h
@@ -113,7 +113,11 @@
#define PACKAGE_VERSION ""
/* The size of a `void*', as computed by sizeof. */
+#ifdef __LP64__
+#define SIZEOF_VOIDP 8
+#else
#define SIZEOF_VOIDP 4
+#endif
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
diff --git a/project/jni/guichan/src/contrib/sdl/sdltruetypefont.cpp b/project/jni/guichan/src/contrib/sdl/sdltruetypefont.cpp
index 675628302..150a192f8 100644
--- a/project/jni/guichan/src/contrib/sdl/sdltruetypefont.cpp
+++ b/project/jni/guichan/src/contrib/sdl/sdltruetypefont.cpp
@@ -121,11 +121,11 @@ namespace gcn
SDL_Surface *textSurface;
if (mAntiAlias)
{
- textSurface = TTF_RenderText_Blended(mFont, text.c_str(), sdlCol);
+ textSurface = TTF_RenderUTF8_Blended(mFont, text.c_str(), sdlCol);
}
else
{
- textSurface = TTF_RenderText_Solid(mFont, text.c_str(), sdlCol);
+ textSurface = TTF_RenderUTF8_Solid(mFont, text.c_str(), sdlCol);
}
SDL_Rect dst, src;
diff --git a/project/jni/guichan/src/widgets/textfield.cpp b/project/jni/guichan/src/widgets/textfield.cpp
index e8fc9c5d6..ab61d1942 100644
--- a/project/jni/guichan/src/widgets/textfield.cpp
+++ b/project/jni/guichan/src/widgets/textfield.cpp
@@ -52,6 +52,10 @@
#include "guichan/key.hpp"
#include "guichan/mouseinput.hpp"
+#ifdef ANDROID
+#include
+#endif
+
namespace gcn
{
TextField::TextField()
@@ -147,6 +151,9 @@ namespace gcn
void TextField::mousePressed(MouseEvent& mouseEvent)
{
+#ifdef ANDROID
+ SDL_ANDROID_ToggleScreenKeyboardTextInput(getText().c_str());
+#endif
if (mouseEvent.getButton() == MouseEvent::LEFT)
{
mCaretPosition = getFont()->getStringIndexAt(mText, mouseEvent.getX() + mXScroll);
diff --git a/project/jni/iconv/Android.mk b/project/jni/iconv/Android.mk
index a92c1a60a..79b303f20 100644
--- a/project/jni/iconv/Android.mk
+++ b/project/jni/iconv/Android.mk
@@ -2,7 +2,10 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-ifeq ($(filter armeabi-v7a-hard, $(APP_ABI)),) # Pre-compiled lib disabled for armhf ABI
+ifneq ($(TARGET_ARCH_ABI),armeabi-v7a-hard) # Pre-compiled lib disabled for armhf ABI
+ifneq ($(TARGET_ARCH_ABI),arm64-v8a) # Not supported yet
+ifneq ($(TARGET_ARCH_ABI),x86_64) # Not supported yet
+ifneq ($(TARGET_ARCH_ABI),mips64) # Not supported yet
LOCAL_MODULE := $(notdir $(LOCAL_PATH))
@@ -13,3 +16,6 @@ LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).so
include $(PREBUILT_SHARED_LIBRARY)
endif
+endif
+endif
+endif
diff --git a/project/jni/icuuc/Android.mk b/project/jni/icuuc/Android.mk
index 00ca61864..04ad93599 100644
--- a/project/jni/icuuc/Android.mk
+++ b/project/jni/icuuc/Android.mk
@@ -2,7 +2,10 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-ifeq ($(filter armeabi-v7a-hard, $(APP_ABI)),) # Pre-compiled lib disabled for armhf ABI
+ifneq ($(TARGET_ARCH_ABI),armeabi-v7a-hard) # Pre-compiled lib disabled for armhf ABI
+ifneq ($(TARGET_ARCH_ABI),arm64-v8a) # Not supported yet
+ifneq ($(TARGET_ARCH_ABI),x86_64) # Not supported yet
+ifneq ($(TARGET_ARCH_ABI),mips64) # Not supported yet
LOCAL_MODULE := $(notdir $(LOCAL_PATH))
@@ -17,3 +20,6 @@ obj/local/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).a: $(LOCAL_PATH)/$(LOCAL_SRC_FIL
include $(PREBUILT_STATIC_LIBRARY)
endif
+endif
+endif
+endif
diff --git a/project/jni/jpeg/Android.mk b/project/jni/jpeg/Android.mk
index 809bd517b..d8f29e80f 100644
--- a/project/jni/jpeg/Android.mk
+++ b/project/jni/jpeg/Android.mk
@@ -30,7 +30,7 @@ LOCAL_SRC_FILES += jidctint.c jidctfst.S
endif
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
-LOCAL_CFLAGS += -DAVOID_TABLES -DANDROID_RGB
+LOCAL_CFLAGS += -DAVOID_TABLES
LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays
LOCAL_MODULE:= jpeg
diff --git a/project/jni/lzma/Android.mk b/project/jni/lzma/Android.mk
index 24ea1ff15..266a787ea 100644
--- a/project/jni/lzma/Android.mk
+++ b/project/jni/lzma/Android.mk
@@ -7,8 +7,7 @@ LOCAL_MODULE := lzma
APP_SUBDIRS := $(patsubst $(LOCAL_PATH)/%, %, $(shell find $(LOCAL_PATH)/src -type d))
LOCAL_C_INCLUDES := $(foreach D, $(APP_SUBDIRS), $(LOCAL_PATH)/$(D)) $(LOCAL_PATH)/include
-LOCAL_CFLAGS := -O3 -DHAVE_CONFIG_H -DTUKLIB_SYMBOL_PREFIX=lzma_ -std=c99 # Enable "restrict" keyword
-
+LOCAL_CFLAGS := -O3 -DHAVE_CONFIG_H -DTUKLIB_SYMBOL_PREFIX=lzma_ -std=c99 -DSDL_JAVA_PACKAGE_PATH=$(SDL_JAVA_PACKAGE_PATH)
LOCAL_CPP_EXTENSION := .cpp
diff --git a/project/jni/lzma/config.h b/project/jni/lzma/config.h
index 7147107a9..59a8b95b4 100644
--- a/project/jni/lzma/config.h
+++ b/project/jni/lzma/config.h
@@ -5,7 +5,7 @@
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* How many MiB of RAM to assume if the real amount cannot be determined. */
-#define ASSUME_RAM 16
+#define ASSUME_RAM 64
/* Define to 1 if translation of program messages to the user's native
language is requested. */
@@ -255,7 +255,7 @@
#define PACKAGE_NAME "XZ Utils"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "XZ Utils 5.0.0"
+#define PACKAGE_STRING "XZ Utils 5.0.7"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "xz"
@@ -264,14 +264,18 @@
#define PACKAGE_URL "http://tukaani.org/xz/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.0.0"
+#define PACKAGE_VERSION "5.0.7"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */
/* The size of `size_t', as computed by sizeof. */
+#ifdef __LP64__
+#define SIZEOF_SIZE_T 8
+#else
#define SIZEOF_SIZE_T 4
+#endif
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
diff --git a/project/jni/lzma/include/lzma/block.h b/project/jni/lzma/include/lzma/block.h
index 3019bf916..e6710a7bc 100644
--- a/project/jni/lzma/include/lzma/block.h
+++ b/project/jni/lzma/include/lzma/block.h
@@ -318,6 +318,9 @@ extern LZMA_API(lzma_ret) lzma_block_header_encode(
* The size of the Block Header must have already been decoded with
* lzma_block_header_size_decode() macro and stored to block->header_size.
*
+ * The integrity check type from Stream Header must have been stored
+ * to block->check.
+ *
* block->filters must have been allocated, but they don't need to be
* initialized (possible existing filter options are not freed).
*
@@ -483,6 +486,7 @@ extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_size)
*
* \return - LZMA_OK: Encoding was successful.
* - LZMA_BUF_ERROR: Not enough output buffer space.
+ * - LZMA_UNSUPPORTED_CHECK
* - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR
* - LZMA_DATA_ERROR
diff --git a/project/jni/lzma/include/lzma/container.h b/project/jni/lzma/include/lzma/container.h
index 83e70b44f..7a9ffc645 100644
--- a/project/jni/lzma/include/lzma/container.h
+++ b/project/jni/lzma/include/lzma/container.h
@@ -66,6 +66,10 @@
* This function is a wrapper for lzma_raw_encoder_memusage().
*
* \param preset Compression preset (level and possible flags)
+ *
+ * \return Number of bytes of memory required for the given
+ * preset when encoding. If an error occurs, for example
+ * due to unsupported preset, UINT64_MAX is returned.
*/
extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t preset)
lzma_nothrow lzma_attr_pure;
@@ -77,6 +81,11 @@ extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t preset)
* This function is a wrapper for lzma_raw_decoder_memusage().
*
* \param preset Compression preset (level and possible flags)
+ *
+ * \return Number of bytes of memory required to decompress a file
+ * that was compressed using the given preset. If an error
+ * occurs, for example due to unsupported preset, UINT64_MAX
+ * is returned.
*/
extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset)
lzma_nothrow lzma_attr_pure;
@@ -148,6 +157,7 @@ extern LZMA_API(lzma_ret) lzma_easy_encoder(
*
* \return - LZMA_OK: Encoding was successful.
* - LZMA_BUF_ERROR: Not enough output buffer space.
+ * - LZMA_UNSUPPORTED_CHECK
* - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR
* - LZMA_DATA_ERROR
@@ -171,6 +181,7 @@ extern LZMA_API(lzma_ret) lzma_easy_buffer_encode(
*
* \return - LZMA_OK: Initialization was successful.
* - LZMA_MEM_ERROR
+ * - LZMA_UNSUPPORTED_CHECK
* - LZMA_OPTIONS_ERROR
* - LZMA_PROG_ERROR
*/
@@ -250,6 +261,7 @@ extern LZMA_API(size_t) lzma_stream_buffer_bound(size_t uncompressed_size)
*
* \return - LZMA_OK: Encoding was successful.
* - LZMA_BUF_ERROR: Not enough output buffer space.
+ * - LZMA_UNSUPPORTED_CHECK
* - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR
* - LZMA_DATA_ERROR
diff --git a/project/jni/lzma/include/lzma/filter.h b/project/jni/lzma/include/lzma/filter.h
index efd036f7f..e0bc163ad 100644
--- a/project/jni/lzma/include/lzma/filter.h
+++ b/project/jni/lzma/include/lzma/filter.h
@@ -131,7 +131,9 @@ extern LZMA_API(lzma_ret) lzma_filters_copy(const lzma_filter *src,
* .id == LZMA_VLI_UNKNOWN.
*
* \return Number of bytes of memory required for the given
- * filter chain when encoding.
+ * filter chain when encoding. If an error occurs,
+ * for example due to unsupported filter chain,
+ * UINT64_MAX is returned.
*/
extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters)
lzma_nothrow lzma_attr_pure;
@@ -148,7 +150,9 @@ extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters)
* .id == LZMA_VLI_UNKNOWN.
*
* \return Number of bytes of memory required for the given
- * filter chain when decoding.
+ * filter chain when decoding. If an error occurs,
+ * for example due to unsupported filter chain,
+ * UINT64_MAX is returned.
*/
extern LZMA_API(uint64_t) lzma_raw_decoder_memusage(const lzma_filter *filters)
lzma_nothrow lzma_attr_pure;
diff --git a/project/jni/lzma/include/lzma/lzma.h b/project/jni/lzma/include/lzma/lzma.h
index 8d5fdb6e5..3f8e095f7 100644
--- a/project/jni/lzma/include/lzma/lzma.h
+++ b/project/jni/lzma/include/lzma/lzma.h
@@ -412,6 +412,9 @@ typedef struct {
*
* This function is available only if LZMA1 or LZMA2 encoder has been enabled
* when building liblzma.
+ *
+ * \return On success, false is returned. If the preset is not
+ * supported, true is returned.
*/
extern LZMA_API(lzma_bool) lzma_lzma_preset(
lzma_options_lzma *options, uint32_t preset) lzma_nothrow;
diff --git a/project/jni/lzma/include/lzma/version.h b/project/jni/lzma/include/lzma/version.h
index 25e8a8201..beec18e20 100644
--- a/project/jni/lzma/include/lzma/version.h
+++ b/project/jni/lzma/include/lzma/version.h
@@ -22,7 +22,7 @@
*/
#define LZMA_VERSION_MAJOR 5
#define LZMA_VERSION_MINOR 0
-#define LZMA_VERSION_PATCH 0
+#define LZMA_VERSION_PATCH 7
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
#ifndef LZMA_VERSION_COMMIT
diff --git a/project/jni/lzma/src/XZInputStream.c b/project/jni/lzma/src/XZInputStream.c
new file mode 100644
index 000000000..dd36011e6
--- /dev/null
+++ b/project/jni/lzma/src/XZInputStream.c
@@ -0,0 +1,65 @@
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include "lzma.h"
+
+#include "jniwrapperstuff.h"
+
+JNIEXPORT jlong JNICALL
+JAVA_EXPORT_NAME(XZInputStream_nativeInit) (JNIEnv* env, jobject thiz)
+{
+ lzma_stream * stream = (lzma_stream *) malloc(sizeof(lzma_stream));
+ lzma_stream tmp = LZMA_STREAM_INIT;
+ *stream = tmp;
+ int ret = lzma_stream_decoder(stream, UINT64_MAX, LZMA_CONCATENATED);
+ if (ret != LZMA_OK)
+ {
+ free(stream);
+ return 0;
+ }
+ return (jlong) (intptr_t) stream;
+}
+
+JNIEXPORT void JNICALL
+JAVA_EXPORT_NAME(XZInputStream_nativeClose) (JNIEnv* env, jobject thiz, jlong nativeData)
+{
+ lzma_stream * stream = (lzma_stream *) (intptr_t) nativeData;
+ lzma_end(stream);
+}
+
+JNIEXPORT jint JNICALL
+JAVA_EXPORT_NAME(XZInputStream_nativeRead) (JNIEnv* env, jobject thiz, jlong nativeData,
+ jobject inBuf, jint inAvailable, jobject outBuf,
+ jint outCount, jobject offsets)
+{
+ lzma_stream * stream = (lzma_stream *) (intptr_t) nativeData;
+ uint8_t *inBufNative = (uint8_t *) (*env)->GetPrimitiveArrayCritical(env, inBuf, NULL);
+ uint8_t *outBufNative = (uint8_t *) (*env)->GetPrimitiveArrayCritical(env, outBuf, NULL);
+ jint *offsetsNative = (jint *) (*env)->GetPrimitiveArrayCritical(env, offsets, NULL);
+ jint inOffset = offsetsNative[0];
+ jint outOffset = offsetsNative[1];
+ int ret;
+
+ stream->avail_in = inAvailable - inOffset;
+ stream->next_in = inBufNative + inOffset;
+ stream->avail_out = outCount;
+ stream->next_out = outBufNative + outOffset;
+ ret = lzma_code(stream, inAvailable == -1 ? LZMA_FINISH : LZMA_RUN);
+
+ (*env)->ReleasePrimitiveArrayCritical(env, offsets, offsetsNative, 0);
+ (*env)->ReleasePrimitiveArrayCritical(env, outBuf, outBufNative, 0);
+ (*env)->ReleasePrimitiveArrayCritical(env, inBuf, inBufNative, 0);
+
+ inOffset = inAvailable - stream->avail_in;
+ outOffset += outCount - stream->avail_out;
+
+ offsetsNative[0] = inOffset;
+ offsetsNative[1] = outOffset;
+
+ return ret;
+}
diff --git a/project/jni/lzma/src/common/sysdefs.h b/project/jni/lzma/src/common/sysdefs.h
index c74c6212c..5ea6bdae4 100644
--- a/project/jni/lzma/src/common/sysdefs.h
+++ b/project/jni/lzma/src/common/sysdefs.h
@@ -65,6 +65,9 @@
#ifndef PRIu32
# define PRIu32 "u"
#endif
+#ifndef PRIx32
+# define PRIx32 "x"
+#endif
#ifndef PRIX32
# define PRIX32 "X"
#endif
@@ -76,6 +79,9 @@
# ifndef PRIu64
# define PRIu64 "llu"
# endif
+# ifndef PRIx64
+# define PRIx64 "llx"
+# endif
# ifndef PRIX64
# define PRIX64 "llX"
# endif
@@ -86,6 +92,9 @@
# ifndef PRIu64
# define PRIu64 "lu"
# endif
+# ifndef PRIx64
+# define PRIx64 "lx"
+# endif
# ifndef PRIX64
# define PRIX64 "lX"
# endif
@@ -94,9 +103,12 @@
# define UINT64_MAX UINT64_C(18446744073709551615)
#endif
-// Interix has broken header files, which typedef size_t to unsigned long,
-// but a few lines later define SIZE_MAX to INT32_MAX.
-#ifdef __INTERIX
+// Incorrect(?) SIZE_MAX:
+// - Interix headers typedef size_t to unsigned long,
+// but a few lines later define SIZE_MAX to INT32_MAX.
+// - SCO OpenServer (x86) headers typedef size_t to unsigned int
+// but define SIZE_MAX to INT32_MAX.
+#if defined(__INTERIX) || defined(_SCO_DS)
# undef SIZE_MAX
#endif
@@ -171,4 +183,10 @@ typedef unsigned char _Bool;
# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#endif
+#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
+# define lzma_attr_alloc_size(x) __attribute__((__alloc_size__(x)))
+#else
+# define lzma_attr_alloc_size(x)
+#endif
+
#endif
diff --git a/project/jni/lzma/src/common/tuklib_open_stdxxx.c b/project/jni/lzma/src/common/tuklib_open_stdxxx.c
index 08bc60d8c..26702a6af 100644
--- a/project/jni/lzma/src/common/tuklib_open_stdxxx.c
+++ b/project/jni/lzma/src/common/tuklib_open_stdxxx.c
@@ -39,12 +39,14 @@ tuklib_open_stdxxx(int err_status)
| (i == 0 ? O_WRONLY : O_RDONLY));
if (fd != i) {
+ if (fd != -1)
+ (void)close(fd);
+
// Something went wrong. Exit with the
// exit status we were given. Don't try
// to print an error message, since stderr
// may very well be non-existent. This
// error should be extremely rare.
- (void)close(fd);
exit(err_status);
}
}
diff --git a/project/jni/lzma/src/jniwrapperstuff.h b/project/jni/lzma/src/jniwrapperstuff.h
new file mode 100644
index 000000000..7f46e0cb9
--- /dev/null
+++ b/project/jni/lzma/src/jniwrapperstuff.h
@@ -0,0 +1,14 @@
+/* The license of this source code is public domain */
+
+/* JNI-C++ wrapper stuff */
+#ifndef _JNI_WRAPPER_STUFF_H_
+#define _JNI_WRAPPER_STUFF_H_
+
+#ifndef SDL_JAVA_PACKAGE_PATH
+#error You have to define SDL_JAVA_PACKAGE_PATH to your package path with dots replaced with underscores, for example "com_example_SanAngeles"
+#endif
+#define JAVA_EXPORT_NAME2(name,package) Java_##package##_##name
+#define JAVA_EXPORT_NAME1(name,package) JAVA_EXPORT_NAME2(name,package)
+#define JAVA_EXPORT_NAME(name) JAVA_EXPORT_NAME1(name,SDL_JAVA_PACKAGE_PATH)
+
+#endif
diff --git a/project/jni/lzma/src/liblzma/check/crc32_fast.c b/project/jni/lzma/src/liblzma/check/crc32_fast.c
index 94da85592..3de02638d 100644
--- a/project/jni/lzma/src/liblzma/check/crc32_fast.c
+++ b/project/jni/lzma/src/liblzma/check/crc32_fast.c
@@ -20,7 +20,7 @@
#include "crc_macros.h"
-// If you make any changes, do some bench marking! Seemingly unrelated
+// If you make any changes, do some benchmarking! Seemingly unrelated
// changes can very easily ruin the performance (and very probably is
// very compiler dependent).
extern LZMA_API(uint32_t)
diff --git a/project/jni/lzma/src/liblzma/check/sha256.c b/project/jni/lzma/src/liblzma/check/sha256.c
index 04231dbae..f2cc0d71a 100644
--- a/project/jni/lzma/src/liblzma/check/sha256.c
+++ b/project/jni/lzma/src/liblzma/check/sha256.c
@@ -6,7 +6,6 @@
/// \todo Crypto++ has x86 ASM optimizations. They use SSE so if they
/// are imported to liblzma, SSE instructions need to be used
/// conditionally to keep the code working on older boxes.
-/// We could also support using some external libary for SHA-256.
//
// This code is based on the code found from 7-Zip, which has a modified
// version of the SHA-256 found from Crypto++ .
@@ -81,7 +80,7 @@ static const uint32_t SHA256_K[64] = {
static void
-transform(uint32_t state[static 8], const uint32_t data[static 16])
+transform(uint32_t state[8], const uint32_t data[16])
{
uint32_t W[16];
uint32_t T[8];
diff --git a/project/jni/lzma/src/liblzma/common/alone_decoder.c b/project/jni/lzma/src/liblzma/common/alone_decoder.c
index 039b42859..c25112e68 100644
--- a/project/jni/lzma/src/liblzma/common/alone_decoder.c
+++ b/project/jni/lzma/src/liblzma/common/alone_decoder.c
@@ -26,6 +26,11 @@ struct lzma_coder_s {
SEQ_CODE,
} sequence;
+ /// If true, reject files that are unlikely to be .lzma files.
+ /// If false, more non-.lzma files get accepted and will give
+ /// LZMA_DATA_ERROR either immediately or after a few output bytes.
+ bool picky;
+
/// Position in the header fields
size_t pos;
@@ -46,7 +51,7 @@ struct lzma_coder_s {
static lzma_ret
alone_decode(lzma_coder *coder,
- lzma_allocator *allocator lzma_attribute((unused)),
+ lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size,
@@ -68,13 +73,13 @@ alone_decode(lzma_coder *coder,
|= (size_t)(in[*in_pos]) << (coder->pos * 8);
if (++coder->pos == 4) {
- if (coder->options.dict_size != UINT32_MAX) {
+ if (coder->picky && coder->options.dict_size
+ != UINT32_MAX) {
// A hack to ditch tons of false positives:
// We allow only dictionary sizes that are
// 2^n or 2^n + 2^(n-1). LZMA_Alone created
// only files with 2^n, but accepts any
- // dictionary size. If someone complains, this
- // will be reconsidered.
+ // dictionary size.
uint32_t d = coder->options.dict_size - 1;
d |= d >> 2;
d |= d >> 3;
@@ -103,9 +108,9 @@ alone_decode(lzma_coder *coder,
// Another hack to ditch false positives: Assume that
// if the uncompressed size is known, it must be less
- // than 256 GiB. Again, if someone complains, this
- // will be reconsidered.
- if (coder->uncompressed_size != LZMA_VLI_UNKNOWN
+ // than 256 GiB.
+ if (coder->picky
+ && coder->uncompressed_size != LZMA_VLI_UNKNOWN
&& coder->uncompressed_size
>= (LZMA_VLI_C(1) << 38))
return LZMA_FORMAT_ERROR;
@@ -189,7 +194,7 @@ alone_decoder_memconfig(lzma_coder *coder, uint64_t *memusage,
extern lzma_ret
lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
- uint64_t memlimit)
+ uint64_t memlimit, bool picky)
{
lzma_next_coder_init(&lzma_alone_decoder_init, next, allocator);
@@ -208,6 +213,7 @@ lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
}
next->coder->sequence = SEQ_PROPERTIES;
+ next->coder->picky = picky;
next->coder->pos = 0;
next->coder->options.dict_size = 0;
next->coder->options.preset_dict = NULL;
@@ -223,7 +229,7 @@ lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
extern LZMA_API(lzma_ret)
lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit)
{
- lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit);
+ lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit, false);
strm->internal->supported_actions[LZMA_RUN] = true;
strm->internal->supported_actions[LZMA_FINISH] = true;
diff --git a/project/jni/lzma/src/liblzma/common/alone_decoder.h b/project/jni/lzma/src/liblzma/common/alone_decoder.h
index 70d0d2a0f..f666fc382 100644
--- a/project/jni/lzma/src/liblzma/common/alone_decoder.h
+++ b/project/jni/lzma/src/liblzma/common/alone_decoder.h
@@ -16,7 +16,8 @@
#include "common.h"
-extern lzma_ret lzma_alone_decoder_init(lzma_next_coder *next,
- lzma_allocator *allocator, uint64_t memlimit);
+extern lzma_ret lzma_alone_decoder_init(
+ lzma_next_coder *next, lzma_allocator *allocator,
+ uint64_t memlimit, bool picky);
#endif
diff --git a/project/jni/lzma/src/liblzma/common/alone_encoder.c b/project/jni/lzma/src/liblzma/common/alone_encoder.c
index d8c0170f0..eb1697e99 100644
--- a/project/jni/lzma/src/liblzma/common/alone_encoder.c
+++ b/project/jni/lzma/src/liblzma/common/alone_encoder.c
@@ -32,7 +32,7 @@ struct lzma_coder_s {
static lzma_ret
alone_encode(lzma_coder *coder,
- lzma_allocator *allocator lzma_attribute((unused)),
+ lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size,
@@ -103,7 +103,7 @@ alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
if (options->dict_size < LZMA_DICT_SIZE_MIN)
return LZMA_OPTIONS_ERROR;
- // Round up to to the next 2^n or 2^n + 2^(n - 1) depending on which
+ // Round up to the next 2^n or 2^n + 2^(n - 1) depending on which
// one is the next unless it is UINT32_MAX. While the header would
// allow any 32-bit integer, we do this to keep the decoder of liblzma
// accepting the resulting files.
diff --git a/project/jni/lzma/src/liblzma/common/auto_decoder.c b/project/jni/lzma/src/liblzma/common/auto_decoder.c
index ae6c3e786..35c895fd1 100644
--- a/project/jni/lzma/src/liblzma/common/auto_decoder.c
+++ b/project/jni/lzma/src/liblzma/common/auto_decoder.c
@@ -54,7 +54,7 @@ auto_decode(lzma_coder *coder, lzma_allocator *allocator,
coder->memlimit, coder->flags));
} else {
return_if_error(lzma_alone_decoder_init(&coder->next,
- allocator, coder->memlimit));
+ allocator, coder->memlimit, true));
// If the application wants to know about missing
// integrity check or about the check in general, we
diff --git a/project/jni/lzma/src/liblzma/common/block_buffer_encoder.c b/project/jni/lzma/src/liblzma/common/block_buffer_encoder.c
index a8f71c214..519c6a684 100644
--- a/project/jni/lzma/src/liblzma/common/block_buffer_encoder.c
+++ b/project/jni/lzma/src/liblzma/common/block_buffer_encoder.c
@@ -226,16 +226,23 @@ lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
const uint8_t *in, size_t in_size,
uint8_t *out, size_t *out_pos, size_t out_size)
{
- // Sanity checks
- if (block == NULL || block->filters == NULL
- || (in == NULL && in_size != 0) || out == NULL
+ // Validate the arguments.
+ if (block == NULL || (in == NULL && in_size != 0) || out == NULL
|| out_pos == NULL || *out_pos > out_size)
return LZMA_PROG_ERROR;
- // Check the version field.
+ // The contents of the structure may depend on the version so
+ // check the version before validating the contents of *block.
if (block->version != 0)
return LZMA_OPTIONS_ERROR;
+ if ((unsigned int)(block->check) > LZMA_CHECK_ID_MAX
+ || block->filters == NULL)
+ return LZMA_PROG_ERROR;
+
+ if (!lzma_check_is_supported(block->check))
+ return LZMA_UNSUPPORTED_CHECK;
+
// Size of a Block has to be a multiple of four, so limit the size
// here already. This way we don't need to check it again when adding
// Block Padding.
@@ -243,8 +250,7 @@ lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
// Get the size of the Check field.
const size_t check_size = lzma_check_size(block->check);
- if (check_size == UINT32_MAX)
- return LZMA_PROG_ERROR;
+ assert(check_size != UINT32_MAX);
// Reserve space for the Check field.
if (out_size - *out_pos <= check_size)
diff --git a/project/jni/lzma/src/liblzma/common/block_encoder.c b/project/jni/lzma/src/liblzma/common/block_encoder.c
index ca5152357..1eeb502b7 100644
--- a/project/jni/lzma/src/liblzma/common/block_encoder.c
+++ b/project/jni/lzma/src/liblzma/common/block_encoder.c
@@ -144,7 +144,7 @@ block_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret
block_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
- const lzma_filter *filters lzma_attribute((unused)),
+ const lzma_filter *filters lzma_attribute((__unused__)),
const lzma_filter *reversed_filters)
{
if (coder->sequence != SEQ_CODE)
@@ -161,6 +161,11 @@ lzma_block_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
{
lzma_next_coder_init(&lzma_block_encoder_init, next, allocator);
+ if (block == NULL)
+ return LZMA_PROG_ERROR;
+
+ // The contents of the structure may depend on the version so
+ // check the version first.
if (block->version != 0)
return LZMA_OPTIONS_ERROR;
diff --git a/project/jni/lzma/src/liblzma/common/common.c b/project/jni/lzma/src/liblzma/common/common.c
index 0408e1532..b9e386027 100644
--- a/project/jni/lzma/src/liblzma/common/common.c
+++ b/project/jni/lzma/src/liblzma/common/common.c
@@ -35,7 +35,7 @@ lzma_version_string(void)
// Memory allocation //
///////////////////////
-extern void * lzma_attribute((malloc))
+extern void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
lzma_alloc(size_t size, lzma_allocator *allocator)
{
// Some malloc() variants return NULL if called with size == 0.
diff --git a/project/jni/lzma/src/liblzma/common/common.h b/project/jni/lzma/src/liblzma/common/common.h
index 3a85168f1..45aba4f06 100644
--- a/project/jni/lzma/src/liblzma/common/common.h
+++ b/project/jni/lzma/src/liblzma/common/common.h
@@ -205,7 +205,7 @@ struct lzma_internal_s {
/// Allocates memory
extern void *lzma_alloc(size_t size, lzma_allocator *allocator)
- lzma_attribute((malloc));
+ lzma_attribute((__malloc__)) lzma_attr_alloc_size(1);
/// Frees memory
extern void lzma_free(void *ptr, lzma_allocator *allocator);
diff --git a/project/jni/lzma/src/liblzma/common/filter_common.c b/project/jni/lzma/src/liblzma/common/filter_common.c
index b157c6280..7c95b05f2 100644
--- a/project/jni/lzma/src/liblzma/common/filter_common.c
+++ b/project/jni/lzma/src/liblzma/common/filter_common.c
@@ -43,7 +43,7 @@ static const struct {
.changes_size = true,
},
#endif
-#ifdef HAVE_DECODER_LZMA2
+#if defined(HAVE_ENCODER_LZMA2) || defined(HAVE_DECODER_LZMA2)
{
.id = LZMA_FILTER_LZMA2,
.options_size = sizeof(lzma_options_lzma),
@@ -52,7 +52,7 @@ static const struct {
.changes_size = true,
},
#endif
-#ifdef HAVE_DECODER_X86
+#if defined(HAVE_ENCODER_X86) || defined(HAVE_DECODER_X86)
{
.id = LZMA_FILTER_X86,
.options_size = sizeof(lzma_options_bcj),
@@ -70,7 +70,7 @@ static const struct {
.changes_size = false,
},
#endif
-#ifdef HAVE_DECODER_IA64
+#if defined(HAVE_ENCODER_IA64) || defined(HAVE_DECODER_IA64)
{
.id = LZMA_FILTER_IA64,
.options_size = sizeof(lzma_options_bcj),
diff --git a/project/jni/lzma/src/liblzma/common/index.c b/project/jni/lzma/src/liblzma/common/index.c
index ddb9d3643..9af4bc19d 100644
--- a/project/jni/lzma/src/liblzma/common/index.c
+++ b/project/jni/lzma/src/liblzma/common/index.c
@@ -398,10 +398,13 @@ extern LZMA_API(lzma_index *)
lzma_index_init(lzma_allocator *allocator)
{
lzma_index *i = index_init_plain(allocator);
+ if (i == NULL)
+ return NULL;
+
index_stream *s = index_stream_init(0, 0, 1, 0, allocator);
- if (i == NULL || s == NULL) {
- index_stream_end(s, allocator);
+ if (s == NULL) {
lzma_free(i, allocator);
+ return NULL;
}
index_tree_append(&i->streams, &s->node);
diff --git a/project/jni/lzma/src/liblzma/common/index_decoder.c b/project/jni/lzma/src/liblzma/common/index_decoder.c
index a6bc650e0..83c8a3af1 100644
--- a/project/jni/lzma/src/liblzma/common/index_decoder.c
+++ b/project/jni/lzma/src/liblzma/common/index_decoder.c
@@ -56,10 +56,11 @@ struct lzma_coder_s {
static lzma_ret
index_decode(lzma_coder *coder, lzma_allocator *allocator,
const uint8_t *restrict in, size_t *restrict in_pos,
- size_t in_size, uint8_t *restrict out lzma_attribute((unused)),
- size_t *restrict out_pos lzma_attribute((unused)),
- size_t out_size lzma_attribute((unused)),
- lzma_action action lzma_attribute((unused)))
+ size_t in_size,
+ uint8_t *restrict out lzma_attribute((__unused__)),
+ size_t *restrict out_pos lzma_attribute((__unused__)),
+ size_t out_size lzma_attribute((__unused__)),
+ lzma_action action lzma_attribute((__unused__)))
{
// Similar optimization as in index_encoder.c
const size_t in_start = *in_pos;
diff --git a/project/jni/lzma/src/liblzma/common/index_encoder.c b/project/jni/lzma/src/liblzma/common/index_encoder.c
index c10d7afa0..45919f094 100644
--- a/project/jni/lzma/src/liblzma/common/index_encoder.c
+++ b/project/jni/lzma/src/liblzma/common/index_encoder.c
@@ -42,12 +42,13 @@ struct lzma_coder_s {
static lzma_ret
index_encode(lzma_coder *coder,
- lzma_allocator *allocator lzma_attribute((unused)),
- const uint8_t *restrict in lzma_attribute((unused)),
- size_t *restrict in_pos lzma_attribute((unused)),
- size_t in_size lzma_attribute((unused)),
+ lzma_allocator *allocator lzma_attribute((__unused__)),
+ const uint8_t *restrict in lzma_attribute((__unused__)),
+ size_t *restrict in_pos lzma_attribute((__unused__)),
+ size_t in_size lzma_attribute((__unused__)),
uint8_t *restrict out, size_t *restrict out_pos,
- size_t out_size, lzma_action action lzma_attribute((unused)))
+ size_t out_size,
+ lzma_action action lzma_attribute((__unused__)))
{
// Position where to start calculating CRC32. The idea is that we
// need to call lzma_crc32() only once per call to index_encode().
diff --git a/project/jni/lzma/src/liblzma/common/stream_buffer_encoder.c b/project/jni/lzma/src/liblzma/common/stream_buffer_encoder.c
index f727d8542..2450ee2e1 100644
--- a/project/jni/lzma/src/liblzma/common/stream_buffer_encoder.c
+++ b/project/jni/lzma/src/liblzma/common/stream_buffer_encoder.c
@@ -51,6 +51,9 @@ lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check,
|| out_pos_ptr == NULL || *out_pos_ptr > out_size)
return LZMA_PROG_ERROR;
+ if (!lzma_check_is_supported(check))
+ return LZMA_UNSUPPORTED_CHECK;
+
// Note for the paranoids: Index encoder prevents the Stream from
// getting too big and still being accepted with LZMA_OK, and Block
// encoder catches if the input is too big. So we don't need to
@@ -81,26 +84,32 @@ lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check,
out_pos += LZMA_STREAM_HEADER_SIZE;
- // Block
+ // Encode a Block but only if there is at least one byte of input.
lzma_block block = {
.version = 0,
.check = check,
.filters = filters,
};
- return_if_error(lzma_block_buffer_encode(&block, allocator,
- in, in_size, out, &out_pos, out_size));
+ if (in_size > 0)
+ return_if_error(lzma_block_buffer_encode(&block, allocator,
+ in, in_size, out, &out_pos, out_size));
// Index
{
- // Create an Index with one Record.
+ // Create an Index. It will have one Record if there was
+ // at least one byte of input to encode. Otherwise the
+ // Index will be empty.
lzma_index *i = lzma_index_init(allocator);
if (i == NULL)
return LZMA_MEM_ERROR;
- lzma_ret ret = lzma_index_append(i, allocator,
- lzma_block_unpadded_size(&block),
- block.uncompressed_size);
+ lzma_ret ret = LZMA_OK;
+
+ if (in_size > 0)
+ ret = lzma_index_append(i, allocator,
+ lzma_block_unpadded_size(&block),
+ block.uncompressed_size);
// If adding the Record was successful, encode the Index
// and get its size which will be stored into Stream Footer.
diff --git a/project/jni/lzma/src/liblzma/common/stream_encoder.c b/project/jni/lzma/src/liblzma/common/stream_encoder.c
index 48d91da79..97a7a23a8 100644
--- a/project/jni/lzma/src/liblzma/common/stream_encoder.c
+++ b/project/jni/lzma/src/liblzma/common/stream_encoder.c
@@ -280,6 +280,7 @@ lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
next->end = &stream_encoder_end;
next->update = &stream_encoder_update;
+ next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
next->coder->block_encoder = LZMA_NEXT_CODER_INIT;
next->coder->index_encoder = LZMA_NEXT_CODER_INIT;
next->coder->index = NULL;
@@ -289,7 +290,6 @@ lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
next->coder->sequence = SEQ_STREAM_HEADER;
next->coder->block_options.version = 0;
next->coder->block_options.check = check;
- next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
// Initialize the Index
lzma_index_end(next->coder->index, allocator);
diff --git a/project/jni/lzma/src/liblzma/delta/delta_encoder.c b/project/jni/lzma/src/liblzma/delta/delta_encoder.c
index ea1cc2cb0..15c7951e1 100644
--- a/project/jni/lzma/src/liblzma/delta/delta_encoder.c
+++ b/project/jni/lzma/src/liblzma/delta/delta_encoder.c
@@ -85,7 +85,7 @@ delta_encode(lzma_coder *coder, lzma_allocator *allocator,
static lzma_ret
delta_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
- const lzma_filter *filters_null lzma_attribute((unused)),
+ const lzma_filter *filters_null lzma_attribute((__unused__)),
const lzma_filter *reversed_filters)
{
// Delta doesn't and will never support changing the options in
diff --git a/project/jni/lzma/src/liblzma/liblzma.pc b/project/jni/lzma/src/liblzma/liblzma.pc
deleted file mode 100644
index 36bbbbc0a..000000000
--- a/project/jni/lzma/src/liblzma/liblzma.pc
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Author: Lasse Collin
-#
-# This file has been put into the public domain.
-# You can do whatever you want with this file.
-#
-
-prefix=/usr/local
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
-
-Name: liblzma
-Description: General purpose data compression library
-URL: http://tukaani.org/xz/
-Version: 5.0.0
-Cflags: -I${includedir}
-Libs: -L${libdir} -llzma
-Libs.private:
diff --git a/project/jni/lzma/src/liblzma/lz/lz_decoder.c b/project/jni/lzma/src/liblzma/lz/lz_decoder.c
index 2c5735512..d74085cf4 100644
--- a/project/jni/lzma/src/liblzma/lz/lz_decoder.c
+++ b/project/jni/lzma/src/liblzma/lz/lz_decoder.c
@@ -126,7 +126,7 @@ decode_buffer(lzma_coder *coder,
static lzma_ret
lz_decode(lzma_coder *coder,
- lzma_allocator *allocator lzma_attribute((unused)),
+ lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size,
diff --git a/project/jni/lzma/src/liblzma/lz/lz_encoder.c b/project/jni/lzma/src/liblzma/lz/lz_encoder.c
index 273f577b6..e24069658 100644
--- a/project/jni/lzma/src/liblzma/lz/lz_encoder.c
+++ b/project/jni/lzma/src/liblzma/lz/lz_encoder.c
@@ -480,7 +480,7 @@ lz_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret
lz_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
- const lzma_filter *filters_null lzma_attribute((unused)),
+ const lzma_filter *filters_null lzma_attribute((__unused__)),
const lzma_filter *reversed_filters)
{
if (coder->lz.options_update == NULL)
diff --git a/project/jni/lzma/src/liblzma/lz/lz_encoder_hash.h b/project/jni/lzma/src/liblzma/lz/lz_encoder_hash.h
index c398d7d05..342a333d1 100644
--- a/project/jni/lzma/src/liblzma/lz/lz_encoder_hash.h
+++ b/project/jni/lzma/src/liblzma/lz/lz_encoder_hash.h
@@ -39,7 +39,7 @@
// Endianness doesn't matter in hash_2_calc() (no effect on the output).
#ifdef TUKLIB_FAST_UNALIGNED_ACCESS
# define hash_2_calc() \
- const uint32_t hash_value = *(const uint16_t *)(cur);
+ const uint32_t hash_value = *(const uint16_t *)(cur)
#else
# define hash_2_calc() \
const uint32_t hash_value \
diff --git a/project/jni/lzma/src/liblzma/lzma/lzma2_decoder.c b/project/jni/lzma/src/liblzma/lzma/lzma2_decoder.c
index f38879ce1..3e42575d5 100644
--- a/project/jni/lzma/src/liblzma/lzma/lzma2_decoder.c
+++ b/project/jni/lzma/src/liblzma/lzma/lzma2_decoder.c
@@ -67,6 +67,10 @@ lzma2_decode(lzma_coder *restrict coder, lzma_dict *restrict dict,
const uint32_t control = in[*in_pos];
++*in_pos;
+ // End marker
+ if (control == 0x00)
+ return LZMA_STREAM_END;
+
if (control >= 0xE0 || control == 1) {
// Dictionary reset implies that next LZMA chunk has
// to set new properties.
@@ -104,10 +108,6 @@ lzma2_decode(lzma_coder *restrict coder, lzma_dict *restrict dict,
&coder->options);
}
} else {
- // End marker
- if (control == 0x00)
- return LZMA_STREAM_END;
-
// Invalid control values
if (control > 2)
return LZMA_DATA_ERROR;
diff --git a/project/jni/lzma/src/liblzma/lzma/lzma2_encoder.c b/project/jni/lzma/src/liblzma/lzma/lzma2_encoder.c
index b48e0d689..992720ca6 100644
--- a/project/jni/lzma/src/liblzma/lzma/lzma2_encoder.c
+++ b/project/jni/lzma/src/liblzma/lzma/lzma2_encoder.c
@@ -374,7 +374,7 @@ lzma_lzma2_props_encode(const void *options, uint8_t *out)
const lzma_options_lzma *const opt = options;
uint32_t d = my_max(opt->dict_size, LZMA_DICT_SIZE_MIN);
- // Round up to to the next 2^n - 1 or 2^n + 2^(n - 1) - 1 depending
+ // Round up to the next 2^n - 1 or 2^n + 2^(n - 1) - 1 depending
// on which one is the next:
--d;
d |= d >> 2;
diff --git a/project/jni/lzma/src/liblzma/lzma/lzma_encoder_presets.c b/project/jni/lzma/src/liblzma/lzma/lzma_encoder_presets.c
index 21e427a8d..8484b7744 100644
--- a/project/jni/lzma/src/liblzma/lzma/lzma_encoder_presets.c
+++ b/project/jni/lzma/src/liblzma/lzma/lzma_encoder_presets.c
@@ -30,14 +30,16 @@ lzma_lzma_preset(lzma_options_lzma *options, uint32_t preset)
options->lp = LZMA_LP_DEFAULT;
options->pb = LZMA_PB_DEFAULT;
- options->dict_size = UINT32_C(1) << (uint8_t []){
- 18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }[level];
+ static const uint8_t dict_pow2[]
+ = { 18, 20, 21, 22, 22, 23, 23, 24, 25, 26 };
+ options->dict_size = UINT32_C(1) << dict_pow2[level];
if (level <= 3) {
options->mode = LZMA_MODE_FAST;
options->mf = level == 0 ? LZMA_MF_HC3 : LZMA_MF_HC4;
options->nice_len = level <= 1 ? 128 : 273;
- options->depth = (uint8_t []){ 4, 8, 24, 48 }[level];
+ static const uint8_t depths[] = { 4, 8, 24, 48 };
+ options->depth = depths[level];
} else {
options->mode = LZMA_MODE_NORMAL;
options->mf = LZMA_MF_BT4;
diff --git a/project/jni/lzma/src/liblzma/simple/arm.c b/project/jni/lzma/src/liblzma/simple/arm.c
index 8fcf64374..a84702ac6 100644
--- a/project/jni/lzma/src/liblzma/simple/arm.c
+++ b/project/jni/lzma/src/liblzma/simple/arm.c
@@ -15,7 +15,7 @@
static size_t
-arm_code(lzma_simple *simple lzma_attribute((unused)),
+arm_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
diff --git a/project/jni/lzma/src/liblzma/simple/armthumb.c b/project/jni/lzma/src/liblzma/simple/armthumb.c
index eb6a69d12..4b49175fe 100644
--- a/project/jni/lzma/src/liblzma/simple/armthumb.c
+++ b/project/jni/lzma/src/liblzma/simple/armthumb.c
@@ -15,7 +15,7 @@
static size_t
-armthumb_code(lzma_simple *simple lzma_attribute((unused)),
+armthumb_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
diff --git a/project/jni/lzma/src/liblzma/simple/ia64.c b/project/jni/lzma/src/liblzma/simple/ia64.c
index fd263d4ae..ce3692b98 100644
--- a/project/jni/lzma/src/liblzma/simple/ia64.c
+++ b/project/jni/lzma/src/liblzma/simple/ia64.c
@@ -15,7 +15,7 @@
static size_t
-ia64_code(lzma_simple *simple lzma_attribute((unused)),
+ia64_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
diff --git a/project/jni/lzma/src/liblzma/simple/powerpc.c b/project/jni/lzma/src/liblzma/simple/powerpc.c
index aaa14f221..6f8351176 100644
--- a/project/jni/lzma/src/liblzma/simple/powerpc.c
+++ b/project/jni/lzma/src/liblzma/simple/powerpc.c
@@ -15,7 +15,7 @@
static size_t
-powerpc_code(lzma_simple *simple lzma_attribute((unused)),
+powerpc_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
diff --git a/project/jni/lzma/src/liblzma/simple/simple_coder.c b/project/jni/lzma/src/liblzma/simple/simple_coder.c
index 06db86ec2..a02b039aa 100644
--- a/project/jni/lzma/src/liblzma/simple/simple_coder.c
+++ b/project/jni/lzma/src/liblzma/simple/simple_coder.c
@@ -35,9 +35,6 @@ copy_or_code(lzma_coder *coder, lzma_allocator *allocator,
} else {
// Call the next coder in the chain to provide us some data.
- // We don't care about uncompressed_size here, because
- // the next filter in the chain will do it for us (since
- // we don't change the size of the data).
const lzma_ret ret = coder->next.code(
coder->next.coder, allocator,
in, in_pos, in_size,
@@ -110,7 +107,7 @@ simple_code(lzma_coder *coder, lzma_allocator *allocator,
// filtered if the buffer sizes used by the application are reasonable.
const size_t out_avail = out_size - *out_pos;
const size_t buf_avail = coder->size - coder->pos;
- if (out_avail > buf_avail) {
+ if (out_avail > buf_avail || buf_avail == 0) {
// Store the old position so that we know from which byte
// to start filtering.
const size_t out_start = *out_pos;
@@ -212,7 +209,7 @@ simple_coder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret
simple_coder_update(lzma_coder *coder, lzma_allocator *allocator,
- const lzma_filter *filters_null lzma_attribute((unused)),
+ const lzma_filter *filters_null lzma_attribute((__unused__)),
const lzma_filter *reversed_filters)
{
// No update support, just call the next filter in the chain.
diff --git a/project/jni/lzma/src/liblzma/simple/simple_private.h b/project/jni/lzma/src/liblzma/simple/simple_private.h
index a69f82785..fcf9f7c19 100644
--- a/project/jni/lzma/src/liblzma/simple/simple_private.h
+++ b/project/jni/lzma/src/liblzma/simple/simple_private.h
@@ -22,8 +22,7 @@ struct lzma_coder_s {
/// Next filter in the chain
lzma_next_coder next;
- /// True if the next coder in the chain has returned LZMA_STREAM_END
- /// or if we have processed uncompressed_size bytes.
+ /// True if the next coder in the chain has returned LZMA_STREAM_END.
bool end_was_reached;
/// True if filter() should encode the data; false to decode.
diff --git a/project/jni/lzma/src/liblzma/simple/sparc.c b/project/jni/lzma/src/liblzma/simple/sparc.c
index 808a59aaa..8270d6ab1 100644
--- a/project/jni/lzma/src/liblzma/simple/sparc.c
+++ b/project/jni/lzma/src/liblzma/simple/sparc.c
@@ -15,7 +15,7 @@
static size_t
-sparc_code(lzma_simple *simple lzma_attribute((unused)),
+sparc_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
diff --git a/project/jni/openal/src/config.h b/project/jni/openal/src/config.h
index 5ddf8411c..3739bd667 100644
--- a/project/jni/openal/src/config.h
+++ b/project/jni/openal/src/config.h
@@ -42,7 +42,13 @@
#define HAVE___INT64
/* Define to the size of a long int type */
+#ifdef __LP64__
+#define SIZEOF_LONG 8
+#define SIZEOF_VOIDP 8
+#else
#define SIZEOF_LONG 4
+#define SIZEOF_VOIDP 4
+#endif
/* Define to the size of a long long int type */
#define SIZEOF_LONG_LONG 8
@@ -51,7 +57,6 @@
#define SIZEOF_UINT 4
/* Define to the size of a void pointer type */
-#define SIZEOF_VOIDP 4
/* Define if we have GCC's destructor attribute */
#define HAVE_GCC_DESTRUCTOR 1
diff --git a/project/jni/sdl-1.2/include/SDL_config_android.h b/project/jni/sdl-1.2/include/SDL_config_android.h
index 59e6c6d11..c2729498e 100644
--- a/project/jni/sdl-1.2/include/SDL_config_android.h
+++ b/project/jni/sdl-1.2/include/SDL_config_android.h
@@ -61,8 +61,12 @@
#define HAVE_STDIO_H 1
-
+#ifdef __LP64__
+#define SIZEOF_VOIDP 8
+#else
#define SIZEOF_VOIDP 4
+#endif
+
#define SDL_HAS_64BIT_TYPE 1
/* FireSlash found that SDL native memcpy crashes sometimes, these defines fix it (and they are faster) */
diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-compat.c b/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-compat.c
index be247322d..424d1f61f 100644
--- a/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-compat.c
+++ b/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-compat.c
@@ -88,7 +88,6 @@ extern void SDL_ANDROID_PumpEvents()
{
static int oldMouseButtons = 0;
SDL_Event ev;
- SDL_ANDROID_processAndroidTrackballDampening();
SDL_ANDROID_processMoveMouseWithKeyboard();
#if SDL_VERSION_ATLEAST(1,3,0)
SDL_Window * window = SDL_GetFocusWindow();
diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-fast.c b/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-fast.c
index ca62b7449..7b8b943d0 100644
--- a/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-fast.c
+++ b/project/jni/sdl-1.2/src/video/android/SDL_androidinput-queue-fast.c
@@ -71,7 +71,6 @@ extern void SDL_ANDROID_PumpEvents()
{
joystickEventsCount = 0;
- SDL_ANDROID_processAndroidTrackballDampening();
SDL_ANDROID_processMoveMouseWithKeyboard();
};
diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidinput.c b/project/jni/sdl-1.2/src/video/android/SDL_androidinput.c
index 5de71dda2..c217e2602 100644
--- a/project/jni/sdl-1.2/src/video/android/SDL_androidinput.c
+++ b/project/jni/sdl-1.2/src/video/android/SDL_androidinput.c
@@ -62,7 +62,6 @@ static inline SDL_scancode TranslateKey(int scancode)
return SDL_android_keymap[scancode];
}
-static int isTrackballUsed = 0;
int SDL_ANDROID_isMouseUsed = 0;
#define NORMALIZE_FLOAT_32767(X) (fminf(32767.0f, fmaxf(-32767.0f, (X) * 32767.0f)))
@@ -92,8 +91,6 @@ int SDL_ANDROID_joysticksAmount = 0;
static int SDL_ANDROID_isAccelerometerUsed = 0;
static int isMultitouchUsed = 0;
SDL_Joystick *SDL_ANDROID_CurrentJoysticks[JOY_GAMEPAD4+1];
-static int TrackballDampening = 0; // in milliseconds
-static Uint32 lastTrackballAction = 0;
enum { TOUCH_PTR_UP = 0, TOUCH_PTR_MOUSE = 1, TOUCH_PTR_SCREENKB = 2 };
static int touchPointers[MAX_MULTITOUCH_POINTERS] = {0};
static int firstMousePointerId = -1, secondMousePointerId = -1;
@@ -945,8 +942,6 @@ void SDL_ANDROID_WarpMouse(int x, int y)
}
};
-static int processAndroidTrackball(int key, int action);
-
JNIEXPORT jint JNICALL
JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeKey) ( JNIEnv* env, jobject thiz, jint key, jint action, jint unicode )
{
@@ -956,9 +951,6 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeKey) ( JNIEnv* env, jobject thiz, jint
return 1;
#endif
- if( isTrackballUsed )
- if( processAndroidTrackball(key, action) )
- return 1;
if( key == rightClickKey && rightClickMethod == RIGHT_CLICK_WITH_KEY )
{
SDL_ANDROID_MainThreadPushMouseButton( action ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_RIGHT );
@@ -970,7 +962,7 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeKey) ( JNIEnv* env, jobject thiz, jint
return 1;
}
- //__android_log_print(ANDROID_LOG_INFO, "libSDL","nativeKey %d translated %d unicode %d", key, TranslateKey(key), unicode);
+ //__android_log_print(ANDROID_LOG_INFO, "libSDL","nativeKey %d action %d translated %d unicode %d", key, action, TranslateKey(key), unicode);
if( TranslateKey(key) == SDLK_NO_REMAP || (TranslateKey(key) == SDLK_UNKNOWN && (unicode & 0xFF80) == 0) )
return 0;
@@ -1077,12 +1069,6 @@ JAVA_EXPORT_NAME(AccelerometerReader_nativeGyroscope) ( JNIEnv* env, jobject th
}
}
-JNIEXPORT void JNICALL
-JAVA_EXPORT_NAME(Settings_nativeSetTrackballUsed) ( JNIEnv* env, jobject thiz)
-{
- isTrackballUsed = 1;
-}
-
static int getClickTimeout(int v)
{
switch(v)
@@ -1330,15 +1316,10 @@ JAVA_EXPORT_NAME(Settings_nativeSetAccelerometerSettings) ( JNIEnv* env, jobjec
accelerometerCenterPos = centerPos;
}
-JNIEXPORT void JNICALL
-JAVA_EXPORT_NAME(Settings_nativeSetTrackballDampening) ( JNIEnv* env, jobject thiz, jint value)
-{
- TrackballDampening = (value * 200);
-}
-
JNIEXPORT void JNICALL
JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeGamepadAnalogJoystickInput) (JNIEnv* env, jobject thiz,
- jfloat stick1x, jfloat stick1y, jfloat stick2x, jfloat stick2y, jfloat rtrigger, jfloat ltrigger)
+ jfloat stick1x, jfloat stick1y, jfloat stick2x, jfloat stick2y, jfloat rtrigger, jfloat ltrigger,
+ jint usingHat)
{
if( SDL_ANDROID_CurrentJoysticks[JOY_GAMEPAD1] )
{
@@ -1349,7 +1330,7 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeGamepadAnalogJoystickInput) (JNIEnv* en
SDL_ANDROID_MainThreadPushJoystickAxis(JOY_GAMEPAD1, 4, NORMALIZE_FLOAT_32767(ltrigger));
SDL_ANDROID_MainThreadPushJoystickAxis(JOY_GAMEPAD1, 5, NORMALIZE_FLOAT_32767(rtrigger));
}
- else
+ else if( !usingHat )
{
// Translate to up/down/left/right
if( stick1x < -0.5f )
@@ -1395,128 +1376,6 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeGamepadAnalogJoystickInput) (JNIEnv* en
}
}
-static int leftPressed = 0, rightPressed = 0, upPressed = 0, downPressed = 0;
-
-int processAndroidTrackball(int key, int action)
-{
- SDL_keysym keysym;
-
- if( ! action && (
- key == KEYCODE_DPAD_UP ||
- key == KEYCODE_DPAD_DOWN ||
- key == KEYCODE_DPAD_LEFT ||
- key == KEYCODE_DPAD_RIGHT ) )
- return 1;
- lastTrackballAction = SDL_GetTicks();
-
- if( key == KEYCODE_DPAD_UP )
- {
- if( downPressed )
- {
- downPressed = 0;
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(KEYCODE_DPAD_DOWN), 0 );
- return 1;
- }
- if( !upPressed )
- {
- upPressed = 1;
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_PRESSED, TranslateKey(key), 0 );
- }
- else
- {
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(key), 0 );
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_PRESSED, TranslateKey(key), 0 );
- }
- return 1;
- }
-
- if( key == KEYCODE_DPAD_DOWN )
- {
- if( upPressed )
- {
- upPressed = 0;
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(KEYCODE_DPAD_UP), 0 );
- return 1;
- }
- if( !upPressed )
- {
- downPressed = 1;
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_PRESSED, TranslateKey(key), 0 );
- }
- else
- {
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(key), 0 );
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_PRESSED, TranslateKey(key), 0 );
- }
- return 1;
- }
-
- if( key == KEYCODE_DPAD_LEFT )
- {
- if( rightPressed )
- {
- rightPressed = 0;
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(KEYCODE_DPAD_RIGHT), 0 );
- return 1;
- }
- if( !leftPressed )
- {
- leftPressed = 1;
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_PRESSED, TranslateKey(key), 0 );
- }
- else
- {
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(key), 0 );
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_PRESSED, TranslateKey(key), 0 );
- }
- return 1;
- }
-
- if( key == KEYCODE_DPAD_RIGHT )
- {
- if( leftPressed )
- {
- leftPressed = 0;
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(KEYCODE_DPAD_LEFT), 0 );
- return 1;
- }
- if( !rightPressed )
- {
- rightPressed = 1;
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_PRESSED, TranslateKey(key), 0 );
- }
- else
- {
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(key), 0 );
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_PRESSED, TranslateKey(key), 0 );
- }
- return 1;
- }
-
- return 0;
-}
-
-void SDL_ANDROID_processAndroidTrackballDampening()
-{
- if( !TrackballDampening )
- return;
- if( SDL_GetTicks() > TrackballDampening + lastTrackballAction )
- {
- if( upPressed )
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(KEYCODE_DPAD_UP), 0 );
- if( downPressed )
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(KEYCODE_DPAD_DOWN), 0 );
- if( leftPressed )
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(KEYCODE_DPAD_LEFT), 0 );
- if( rightPressed )
- SDL_ANDROID_MainThreadPushKeyboardKey( SDL_RELEASED, TranslateKey(KEYCODE_DPAD_RIGHT), 0 );
- upPressed = 0;
- downPressed = 0;
- leftPressed = 0;
- rightPressed = 0;
- }
-}
-
int SDL_SYS_JoystickInit(void)
{
SDL_numjoysticks = JOY_GAMEPAD4 + 1;
diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.h b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.h
index 2d860c6f2..f46c66452 100644
--- a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.h
+++ b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo.h
@@ -73,7 +73,6 @@ extern int SDL_ANDROID_IsScreenKeyboardShownFlag;
extern int SDL_ANDROID_drawTouchscreenKeyboard();
extern void SDL_ANDROID_VideoContextLost();
extern void SDL_ANDROID_VideoContextRecreated();
-extern void SDL_ANDROID_processAndroidTrackballDampening();
extern void SDL_ANDROID_processMoveMouseWithKeyboard();
extern int SDL_ANDROID_InsideVideoThread();
extern void SDL_ANDROID_initFakeStdout();
diff --git a/project/jni/sdl-1.2/src/video/android/SDL_touchscreenkeyboard.c b/project/jni/sdl-1.2/src/video/android/SDL_touchscreenkeyboard.c
index 4906d3b7e..572201f1d 100644
--- a/project/jni/sdl-1.2/src/video/android/SDL_touchscreenkeyboard.c
+++ b/project/jni/sdl-1.2/src/video/android/SDL_touchscreenkeyboard.c
@@ -690,7 +690,7 @@ JAVA_EXPORT_NAME(Settings_nativeSetupScreenKeyboard) ( JNIEnv* env, jobject thiz
}
// Arrows to the lower-left part of screen
- arrows[0].w = SDL_ANDROID_sRealWindowWidth / (size + 2) * 2 / 3;
+ arrows[0].w = SDL_ANDROID_sRealWindowWidth / (size + 3) * 2 / 2;
arrows[0].h = arrows[0].w;
// Move to the screen edge
arrows[0].x = 0;
@@ -727,7 +727,7 @@ JAVA_EXPORT_NAME(Settings_nativeSetupScreenKeyboard) ( JNIEnv* env, jobject thiz
{
// Custom button ordering
int iii = ii + i*2;
- buttons[iii].w = SDL_ANDROID_sRealWindowWidth / (size + 2) / 3;
+ buttons[iii].w = SDL_ANDROID_sRealWindowWidth / (size + 3) / 2;
buttons[iii].h = buttons[iii].w;
// Move to the screen edge
buttons[iii].x = SDL_ANDROID_sRealWindowWidth - buttons[iii].w * (ii + 1);
diff --git a/project/libs/xz.jar b/project/libs/xz.jar
deleted file mode 100644
index 39fa03d2d..000000000
Binary files a/project/libs/xz.jar and /dev/null differ
diff --git a/project/project.properties b/project/project.properties
index 4ab125693..6e18427a4 100644
--- a/project/project.properties
+++ b/project/project.properties
@@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
-target=android-19
+target=android-21
diff --git a/todo.txt b/todo.txt
index f8646b109..6a1f22053 100644
--- a/todo.txt
+++ b/todo.txt
@@ -7,6 +7,16 @@ TODO, which will get actually done
- TeeWorlds: control movement with gyroscope.
+- TeeWorlds: voting is broken.
+
+- TeeWorlds: can't fully delete the mod filter.
+
+- TeeWorlds: sending smilies (likely Unicode emoji) crashes the client.
+
+- TeeWorlds: client timeouts from server whne app is in the background.
+
+- TeeWorlds: implement rcon.
+
- OpenArena: navigate game menu with analog joystick.
- OpenArena: do not treat commands starting with / as chat text.
@@ -17,18 +27,28 @@ TODO, which will get actually done
- UQM: use gyroscope to steer the ship, search button for starmap.
-- SuperTux: Update, enable OpenGL renderer, add touchscreen jump helper, add gamepad support, fix zoom in settings.
-
- SDL: control mouse with right analog gamepad stick.
- SDL: sometimes the screen stays black after restoring from background.
- XSDL: support Android intent x11://localhost:6000 - http://www.openintents.org/node/905
-- Nvidia Shield D-Pad does not send any events (probably acts as 3-rd joystick).
+- XSDL: screen follows mouse when on-screen keyboard is shown.
-- USB Keyboard: touchpad mode, configurable mouse speed, show keyboard LEDs, show error when root is not installed.
+- XSDL: copy text from Android clipboard when it changes.
+
+- USB Keyboard: configurable mouse speed, show keyboard LEDs, redefine unknown keys, fix Lollipop SELinux bug.
- S Planner Killer: options to restore calendar settiongs, and to kill lock-screen widget.
- GemRB: update.
+
+- OpenTTD: tutorial.
+
+- OpenTTD: horizintal toobar popup menu out of screen.
+
+- OpenTTD: tap anywhere to close popup menu.
+
+- OpenTTD: Ctrl key does not work when using physical keyboard.
+
+- Add glshim library: https://github.com/lunixbochs/glshim