Minor update Android, light, remove pageflip, other

master
Maksim Gamarnik 2016-03-21 01:38:25 +02:00
parent 7039222ef9
commit 2d64ccab9a
14 changed files with 87 additions and 224 deletions

View File

@ -4,7 +4,7 @@
# GPROF = 1 # GPROF = 1
# build for build platform # build for build platform
APP_PLATFORM = android-19 APP_PLATFORM = android-19
# paths used for timestaps, dependencys, tree config and libs # paths used for timestaps, dependencys, tree config and libs
PATHCFGFILE = path.cfg PATHCFGFILE = path.cfg
@ -21,8 +21,8 @@ TARGET_HOST = arm-linux
TARGET_HOST2 = arm-linux TARGET_HOST2 = arm-linux
TARGET_ABI = armeabi-v7a-hard TARGET_ABI = armeabi-v7a-hard
TARGET_LIBDIR = armeabi-v7a TARGET_LIBDIR = armeabi-v7a
TARGET_TOOLCHAIN = arm-linux-androideabi- TARGET_TOOLCHAIN = arm-linux-androideabi
TARGET_CFLAGS_ADDON = -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mfloat-abi=hard -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
TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON) TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON)
TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections -lm_hard TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections -lm_hard
TARGET_ARCH = armv7 TARGET_ARCH = armv7
@ -36,10 +36,11 @@ CROSS_PREFIX = arm-linux-androideabi-
# TARGET_HOST2 = arm-linux # TARGET_HOST2 = arm-linux
# TARGET_ABI = arm64-v8a # TARGET_ABI = arm64-v8a
# TARGET_LIBDIR = arm64-v8a # TARGET_LIBDIR = arm64-v8a
# TARGET_TOOLCHAIN = aarch64-linux-android- # TARGET_TOOLCHAIN = aarch64-linux-android
# TARGET_CFLAGS_ADDON = -Ofast # TARGET_CFLAGS_ADDON = -march=armv8-a -Ofast -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves
# TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON) # TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON)
# TARGET_ARCH = aarch64 # TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections
# TARGET_ARCH = arm64
# CROSS_PREFIX = aarch64-linux-android- # CROSS_PREFIX = aarch64-linux-android-
################################################################################ ################################################################################
@ -50,9 +51,10 @@ CROSS_PREFIX = arm-linux-androideabi-
# TARGET_HOST2 = x86-linux # TARGET_HOST2 = x86-linux
# TARGET_ABI = x86 # TARGET_ABI = x86
# TARGET_LIBDIR = x86 # TARGET_LIBDIR = x86
# TARGET_TOOLCHAIN = x86- # TARGET_TOOLCHAIN = x86
# TARGET_CFLAGS_ADDON = -Ofast # TARGET_CFLAGS_ADDON = -Ofast
# TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON) # TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON)
# TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections
# TARGET_ARCH = x86 # TARGET_ARCH = x86
# CROSS_PREFIX = i686-linux-android- # CROSS_PREFIX = i686-linux-android-
@ -75,6 +77,7 @@ OGG_TIMESTAMP_INT = $(ROOT)/deps/ogg_timestamp
OGG_URL_GIT = https://github.com/vincentjames501/libvorbis-libogg-android OGG_URL_GIT = https://github.com/vincentjames501/libvorbis-libogg-android
IRRLICHT_COMMIT = 58fa0cf3419c2733159fc3c6253634bedada3bfe IRRLICHT_COMMIT = 58fa0cf3419c2733159fc3c6253634bedada3bfe
#IRRLICHT_COMMIT = 54b8cba398c3b845d0d1158822916c2f78be194b
IRRLICHT_DIR = $(ROOT)/deps/irrlicht IRRLICHT_DIR = $(ROOT)/deps/irrlicht
IRRLICHT_LIB = $(IRRLICHT_DIR)/lib/Android/libIrrlicht.a IRRLICHT_LIB = $(IRRLICHT_DIR)/lib/Android/libIrrlicht.a
IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)/timestamp IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)/timestamp
@ -185,9 +188,6 @@ $(PATHCFGFILE) :
exit 1; \ exit 1; \
fi; \ fi; \
echo "ANDROID_NDK = $$ANDROID_NDK" > ${PATHCFGFILE}; \ echo "ANDROID_NDK = $$ANDROID_NDK" > ${PATHCFGFILE}; \
echo "NDK_MODULE_PATH = $$ANDROID_NDK/toolchains" >> ${PATHCFGFILE}; \
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";\
echo "+ Note: NDK_MODULE_PATH is set to $$ANDROID_NDK/toolchains"; \
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";\ echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";\
echo "Please specify path of ANDROID SDK"; \ echo "Please specify path of ANDROID SDK"; \
echo "e.g. /home/user/adt-bundle-linux-x86_64-20131030/sdk/"; \ echo "e.g. /home/user/adt-bundle-linux-x86_64-20131030/sdk/"; \
@ -226,7 +226,7 @@ $(OPENAL_LIB): $(OPENAL_TIMESTAMP)
export PATH=$$PATH:${ANDROID_NDK}; \ export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for openal detected building..."; \ echo "changed timestamp for openal detected building..."; \
cd ${OPENAL_DIR}; \ cd ${OPENAL_DIR}; \
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \ ndk-build NDEBUG=${NDEBUG} \
APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} TARGET_ARCH_ABI=${TARGET_ABI} \ APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} TARGET_ARCH_ABI=${TARGET_ABI} \
APP_PLATFORM=${APP_PLATFORM} TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \ APP_PLATFORM=${APP_PLATFORM} TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \ TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
@ -272,7 +272,7 @@ $(OGG_LIB): $(OGG_TIMESTAMP)
export PATH=$$PATH:${ANDROID_NDK}; \ export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for ogg detected building..."; \ echo "changed timestamp for ogg detected building..."; \
cd ${OGG_DIR}; \ cd ${OGG_DIR}; \
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \ ndk-build NDEBUG=${NDEBUG} \
APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} \ APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} \
TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \ TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \ TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
@ -319,7 +319,7 @@ $(OPENSSL_LIB): $(OPENSSL_TIMESTAMP) $(GMP_LIB)
cd ${OPENSSL_DIR}; \ cd ${OPENSSL_DIR}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-openssl; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-openssl; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \ --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \
--install-dir=$${TOOLCHAIN} --platform=${APP_PLATFORM}; \ --install-dir=$${TOOLCHAIN} --platform=${APP_PLATFORM}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
CC=${CROSS_PREFIX}gcc ./Configure no-ssl2 no-ssl3 no-hw enable-gmp \ CC=${CROSS_PREFIX}gcc ./Configure no-ssl2 no-ssl3 no-hw enable-gmp \
@ -351,7 +351,7 @@ freetype_download :
wget ${FREETYPE_URL_HTTP} || exit 1; \ wget ${FREETYPE_URL_HTTP} || exit 1; \
tar -xjf freetype-${FREETYPE_VERSION}.tar.bz2 || exit 1; \ tar -xjf freetype-${FREETYPE_VERSION}.tar.bz2 || exit 1; \
rm freetype-${FREETYPE_VERSION}.tar.bz2; \ rm freetype-${FREETYPE_VERSION}.tar.bz2; \
ln -s freetype-${FREETYPE_VERSION} freetype; \ mv freetype-${FREETYPE_VERSION} freetype; \
fi fi
freetype : $(FREETYPE_LIB) freetype : $(FREETYPE_LIB)
@ -375,12 +375,12 @@ $(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP)
export CROSS_PREFIX=${CROSS_PREFIX}; \ export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-freetype; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-freetype; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \ --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \
--install-dir=$${TOOLCHAIN}; \ --platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
export CXX=${CROSS_PREFIX}g++; \ export CXX=${CROSS_PREFIX}g++; \
export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \ export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
CC=${CROSS_PREFIX}gcc ./configure --host=${TARGET_HOST}-androideabi \ CC=${CROSS_PREFIX}gcc ./configure --host=${TARGET_HOST} \
--prefix=${TOOLCHAIN} --with-png=no --with-harfbuzz=no || exit 1; \ --prefix=${TOOLCHAIN} --with-png=no --with-harfbuzz=no || exit 1; \
CC=${CROSS_PREFIX}gcc ANDROID_DEV=/tmp/ndk-${TARGET_HOST}-freetype make || exit 1; \ CC=${CROSS_PREFIX}gcc ANDROID_DEV=/tmp/ndk-${TARGET_HOST}-freetype make || exit 1; \
touch ${FREETYPE_TIMESTAMP}; \ touch ${FREETYPE_TIMESTAMP}; \
@ -433,7 +433,7 @@ $(ICONV_LIB) : $(ICONV_TIMESTAMP)
cd ${ICONV_DIR}; \ cd ${ICONV_DIR}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-iconv; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-iconv; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \ --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \
--platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \ --platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
export CC=${CROSS_PREFIX}gcc; \ export CC=${CROSS_PREFIX}gcc; \
@ -500,7 +500,7 @@ $(IRRLICHT_LIB): $(IRRLICHT_TIMESTAMP) $(FREETYPE_LIB)
export PATH=$$PATH:${ANDROID_NDK}; \ export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for irrlicht detected building..."; \ echo "changed timestamp for irrlicht detected building..."; \
cd deps/irrlicht/source/Irrlicht/Android; \ cd deps/irrlicht/source/Irrlicht/Android; \
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \ ndk-build NDEBUG=${NDEBUG} \
APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} || exit 1; \ APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} || exit 1; \
touch ${IRRLICHT_TIMESTAMP}; \ touch ${IRRLICHT_TIMESTAMP}; \
touch ${IRRLICHT_TIMESTAMP_INT}; \ touch ${IRRLICHT_TIMESTAMP_INT}; \
@ -550,7 +550,7 @@ $(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
export CROSS_PREFIX=${CROSS_PREFIX}; \ export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-curl; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-curl; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \ --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \
--platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \ --platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
export CC=${CROSS_PREFIX}gcc; \ export CC=${CROSS_PREFIX}gcc; \
@ -607,10 +607,10 @@ $(GMP_LIB): $(GMP_TIMESTAMP)
export PATH=$$PATH:${ANDROID_NDK}; \ export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for gmp detected building..."; \ echo "changed timestamp for gmp detected building..."; \
cd deps/gmp; \ cd deps/gmp; \
export CROSS_PREFIX=${CROSS_PREFIX}; \ export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-gmp; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-gmp; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \ --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \
--platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \ --platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
export CC=${CROSS_PREFIX}gcc; \ export CC=${CROSS_PREFIX}gcc; \
@ -702,7 +702,7 @@ $(LUAJIT_LIB): $(LUAJIT_TIMESTAMP)
export CROSS_PREFIX=${CROSS_PREFIX}; \ export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-luajit; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-luajit; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \ --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \
--platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \ --platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
export TARGET_FLAGS="${TARGET_CFLAGS_ADDON}"; \ export TARGET_FLAGS="${TARGET_CFLAGS_ADDON}"; \
@ -716,18 +716,15 @@ $(LUAJIT_LIB): $(LUAJIT_TIMESTAMP)
fi fi
clean_luajit: clean_luajit:
$(RM) -R deps/luajit $(RM) -r deps/luajit
assets : $(ASSETS_TIMESTAMP) assets : $(ASSETS_TIMESTAMP)
@REFRESH=0; \ @REFRESH=0; \
if [ ! -e ${ASSETS_TIMESTAMP}.old ] ; then \ if [ ! -e ${ASSETS_TIMESTAMP} ] ; then \
REFRESH=1; \ REFRESH=1; \
fi; \ fi; \
if [ ${ASSETS_TIMESTAMP} -nt ${ASSETS_TIMESTAMP}.old ] ; then \ if [ ${ASSETS_TIMESTAMP} -nt ${ASSETS_TIMESTAMP} ] ; then \
REFRESH=1; \ REFRESH=1; \
fi; \
if [ ! -d ${ROOT}/assets ] ; then \
REFRESH=1; \
fi; \ fi; \
if [ $$REFRESH -ne 0 ] ; then \ if [ $$REFRESH -ne 0 ] ; then \
echo "assets changed, refreshing..."; \ echo "assets changed, refreshing..."; \
@ -749,9 +746,10 @@ assets : $(ASSETS_TIMESTAMP)
find . -type f -path "*.gitignore" -exec rm -rf {} \; ; \ find . -type f -path "*.gitignore" -exec rm -rf {} \; ; \
ls -R | grep ":$$" | sed -e 's/:$$//' -e 's/\.//' -e 's/^\///' > "index.txt"; \ ls -R | grep ":$$" | sed -e 's/:$$//' -e 's/\.//' -e 's/^\///' > "index.txt"; \
find MultiCraft >"filelist.txt"; \ find MultiCraft >"filelist.txt"; \
cp ${ROOT}/${ASSETS_TIMESTAMP} ${ROOT}/${ASSETS_TIMESTAMP}.old; \
echo "Creating Files.zip"; \ echo "Creating Files.zip"; \
zip -r Files.zip MultiCraft; \ zip -r Files.zip MultiCraft; \
touch ${ASSETS_TIMESTAMP}; \
touch ${ASSETS_TIMESTAMP_INT}; \
else \ else \
echo "nothing to be done for assets"; \ echo "nothing to be done for assets"; \
fi fi
@ -760,14 +758,14 @@ clean_assets :
@$(RM) -r assets @$(RM) -r assets
apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) \ apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) \
$(LUAJIT_LIB) \ $(LUAJIT_LIB) \
$(OPENAL_LIB) $(OGG_LIB) prep_srcdir $(ROOT)/jni/src/android_version.h \ $(OPENAL_LIB) $(OGG_LIB) prep_srcdir $(ROOT)/jni/src/android_version.h \
$(ROOT)/jni/src/android_version_githash.h sqlite3_download $(ROOT)/jni/src/android_version_githash.h sqlite3_download
@export NDEBUG=$$NDEBUG; $(MAKE) manifest; \ @export NDEBUG=$$NDEBUG; $(MAKE) manifest; \
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \ export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
export ANDROID_HOME=${SDKFOLDER}; \ export ANDROID_HOME=${SDKFOLDER}; \
mkdir -p ${ROOT}/src; \ mkdir -p ${ROOT}/src; \
ndk-build NDK_MODULE_PATH=${NDK_MODULE_PATH} \ ndk-build NDEBUG=${NDEBUG} \
GPROF=${GPROF} APP_ABI=${TARGET_ABI} \ GPROF=${GPROF} APP_ABI=${TARGET_ABI} \
APP_PLATFORM=${APP_PLATFORM} \ APP_PLATFORM=${APP_PLATFORM} \
TARGET_LIBDIR=${TARGET_LIBDIR} \ TARGET_LIBDIR=${TARGET_LIBDIR} \

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.orig 2016-02-15 05:33:03.000000000 +0200
+++ irrlicht/source/Irrlicht/Android/jni/Android.mk 2016-02-15 05:34:34.913711815 +0200 +++ irrlicht/source/Irrlicht/Android/jni/Android.mk 2016-02-15 05:34:34.913711815 +0200
@@ -11,7 +11,8 @@ @@ -11,7 +11,9 @@
ifndef NDEBUG ifndef NDEBUG
LOCAL_CFLAGS += -g -D_DEBUG LOCAL_CFLAGS += -g -D_DEBUG
else else
-LOCAL_CFLAGS += -fexpensive-optimizations -O3 -LOCAL_CFLAGS += -fexpensive-optimizations -O3
+LOCAL_CFLAGS += -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mfloat-abi=hard -march=armv7-a -Ofast -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)
+LOCAL_LDFLAGS = -Wl,--no-warn-mismatch,--gc-sections -lm_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
+endif
endif endif
LOCAL_C_INCLUDES := ../../../include LOCAL_C_INCLUDES := ../../../include

View File

@ -66,8 +66,7 @@ ifdef GPROF
GPROF_DEF=-DGPROF GPROF_DEF=-DGPROF
endif endif
LOCAL_CFLAGS := -D_IRR_ANDROID_PLATFORM_ \ LOCAL_CFLAGS := -DHAVE_TOUCHSCREENGUI \
-DHAVE_TOUCHSCREENGUI \
-DUSE_CURL=1 \ -DUSE_CURL=1 \
-DUSE_SOUND=1 \ -DUSE_SOUND=1 \
-DUSE_FREETYPE=1 \ -DUSE_FREETYPE=1 \
@ -79,7 +78,7 @@ LOCAL_CFLAGS += -g -D_DEBUG -O0 -fno-omit-frame-pointer
else else
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard) ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)
LOCAL_CFLAGS += -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mfloat-abi=hard -march=armv7-a -Ofast -fno-fast-math -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 -fno-fast-math -fdata-sections -ffunction-sections -fmodulo-sched -fmodulo-sched-allow-regmoves -Wno-deprecated-declarations
LOCAL_LDFLAGS = -Wl,--no-warn-mismatch,--gc-sections -lm_hard LOCAL_LDFLAGS = -Wl,--no-warn-mismatch,--gc-sections -lm_hard
endif endif
@ -92,6 +91,7 @@ endif
ifeq ($(TARGET_ARCH_ABI),x86) ifeq ($(TARGET_ARCH_ABI),x86)
LOCAL_CFLAGS += -fno-stack-protector LOCAL_CFLAGS += -fno-stack-protector
LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true
endif endif
LOCAL_C_INCLUDES := \ LOCAL_C_INCLUDES := \
@ -107,7 +107,7 @@ LOCAL_C_INCLUDES := \
deps/libvorbis-libogg-android/jni/include \ deps/libvorbis-libogg-android/jni/include \
deps/gmp/usr/include \ deps/gmp/usr/include \
deps/sqlite/ \ deps/sqlite/ \
deps/luajit/src deps/luajit/src
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
jni/src/ban.cpp \ jni/src/ban.cpp \

View File

@ -1,6 +1,3 @@
NDK_TOOLCHAIN_VERSION := 4.9 APP_MODULES := multicraft
APP_MODULES := multicraft APP_STL := gnustl_static
APP_STL := gnustl_static APP_CPPFLAGS += -fexceptions -frtti
APP_CPPFLAGS += -fexceptions
APP_GNUSTL_FORCE_CPP_FEATURES := rtti

View File

@ -133,4 +133,4 @@ local function init_globals()
--minetest.set_background("header",minetest.formspec_escape(mm_texture.basetexturedir)..'header.png') --minetest.set_background("header",minetest.formspec_escape(mm_texture.basetexturedir)..'header.png')
end end
init_globals() init_globals()

View File

@ -447,8 +447,7 @@ fall_bobbing_amount (Fall bobbing) float 0.0
# - interlaced: odd/even line based polarisation screen support. # - interlaced: odd/even line based polarisation screen support.
# - topbottom: split screen top/bottom. # - topbottom: split screen top/bottom.
# - sidebyside: split screen side by side. # - sidebyside: split screen side by side.
# - pageflip: quadbuffer based 3d. 3d_mode (3D mode) enum none none,anaglyph,interlaced,topbottom,sidebyside
3d_mode (3D mode) enum none none,anaglyph,interlaced,topbottom,sidebyside,pageflip
# In-game chat console background color (R,G,B). # In-game chat console background color (R,G,B).
console_color (Console color) string (0,0,0) console_color (Console color) string (0,0,0)

View File

@ -510,8 +510,7 @@
# - interlaced: odd/even line based polarisation screen support. # - interlaced: odd/even line based polarisation screen support.
# - topbottom: split screen top/bottom. # - topbottom: split screen top/bottom.
# - sidebyside: split screen side by side. # - sidebyside: split screen side by side.
# - pageflip: quadbuffer based 3d. # type: enum values: none, anaglyph, interlaced, topbottom, sidebyside
# type: enum values: none, anaglyph, interlaced, topbottom, sidebyside, pageflip
# 3d_mode = none # 3d_mode = none
# In-game chat console background color (R,G,B). # In-game chat console background color (R,G,B).

View File

@ -512,9 +512,6 @@ bool ClientLauncher::create_engine_device()
u16 bits = g_settings->getU16("fullscreen_bpp"); u16 bits = g_settings->getU16("fullscreen_bpp");
u16 fsaa = g_settings->getU16("fsaa"); u16 fsaa = g_settings->getU16("fsaa");
// stereo buffer required for pageflip stereo
bool stereo_buffer = g_settings->get("3d_mode") == "pageflip";
// Determine driver // Determine driver
video::E_DRIVER_TYPE driverType = video::EDT_OPENGL; video::E_DRIVER_TYPE driverType = video::EDT_OPENGL;
std::string driverstring = g_settings->get("video_driver"); std::string driverstring = g_settings->get("video_driver");
@ -540,7 +537,6 @@ bool ClientLauncher::create_engine_device()
params.AntiAlias = fsaa; params.AntiAlias = fsaa;
params.Fullscreen = fullscreen; params.Fullscreen = fullscreen;
params.Stencilbuffer = false; params.Stencilbuffer = false;
params.Stereobuffer = stereo_buffer;
params.Vsync = vsync; params.Vsync = vsync;
params.EventReceiver = receiver; params.EventReceiver = receiver;
params.HighPrecisionFPU = g_settings->getBool("high_precision_fpu"); params.HighPrecisionFPU = g_settings->getBool("high_precision_fpu");

View File

@ -936,7 +936,11 @@ video::ITexture* TextureSource::generateTextureFromMesh(
smgr->drop(); smgr->drop();
// Unset render target // Unset render target
//#if ((IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR < 9))
driver->setRenderTarget(0, false, true, 0); driver->setRenderTarget(0, false, true, 0);
//#else
// driver->setRenderTarget(0, video::ECBF_COLOR, 0);
//#endif
if (params.delete_texture_on_shutdown) if (params.delete_texture_on_shutdown)
m_texture_trash.push_back(rtt); m_texture_trash.push_back(rtt);

View File

@ -377,82 +377,6 @@ void draw_top_bottom_3d_mode(Camera& camera, bool show_hud,
camera.getCameraNode()->setTarget(oldTarget); camera.getCameraNode()->setTarget(oldTarget);
} }
void draw_pageflip_3d_mode(Camera& camera, bool show_hud,
Hud& hud, video::IVideoDriver* driver,
scene::ISceneManager* smgr, const v2u32& screensize,
bool draw_wield_tool, Client& client, gui::IGUIEnvironment* guienv,
video::SColor skycolor)
{
/* preserve old setup*/
irr::core::vector3df oldPosition = camera.getCameraNode()->getPosition();
irr::core::vector3df oldTarget = camera.getCameraNode()->getTarget();
irr::core::matrix4 startMatrix =
camera.getCameraNode()->getAbsoluteTransformation();
irr::core::vector3df focusPoint = (camera.getCameraNode()->getTarget()
- camera.getCameraNode()->getAbsolutePosition()).setLength(1)
+ camera.getCameraNode()->getAbsolutePosition();
//Left eye...
driver->setRenderTarget(irr::video::ERT_STEREO_LEFT_BUFFER);
irr::core::vector3df leftEye;
irr::core::matrix4 leftMove;
leftMove.setTranslation(
irr::core::vector3df(-g_settings->getFloat("3d_paralax_strength"),
0.0f, 0.0f));
leftEye = (startMatrix * leftMove).getTranslation();
//clear the depth buffer, and color
driver->beginScene(true, true, irr::video::SColor(200, 200, 200, 255));
camera.getCameraNode()->setPosition(leftEye);
camera.getCameraNode()->setTarget(focusPoint);
smgr->drawAll();
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
if (show_hud) {
hud.drawSelectionMesh();
if (draw_wield_tool)
camera.drawWieldedTool(&leftMove);
hud.drawHotbar(client.getPlayerItem());
hud.drawLuaElements(camera.getOffset());
camera.drawNametags();
}
guienv->drawAll();
//Right eye...
driver->setRenderTarget(irr::video::ERT_STEREO_RIGHT_BUFFER);
irr::core::vector3df rightEye;
irr::core::matrix4 rightMove;
rightMove.setTranslation(
irr::core::vector3df(g_settings->getFloat("3d_paralax_strength"),
0.0f, 0.0f));
rightEye = (startMatrix * rightMove).getTranslation();
//clear the depth buffer, and color
driver->beginScene(true, true, irr::video::SColor(200, 200, 200, 255));
camera.getCameraNode()->setPosition(rightEye);
camera.getCameraNode()->setTarget(focusPoint);
smgr->drawAll();
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
if (show_hud) {
hud.drawSelectionMesh();
if (draw_wield_tool)
camera.drawWieldedTool(&rightMove);
hud.drawHotbar(client.getPlayerItem());
hud.drawLuaElements(camera.getOffset());
camera.drawNametags();
}
guienv->drawAll();
camera.getCameraNode()->setPosition(oldPosition);
camera.getCameraNode()->setTarget(oldTarget);
}
void draw_plain(Camera &camera, bool show_hud, Hud &hud, void draw_plain(Camera &camera, bool show_hud, Hud &hud,
video::IVideoDriver *driver, bool draw_wield_tool, video::IVideoDriver *driver, bool draw_wield_tool,
Client &client, gui::IGUIEnvironment *guienv) Client &client, gui::IGUIEnvironment *guienv)
@ -516,13 +440,6 @@ void draw_scene(video::IVideoDriver *driver, scene::ISceneManager *smgr,
smgr, screensize, draw_wield_tool, client, guienv, skycolor); smgr, screensize, draw_wield_tool, client, guienv, skycolor);
show_hud = false; show_hud = false;
} }
else if (draw_mode == "pageflip")
{
draw_pageflip_3d_mode(camera, show_hud, hud, driver,
smgr, screensize, draw_wield_tool, client, guienv, skycolor);
draw_crosshair = false;
show_hud = false;
}
else { else {
draw_plain(camera, show_hud, hud, driver, draw_plain(camera, show_hud, hud, driver,
draw_wield_tool, client, guienv); draw_wield_tool, client, guienv);

View File

@ -1863,10 +1863,6 @@ void Game::run()
void Game::shutdown() void Game::shutdown()
{ {
if (g_settings->get("3d_mode") == "pageflip") {
driver->setRenderTarget(irr::video::ERT_STEREO_BOTH_BUFFERS);
}
showOverlayMessage(wgettext("Shutting down..."), 0, 0, false); showOverlayMessage(wgettext("Shutting down..."), 0, 0, false);
if (clouds) if (clouds)

View File

@ -105,7 +105,7 @@ void ItemDefinition::reset()
inventory_image = ""; inventory_image = "";
wield_image = ""; wield_image = "";
wield_scale = v3f(1.0, 1.0, 1.0); wield_scale = v3f(1.0, 1.0, 1.0);
stack_max = 99; stack_max = 64;
usable = false; usable = false;
liquids_pointable = false; liquids_pointable = false;
if(tool_capabilities) if(tool_capabilities)

View File

@ -70,7 +70,9 @@ void set_light_table(float gamma)
* of 1.8 the light values set by this function are the same as those * of 1.8 the light values set by this function are the same as those
* hardcoded in the initalizer list for the declaration of light_LUT. * hardcoded in the initalizer list for the declaration of light_LUT.
*/ */
static const int adjustments[LIGHT_MAX + 1] = {
// I'm not sure it can be done. But it works just fine! :)
/*static const int adjustments[LIGHT_MAX + 1] = {
7, 7,
7, 7,
7, 7,
@ -86,7 +88,7 @@ void set_light_table(float gamma)
-40, -40,
-25, -25,
0 0
}; };*/
gamma = rangelim(gamma, 1.0, 3.0); gamma = rangelim(gamma, 1.0, 3.0);
@ -94,7 +96,8 @@ void set_light_table(float gamma)
for (size_t i = 0; i < LIGHT_MAX; i++) { for (size_t i = 0; i < LIGHT_MAX; i++) {
light_LUT[i] = (u8)(255 * powf(brightness / 255.0f, gamma)); light_LUT[i] = (u8)(255 * powf(brightness / 255.0f, gamma));
light_LUT[i] = rangelim(light_LUT[i] + adjustments[i], 0, 255); //light_LUT[i] = rangelim(light_LUT[i] + adjustments[i], 0, 255);
light_LUT[i] = rangelim(light_LUT[i] + 10, 0, 255);
if (i > 1 && light_LUT[i] < light_LUT[i-1]) if (i > 1 && light_LUT[i] < light_LUT[i-1])
light_LUT[i] = light_LUT[i-1] + 1; light_LUT[i] = light_LUT[i-1] + 1;
brightness += brightness_step; brightness += brightness_step;
@ -385,4 +388,3 @@ u8 light_decode_table[LIGHT_MAX+1] =
}; };
#endif #endif

View File

@ -102,13 +102,6 @@ std::wstring utf8_to_wide(const std::string &input)
return out; return out;
} }
#ifdef __ANDROID__
// TODO: this is an ugly fix for wide_to_utf8 somehow not working on android
std::string wide_to_utf8(const std::wstring &input)
{
return wide_to_narrow(input);
}
#else
std::string wide_to_utf8(const std::wstring &input) std::string wide_to_utf8(const std::wstring &input)
{ {
size_t inbuf_size = (input.length() + 1) * sizeof(wchar_t); size_t inbuf_size = (input.length() + 1) * sizeof(wchar_t);
@ -135,7 +128,6 @@ std::string wide_to_utf8(const std::wstring &input)
return out; return out;
} }
#endif
#else // _WIN32 #else // _WIN32
std::wstring utf8_to_wide(const std::string &input) std::wstring utf8_to_wide(const std::string &input)
@ -202,23 +194,12 @@ wchar_t *narrow_to_wide_c(const char *str)
#ifdef __ANDROID__ #ifdef __ANDROID__
const wchar_t* wide_chars =
L" !\"#$%&'()*+,-./0123456789:;<=>?@"
L"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`"
L"abcdefghijklmnopqrstuvwxyz{|}~";
int wctomb(char *s, wchar_t wc) int wctomb(char *s, wchar_t wc)
{ {
for (unsigned int j = 0; j < (sizeof(wide_chars)/sizeof(wchar_t));j++) { if (wc == L'\n') {
if (wc == wide_chars[j]) {
*s = (char) (j+32);
return 1;
}
else if (wc == L'\n') {
*s = '\n'; *s = '\n';
return 1; return 1;
} }
}
return -1; return -1;
} }
@ -235,27 +216,7 @@ int mbtowc(wchar_t *pwc, const char *s, size_t n)
} }
} }
std::wstring narrow_to_wide(const std::string &mbs) { #endif
size_t wcl = mbs.size();
std::wstring retval = L"";
for (unsigned int i = 0; i < wcl; i++) {
if (((unsigned char) mbs[i] >31) &&
((unsigned char) mbs[i] < 127)) {
retval += wide_chars[(unsigned char) mbs[i] -32];
}
//handle newline
else if (mbs[i] == '\n') {
retval += L'\n';
}
}
return retval;
}
#else // not Android
std::wstring narrow_to_wide(const std::string &mbs) std::wstring narrow_to_wide(const std::string &mbs)
{ {
@ -268,38 +229,6 @@ std::wstring narrow_to_wide(const std::string &mbs)
return *wcs; return *wcs;
} }
#endif
#ifdef __ANDROID__
std::string wide_to_narrow(const std::wstring &wcs) {
size_t mbl = wcs.size()*4;
std::string retval = "";
for (unsigned int i = 0; i < wcs.size(); i++) {
wchar_t char1 = (wchar_t) wcs[i];
if (char1 == L'\n') {
retval += '\n';
continue;
}
for (unsigned int j = 0; j < wcslen(wide_chars);j++) {
wchar_t char2 = (wchar_t) wide_chars[j];
if (char1 == char2) {
char toadd = (j+32);
retval += toadd;
break;
}
}
}
return retval;
}
#else // not Android
std::string wide_to_narrow(const std::wstring &wcs) std::string wide_to_narrow(const std::wstring &wcs)
{ {
size_t mbl = wcs.size() * 4; size_t mbl = wcs.size() * 4;
@ -312,8 +241,6 @@ std::string wide_to_narrow(const std::wstring &wcs)
return *mbs; return *mbs;
} }
#endif
std::string urlencode(std::string str) std::string urlencode(std::string str)
{ {
// Encodes non-unreserved URI characters by a percent sign // Encodes non-unreserved URI characters by a percent sign
@ -729,7 +656,34 @@ static bool parseNamedColorString(const std::string &value, video::SColor &color
return true; return true;
} }
std::wstring removeChatEscapes(const std::wstring &s) {
std::wstring output;
size_t i = 0;
while (i < s.length()) {
if (s[i] == L'\v') {
++i;
if (i == s.length()) continue;
if (s[i] == L'(') {
++i;
while (i < s.length() && s[i] != L')') {
if (s[i] == L'\\') {
++i;
}
++i;
}
++i;
} else {
++i;
}
continue;
}
output += s[i];
++i;
}
return output;
}
void str_replace(std::string &str, char from, char to) void str_replace(std::string &str, char from, char to)
{ {
std::replace(str.begin(), str.end(), from, to); std::replace(str.begin(), str.end(), from, to);
} }