Added openttd project files
This commit is contained in:
33
project/jni/application/openttd/AndroidAppSettings.cfg
Normal file
33
project/jni/application/openttd/AndroidAppSettings.cfg
Normal file
@@ -0,0 +1,33 @@
|
||||
# The application settings for Android libSDL port
|
||||
AppSettingVersion=15
|
||||
LibSdlVersion=1.2
|
||||
AppName="OpenTTD"
|
||||
AppFullName=org.openttd.sdl
|
||||
ScreenOrientation=h
|
||||
InhibitSuspend=n
|
||||
AppDataDownloadUrl="Data files size is 19 Mb|https://sites.google.com/site/andgamdev/openttd-1.0.4-data.zip?attredirects=0&d=1/download^OpenTTD fonts 4MB|https://sites.google.com/site/andgamdev/openttd-1.0.4-fonts-data.zip?attredirects=0&d=1^MIDI music support (18 Mb)|http://sourceforge.net/projects/libsdl-android/files/timidity.zip/download"
|
||||
SdlVideoResize=y
|
||||
SdlVideoResizeKeepAspect=n
|
||||
NeedDepthBuffer=n
|
||||
AppUsesMouse=y
|
||||
AppNeedsTwoButtonMouse=n
|
||||
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=10501
|
||||
AppVersionName="1.0.5.01"
|
||||
CompiledLibraries="jpeg png freetype timidity lzma lzo2"
|
||||
CustomBuildScript=y
|
||||
AppCflags=''
|
||||
AppLdflags=''
|
||||
AppSubdirsBuild=''
|
||||
AppUseCrystaXToolchain=y
|
||||
AppCmdline=''
|
||||
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
|
||||
19
project/jni/application/openttd/AndroidBuild.sh
Executable file
19
project/jni/application/openttd/AndroidBuild.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/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
|
||||
|
||||
if [ \! -f openttd/objs/lang/english.lng ] ; then
|
||||
sh -c "cd openttd && ./configure --without-freetype --without-png --without-zlib --without-lzma --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-lzma=sdl-config --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
|
||||
BIN
project/jni/application/openttd/icon.png
Normal file
BIN
project/jni/application/openttd/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
project/jni/application/openttd/libapplication.so
Executable file
BIN
project/jni/application/openttd/libapplication.so
Executable file
Binary file not shown.
1
project/jni/application/openttd/openttd
Symbolic link
1
project/jni/application/openttd/openttd
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../../openttd/
|
||||
33
project/jni/application/openttd/openttd-1.0.4-android.patch
Normal file
33
project/jni/application/openttd/openttd-1.0.4-android.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
diff -ru orig/openttd-1.0.4/src/network/core/os_abstraction.h openttd-1.0.4/src/network/core/os_abstraction.h
|
||||
--- orig/openttd-1.0.4/src/network/core/os_abstraction.h 2010-05-18 17:49:59.000000000 -0400
|
||||
+++ openttd-1.0.4/src/network/core/os_abstraction.h 2010-11-13 16:35:45.000000000 -0500
|
||||
@@ -159,7 +159,7 @@
|
||||
# include <net/if.h>
|
||||
/* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */
|
||||
# if !defined(__sgi__) && !defined(SUNOS) && !defined(__MORPHOS__) && !defined(__BEOS__) && !defined(__HAIKU__) && !defined(__INNOTEK_LIBC__) \
|
||||
- && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX)
|
||||
+ && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX) && !defined(ANDROID)
|
||||
/* If for any reason ifaddrs.h does not exist on your system, comment out
|
||||
* the following two lines and an alternative way will be used to fetch
|
||||
* the list of IPs from the system. */
|
||||
diff -ru orig/openttd-1.0.4/src/os/unix/unix.cpp openttd-1.0.4/src/os/unix/unix.cpp
|
||||
--- orig/openttd-1.0.4/src/os/unix/unix.cpp 2010-05-18 17:44:47.000000000 -0400
|
||||
+++ openttd-1.0.4/src/os/unix/unix.cpp 2010-11-13 18:06:14.000000000 -0500
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifdef __APPLE__
|
||||
#include <sys/mount.h>
|
||||
#elif (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) || defined(__GLIBC__)
|
||||
- #define HAS_STATVFS
|
||||
+// #define HAS_STATVFS
|
||||
#endif
|
||||
|
||||
#ifdef HAS_STATVFS
|
||||
@@ -239,6 +239,8 @@
|
||||
void cocoaReleaseAutoreleasePool();
|
||||
#endif
|
||||
|
||||
+#include <SDL.h>
|
||||
+extern "C" int CDECL main(int, char *[]);
|
||||
int CDECL main(int argc, char *argv[])
|
||||
{
|
||||
int ret;
|
||||
38
project/jni/application/openttd/openttd-trunk-android.patch
Normal file
38
project/jni/application/openttd/openttd-trunk-android.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
Index: src/os/unix/unix.cpp
|
||||
===================================================================
|
||||
--- src/os/unix/unix.cpp (revision 21200)
|
||||
+++ src/os/unix/unix.cpp (working copy)
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <sys/mount.h>
|
||||
-#elif (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) || defined(__GLIBC__)
|
||||
+#elif ((defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) || defined(__GLIBC__)) && !defined(ANDROID)
|
||||
#define HAS_STATVFS
|
||||
#endif
|
||||
|
||||
@@ -245,6 +245,11 @@
|
||||
void cocoaReleaseAutoreleasePool();
|
||||
#endif
|
||||
|
||||
+#ifdef ANDROID
|
||||
+#define main SDL_main
|
||||
+extern "C" int CDECL main(int, char *[]);
|
||||
+#endif
|
||||
+
|
||||
int CDECL main(int argc, char *argv[])
|
||||
{
|
||||
int ret;
|
||||
Index: src/network/core/os_abstraction.h
|
||||
===================================================================
|
||||
--- src/network/core/os_abstraction.h (revision 21200)
|
||||
+++ src/network/core/os_abstraction.h (working copy)
|
||||
@@ -161,7 +161,7 @@
|
||||
# include <net/if.h>
|
||||
/* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */
|
||||
# if !defined(__sgi__) && !defined(SUNOS) && !defined(__MORPHOS__) && !defined(__BEOS__) && !defined(__HAIKU__) && !defined(__INNOTEK_LIBC__) \
|
||||
- && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX)
|
||||
+ && !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX) && !defined(ANDROID)
|
||||
/* If for any reason ifaddrs.h does not exist on your system, comment out
|
||||
* the following two lines and an alternative way will be used to fetch
|
||||
* the list of IPs from the system. */
|
||||
Reference in New Issue
Block a user