Updated OpenTTD
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
KEYSTORE=~/.ssh/android.keystore
|
||||
ALIAS=pelya
|
||||
APPS_SKIP="src scummvm"
|
||||
APPS_BUILD="$*"
|
||||
|
||||
mkdir -p apk
|
||||
|
||||
if [ "-$1" = "--a" ] ; then
|
||||
cd apk
|
||||
for F in *.apk; do
|
||||
APPS_SKIP="$APPS_SKIP `echo $F | sed 's/\(.*\)[.]apk/\1/'`"
|
||||
done
|
||||
cd ..
|
||||
fi
|
||||
|
||||
echo -n "Enter password for keystore at $KEYSTORE alias $ALIAS: "
|
||||
stty -echo
|
||||
read PASSWORD
|
||||
stty echo
|
||||
|
||||
echo
|
||||
|
||||
# First edit app settings if their format was changed
|
||||
for APP1 in project/jni/application/*/AndroidAppSettings.cfg; do
|
||||
APP=`echo $APP1 | sed 's@project/jni/application/\([^/]*\)/.*@\1@'`
|
||||
if [ -n "$APPS_BUILD" ] ; then
|
||||
echo "$APPS_BUILD" | grep "$APP" || continue
|
||||
else
|
||||
if echo $APPS_SKIP | grep $APP > /dev/null ; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
rm project/jni/application/src
|
||||
ln -s $APP project/jni/application/src
|
||||
echo
|
||||
echo ===== Settings for $APP =====
|
||||
./ChangeAppSettings.sh -v
|
||||
rm -f apk/$APP.apk
|
||||
done
|
||||
|
||||
for APP1 in project/jni/application/*/AndroidAppSettings.cfg; do
|
||||
APP=`echo $APP1 | sed 's@project/jni/application/\([^/]*\)/.*@\1@'`
|
||||
if [ -n "$APPS_BUILD" ] ; then
|
||||
echo "$APPS_BUILD" | grep "$APP" || continue
|
||||
else
|
||||
if echo $APPS_SKIP | grep $APP > /dev/null ; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
rm -f project/jni/application/src
|
||||
ln -s $APP project/jni/application/src
|
||||
rm -rf project/obj/local/*/libapplication.so project/obj/local/*/objs/application
|
||||
rm -rf project/obj/local/*/libsdl*.so project/obj/local/*/objs/sdl*
|
||||
./ChangeAppSettings.sh -a
|
||||
NDKBUILD=ndk-build
|
||||
if grep "AppUseCrystaXToolchain=y" AndroidAppSettings.cfg > /dev/null ; then
|
||||
NDKBUILD=`which ndk-build | sed 's@/[^/]*/ndk-build@/android-ndk-r4-crystax@'`/ndk-build
|
||||
fi
|
||||
echo Compiling $APP
|
||||
APPVERSION=`grep 'AppVersionCode=' AndroidAppSettings.cfg | sed 's/AppVersionCode=\(.*\)/\1/'`
|
||||
OLDPATH="`pwd`"
|
||||
( cd project && nice -n5 $NDKBUILD -j4 V=1 && ant release && \
|
||||
jarsigner -verbose -keystore "$KEYSTORE" -storepass "$PASSWORD" bin/DemoActivity-unsigned.apk $ALIAS && \
|
||||
zipalign 4 bin/DemoActivity-unsigned.apk ../apk/$APP.apk && \
|
||||
mkdir -p debuginfo/$APP-$APPVERSION && cp -f obj/local/armeabi/libapplication.so obj/local/armeabi/libsdl-*.so debuginfo/$APP-$APPVERSION &&
|
||||
cd .. ) || exit 1
|
||||
done
|
||||
@@ -20,7 +20,7 @@ AppUsesMouse=n
|
||||
AppNeedsTwoButtonMouse=n
|
||||
ShowMouseCursor=n
|
||||
ForceRelativeMouseMode=n
|
||||
AppNeedsArrowKeys=y
|
||||
AppNeedsArrowKeys=n
|
||||
AppNeedsTextInput=y
|
||||
AppUsesJoystick=y
|
||||
AppUsesAccelerometer=y
|
||||
@@ -33,11 +33,11 @@ RedefinedKeysScreenKb="0 1 2 3 4 5 6 7 8 9"
|
||||
StartupMenuButtonTimeout=3000
|
||||
HiddenMenuOptions='OptionalDownloadConfig DisplaySizeConfig'
|
||||
FirstStartMenuOptions=''
|
||||
MultiABI=y
|
||||
AppVersionCode=08803
|
||||
MultiABI=n
|
||||
AppVersionCode=0880301
|
||||
AppVersionName="0.8.8.03"
|
||||
ResetSdlConfigForThisVersion=n
|
||||
DeleteFilesOnUpgrade="%"
|
||||
DeleteFilesOnUpgrade="libsdl-DownloadFinished-1.flag"
|
||||
CompiledLibraries="sdl_mixer sdl_image freetype curl vorbis ogg"
|
||||
CustomBuildScript=y
|
||||
AppCflags='-O2 -finline-functions'
|
||||
|
||||
Binary file not shown.
Submodule project/jni/application/openarena/engine updated: baaf81c36c...eadc21d370
Submodule project/jni/application/openarena/vm updated: 13d35e073a...1efb7db728
@@ -5,7 +5,7 @@ AppName="OpenTTD"
|
||||
AppFullName=org.openttd.sdl
|
||||
ScreenOrientation=h
|
||||
InhibitSuspend=n
|
||||
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"
|
||||
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^!Config file|:.openttd/openttd.cfg:openttd-1.2.2.22.cfg"
|
||||
VideoDepthBpp=16
|
||||
NeedDepthBuffer=n
|
||||
NeedStencilBuffer=n
|
||||
@@ -36,7 +36,7 @@ FirstStartMenuOptions=''
|
||||
MultiABI=n
|
||||
AppVersionCode=12222
|
||||
AppVersionName="1.2.2.22"
|
||||
ResetSdlConfigForThisVersion=n
|
||||
ResetSdlConfigForThisVersion=y
|
||||
DeleteFilesOnUpgrade=".openttd/openttd.cfg"
|
||||
CompiledLibraries="jpeg png freetype timidity lzma lzo2"
|
||||
CustomBuildScript=y
|
||||
|
||||
@@ -16,6 +16,6 @@ if [ \! -f openttd/objs/lang/english.lng ] ; then
|
||||
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 --with-lzma --endian=LE || echo 'Run: sudo apt-get install liblzma-dev - it is needed only for configure script'"
|
||||
../setEnvironment.sh sh -c "cd openttd && env ./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
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
[misc]
|
||||
resolution = 800,480
|
||||
small_font = fonts/FreeSans.ttf
|
||||
medium_font = fonts/FreeSerif.ttf
|
||||
large_font = fonts/FreeSerif.ttf
|
||||
mono_font = fonts/FreeMono.ttf
|
||||
small_size = 10
|
||||
medium_size = 12
|
||||
large_size = 16
|
||||
mono_size = 12
|
||||
small_aa = true
|
||||
medium_aa = true
|
||||
large_aa = true
|
||||
mono_aa = true
|
||||
last_newgrf_count = 1
|
||||
|
||||
[newgrf]
|
||||
opengfx+biggui.grf =
|
||||
|
||||
[gui]
|
||||
left_mouse_btn_scrolling = true
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
Index: src/os/unix/unix.cpp
|
||||
===================================================================
|
||||
--- src/os/unix/unix.cpp (revision 24501)
|
||||
--- src/os/unix/unix.cpp (revision 24562)
|
||||
+++ src/os/unix/unix.cpp (working copy)
|
||||
@@ -25,7 +25,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)
|
||||
+#elif ((defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) || defined(__GLIBC__)) && !defined(__ANDROID__)
|
||||
#define HAS_STATVFS
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,7 @@ Index: src/os/unix/unix.cpp
|
||||
void cocoaReleaseAutoreleasePool();
|
||||
#endif
|
||||
|
||||
+#ifdef ANDROID
|
||||
+#ifdef __ANDROID__
|
||||
+#define main SDL_main
|
||||
+extern "C" int CDECL main(int, char *[]);
|
||||
+#endif
|
||||
@@ -25,13 +25,13 @@ Index: src/os/unix/unix.cpp
|
||||
int ret;
|
||||
Index: src/os/unix/crashlog_unix.cpp
|
||||
===================================================================
|
||||
--- src/os/unix/crashlog_unix.cpp (revision 24501)
|
||||
--- src/os/unix/crashlog_unix.cpp (revision 24562)
|
||||
+++ src/os/unix/crashlog_unix.cpp (working copy)
|
||||
@@ -141,7 +141,11 @@
|
||||
};
|
||||
|
||||
/** The signals we want our crash handler to handle. */
|
||||
+#ifdef ANDROID
|
||||
+#ifdef __ANDROID__
|
||||
+static const int _signals_to_handle[] = { }; // Default Android signal handler will give us stack trace
|
||||
+#else
|
||||
static const int _signals_to_handle[] = { SIGSEGV, SIGABRT, SIGFPE, SIGBUS, SIGILL };
|
||||
@@ -39,80 +39,57 @@ Index: src/os/unix/crashlog_unix.cpp
|
||||
|
||||
/**
|
||||
* Entry point for the crash handler.
|
||||
Index: src/openttd.cpp
|
||||
Index: src/osk_gui.cpp
|
||||
===================================================================
|
||||
--- src/openttd.cpp (revision 24501)
|
||||
+++ src/openttd.cpp (working copy)
|
||||
@@ -695,7 +695,6 @@
|
||||
LoadFromConfig(true);
|
||||
--- src/osk_gui.cpp (revision 24562)
|
||||
+++ src/osk_gui.cpp (working copy)
|
||||
@@ -21,6 +21,9 @@
|
||||
|
||||
if (resolution.width != 0) _cur_resolution = resolution;
|
||||
-
|
||||
/*
|
||||
* The width and height must be at least 1 pixel and width times
|
||||
* height times bytes per pixel must still fit within a 32 bits
|
||||
Index: src/script/api/script_date.cpp
|
||||
===================================================================
|
||||
--- src/script/api/script_date.cpp (revision 24501)
|
||||
+++ src/script/api/script_date.cpp (working copy)
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/** @file script_date.cpp Implementation of ScriptDate. */
|
||||
|
||||
+#include "../../stdafx.h"
|
||||
#include <time.h>
|
||||
-#include "../../stdafx.h"
|
||||
#include "script_date.hpp"
|
||||
#include "../../date_func.h"
|
||||
|
||||
Index: src/debug.cpp
|
||||
===================================================================
|
||||
--- src/debug.cpp (revision 24501)
|
||||
+++ src/debug.cpp (working copy)
|
||||
@@ -16,6 +16,9 @@
|
||||
#include "string_func.h"
|
||||
#include "fileio_func.h"
|
||||
#include "settings_type.h"
|
||||
+#ifdef ANDROID
|
||||
+#include <android/log.h>
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
+#ifdef __ANDROID__
|
||||
+#include <SDL_screenkeyboard.h>
|
||||
+#endif
|
||||
|
||||
#include <time.h>
|
||||
char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1];
|
||||
static WChar _keyboard[2][OSK_KEYBOARD_ENTRIES];
|
||||
@@ -439,6 +442,14 @@
|
||||
|
||||
@@ -82,6 +85,9 @@
|
||||
*/
|
||||
static void debug_print(const char *dbg, const char *buf)
|
||||
{
|
||||
+#ifdef ANDROID
|
||||
+ __android_log_print(ANDROID_LOG_INFO, "OpenTTD", "[%s] %s", dbg, buf);
|
||||
+#endif
|
||||
#if defined(ENABLE_NETWORK)
|
||||
if (_debug_socket != INVALID_SOCKET) {
|
||||
char buf2[1024 + 32];
|
||||
Index: src/window.cpp
|
||||
===================================================================
|
||||
--- src/window.cpp (revision 24501)
|
||||
+++ src/window.cpp (working copy)
|
||||
@@ -2354,6 +2354,10 @@
|
||||
* But there is no company related window open anyway, so _current_company is not used. */
|
||||
assert(HasModalProgress() || IsLocalCompany());
|
||||
|
||||
+#ifdef ANDROID
|
||||
+ _settings_client.gui.left_mouse_btn_scrolling = true;
|
||||
+#endif
|
||||
GetKeyboardLayout();
|
||||
new OskWindow(&_osk_desc, parent, button, cancel, ok);
|
||||
+#ifdef __ANDROID__
|
||||
+ SDL_ANDROID_GetScreenKeyboardTextInput(parent->text.buf, parent->text.max_bytes); /* Invoke Android built-in screen keyboard */
|
||||
+ OskWindow *osk = dynamic_cast<OskWindow *>(FindWindowById(WC_OSK, 0));
|
||||
+ free(osk->orig_str_buf);
|
||||
+ osk->orig_str_buf = strdup(osk->qs->text.buf);
|
||||
+
|
||||
HandlePlacePresize();
|
||||
UpdateTileSelection();
|
||||
+ osk->SetDirty();
|
||||
+#endif
|
||||
}
|
||||
|
||||
/**
|
||||
Index: src/network/core/os_abstraction.h
|
||||
===================================================================
|
||||
--- src/network/core/os_abstraction.h (revision 24562)
|
||||
+++ 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. */
|
||||
Index: src/video/sdl_v.cpp
|
||||
===================================================================
|
||||
--- src/video/sdl_v.cpp (revision 24501)
|
||||
--- src/video/sdl_v.cpp (revision 24562)
|
||||
+++ src/video/sdl_v.cpp (working copy)
|
||||
@@ -25,6 +25,9 @@
|
||||
#include "../fileio_func.h"
|
||||
#include "sdl_v.h"
|
||||
#include <SDL.h>
|
||||
+#ifdef ANDROID
|
||||
+#ifdef __ANDROID__
|
||||
+#include <SDL_screenkeyboard.h>
|
||||
+#endif
|
||||
|
||||
@@ -123,7 +100,7 @@ Index: src/video/sdl_v.cpp
|
||||
}
|
||||
}
|
||||
-
|
||||
+#ifdef ANDROID
|
||||
+#ifdef __ANDROID__
|
||||
+ SDL_Rect r;
|
||||
+ r.h = SDL_ListModes(NULL, 0)[0]->h / 10;
|
||||
+ r.w = r.h;
|
||||
@@ -177,28 +154,7 @@ Index: src/video/sdl_v.cpp
|
||||
case SDL_VIDEOEXPOSE: {
|
||||
/* Force a redraw of the entire screen. Note
|
||||
* that SDL 1.2 seems to do this automatically
|
||||
@@ -506,6 +519,20 @@
|
||||
if (s != NULL) return s;
|
||||
|
||||
GetVideoModes();
|
||||
+
|
||||
+#ifdef __ANDROID__
|
||||
+ // The GUI is way too small for HDPI devices, so we'll leave the default 640x80 here
|
||||
+ /*
|
||||
+ FILE * config_exists = fopen(".openttd/openttd.cfg", "r");
|
||||
+ if( config_exists )
|
||||
+ fclose(config_exists);
|
||||
+ else {
|
||||
+ _cur_resolution.width = SDL_GetVideoInfo()->current_w;
|
||||
+ _cur_resolution.height = SDL_GetVideoInfo()->current_h;
|
||||
+ }
|
||||
+ */
|
||||
+#endif
|
||||
+
|
||||
if (!CreateMainSurface(_cur_resolution.width, _cur_resolution.height)) {
|
||||
return SDL_CALL SDL_GetError();
|
||||
}
|
||||
@@ -519,6 +546,9 @@
|
||||
@@ -519,6 +532,9 @@
|
||||
SDL_CALL SDL_EnableUNICODE(1);
|
||||
|
||||
_draw_threaded = GetDriverParam(parm, "no_threads") == NULL && GetDriverParam(parm, "no_thread") == NULL;
|
||||
@@ -210,13 +166,13 @@ Index: src/video/sdl_v.cpp
|
||||
}
|
||||
Index: src/sound/sdl_s.cpp
|
||||
===================================================================
|
||||
--- src/sound/sdl_s.cpp (revision 24501)
|
||||
--- src/sound/sdl_s.cpp (revision 24562)
|
||||
+++ src/sound/sdl_s.cpp (working copy)
|
||||
@@ -21,6 +21,10 @@
|
||||
/** Factory for the SDL sound driver. */
|
||||
static FSoundDriver_SDL iFSoundDriver_SDL;
|
||||
|
||||
+#ifdef ANDROID
|
||||
+#ifdef __ANDROID__
|
||||
+extern void Android_MidiMixMusic(Sint16 *stream, int len);
|
||||
+#endif
|
||||
+
|
||||
@@ -227,7 +183,7 @@ Index: src/sound/sdl_s.cpp
|
||||
static void CDECL fill_sound_buffer(void *userdata, Uint8 *stream, int len)
|
||||
{
|
||||
MxMixSamples(stream, len / 4);
|
||||
+#if defined(ANDROID) && defined(LIBTIMIDITY)
|
||||
+#if defined(__ANDROID__) && defined(LIBTIMIDITY)
|
||||
+ Android_MidiMixMusic((Sint16 *)stream, len / 2);
|
||||
+#endif
|
||||
}
|
||||
@@ -235,9 +191,17 @@ Index: src/sound/sdl_s.cpp
|
||||
const char *SoundDriver_SDL::Start(const char * const *parm)
|
||||
Index: src/music/libtimidity.cpp
|
||||
===================================================================
|
||||
--- src/music/libtimidity.cpp (revision 24501)
|
||||
--- src/music/libtimidity.cpp (revision 24562)
|
||||
+++ src/music/libtimidity.cpp (working copy)
|
||||
@@ -22,6 +22,7 @@
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "../openttd.h"
|
||||
#include "../sound_type.h"
|
||||
#include "../debug.h"
|
||||
+#include "../core/math_func.hpp"
|
||||
#include "libtimidity.h"
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
@@ -22,6 +23,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <timidity.h>
|
||||
@@ -245,20 +209,20 @@ Index: src/music/libtimidity.cpp
|
||||
#if defined(PSP)
|
||||
#include <pspaudiolib.h>
|
||||
#endif /* PSP */
|
||||
@@ -51,6 +52,24 @@
|
||||
@@ -51,6 +53,24 @@
|
||||
}
|
||||
}
|
||||
#endif /* PSP */
|
||||
+#ifdef ANDROID
|
||||
+#define MIN(X ,Y) ((X) < (Y) ? (X) : (Y))
|
||||
+#ifdef __ANDROID__
|
||||
+/* Android does not have Midi chip, we have to route the libtimidity output through SDL audio output */
|
||||
+void Android_MidiMixMusic(Sint16 *stream, int len)
|
||||
+{
|
||||
+ if (_midi.status == MIDI_PLAYING) {
|
||||
+ Sint16 buf[16384];
|
||||
+ while( len > 0 )
|
||||
+ {
|
||||
+ int minlen = MIN(sizeof(buf), len);
|
||||
+ mid_song_read_wave(_midi.song, stream, MIN(sizeof(buf), len*2));
|
||||
+ int minlen = min(sizeof(buf), len);
|
||||
+ mid_song_read_wave(_midi.song, stream, min(sizeof(buf), len*2));
|
||||
+ for( Uint16 i = 0; i < minlen; i++ )
|
||||
+ stream[i] += buf[i];
|
||||
+ stream += minlen;
|
||||
@@ -270,151 +234,41 @@ Index: src/music/libtimidity.cpp
|
||||
|
||||
/** Factory for the libtimidity driver. */
|
||||
static FMusicDriver_LibTimidity iFMusicDriver_LibTimidity;
|
||||
Index: src/table/misc_settings.ini
|
||||
Index: src/script/api/script_date.cpp
|
||||
===================================================================
|
||||
--- src/table/misc_settings.ini (revision 24501)
|
||||
+++ src/table/misc_settings.ini (working copy)
|
||||
@@ -104,7 +104,7 @@
|
||||
type = SLE_INT
|
||||
length = 2
|
||||
var = _cur_resolution
|
||||
-def = ""640,480""
|
||||
+def = ""800,480""
|
||||
--- src/script/api/script_date.cpp (revision 24562)
|
||||
+++ src/script/api/script_date.cpp (working copy)
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
[SDTG_STR]
|
||||
name = ""screenshot_format""
|
||||
@@ -128,35 +128,35 @@
|
||||
name = ""small_font""
|
||||
type = SLE_STRB
|
||||
var = _freetype.small_font
|
||||
-def = NULL
|
||||
+def = ""fonts/FreeSans.ttf""
|
||||
/** @file script_date.cpp Implementation of ScriptDate. */
|
||||
|
||||
[SDTG_STR]
|
||||
ifdef = WITH_FREETYPE
|
||||
name = ""medium_font""
|
||||
type = SLE_STRB
|
||||
var = _freetype.medium_font
|
||||
-def = NULL
|
||||
+def = ""fonts/FreeSerif.ttf""
|
||||
+#include "../../stdafx.h" /* Have to be included before time.h, if we want UINT32_MAX macro defined on Android */
|
||||
#include <time.h>
|
||||
-#include "../../stdafx.h"
|
||||
#include "script_date.hpp"
|
||||
#include "../../date_func.h"
|
||||
|
||||
[SDTG_STR]
|
||||
ifdef = WITH_FREETYPE
|
||||
name = ""large_font""
|
||||
type = SLE_STRB
|
||||
var = _freetype.large_font
|
||||
-def = NULL
|
||||
+def = ""fonts/FreeSerif.ttf""
|
||||
|
||||
[SDTG_STR]
|
||||
ifdef = WITH_FREETYPE
|
||||
name = ""mono_font""
|
||||
type = SLE_STRB
|
||||
var = _freetype.mono_font
|
||||
-def = NULL
|
||||
+def = ""fonts/FreeMono.ttf""
|
||||
|
||||
[SDTG_VAR]
|
||||
ifdef = WITH_FREETYPE
|
||||
name = ""small_size""
|
||||
type = SLE_UINT
|
||||
var = _freetype.small_size
|
||||
-def = 8
|
||||
+def = 10
|
||||
min = 0
|
||||
max = 72
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
name = ""medium_size""
|
||||
type = SLE_UINT
|
||||
var = _freetype.medium_size
|
||||
-def = 10
|
||||
+def = 12
|
||||
min = 0
|
||||
max = 72
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
name = ""mono_size""
|
||||
type = SLE_UINT
|
||||
var = _freetype.mono_size
|
||||
-def = 10
|
||||
+def = 12
|
||||
min = 0
|
||||
max = 72
|
||||
|
||||
@@ -191,25 +191,25 @@
|
||||
ifdef = WITH_FREETYPE
|
||||
name = ""small_aa""
|
||||
var = _freetype.small_aa
|
||||
-def = false
|
||||
+def = true
|
||||
|
||||
[SDTG_BOOL]
|
||||
ifdef = WITH_FREETYPE
|
||||
name = ""medium_aa""
|
||||
var = _freetype.medium_aa
|
||||
-def = false
|
||||
+def = true
|
||||
|
||||
[SDTG_BOOL]
|
||||
ifdef = WITH_FREETYPE
|
||||
name = ""large_aa""
|
||||
var = _freetype.large_aa
|
||||
-def = false
|
||||
+def = true
|
||||
|
||||
[SDTG_BOOL]
|
||||
ifdef = WITH_FREETYPE
|
||||
name = ""mono_aa""
|
||||
var = _freetype.mono_aa
|
||||
-def = false
|
||||
+def = true
|
||||
|
||||
[SDTG_VAR]
|
||||
name = ""sprite_cache_size_px""
|
||||
Index: src/settings.cpp
|
||||
Index: src/debug.cpp
|
||||
===================================================================
|
||||
--- src/settings.cpp (revision 24501)
|
||||
+++ src/settings.cpp (working copy)
|
||||
@@ -1632,6 +1632,16 @@
|
||||
if (!minimal) {
|
||||
_grfconfig_newgame = GRFLoadConfig(ini, "newgrf", false);
|
||||
_grfconfig_static = GRFLoadConfig(ini, "newgrf-static", true);
|
||||
--- src/debug.cpp (revision 24562)
|
||||
+++ src/debug.cpp (working copy)
|
||||
@@ -16,6 +16,9 @@
|
||||
#include "string_func.h"
|
||||
#include "fileio_func.h"
|
||||
#include "settings_type.h"
|
||||
+#ifdef __ANDROID__
|
||||
+ FILE * config_exists = fopen(".openttd/openttd.cfg", "r");
|
||||
+ if( config_exists )
|
||||
+ fclose(config_exists);
|
||||
+ else {
|
||||
+ _grfconfig_newgame = new GRFConfig("opengfx+biggui.grf");
|
||||
+ FillGRFDetails(_grfconfig_newgame, false);
|
||||
+ }
|
||||
+#include <android/log.h>
|
||||
+#endif
|
||||
+
|
||||
NewsDisplayLoadConfig(ini, "news_display");
|
||||
AILoadConfig(ini, "ai_players");
|
||||
GameLoadConfig(ini, "game_scripts");
|
||||
Index: src/network/core/os_abstraction.h
|
||||
===================================================================
|
||||
--- src/network/core/os_abstraction.h (revision 24501)
|
||||
+++ 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. */
|
||||
Index: findversion.sh
|
||||
===================================================================
|
||||
--- findversion.sh (revision 24501)
|
||||
+++ findversion.sh (working copy)
|
||||
@@ -134,6 +134,7 @@
|
||||
REV_NR=""
|
||||
fi
|
||||
|
||||
+MODIFIED="0" # This prevents Andorid build from connecting to a public servers
|
||||
if [ "$MODIFIED" -eq "2" ]; then
|
||||
REV="${REV}M"
|
||||
fi
|
||||
#include <time.h>
|
||||
|
||||
@@ -82,6 +85,9 @@
|
||||
*/
|
||||
static void debug_print(const char *dbg, const char *buf)
|
||||
{
|
||||
+#ifdef __ANDROID__
|
||||
+ __android_log_print(ANDROID_LOG_INFO, "OpenTTD", "[%s] %s", dbg, buf);
|
||||
+#endif
|
||||
#if defined(ENABLE_NETWORK)
|
||||
if (_debug_socket != INVALID_SOCKET) {
|
||||
char buf2[1024 + 32];
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
IFS='
|
||||
'
|
||||
|
||||
MYARCH=linux-x86
|
||||
if uname -s | grep -i "linux" > /dev/null ; then
|
||||
MYARCH=linux-x86
|
||||
fi
|
||||
if uname -s | grep -i "darwin" > /dev/null ; then
|
||||
MYARCH=darwin-x86
|
||||
fi
|
||||
if uname -s | grep -i "windows" > /dev/null ; then
|
||||
MYARCH=windows-x86
|
||||
fi
|
||||
|
||||
NDK=`which ndk-build`
|
||||
NDK=`dirname $NDK`
|
||||
NDK=`readlink -f $NDK`
|
||||
|
||||
#echo NDK $NDK
|
||||
GCCPREFIX=arm-linux-androideabi
|
||||
GCCVER=4.6
|
||||
PLATFORMVER=android-8
|
||||
LOCAL_PATH=`dirname $0`
|
||||
LOCAL_PATH=`cd $LOCAL_PATH && pwd`
|
||||
ARCH=armeabi
|
||||
#echo LOCAL_PATH $LOCAL_PATH
|
||||
|
||||
APP_MODULES=`grep 'APP_MODULES [:][=]' $LOCAL_PATH/../Settings.mk | sed 's@.*[=]\(.*\)@\1@'`
|
||||
APP_AVAILABLE_STATIC_LIBS=`grep 'APP_AVAILABLE_STATIC_LIBS [:][=]' $LOCAL_PATH/../Settings.mk | sed 's@.*[=]\(.*\)@\1@'`
|
||||
APP_SHARED_LIBS=$(
|
||||
echo $APP_MODULES | xargs -n 1 echo | while read LIB ; do
|
||||
STATIC=`echo $APP_AVAILABLE_STATIC_LIBS application sdl_main stlport stdout-test | grep "\\\\b$LIB\\\\b"`
|
||||
if [ -n "$STATIC" ] ; then true
|
||||
else
|
||||
echo $LIB
|
||||
fi
|
||||
done
|
||||
)
|
||||
|
||||
|
||||
MISSING_INCLUDE=
|
||||
MISSING_LIB=
|
||||
|
||||
CFLAGS="\
|
||||
-fpic -ffunction-sections -funwind-tables -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi \
|
||||
-march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \
|
||||
-isystem$NDK/platforms/$PLATFORMVER/arch-arm/usr/include -Wa,--noexecstack \
|
||||
-DANDROID \
|
||||
-DNDEBUG -O2 -g \
|
||||
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include \
|
||||
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH/include \
|
||||
-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"
|
||||
|
||||
SHARED="-shared -Wl,-soname,libapplication.so"
|
||||
if [ -n "$BUILD_EXECUTABLE" ]; then
|
||||
SHARED=
|
||||
fi
|
||||
if [ -n "$NO_SHARED_LIBS" ]; then
|
||||
APP_SHARED_LIBS=
|
||||
fi
|
||||
|
||||
|
||||
LDFLAGS="\
|
||||
$SHARED \
|
||||
--sysroot=$NDK/platforms/$PLATFORMVER/arch-arm \
|
||||
`echo $APP_SHARED_LIBS | sed \"s@\([-a-zA-Z0-9_.]\+\)@$LOCAL_PATH/../../obj/local/$ARCH/lib\1.so@g\"` \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libc.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libm.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libGLESv1_CM.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libdl.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/liblog.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libz.so \
|
||||
-L$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH \
|
||||
-lgnustl_static \
|
||||
-L$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib \
|
||||
-L$LOCAL_PATH/../../obj/local/$ARCH -Wl,--no-undefined -Wl,-z,noexecstack \
|
||||
-Wl,-rpath-link=$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib -lsupc++ \
|
||||
$MISSING_LIB $LDFLAGS"
|
||||
|
||||
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
|
||||
|
||||
env PATH=$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
|
||||
CFLAGS="$CFLAGS" \
|
||||
CXXFLAGS="$CXXFLAGS $CFLAGS" \
|
||||
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" \
|
||||
"$@"
|
||||
@@ -1,25 +1,103 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Set here your own NDK path if needed
|
||||
# export PATH=$PATH:~/src/endless_space/android-ndk-r4b
|
||||
# export PATH=$PATH:~/src/endless_space/android-ndk-r5b
|
||||
|
||||
IFS='
|
||||
'
|
||||
|
||||
MYARCH=linux-x86
|
||||
if uname -s | grep -i "linux" > /dev/null ; then
|
||||
MYARCH=linux-x86
|
||||
fi
|
||||
if uname -s | grep -i "darwin" > /dev/null ; then
|
||||
MYARCH=darwin-x86
|
||||
fi
|
||||
if uname -s | grep -i "windows" > /dev/null ; then
|
||||
MYARCH=windows-x86
|
||||
fi
|
||||
|
||||
NDK=`which ndk-build`
|
||||
NDK=`dirname $NDK`
|
||||
NDK=`readlink -f $NDK`
|
||||
|
||||
#echo NDK $NDK
|
||||
GCCPREFIX=arm-linux-androideabi
|
||||
GCCVER=4.6
|
||||
PLATFORMVER=android-8
|
||||
LOCAL_PATH=`dirname $0`
|
||||
LOCAL_PATH=`cd $LOCAL_PATH && pwd`
|
||||
|
||||
if [ -n "`echo $NDK | grep 'android-ndk-r\(8b\|9\)'`" ]; then
|
||||
SCRIPT=setEnvironment-r8b.sh
|
||||
elif [ -n "`echo $NDK | grep 'android-ndk-r[5678]'`" ]; then
|
||||
SCRIPT=setEnvironment-r5b.sh
|
||||
if which realpath > /dev/null ; then
|
||||
LOCAL_PATH=`realpath $LOCAL_PATH`
|
||||
else
|
||||
SCRIPT=setEnvironment-r4b.sh
|
||||
LOCAL_PATH=`cd $LOCAL_PATH && pwd`
|
||||
fi
|
||||
#echo LOCAL_PATH $LOCAL_PATH
|
||||
ARCH=armeabi
|
||||
|
||||
APP_MODULES=`grep 'APP_MODULES [:][=]' $LOCAL_PATH/../Settings.mk | sed 's@.*[=]\(.*\)@\1@'`
|
||||
APP_AVAILABLE_STATIC_LIBS=`grep 'APP_AVAILABLE_STATIC_LIBS [:][=]' $LOCAL_PATH/../Settings.mk | sed 's@.*[=]\(.*\)@\1@'`
|
||||
APP_SHARED_LIBS=$(
|
||||
echo $APP_MODULES | xargs -n 1 echo | while read LIB ; do
|
||||
STATIC=`echo $APP_AVAILABLE_STATIC_LIBS application sdl_main stlport stdout-test | grep "\\\\b$LIB\\\\b"`
|
||||
if [ -n "$STATIC" ] ; then true
|
||||
else
|
||||
echo $LIB
|
||||
fi
|
||||
done
|
||||
)
|
||||
|
||||
|
||||
MISSING_INCLUDE=
|
||||
MISSING_LIB=
|
||||
|
||||
CFLAGS="\
|
||||
-fpic -ffunction-sections -funwind-tables -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi \
|
||||
-march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \
|
||||
-isystem$NDK/platforms/$PLATFORMVER/arch-arm/usr/include -Wa,--noexecstack \
|
||||
-DANDROID \
|
||||
-DNDEBUG -O2 -g \
|
||||
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/include \
|
||||
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH/include \
|
||||
-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"
|
||||
|
||||
SHARED="-shared -Wl,-soname,libapplication.so"
|
||||
if [ -n "$BUILD_EXECUTABLE" ]; then
|
||||
SHARED=
|
||||
fi
|
||||
if [ -n "$NO_SHARED_LIBS" ]; then
|
||||
APP_SHARED_LIBS=
|
||||
fi
|
||||
|
||||
env $LOCAL_PATH/$SCRIPT "$@"
|
||||
|
||||
LDFLAGS="\
|
||||
$SHARED \
|
||||
--sysroot=$NDK/platforms/$PLATFORMVER/arch-arm \
|
||||
`echo $APP_SHARED_LIBS | sed \"s@\([-a-zA-Z0-9_.]\+\)@$LOCAL_PATH/../../obj/local/$ARCH/lib\1.so@g\"` \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libc.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libm.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libGLESv1_CM.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libdl.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/liblog.so \
|
||||
$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libz.so \
|
||||
-L$NDK/sources/cxx-stl/gnu-libstdc++/$GCCVER/libs/$ARCH \
|
||||
-lgnustl_static \
|
||||
-L$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib \
|
||||
-L$LOCAL_PATH/../../obj/local/$ARCH -Wl,--no-undefined -Wl,-z,noexecstack \
|
||||
-Wl,-rpath-link=$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib -lsupc++ \
|
||||
$MISSING_LIB $LDFLAGS"
|
||||
|
||||
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
|
||||
|
||||
env PATH=$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \
|
||||
CFLAGS="$CFLAGS" \
|
||||
CXXFLAGS="$CXXFLAGS $CFLAGS" \
|
||||
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" \
|
||||
"$@"
|
||||
|
||||
Reference in New Issue
Block a user