diff --git a/project/jni/application/openttd-lowmem/AndroidAppSettings.cfg b/project/jni/application/openttd-lowmem/AndroidAppSettings.cfg new file mode 100644 index 000000000..505d5551c --- /dev/null +++ b/project/jni/application/openttd-lowmem/AndroidAppSettings.cfg @@ -0,0 +1,33 @@ +# The application settings for Android libSDL port +AppSettingVersion=15 +LibSdlVersion=1.2 +AppName="OpenTTD-lowmem" +AppFullName=org.openttd.sdl.lowmem +ScreenOrientation=h +InhibitSuspend=n +AppDataDownloadUrl="Data files - 6 Mb|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-lowmem-2.zip/download^Big GUI add-on - enable it in NewGRF Settings|:data/opengfx+biggui.grf:http://www.tt-forums.net/download/file.php?id=135095" +SdlVideoResize=y +SdlVideoResizeKeepAspect=n +NeedDepthBuffer=n +AppUsesMouse=y +AppNeedsTwoButtonMouse=y +AppNeedsArrowKeys=y +AppNeedsTextInput=y +AppUsesJoystick=n +AppHandlesJoystickSensitivity=n +AppUsesMultitouch=n +NonBlockingSwapBuffers=n +RedefinedKeys="LALT RETURN KP_PLUS KP_MINUS DELETE" +AppTouchscreenKeyboardKeysAmount=0 +AppTouchscreenKeyboardKeysAmountAutoFire=0 +MultiABI=n +AppVersionCode=10503 +AppVersionName="1.0.5.03" +CompiledLibraries="png lzo2" +CustomBuildScript=y +AppCflags='' +AppLdflags='' +AppSubdirsBuild='' +AppUseCrystaXToolchain=y +AppCmdline='openttd -d 3 -b 8bpp-simple' +ReadmeText='^You may press "Home" now - the data will be downloaded in background' diff --git a/project/jni/application/openttd-lowmem/AndroidBuild.sh b/project/jni/application/openttd-lowmem/AndroidBuild.sh new file mode 100755 index 000000000..1db6c79e0 --- /dev/null +++ b/project/jni/application/openttd-lowmem/AndroidBuild.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +LOCAL_PATH=`dirname $0` +LOCAL_PATH=`cd $LOCAL_PATH && pwd` + + +# Uncomment if your configure expects SDL libraries in form "libSDL_name.so" +#ln -sf libtremor.a $LOCAL_PATH/../../../obj/local/armeabi/libvorbisidec.a +#ln -sf libflac.a $LOCAL_PATH/../../../obj/local/armeabi/libFLAC.a + +# OpenTTD build system is uglier than war. + +if [ \! -f openttd/objs/lang/english.lng ] ; then + sh -c "cd openttd && ./configure --without-freetype --without-png --without-zlib --without-lzo2 --endian=LE && make lang && make -C objs/release endian_target.h depend" + rm -f openttd/Makefile +fi + +if [ \! -f openttd/Makefile ] ; then + ../setEnvironment.sh sh -c "cd openttd && ./configure --host=arm-eabi --with-sdl --without-freetype --with-png --with-zlib --with-lzo2=$LOCAL_PATH/../../../obj/local/armeabi/liblzo2.so --prefix-dir='.' --data-dir='' --without-allegro --without-fontconfig --endian=LE" +fi +../setEnvironment.sh sh -c "cd openttd && make -j1 VERBOSE=1 LIBS='-lsdl-1.2 -llzo2 -lpng -lgcc -lz -lc -lstdc++'" && cp -f openttd/objs/release/openttd libapplication.so diff --git a/project/jni/application/openttd-lowmem/icon.png b/project/jni/application/openttd-lowmem/icon.png new file mode 100644 index 000000000..607f06043 Binary files /dev/null and b/project/jni/application/openttd-lowmem/icon.png differ diff --git a/project/jni/application/openttd-lowmem/openttd b/project/jni/application/openttd-lowmem/openttd new file mode 120000 index 000000000..2d882c54a --- /dev/null +++ b/project/jni/application/openttd-lowmem/openttd @@ -0,0 +1 @@ +../../../../../openttd-1.0.5-lowmem \ No newline at end of file diff --git a/project/jni/application/openttd-lowmem/readme.txt b/project/jni/application/openttd-lowmem/readme.txt new file mode 100644 index 000000000..7c2db7865 --- /dev/null +++ b/project/jni/application/openttd-lowmem/readme.txt @@ -0,0 +1 @@ +The same as "openttd" package, but with sound and music disabled to save some RAM. diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index 279512ea0..1ed5754aa 100644 --- a/project/jni/application/openttd/AndroidAppSettings.cfg +++ b/project/jni/application/openttd/AndroidAppSettings.cfg @@ -5,7 +5,7 @@ AppName="OpenTTD" AppFullName=org.openttd.sdl ScreenOrientation=h InhibitSuspend=n -AppDataDownloadUrl="Data files - 20 Mb|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-3.zip/download^Localization files and fonts (7 MB)|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-lang-3.zip/download^MIDI music support (18 Mb)|http://sourceforge.net/projects/libsdl-android/files/timidity.zip/download" +AppDataDownloadUrl="Data files - 20 Mb|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-4.zip/download^Localization files and fonts (7 MB)|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-lang-4.zip/download^MIDI music support (18 Mb)|http://sourceforge.net/projects/libsdl-android/files/timidity.zip/download^Big GUI add-on - enable it in NewGRF Settings|:data/opengfx+biggui.grf:http://www.tt-forums.net/download/file.php?id=135095" SdlVideoResize=y SdlVideoResizeKeepAspect=n NeedDepthBuffer=n @@ -21,8 +21,8 @@ RedefinedKeys="LALT RETURN KP_PLUS KP_MINUS DELETE" AppTouchscreenKeyboardKeysAmount=0 AppTouchscreenKeyboardKeysAmountAutoFire=0 MultiABI=n -AppVersionCode=10502 -AppVersionName="1.0.4.02" +AppVersionCode=10503 +AppVersionName="1.0.5.03" CompiledLibraries="jpeg png freetype timidity lzma lzo2" CustomBuildScript=y AppCflags='' diff --git a/project/jni/application/openttd/AndroidBuild.sh b/project/jni/application/openttd/AndroidBuild.sh index 39352727a..5bf2857c5 100755 --- a/project/jni/application/openttd/AndroidBuild.sh +++ b/project/jni/application/openttd/AndroidBuild.sh @@ -11,11 +11,11 @@ LOCAL_PATH=`cd $LOCAL_PATH && pwd` # OpenTTD build system is uglier than war. if [ \! -f openttd/objs/lang/english.lng ] ; then - sh -c "cd openttd && ./configure --without-freetype --without-png --without-zlib --without-lzo2 --without-lzma --endian=LE && make lang && make -C objs/release endian_target.h depend" + sh -c "cd openttd && ./configure --without-freetype --without-png --without-zlib --without-lzo2 --endian=LE && make lang && make -C objs/release endian_target.h depend" rm -f openttd/Makefile fi if [ \! -f openttd/Makefile ] ; then - ../setEnvironment.sh sh -c "cd openttd && ./configure --host=arm-eabi --with-sdl --with-freetype=sdl-config --with-png --with-zlib --with-libtimidity=$LOCAL_PATH/../../../obj/local/armeabi/libtimidity.so --with-lzo2=$LOCAL_PATH/../../../obj/local/armeabi/liblzo2.so --prefix-dir='.' --data-dir='' --without-allegro --without-fontconfig --endian=LE --with-lzma=sdl-config" + ../setEnvironment.sh sh -c "cd openttd && ./configure --host=arm-eabi --with-sdl --with-freetype=sdl-config --with-png --with-zlib --with-libtimidity=$LOCAL_PATH/../../../obj/local/armeabi/libtimidity.so --with-lzo2=$LOCAL_PATH/../../../obj/local/armeabi/liblzo2.so --prefix-dir='.' --data-dir='' --without-allegro --without-fontconfig --endian=LE" fi ../setEnvironment.sh sh -c "cd openttd && make -j1 VERBOSE=1 LIBS='-lsdl-1.2 -llzo2 -lpng -ltimidity -lfreetype -lgcc -lz -lc -lstdc++'" && cp -f openttd/objs/release/openttd libapplication.so diff --git a/project/jni/application/openttd/openttd-trunk-android.patch b/project/jni/application/openttd/openttd-trunk-android.patch index d1e19ffb9..273f493b1 100644 --- a/project/jni/application/openttd/openttd-trunk-android.patch +++ b/project/jni/application/openttd/openttd-trunk-android.patch @@ -13,7 +13,7 @@ Index: src/sound/sdl_s.cpp static void CDECL fill_sound_buffer(void *userdata, Uint8 *stream, int len) { MxMixSamples(stream, len / 4); -+#ifdef ANDROID ++#if defined(ANDROID) && defined(LIBTIMIDITY) + Android_MidiMixMusic((Sint16 *)stream, len / 2); +#endif } diff --git a/project/jni/application/src b/project/jni/application/src index 59d41f41e..1a282e5b1 120000 --- a/project/jni/application/src +++ b/project/jni/application/src @@ -1 +1 @@ -fheroes2 \ No newline at end of file +openttd-lowmem \ No newline at end of file