OpenTTD JGR: updated build files

This commit is contained in:
Sergii Pylypenko
2019-09-03 21:20:27 +03:00
parent 8cc60c9d4b
commit f2074457a4
8 changed files with 65 additions and 47 deletions

View File

@@ -7,10 +7,10 @@ AppName="OpenTTD JGR"
AppFullName=org.openttd.jgrpp AppFullName=org.openttd.jgrpp
# Application version code (integer) # Application version code (integer)
AppVersionCode=025281 AppVersionCode=031500
# Application user-visible version name (string) # Application user-visible version name (string)
AppVersionName="0.25.2.81" AppVersionName="0.31.5"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...' # 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, '!!' will also hide the entry from the menu, so it cannot be disabled # If you'll start Description with '!' symbol it will be enabled by default, '!!' will also hide the entry from the menu, so it cannot be disabled
@@ -20,7 +20,7 @@ AppVersionName="0.25.2.81"
# You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version for obb file # You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version for obb file
# You can use .zip.xz archives for better compression, but you need to add 'lzma' to CompiledLibraries # You can use .zip.xz archives for better compression, but you need to add 'lzma' to CompiledLibraries
# Generate .zip.xz files like this: zip -0 -r data.zip your-data/* ; xz -8 data.zip # Generate .zip.xz files like this: zip -0 -r data.zip your-data/* ; xz -8 data.zip
AppDataDownloadUrl="!!Data files - 20 Mb|openttd-data-0.25.2-0.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|icudt59l.zip.xz|http://sourceforge.net/projects/libsdl-android/files/icudt59l.zip.xz" AppDataDownloadUrl="!!Data files|openttd-data-0.31.5-0.zip.xz^!!MIDI music support|GeneralUser-GS-v1.471.sf2.zip.xz^!!Internationalization files|icudt62l.zip.xz"
# Reset SDL config when updating application to the new version (y) / (n) # Reset SDL config when updating application to the new version (y) / (n)
ResetSdlConfigForThisVersion=y ResetSdlConfigForThisVersion=y
@@ -40,7 +40,7 @@ ScreenOrientation=h
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only # 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) # with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
VideoDepthBpp=16 VideoDepthBpp=24
# Enable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n) # Enable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n)
NeedDepthBuffer=n NeedDepthBuffer=n
@@ -269,12 +269,13 @@ APP_PLATFORM=
# Specify architectures to compile, 'all' or 'y' to compile for all architectures. # Specify architectures to compile, 'all' or 'y' to compile for all architectures.
# Available architectures: armeabi-v7a arm64-v8a x86 x86_64 # Available architectures: armeabi-v7a arm64-v8a x86 x86_64
MultiABI='arm64-v8a armeabi-v7a x86 x86_64' MultiABI='arm64-v8a'
#MultiABI='arm64-v8a armeabi-v7a x86 x86_64'
# Optional shared libraries to compile - removing some of them will save space # Optional shared libraries to compile - removing some of them will save space
# MP3 patents are expired, but libmad license is GPL, not LGPL # MP3 patents are expired, but libmad license is GPL, not LGPL
# 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 # 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="c++_shared jpeg png freetype timidity expat fontconfig lzma lzo2 icui18n iculx icu-le-hb harfbuzz icudata icuuc" CompiledLibraries="c++_shared jpeg png freetype fluidsynth expat fontconfig lzma lzo2 icui18n iculx icu-le-hb harfbuzz icudata icuuc"
# Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n) # Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n)
CustomBuildScript=y CustomBuildScript=y
@@ -298,7 +299,7 @@ AppSubdirsBuild=''
AppBuildExclude='' AppBuildExclude=''
# Application command line parameters, including app name as 0-th param # Application command line parameters, including app name as 0-th param
AppCmdline='openttd -d 0 -b 16bpp-simple' AppCmdline='openttd -d 1'
# Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens # 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 # Minimum screen size that application supports: (s)mall / (m)edium / (l)arge
@@ -314,7 +315,7 @@ AdmobTestDeviceId=
AdmobBannerSize= AdmobBannerSize=
# Google Play Game Services application ID, required for cloud saves to work # Google Play Game Services application ID, required for cloud saves to work
GooglePlayGameServicesId=942284197278 GooglePlayGameServicesId=
# The app will open files with following extension, file path will be added to commandline params # The app will open files with following extension, file path will be added to commandline params
AppOpenFileExtension='' AppOpenFileExtension=''

View File

@@ -12,19 +12,34 @@ CPU_TYPE=32
[ "$ARCH" = "arm64-v8a" ] && CPU_TYPE=64 [ "$ARCH" = "arm64-v8a" ] && CPU_TYPE=64
[ "$ARCH" = "x86_64" ] && CPU_TYPE=64 [ "$ARCH" = "x86_64" ] && CPU_TYPE=64
[ -e openttd-$VER-$1/objs/lang/english.lng ] || { [ -e openttd-$VER-$1/bin/baseset/orig_extra.grf ] || {
sh -c "cd openttd-$VER-$1 && ../src/configure --without-freetype --without-png --without-zlib --without-lzo2 --without-lzma --cpu-type=$CPU_TYPE && make lang && make -C objs/release endian_target.h depend && make -C objs/setting" || exit 1 mkdir -p openttd-$VER-$1/bin
rm -f openttd-$VER-$1/Makefile cp -a src/bin/baseset openttd-$VER-$1/bin/
} || exit 1 } || exit 1
#[ -e openttd-$VER-$1/objs/lang/english.lng ] || {
# sh -c "cd openttd-$VER-$1 && ../src/configure --without-freetype --without-png --without-zlib \
# --without-lzo2 --without-lzma --cpu-type=$CPU_TYPE && \
# make lang && make -C objs/release endian_target.h depend && make -C objs/setting" || exit 1
# rm -f openttd-$VER-$1/Makefile
#} || exit 1
[ -e openttd-$VER-$1/Makefile ] || { [ -e openttd-$VER-$1/Makefile ] || {
rm -f src/src/rev.cpp rm -f src/src/rev.cpp
env PATH=$LOCAL_PATH/..:$PATH \ env PATH=$LOCAL_PATH/..:$PATH \
env CLANG=1 ../setEnvironment-$1.sh sh -c "cd openttd-$VER-$1 && env ../src/configure --with-sdl --with-freetype --with-png --with-zlib --with-icu --with-libtimidity='pkg-config libtimidity' --with-lzo2=$LOCAL_PATH/../../../obj/local/$ARCH/liblzo2.so --prefix-dir='.' --data-dir='' --without-allegro --with-fontconfig --with-lzma --cpu-type=$CPU_TYPE" env LDFLAGS=-L$LOCAL_PATH/../../../obj/local/$ARCH \
env CFLAGS_BUILD="-I." \
env CXXFLAGS_BUILD="-I." \
env LDFLAGS_BUILD="-L." \
env ANDROID=1 \
env CLANG=1 ../setEnvironment-$1.sh sh -c "cd openttd-$VER-$1 && env ../src/configure \
--with-sdl --with-freetype --with-png --with-zlib --with-icu --with-fluidsynth \
--with-lzo2=$LOCAL_PATH/../../../obj/local/$ARCH/liblzo2.so --prefix-dir='.' --data-dir='' \
--without-allegro --with-fontconfig --with-lzma --cpu-type=$CPU_TYPE --os=unix --cc-build=gcc --cxx-build=g++ --without-sse"
} || exit 1 } || exit 1
NCPU=4 NCPU=4
uname -s | grep -i "linux" > /dev/null && NCPU=`cat /proc/cpuinfo | grep -c -i processor` uname -s | grep -i "linux" > /dev/null && NCPU=`cat /proc/cpuinfo | grep -c -i processor`
env CLANG=1 ../setEnvironment-$1.sh sh -c "cd openttd-$VER-$1 && make -j$NCPU VERBOSE=1 STRIP='' "' LIBS="-lsdl-1.2 -llzo2 -lpng -ltimidity -lfontconfig -lfreetype -lexpat-sdl -licui18n -liculx -licu-le-hb -lharfbuzz -licuuc -licudata $LDFLAGS"' && cp -f openttd-$VER-$1/objs/release/openttd libapplication-$1.so || exit 1 env CLANG=1 ../setEnvironment-$1.sh sh -c "cd openttd-$VER-$1 && make -j$NCPU VERBOSE=1 STRIP='' " && cp -f openttd-$VER-$1/objs/release/openttd libapplication-$1.so || exit 1

View File

@@ -1,5 +1,4 @@
[misc] [misc]
resolution = 854,480
small_font = fonts/Roboto-Bold.ttf small_font = fonts/Roboto-Bold.ttf
medium_font = fonts/Roboto-Bold.ttf medium_font = fonts/Roboto-Bold.ttf
large_font = fonts/DroidSerif-Bold.ttf large_font = fonts/DroidSerif-Bold.ttf
@@ -12,14 +11,6 @@ small_aa = true
medium_aa = true medium_aa = true
large_aa = true large_aa = true
mono_aa = true mono_aa = true
min_button_size = 48
min_step_size = 48
[gui] [gui]
left_mouse_btn_scrolling = true
osk_activation = disabled osk_activation = disabled
auto_scrolling = 0
reverse_scroll = true
windows_titlebars = false
windows_decorations = true
compact_vertical_toolbar = true

View File

@@ -5,23 +5,27 @@ LOCAL_PATH=`cd $LOCAL_PATH && pwd`
mkdir -p openttd-pc openttd-pc/baseset mkdir -p openttd-pc openttd-pc/baseset
cd openttd-pc cd openttd-pc
ln -s ../src/src .
[ -e bin/baseset ] || cp -a ../src/bin ./ [ -e bin/baseset ] || cp -a ../src/bin ./
[ -e bin/fonts ] || cp -a ../data/fonts bin/ [ -e bin/fonts ] || cp -a ../data/fonts bin/
mkdir -p src
ln -sf ../../src/src/stdafx.h src/
export CFLAGS=-O0 export CFLAGS=-O0
export CXXFLAGS=-O0 export CXXFLAGS=-O0
[ -e Makefile ] || ../src/configure --enable-debug || exit 1 [ -e Makefile ] || ../src/configure --enable-debug --with-fluidsynth || exit 1
make -j8 VERBOSE=1 || exit 1 make -j8 VERBOSE=1 || exit 1
cd bin cd bin
export LD_LIBRARY_PATH=/usr/local/lib export LD_LIBRARY_PATH=/usr/local/lib
if [ -z "$1" ]; then if [ -z "$1" ]; then
./openttd -d 2 -r 854x480 -g opntitle.sav ./openttd -d 0 -m null -g opntitle.sav
elif [ -n "$2" ]; then
valgrind --track-fds=yes --log-file=../../valgrind.log --leak-check=full \
./openttd -d 0 -m null # -g opntitle.sav
else else
#valgrind --track-fds=yes --log-file=valgrind.log --leak-check=full \ #valgrind --track-fds=yes --log-file=valgrind.log --leak-check=full \
gdb -ex run --args \ gdb -ex run --args \
./openttd -d 2 -r 854x480 -g opntitle.sav ./openttd -d 0 -m null -g opntitle.sav
fi fi

View File

@@ -1,20 +1,27 @@
diff --git a/project/java/Settings.java b/project/java/Settings.java diff --git a/project/java/Settings.java b/project/java/Settings.java
index 9e6150a41..77e84dce4 100644 index 4467879a0..1de0689c2 100644
--- a/project/java/Settings.java --- a/project/java/Settings.java
+++ b/project/java/Settings.java +++ b/project/java/Settings.java
@@ -521,6 +521,15 @@ public class Settings @@ -532,6 +532,9 @@ public class Settings
for( String sdpath: SdcardAppPath.get().allPaths(p) ) } catch ( IOException e ) { }
deleteRecursivelyAndLog(new File(sdpath + "/" + path )); new File( p.getFilesDir() + "/" + SettingsFileName ).delete();
}
+ // Hack to save old config file, which is gettign corrupted on app update + // Kill it with vengeance and unload all shared libraries
+ try { + android.os.Process.killProcess(android.os.Process.myPid());
+ String cmd = "cp " + Globals.DataDir + "/.openttd/openttd.cfg " + Globals.DataDir + "/.openttd/openttd-backup.cfg"; +
+ Log.i("SDL", "==============="); Intent intent = new Intent(p, RestartMainActivity.class);
+ Log.i("SDL", cmd); p.startActivity(intent);
+ int ret = Runtime.getRuntime().exec(cmd).waitFor(); System.exit(0);
+ Log.i("SDL", "Status: " + String.valueOf(ret)); diff --git a/project/java/Globals.java b/project/java/Globals.java
+ Log.i("SDL", "==============="); index 8c7017d8a..9ba3a16f7 100644
+ } catch (Exception e) { } --- a/project/java/Globals.java
} +++ b/project/java/Globals.java
public static void DeleteSdlConfigOnUpgradeAndRestart(final MainActivity p) @@ -119,7 +119,7 @@ class Globals
{ public static int MoveMouseWithGyroscopeSpeed = 2;
public static boolean ClickMouseWithDpad = false;
public static boolean RelativeMouseMovement = ForceRelativeMouseMode; // Laptop touchpad mode
- public static boolean ForceHardwareMouse = false;
+ public static boolean ForceHardwareMouse = true;
public static int RelativeMouseMovementSpeed = 2;
public static int RelativeMouseMovementAccel = 0;
public static int ShowScreenUnderFinger = Mouse.ZOOM_NONE;

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
VER=0.25.2-0 VER=0.31.5-0
cd data cd data
rm -f ../AndroidData/openttd-data-*.zip.xz ../AndroidData/openttd-data-*.zip rm -f ../AndroidData/openttd-data-*.zip.xz ../AndroidData/openttd-data-*.zip

View File

@@ -1,6 +1,6 @@
Quick compilation guide: Quick compilation guide:
Install liblzma-dev, it's needed for configure script Install liblzma-dev and libfluidsynth-dev, it's needed for broken configure script
sudo apt-get install liblzma-dev sudo apt-get install liblzma-dev libfluidsynth-dev
Download my Git repo from https://github.com/pelya/commandergenius, Download my Git repo from https://github.com/pelya/commandergenius,
then install Android SDK, Android NDK, then launch commands then install Android SDK, Android NDK, then launch commands
git submodule update --init --recursive git submodule update --init --recursive