This commit is contained in:
Maksim Gamarnik 2016-04-18 22:40:42 +03:00
parent 37fc3dbe6a
commit 2bc88a95a4
10 changed files with 56 additions and 58 deletions

View File

@ -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}; \
@ -792,6 +796,9 @@ clean_all :
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; \
export VERSION_FILE_NEW=$${VERSION_FILE}.new; \

View File

@ -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

View File

@ -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,9 +270,8 @@ 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
@ -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

View File

@ -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 <GLES/gl.h>
/**
* Check and align image to npot2 if required by hardware
* @param image image to check for npot2 alignment

View File

@ -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

View File

@ -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");

View File

@ -40,7 +40,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifdef __ANDROID__
#include "client/tile.h"
#include <GLES/gl.h>
#endif

View File

@ -38,9 +38,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <map>
#include <set>
#ifdef __ANDROID__
#include <GLES/gl.h>
#endif
/*
ItemDefinition

4
src/path.cfg Normal file
View File

@ -0,0 +1,4 @@
#ANDROID_NDK = /media/maksim/LinuxWork/crystax-ndk-10.3.1
ANDROID_NDK = /media/maksim/LinuxWork/android-ndk-r11c
SDKFOLDER =