diff --git a/project/jni/application/openttd/AndroidAppSettings.cfg b/project/jni/application/openttd/AndroidAppSettings.cfg index 1d31c90fbb..810f2550a2 100644 --- a/project/jni/application/openttd/AndroidAppSettings.cfg +++ b/project/jni/application/openttd/AndroidAppSettings.cfg @@ -209,7 +209,7 @@ AppMinimumRAM=0 # Optional shared libraries to compile - removing some of them will save space # MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed # 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="jpeg png freetype timidity lzma lzo2 icui18n iculx icule icudata icuuc" +CompiledLibraries="jpeg png freetype timidity expat fontconfig lzma lzo2 icui18n iculx icule icudata icuuc" # Application uses custom build script AndroidBuild.sh instead of Android.mk (y) or (n) CustomBuildScript=y diff --git a/project/jni/application/openttd/AndroidBuild.sh b/project/jni/application/openttd/AndroidBuild.sh index 0807ef1a2d..9e4e7d461f 100755 --- a/project/jni/application/openttd/AndroidBuild.sh +++ b/project/jni/application/openttd/AndroidBuild.sh @@ -19,6 +19,6 @@ fi export ARCH=$1 if [ \! -f openttd-$VER-$1/Makefile ] ; then - ../setEnvironment-$1.sh sh -c "cd openttd-$VER-$1 && env ./configure --host=$2 --with-sdl --with-freetype=sdl-config --with-png --with-zlib --with-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-$1.sh sh -c "cd openttd-$VER-$1 && env ./configure --host=$2 --with-sdl --with-freetype=sdl-config --with-png --with-zlib --with-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 --with-fontconfig --with-lzma --endian=LE || echo 'Run: sudo apt-get install liblzma-dev - it is needed only for configure script'" fi -../setEnvironment-$1.sh sh -c "cd openttd-$VER-$1 && make -j4 VERBOSE=1 STRIP='' LIBS='-lsdl-1.2 -llzo2 -lpng -ltimidity -lfreetype -licui18n -liculx -licule -licuuc -licudata -lgcc -lz -lc -lgnustl_static -lsupc++'" && cp -f openttd-$VER-$1/objs/release/openttd libapplication-$1.so +../setEnvironment-$1.sh sh -c "cd openttd-$VER-$1 && make -j4 VERBOSE=1 STRIP='' LIBS='-lsdl-1.2 -llzo2 -lpng -ltimidity -lfreetype -lfontconfig -lexpat -licui18n -liculx -licule -licuuc -licudata -lgcc -lz -lc -lgnustl_static -lsupc++'" && cp -f openttd-$VER-$1/objs/release/openttd libapplication-$1.so diff --git a/project/jni/application/openttd/openttd-trunk-android.patch b/project/jni/application/openttd/openttd-trunk-android.patch index 50ea69ba64..8954b530de 100644 --- a/project/jni/application/openttd/openttd-trunk-android.patch +++ b/project/jni/application/openttd/openttd-trunk-android.patch @@ -1,5 +1,15 @@ ---- src/debug.cpp 2013-07-27 18:09:40.000000000 +0300 -+++ src/debug.cpp 2013-08-01 19:17:24.013408999 +0300 +--- findversion.sh 2014-02-25 11:17:27.000000000 +0200 ++++ findversion.sh 2014-03-13 22:51:42.431059430 +0200 +@@ -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 +--- src/debug.cpp 2014-02-25 11:17:24.000000000 +0200 ++++ src/debug.cpp 2014-03-13 22:51:41.679014683 +0200 @@ -16,6 +16,9 @@ #include "string_func.h" #include "fileio_func.h" @@ -20,27 +30,8 @@ #if defined(ENABLE_NETWORK) if (_debug_socket != INVALID_SOCKET) { char buf2[1024 + 32]; ---- src/fontdetection.cpp 2013-07-27 18:09:39.000000000 +0300 -+++ src/fontdetection.cpp 2013-08-01 19:19:43.089408999 +0300 -@@ -772,7 +772,15 @@ - return ret; - } - --#else /* without WITH_FONTCONFIG */ -+#elif defined(__ANDROID__) /* end if defined(WITH_FONTCONFIG) */ -+FT_Error GetFontByFaceName(const char *font_name, FT_Face *face) {return FT_Err_Cannot_Open_Resource;} -+bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback) -+{ -+ callback->SetFontNames(settings, "fonts/FreeSans.ttf"); /* We don't really have other fonts on Android, other than our own */ -+ callback->FindMissingGlyphs(NULL); -+ return true; -+} -+#else /* end if defined(__ANDROID__) */ - FT_Error GetFontByFaceName(const char *font_name, FT_Face *face) {return FT_Err_Cannot_Open_Resource;} - bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback) { return false; } - #endif /* WITH_FONTCONFIG */ ---- src/music/libtimidity.cpp 2013-07-27 18:09:28.000000000 +0300 -+++ src/music/libtimidity.cpp 2013-08-01 19:17:24.013408999 +0300 +--- src/music/libtimidity.cpp 2014-02-25 11:17:00.000000000 +0200 ++++ src/music/libtimidity.cpp 2014-03-13 22:51:41.711016587 +0200 @@ -13,6 +13,7 @@ #include "../openttd.h" #include "../sound_type.h" @@ -82,8 +73,8 @@ /** Factory for the libtimidity driver. */ static FMusicDriver_LibTimidity iFMusicDriver_LibTimidity; ---- src/network/core/os_abstraction.h 2013-07-27 18:09:36.000000000 +0300 -+++ src/network/core/os_abstraction.h 2013-08-01 19:17:24.013408999 +0300 +--- src/network/core/os_abstraction.h 2014-02-25 11:17:18.000000000 +0200 ++++ src/network/core/os_abstraction.h 2014-03-13 22:51:42.427059192 +0200 @@ -161,7 +161,7 @@ # include /* According to glibc/NEWS, appeared in glibc-2.3. */ @@ -93,8 +84,8 @@ /* 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. */ ---- src/os/unix/crashlog_unix.cpp 2013-07-27 18:09:32.000000000 +0300 -+++ src/os/unix/crashlog_unix.cpp 2013-08-01 19:17:24.017408999 +0300 +--- src/os/unix/crashlog_unix.cpp 2014-02-25 11:17:03.000000000 +0200 ++++ src/os/unix/crashlog_unix.cpp 2014-03-13 22:51:42.427059192 +0200 @@ -141,7 +141,11 @@ }; @@ -107,8 +98,8 @@ /** * Entry point for the crash handler. ---- src/os/unix/unix.cpp 2013-07-27 18:09:32.000000000 +0300 -+++ src/os/unix/unix.cpp 2013-08-01 19:17:24.017408999 +0300 +--- src/os/unix/unix.cpp 2014-02-25 11:17:03.000000000 +0200 ++++ src/os/unix/unix.cpp 2014-03-13 22:51:42.427059192 +0200 @@ -25,7 +25,7 @@ #ifdef __APPLE__ @@ -130,9 +121,9 @@ int CDECL main(int argc, char *argv[]) { int ret; ---- src/osk_gui.cpp 2013-07-27 18:09:40.000000000 +0300 -+++ src/osk_gui.cpp 2013-08-01 19:17:24.017408999 +0300 -@@ -21,6 +21,9 @@ +--- src/osk_gui.cpp 2014-02-25 11:17:24.000000000 +0200 ++++ src/osk_gui.cpp 2014-03-13 22:51:42.431059430 +0200 +@@ -22,6 +22,9 @@ #include "table/sprites.h" #include "table/strings.h" @@ -142,7 +133,7 @@ char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1]; static WChar _keyboard[2][OSK_KEYBOARD_ENTRIES]; -@@ -411,6 +414,16 @@ +@@ -413,6 +416,16 @@ GetKeyboardLayout(); new OskWindow(&_osk_desc, parent, button); @@ -159,8 +150,8 @@ } /** ---- src/script/api/script_date.cpp 2013-07-27 18:09:35.000000000 +0300 -+++ src/script/api/script_date.cpp 2013-08-01 19:17:24.017408999 +0300 +--- src/script/api/script_date.cpp 2014-02-25 11:17:12.000000000 +0200 ++++ src/script/api/script_date.cpp 2014-03-13 22:51:42.431059430 +0200 @@ -9,8 +9,8 @@ /** @file script_date.cpp Implementation of ScriptDate. */ @@ -171,8 +162,58 @@ #include "script_date.hpp" #include "../../date_func.h" ---- src/sound/sdl_s.cpp 2013-07-27 18:09:28.000000000 +0300 -+++ src/sound/sdl_s.cpp 2013-08-01 19:17:24.017408999 +0300 +--- src/settings_gui.cpp 2014-02-25 11:17:23.000000000 +0200 ++++ src/settings_gui.cpp 2014-03-13 23:01:22.521550369 +0200 +@@ -323,17 +323,17 @@ + switch (widget) { + case WID_GO_BASE_GRF_DESCRIPTION: + SetDParamStr(0, BaseGraphics::GetUsedSet()->GetDescription(GetCurrentLanguageIsoCode())); +- DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_BLACK_RAW_STRING); ++ DrawString(r.left, r.right, r.top, STR_BLACK_RAW_STRING); + break; + + case WID_GO_BASE_SFX_DESCRIPTION: + SetDParamStr(0, BaseSounds::GetUsedSet()->GetDescription(GetCurrentLanguageIsoCode())); +- DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_BLACK_RAW_STRING); ++ DrawString(r.left, r.right, r.top, STR_BLACK_RAW_STRING); + break; + + case WID_GO_BASE_MUSIC_DESCRIPTION: + SetDParamStr(0, BaseMusic::GetUsedSet()->GetDescription(GetCurrentLanguageIsoCode())); +- DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, STR_BLACK_RAW_STRING); ++ DrawString(r.left, r.right, r.top, STR_BLACK_RAW_STRING); + break; + } + } +@@ -344,7 +344,7 @@ + case WID_GO_BASE_GRF_DESCRIPTION: + /* Find the biggest description for the default size. */ + for (int i = 0; i < BaseGraphics::GetNumSets(); i++) { +- SetDParamStr(0, BaseGraphics::GetSet(i)->GetDescription(GetCurrentLanguageIsoCode())); ++ SetDParamStr(0, "123"); + size->height = max(size->height, (uint)GetStringHeight(STR_BLACK_RAW_STRING, size->width)); + } + break; +@@ -363,7 +363,7 @@ + case WID_GO_BASE_SFX_DESCRIPTION: + /* Find the biggest description for the default size. */ + for (int i = 0; i < BaseSounds::GetNumSets(); i++) { +- SetDParamStr(0, BaseSounds::GetSet(i)->GetDescription(GetCurrentLanguageIsoCode())); ++ SetDParamStr(0, "123"); + size->height = max(size->height, (uint)GetStringHeight(STR_BLACK_RAW_STRING, size->width)); + } + break; +@@ -371,7 +371,7 @@ + case WID_GO_BASE_MUSIC_DESCRIPTION: + /* Find the biggest description for the default size. */ + for (int i = 0; i < BaseMusic::GetNumSets(); i++) { +- SetDParamStr(0, BaseMusic::GetSet(i)->GetDescription(GetCurrentLanguageIsoCode())); ++ SetDParamStr(0, "123"); + size->height = max(size->height, (uint)GetStringHeight(STR_BLACK_RAW_STRING, size->width)); + } + break; +--- src/sound/sdl_s.cpp 2014-02-25 11:16:59.000000000 +0200 ++++ src/sound/sdl_s.cpp 2014-03-13 22:51:42.431059430 +0200 @@ -21,6 +21,10 @@ /** Factory for the SDL sound driver. */ static FSoundDriver_SDL iFSoundDriver_SDL; @@ -194,8 +235,8 @@ } const char *SoundDriver_SDL::Start(const char * const *parm) ---- src/video/sdl_v.cpp 2013-07-27 18:09:22.000000000 +0300 -+++ src/video/sdl_v.cpp 2013-08-01 19:17:24.017408999 +0300 +--- src/video/sdl_v.cpp 2014-02-25 11:16:44.000000000 +0200 ++++ src/video/sdl_v.cpp 2014-03-13 22:51:42.431059430 +0200 @@ -25,6 +25,9 @@ #include "../fileio_func.h" #include "sdl_v.h" @@ -231,7 +272,7 @@ #else if (sym->scancode == 49) key = WKC_BACKQUOTE; #endif -@@ -596,7 +610,7 @@ +@@ -597,7 +611,7 @@ } HandleMouseEvents(); break; @@ -240,7 +281,7 @@ case SDL_ACTIVEEVENT: if (!(ev.active.state & SDL_APPMOUSEFOCUS)) break; -@@ -607,7 +621,7 @@ +@@ -608,7 +622,7 @@ _cursor.in_window = false; } break; @@ -249,8 +290,8 @@ case SDL_QUIT: HandleExitGameRequest(); break; -@@ -620,13 +634,14 @@ - HandleKeypress(ConvertSdlKeyIntoMy(&ev.key.keysym)); +@@ -623,13 +637,14 @@ + HandleKeypress(keycode, character); } break; - @@ -265,7 +306,7 @@ case SDL_VIDEOEXPOSE: { /* Force a redraw of the entire screen. Note * that SDL 1.2 seems to do this automatically -@@ -658,6 +673,9 @@ +@@ -661,6 +676,9 @@ SetupKeyboard(); _draw_threaded = GetDriverParam(parm, "no_threads") == NULL && GetDriverParam(parm, "no_thread") == NULL; diff --git a/project/jni/fontconfig/src/fcarch.c b/project/jni/fontconfig/src/fcarch.c deleted file mode 100644 index 398f4bbfcd..0000000000 --- a/project/jni/fontconfig/src/fcarch.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright © 2002 Keith Packard - * Copyright © 2010 Behdad Esfahbod - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of the author(s) not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. The authors make no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include - -#include "fcint.h" -#include "fcarch.h" - -FC_ASSERT_STATIC (1 == sizeof (char)); -FC_ASSERT_STATIC (2 == sizeof (FcChar16)); -FC_ASSERT_STATIC (4 == sizeof (int)); -FC_ASSERT_STATIC (4 == sizeof (FcChar32)); -FC_ASSERT_STATIC (4 == sizeof (FcObject)); -FC_ASSERT_STATIC (4 == sizeof (FcValueBinding)); -FC_ASSERT_STATIC (8 == sizeof (FcAlign)); -FC_ASSERT_STATIC (0x20 == sizeof (FcCharLeaf)); - -FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (intptr_t)); -FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcPatternEltPtr)); -FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueListPtr)); -FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (char *)); -FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (struct FcPatternElt *)); -FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueList *)); -FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcStrSet *)); -FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcCharLeaf **)); -FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcChar16 *)); - -FC_ASSERT_STATIC (0x08 + 1*FC_MAX(SIZEOF_VOID_P,ALIGNOF_DOUBLE) == sizeof (FcValue)); -FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt)); -FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern)); -FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet)); -FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache)); - - -int -main (int argc FC_UNUSED, char **argv FC_UNUSED) -{ - printf ("%s\n", FC_ARCHITECTURE); - return 0; -} diff --git a/project/jni/freetype/Android.mk b/project/jni/freetype/Android.mk index a6cb8f39b8..bb7fedbc2b 100644 --- a/project/jni/freetype/Android.mk +++ b/project/jni/freetype/Android.mk @@ -7,7 +7,7 @@ LOCAL_MODULE := freetype APP_SUBDIRS := $(patsubst $(LOCAL_PATH)/%, %, $(shell find $(LOCAL_PATH)/src -type d)) LOCAL_C_INCLUDES := $(foreach D, $(APP_SUBDIRS), $(LOCAL_PATH)/$(D)) $(LOCAL_PATH)/include -LOCAL_CFLAGS := -Os -DFT2_BUILD_LIBRARY +LOCAL_CFLAGS := -O2 -DFT2_BUILD_LIBRARY LOCAL_CPP_EXTENSION := .cpp