diff --git a/build/android/Makefile b/build/android/Makefile index 07a0a475..4fae5921 100644 --- a/build/android/Makefile +++ b/build/android/Makefile @@ -22,7 +22,7 @@ TARGET_HOST2 = arm-linux TARGET_ABI = armeabi-v7a-hard TARGET_LIBDIR = armeabi-v7a TARGET_TOOLCHAIN = arm-linux-androideabi -TARGET_CFLAGS_ADDON = -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -march=armv7-a -Ofast -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves +TARGET_CFLAGS_ADDON = -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -march=armv7-a -Ofast -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves -fvisibility=hidden TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON) TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections -lm_hard TARGET_ARCH = armv7 @@ -156,7 +156,8 @@ VERSION_PATCH := $(shell cat $(ROOT)/../../CMakeLists.txt | \ $(ASSETS_TIMESTAMP) $(LUAJIT_TIMESTAMP) \ $(OPENAL_TIMESTAMP) $(VORBIS_TIMESTAMP) \ $(IRRLICHT_TIMESTAMP) $(CURL_TIMESTAMP) \ - $(OPENSSL_TIMESTAMP) $(VORBIS_TIMESTAMP) \ + #$(OPENSSL_TIMESTAMP) $(VORBIS_TIMESTAMP) \ + $(VORBIS_TIMESTAMP) \ $(ROOT)/jni/src/android_version.h \ $(ROOT)/jni/src/android_version_githash.h @@ -547,11 +548,14 @@ $(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB) export CC=${CROSS_PREFIX}gcc; \ export CXX=${CROSS_PREFIX}g++; \ export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \ - export CPPFLAGS="$${CPPFLAGS} -I${OPENSSL_DIR}/include \ + #export CPPFLAGS="$${CPPFLAGS} -I${OPENSSL_DIR}/include \ + export CPPFLAGS="$${CPPFLAGS} \ ${TARGET_CFLAGS_ADDON}"; \ export CFLAGS="$${CFLAGS} ${TARGET_CFLAGS_ADDON}"; \ - export LDFLAGS="$${LDFLAGS} -L${OPENSSL_DIR} ${TARGET_LDFLAGS_ADDON}"; \ - ./configure --host=${TARGET_HOST} --enable-static --disable-shared --with-ssl; \ + #export LDFLAGS="$${LDFLAGS} -L${OPENSSL_DIR} ${TARGET_LDFLAGS_ADDON}"; \ + export LDFLAGS="$${LDFLAGS} ${TARGET_LDFLAGS_ADDON}"; \ + #./configure --host=${TARGET_HOST} --enable-static --disable-shared --with-ssl; \ + ./configure --host=${TARGET_HOST} --enable-static --disable-shared; \ $(MAKE) -s || exit 1; \ touch ${CURL_TIMESTAMP}; \ touch ${CURL_TIMESTAMP_INT}; \ @@ -791,6 +795,9 @@ clean_all : $(MAKE) clean_assets clean_manifest; \ sleep 1; \ $(RM) -r gen libs obj deps bin Debug and_env jni/src + +clean_src : + $(RM) -r gen libs obj bin Debug and_env jni/src $(ROOT)/jni/src/android_version_githash.h : prep_srcdir @export VERSION_FILE=${ROOT}/jni/src/android_version_githash.h; \ diff --git a/build/android/irrlicht-optimization.patch b/build/android/irrlicht-optimization.patch index 1b800ee5..4e6e2754 100644 --- a/build/android/irrlicht-optimization.patch +++ b/build/android/irrlicht-optimization.patch @@ -1,12 +1,13 @@ --- irrlicht/source/Irrlicht/Android/jni/Android.mk.orig 2016-02-15 05:33:03.000000000 +0200 +++ irrlicht/source/Irrlicht/Android/jni/Android.mk 2016-02-15 05:34:34.913711815 +0200 -@@ -11,7 +11,9 @@ +@@ -11,7 +11,10 @@ ifndef NDEBUG LOCAL_CFLAGS += -g -D_DEBUG else -LOCAL_CFLAGS += -fexpensive-optimizations -O3 +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard) -+LOCAL_CFLAGS += -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -march=armv7-a -Ofast -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves ++LOCAL_CFLAGS += -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -march=armv7-a -Ofast -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves -fvisibility=hidden ++LOCAL_LDFLAGS += -Wl,--no-warn-mismatch,--gc-sections -lm_hard +endif endif diff --git a/build/android/jni/Android.mk b/build/android/jni/Android.mk index db6c67e3..081574e0 100644 --- a/build/android/jni/Android.mk +++ b/build/android/jni/Android.mk @@ -37,16 +37,6 @@ LOCAL_MODULE := gmp LOCAL_SRC_FILES := deps/gmp/usr/lib/libgmp.so include $(PREBUILT_SHARED_LIBRARY) -include $(CLEAR_VARS) -LOCAL_MODULE := ssl -LOCAL_SRC_FILES := deps/openssl/libssl.a -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := crypto -LOCAL_SRC_FILES := deps/openssl/libcrypto.a -include $(PREBUILT_STATIC_LIBRARY) - include $(CLEAR_VARS) LOCAL_MODULE := LuaJIT LOCAL_SRC_FILES := deps/luajit/src/libluajit.a @@ -72,7 +62,7 @@ LOCAL_CFLAGS += -g -D_DEBUG -O0 -fno-omit-frame-pointer else ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard) -LOCAL_CFLAGS += -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -march=armv7-a -Ofast -fno-fast-math -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves -Wno-deprecated-declarations +LOCAL_CFLAGS += -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -march=armv7-a -Ofast -fno-fast-math -funsafe-math-optimizations -fno-trapping-math -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves -fvisibility=hidden LOCAL_LDFLAGS = -Wl,--no-warn-mismatch,--gc-sections -lm_hard endif @@ -84,13 +74,13 @@ LOCAL_CFLAGS += -pg endif ifeq ($(TARGET_ARCH_ABI),x86) -LOCAL_CFLAGS += -mhard-float -Ofast -fno-fast-math -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves -Wno-deprecated-declarations -fno-stack-protector +LOCAL_CFLAGS += -mhard-float -Ofast -fno-fast-math -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves -Wno-deprecated-declarations -fvisibility=hidden -fno-stack-protector LOCAL_LDFLAGS = -Wl,--no-warn-mismatch,--gc-sections LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true endif LOCAL_C_INCLUDES := \ - jni/src jni/src/sqlite \ + jni/src \ jni/src/script \ jni/src/json \ jni/src/cguittfont \ @@ -118,7 +108,6 @@ LOCAL_SRC_FILES := \ jni/src/collision.cpp \ jni/src/content_abm.cpp \ jni/src/content_cao.cpp \ - jni/src/content_cso.cpp \ jni/src/content_mapblock.cpp \ jni/src/content_mapnode.cpp \ jni/src/content_nodemeta.cpp \ @@ -228,9 +217,9 @@ LOCAL_SRC_FILES := \ jni/src/settings.cpp \ jni/src/wieldmesh.cpp \ jni/src/client/clientlauncher.cpp \ - jni/src/client/tile.cpp - -# intentionally kept out (we already build openssl itself): jni/src/util/sha256.c + jni/src/client/tile.cpp \ + jni/src/util/sha256.c +# jni/src/content_cso.cpp # Network LOCAL_SRC_FILES += \ @@ -239,9 +228,9 @@ LOCAL_SRC_FILES += \ jni/src/network/clientopcodes.cpp \ jni/src/network/clientpackethandler.cpp \ jni/src/network/serveropcodes.cpp \ - jni/src/network/serverpackethandler.cpp \ + jni/src/network/serverpackethandler.cpp -# lua api +# Lua API LOCAL_SRC_FILES += \ jni/src/script/common/c_content.cpp \ jni/src/script/common/c_converter.cpp \ @@ -281,15 +270,14 @@ LOCAL_SRC_FILES += \ jni/src/script/scripting_game.cpp \ jni/src/script/scripting_mainmenu.cpp -#freetype2 support -LOCAL_SRC_FILES += \ - jni/src/cguittfont/xCGUITTFont.cpp +# Freetype2 +LOCAL_SRC_FILES += jni/src/cguittfont/xCGUITTFont.cpp # SQLite3 LOCAL_SRC_FILES += deps/sqlite/sqlite3.c # Threading -LOCAL_SRC_FILES += \ +LOCAL_SRC_FILES += \ jni/src/threading/event.cpp \ jni/src/threading/mutex.cpp \ jni/src/threading/semaphore.cpp \ @@ -299,13 +287,13 @@ LOCAL_SRC_FILES += \ LOCAL_SRC_FILES += jni/src/json/jsoncpp.cpp LOCAL_SHARED_LIBRARIES := gmp -LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto iconv LuaJIT openal vorbis android_native_app_glue $(PROFILER_LIBS) + +LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl iconv LuaJIT openal vorbis android_native_app_glue $(PROFILER_LIBS) LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid -lOpenSLES include $(BUILD_SHARED_LIBRARY) -# at the end of Android.mk ifdef GPROF $(call import-module,android-ndk-profiler) endif diff --git a/build/android/jni/Application.mk b/build/android/jni/Application.mk index 07333f99..451681a4 100644 --- a/build/android/jni/Application.mk +++ b/build/android/jni/Application.mk @@ -1,5 +1,5 @@ APP_MODULES := multicraft APP_STL := gnustl_static -#APP_STL := c++_shared +#APP_STL := c++_shared #LIBCXX_FORCE_REBUILD := true APP_CPPFLAGS += -fexceptions -frtti \ No newline at end of file diff --git a/src/client/tile.cpp b/src/client/tile.cpp index d8ed8ac7..38e38a6e 100644 --- a/src/client/tile.cpp +++ b/src/client/tile.cpp @@ -756,10 +756,10 @@ video::ITexture* TextureSource::generateTextureFromMesh( // use no render to texture hack if ( - (renderer.find("Adreno") != std::string::npos) || - (renderer.find("Mali") != std::string::npos) || - (renderer.find("Immersion") != std::string::npos) || - (renderer.find("Tegra") != std::string::npos) || + //(renderer.find("Adreno") != std::string::npos) || + //(renderer.find("Mali") != std::string::npos) || + //(renderer.find("Immersion") != std::string::npos) || + //(renderer.find("Tegra") != std::string::npos) || g_settings->getBool("inventory_image_hack") ) { // Get a scene manager @@ -1053,7 +1053,6 @@ video::IImage* TextureSource::generateImage(const std::string &name) } #ifdef __ANDROID__ -#include /** * Check and align image to npot2 if required by hardware * @param image image to check for npot2 alignment diff --git a/src/content_cao.cpp b/src/content_cao.cpp index 6431bf3d..ad8eaa47 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -37,7 +37,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "mesh.h" #include "itemdef.h" #include "tool.h" -#include "content_cso.h" +//disable +//#include "content_cso.h" #include "sound.h" #include "nodedef.h" #include "localplayer.h" @@ -1745,10 +1746,11 @@ void GenericCAO::processMessage(const std::string &data) { // TODO: Execute defined fast response // As there is no definition, make a smoke puff - ClientSimpleObject *simple = createSmokePuff( - m_smgr, m_env, m_position, - m_prop.visual_size * BS); - m_env->addSimpleObject(simple); + //disable + //ClientSimpleObject *simple = createSmokePuff( + // m_smgr, m_env, m_position, + // m_prop.visual_size * BS); + //m_env->addSimpleObject(simple); } else { // TODO: Execute defined fast response // Flashing shall suffice as there is no definition @@ -1801,10 +1803,11 @@ bool GenericCAO::directReportPunch(v3f dir, const ItemStack *punchitem, m_hp = 0; // TODO: Execute defined fast response // As there is no definition, make a smoke puff - ClientSimpleObject *simple = createSmokePuff( - m_smgr, m_env, m_position, - m_prop.visual_size * BS); - m_env->addSimpleObject(simple); + //disable + //ClientSimpleObject *simple = createSmokePuff( + // m_smgr, m_env, m_position, + // m_prop.visual_size * BS); + //m_env->addSimpleObject(simple); } // TODO: Execute defined fast response // Flashing shall suffice as there is no definition diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 580a9f47..6de40add 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -151,7 +151,7 @@ void set_default_settings(Settings *settings) settings->setDefault("desynchronize_mapblock_texture_animation", "true"); settings->setDefault("hud_hotbar_max_width", "1.0"); settings->setDefault("enable_local_map_saving", "false"); - settings->setDefault("show_entity_selectionbox", "true"); + settings->setDefault("show_entity_selectionbox", "false"); settings->setDefault("mip_map", "false"); settings->setDefault("anisotropic_filter", "false"); @@ -205,7 +205,7 @@ void set_default_settings(Settings *settings) #if USE_FREETYPE settings->setDefault("freetype", "true"); - settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "basis33.ttf")); + settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "retrovillenc.ttf")); settings->setDefault("font_shadow", "1"); settings->setDefault("font_shadow_alpha", "128"); settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "liberationmono.ttf")); @@ -217,7 +217,7 @@ void set_default_settings(Settings *settings) std::stringstream fontsize; fontsize << DEFAULT_FONT_SIZE; - settings->setDefault("font_size", "16"); + settings->setDefault("font_size", "12"); settings->setDefault("mono_font_size", fontsize.str()); settings->setDefault("fallback_font_size", fontsize.str()); #else @@ -291,7 +291,7 @@ void set_default_settings(Settings *settings) settings->setDefault("emergequeue_limit_total", "256"); settings->setDefault("emergequeue_limit_diskonly", "32"); settings->setDefault("emergequeue_limit_generate", "32"); - settings->setDefault("num_emerge_threads", "1"); + settings->setDefault("num_emerge_threads", "2"); settings->setDefault("secure.enable_security", "false"); settings->setDefault("secure.trusted_mods", ""); settings->setDefault("secure.http_mods", ""); @@ -361,7 +361,7 @@ void set_default_settings(Settings *settings) settings->setDefault("client_unload_unused_data_timeout", "60"); settings->setDefault("active_block_range", "1"); settings->setDefault("chunksize", "3"); - settings->setDefault("client_mapblock_limit", "1000"); + settings->setDefault("client_mapblock_limit", "500"); settings->setDefault("viewing_range", "25"); settings->setDefault("inventory_image_hack", "false"); @@ -370,7 +370,7 @@ void set_default_settings(Settings *settings) float x_inches = ((double) porting::getDisplaySize().X / (160 * porting::getDisplayDensity())); if (x_inches < 3.5) { - settings->setDefault("hud_scaling", "0.5"); + settings->setDefault("hud_scaling", "0.45"); settings->setDefault("gui_scaling", "1.0"); } if (x_inches < 6.0) { @@ -383,7 +383,7 @@ void set_default_settings(Settings *settings) } std::stringstream anddroidfontsize; - anddroidfontsize << DEFAULT_FONT_SIZE / 2.5 * x_inches; + anddroidfontsize << DEFAULT_FONT_SIZE / 2.8 * x_inches; settings->setDefault("font_size", anddroidfontsize.str()); settings->setDefault("mono_font_path", "/system/fonts/DroidSansMono.ttf"); settings->setDefault("fallback_font_path", "/system/fonts/DroidSans.ttf"); diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp index 620d6f93..0f3606dd 100644 --- a/src/guiEngine.cpp +++ b/src/guiEngine.cpp @@ -40,7 +40,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifdef __ANDROID__ #include "client/tile.h" -#include #endif diff --git a/src/itemdef.cpp b/src/itemdef.cpp index 4f0cfdc8..16c2bcd1 100644 --- a/src/itemdef.cpp +++ b/src/itemdef.cpp @@ -38,9 +38,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include -#ifdef __ANDROID__ -#include -#endif /* ItemDefinition diff --git a/src/path.cfg b/src/path.cfg new file mode 100644 index 00000000..0c480b28 --- /dev/null +++ b/src/path.cfg @@ -0,0 +1,4 @@ +#ANDROID_NDK = /media/maksim/LinuxWork/crystax-ndk-10.3.1 +ANDROID_NDK = /media/maksim/LinuxWork/android-ndk-r11c + +SDKFOLDER =