Merge branch 'sdl_android' of github.com:pelya/commandergenius into android

This commit is contained in:
pelya
2012-09-12 13:34:14 +03:00
7 changed files with 25 additions and 15 deletions

View File

@@ -42,8 +42,7 @@ if uname -s | grep -i "windows" > /dev/null ; then
fi
rm -r -f project/bin/* # New Android SDK introduced some lame-ass optimizations to the build system which we should take care about
cd project && env PATH=$NDKBUILDPATH nice -n19 ndk-build V=1 -j$NCPU && \
cd project && env PATH=$NDKBUILDPATH nice -n19 ndk-build -j$NCPU && \
{ grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \
[ -`which ndk-build | xargs readlink -f | grep '/android-ndk-r[56789]'` != - ] && \
echo Stripping libapplication.so by hand \

View File

@@ -330,7 +330,7 @@ class Settings
Globals.DownloadToSdcard = false;
}
Globals.DataDir = Globals.DownloadToSdcard ?
SdcardAppPath.get().path(p) :
SdcardAppPath.getPath(p) :
p.getFilesDir().getAbsolutePath();
if( Globals.DownloadToSdcard )
{
@@ -2537,7 +2537,7 @@ class Settings
abstract static class SdcardAppPath
{
public static SdcardAppPath get()
private static SdcardAppPath get()
{
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.FROYO)
return Froyo.Holder.sInstance;
@@ -2549,6 +2549,13 @@ class Settings
{
return Environment.getExternalStorageDirectory().getAbsolutePath() + "/app-data/" + p.getPackageName();
}
public static String getPath(final Context p)
{
try {
return get().path(p);
} catch(Exception e) { }
return Dummy.Holder.sInstance.path(p);
}
private static class Froyo extends SdcardAppPath
{

View File

@@ -34,8 +34,8 @@ StartupMenuButtonTimeout=3000
HiddenMenuOptions='OptionalDownloadConfig DisplaySizeConfig'
FirstStartMenuOptions=''
MultiABI=n
AppVersionCode=08802
AppVersionName="0.8.8.02"
AppVersionCode=08803
AppVersionName="0.8.8.03"
ResetSdlConfigForThisVersion=n
DeleteFilesOnUpgrade="%"
CompiledLibraries="sdl_mixer sdl_image freetype curl vorbis ogg"

View File

@@ -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-1.2.1.zip^!MIDI music support (18 Mb)|http://sourceforge.net/projects/libsdl-android/files/timidity.zip"
AppDataDownloadUrl="!Data files - 20 Mb|openttd-data-1.2.2.zip|http://sourceforge.net/projects/libsdl-android/files/OpenTTD/openttd-data-1.2.2.zip^!MIDI music support (18 Mb)|timidity.zip|http://sourceforge.net/projects/libsdl-android/files/timidity.zip"
VideoDepthBpp=16
NeedDepthBuffer=n
NeedStencilBuffer=n
@@ -34,10 +34,10 @@ StartupMenuButtonTimeout=3000
HiddenMenuOptions='OptionalDownloadConfig'
FirstStartMenuOptions=''
MultiABI=n
AppVersionCode=12118
AppVersionName="1.2.1.18"
ResetSdlConfigForThisVersion=y
DeleteFilesOnUpgrade="data gm"
AppVersionCode=12219
AppVersionName="1.2.2.19"
ResetSdlConfigForThisVersion=n
DeleteFilesOnUpgrade="%"
CompiledLibraries="jpeg png freetype timidity lzma lzo2"
CustomBuildScript=y
AppCflags=''
@@ -45,3 +45,7 @@ AppLdflags=''
AppSubdirsBuild=''
AppCmdline='openttd'
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
MinimumScreenSize=s
AdmobPublisherId=n
AdmobTestDeviceId=
AdmobBannerSize=

View File

@@ -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 --endian=LE && make lang && make -C objs/release endian_target.h depend && make -C objs/setting"
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 && make -C objs/setting"
rm -f openttd/Makefile
fi
if [ \! -f openttd/Makefile ] ; then
../setEnvironment.sh sh -c "cd openttd && ./configure --host=arm-linux-androideabi --with-sdl --with-freetype=sdl-config --with-png --with-zlib --without-icu --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"
../setEnvironment.sh sh -c "cd openttd && ./configure --host=arm-linux-androideabi --with-sdl --with-freetype=sdl-config --with-png --with-zlib --without-icu --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 --with-lzma --endian=LE || echo 'Run: sudo apt-get install liblzma-dev - it is needed only for configure script'"
fi
../setEnvironment.sh sh -c "cd openttd && make -j4 VERBOSE=1 STRIP='' LIBS='-lsdl-1.2 -llzo2 -lpng -ltimidity -lfreetype -lgcc -lz -lc -lgnustl_static -lsupc++'" && cp -f openttd/objs/release/openttd libapplication.so

View File

@@ -1 +1 @@
../../../../../openttd-1.2.1
../../../../../openttd-1.2.2