This commit is contained in:
Maksim Gamarnik 2016-03-04 15:14:34 +02:00
parent 69b1dca4f3
commit 25d909bfdc
8 changed files with 197 additions and 260 deletions

View File

@ -21,13 +21,12 @@ 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 -mfloat-abi=hard -march=armv7-a -Ofast
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_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON)
TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch -lm_hard
TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections -lm_hard
TARGET_ARCH = armv7
CROSS_PREFIX = arm-linux-androideabi-
COMPILER_VERSION = 4.9
HAVE_LEVELDB = 0
################################################################################
# toolchain config for ARMv8
@ -43,7 +42,6 @@ HAVE_LEVELDB = 0
# TARGET_ARCH = arm64
# CROSS_PREFIX = aarch64-linux-android-
# COMPILER_VERSION = 4.9
# HAVE_LEVELDB = 0
################################################################################
# toolchain config for x86
@ -59,77 +57,76 @@ HAVE_LEVELDB = 0
# TARGET_ARCH = x86
# CROSS_PREFIX = i686-linux-android-
# COMPILER_VERSION = 4.9
# HAVE_LEVELDB = 0
################################################################################
ASSETS_TIMESTAMP = deps/assets_timestamp
LEVELDB_DIR = $(ROOT)/deps/leveldb/
LEVELDB_LIB = $(LEVELDB_DIR)libleveldb.a
LEVELDB_TIMESTAMP = $(LEVELDB_DIR)/timestamp
LEVELDB_TIMESTAMP_INT = $(ROOT)/deps/leveldb_timestamp
LEVELDB_URL_GIT = https://github.com/google/leveldb
LEVELDB_COMMIT = 2d0320a458d0e6a20fff46d5f80b18bfdcce7018
OPENAL_DIR = $(ROOT)/deps/openal-soft/
OPENAL_DIR = $(ROOT)/deps/openal-soft/android
OPENAL_LIB = $(OPENAL_DIR)libs/$(TARGET_ABI)/libopenal.so
OPENAL_TIMESTAMP = $(OPENAL_DIR)/timestamp
OPENAL_TIMESTAMP_INT = $(ROOT)/deps/openal_timestamp
OPENAL_URL_GIT = https://github.com/apportable/openal-soft
OPENAL_URL_GIT = https://github.com/Wemersive/openal-soft
OGG_DIR = $(ROOT)/deps/libvorbis-libogg-android/
OGG_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so
VORBIS_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so
OGG_TIMESTAMP = $(OGG_DIR)timestamp
OGG_DIR = $(ROOT)/deps/libvorbis-libogg-android
OGG_LIB = $(OGG_DIR)/libs/$(TARGET_ABI)/libogg.so
VORBIS_LIB = $(OGG_DIR)/libs/$(TARGET_ABI)/libogg.so
OGG_TIMESTAMP = $(OGG_DIR)/timestamp
OGG_TIMESTAMP_INT = $(ROOT)/deps/ogg_timestamp
OGG_URL_GIT = https://github.com/vincentjames501/libvorbis-libogg-android
IRRLICHT_REVISION = 5122
IRRLICHT_DIR = $(ROOT)/deps/irrlicht/
IRRLICHT_LIB = $(IRRLICHT_DIR)lib/Android/libIrrlicht.a
IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)timestamp
IRRLICHT_COMMIT = 58fa0cf3419c2733159fc3c6253634bedada3bfe
IRRLICHT_DIR = $(ROOT)/deps/irrlicht
IRRLICHT_LIB = $(IRRLICHT_DIR)/lib/Android/libIrrlicht.a
IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)/timestamp
IRRLICHT_TIMESTAMP_INT = $(ROOT)/deps/irrlicht_timestamp
IRRLICHT_URL_SVN = http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@$(IRRLICHT_REVISION)
IRRLICHT_URL_HTTP = https://github.com/zaki/irrlicht/archive/$(IRRLICHT_COMMIT).zip
OPENSSL_VERSION = 1.0.2f
OPENSSL_BASEDIR = openssl-$(OPENSSL_VERSION)
OPENSSL_DIR = $(ROOT)/deps/$(OPENSSL_BASEDIR)/
OPENSSL_DIR = $(ROOT)/deps/openssl
OPENSSL_LIB = $(OPENSSL_DIR)/libssl.so.1.0.0
OPENSSL_TIMESTAMP = $(OPENSSL_DIR)timestamp
OPENSSL_TIMESTAMP = $(OPENSSL_DIR)/timestamp
OPENSSL_TIMESTAMP_INT = $(ROOT)/deps/openssl_timestamp
OPENSSL_URL = http://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz
OPENSSL_URL = ftp://ftp.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz
CURL_VERSION = 7.47.1
CURL_DIR = $(ROOT)/deps/curl-$(CURL_VERSION)
CURL_DIR = $(ROOT)/deps/curl
CURL_LIB = $(CURL_DIR)/lib/.libs/libcurl.a
CURL_TIMESTAMP = $(CURL_DIR)/timestamp
CURL_TIMESTAMP_INT = $(ROOT)/deps/curl_timestamp
CURL_URL_HTTP = http://curl.haxx.se/download/curl-${CURL_VERSION}.tar.bz2
GMP_VERSION = 6.1.0
GMP_DIR = $(ROOT)/deps/gmp-$(GMP_VERSION)
GMP_DIR = $(ROOT)/deps/gmp
GMP_LIB = $(GMP_DIR)/usr/lib/libgmp.so
GMP_TIMESTAMP = $(GMP_DIR)/timestamp
GMP_TIMESTAMP_INT = $(ROOT)/deps/gmp_timestamp
GMP_URL_HTTP = https://gmplib.org/download/gmp/gmp-$(GMP_VERSION).tar.bz2
FREETYPE_VERSION = 2.6.2
FREETYPE_DIR = $(ROOT)/deps/freetype-$(FREETYPE_VERSION)
FREETYPE_DIR = $(ROOT)/deps/freetype
FREETYPE_LIB = $(FREETYPE_DIR)/objs/.libs/libfreetype.a
FREETYPE_TIMESTAMP = $(FREETYPE_DIR)/timestamp
FREETYPE_TIMESTAMP_INT = $(ROOT)/deps/freetype_timestamp
FREETYPE_URL_HTTP = http://sourceforge.net/projects/freetype/files/freetype2/2.6.2/freetype-$(FREETYPE_VERSION).tar.bz2
ICONV_VERSION = 1.14
ICONV_DIR = $(ROOT)/deps/libiconv/
ICONV_LIB = $(ICONV_DIR)/lib/.libs/libiconv.so
ICONV_TIMESTAMP = $(ICONV_DIR)timestamp
ICONV_DIR = $(ROOT)/deps/libiconv
ICONV_LIB = $(ICONV_DIR)/lib/.libs/libiconv.a
ICONV_TIMESTAMP = $(ICONV_DIR)/timestamp
ICONV_TIMESTAMP_INT = $(ROOT)/deps/iconv_timestamp
ICONV_URL_HTTP = http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$(ICONV_VERSION).tar.gz
SQLITE3_FOLDER = sqlite-amalgamation-3110000
SQLITE3_URL = http://www.sqlite.org/2016/$(SQLITE3_FOLDER).zip
SQLITE3_VERSION= 3110000
SQLITE3_DIR = $(ROOT)/deps/sqlite-amalgamation-$(SQLITE3_VERSION)
SQLITE3_URL = http://www.sqlite.org/2016/sqlite-amalgamation-$(SQLITE3_VERSION).zip
LUAJIT_GIT_BRANCH = v2.1
LUAJIT_DIR = $(ROOT)/deps/luajit
LUAJIT_LIB = $(LUAJIT_DIR)src/libluajit.a
LUAJIT_TIMESTAMP = $(LUAJIT_DIR)/timestamp
LUAJIT_TIMESTAMP_INT = $(ROOT)/deps/luajit_timestamp
LUAJIT_URL_GIT = https://github.com/LuaJIT/LuaJIT.git
################################################################################
@ -146,21 +143,16 @@ VERSION_PATCH := $(shell cat $(ROOT)/../../CMakeLists.txt | \
-include $(PATHCFGFILE)
#use interim target variable to switch leveldb on or off
ifeq ($(HAVE_LEVELDB),1)
LEVELDB_TARGET = $(LEVELDB_LIB)
endif
.PHONY : debug release reconfig delconfig \
leveldb_download clean_leveldb leveldb\
irrlicht_download clean_irrlicht irrlicht \
clean_assets assets sqlite3_download \
freetype_download clean_freetype freetype \
luajit_download clean_luajit luajit \
apk clean_apk \
clean_all clean prep_srcdir \
install_debug install envpaths all \
manifest clean_manifest\
$(ASSETS_TIMESTAMP) $(LEVELDB_TIMESTAMP) \
$(ASSETS_TIMESTAMP) $(LUAJIT_TIMESTAMP) \
$(OPENAL_TIMESTAMP) $(OGG_TIMESTAMP) \
$(IRRLICHT_TIMESTAMP) $(CURL_TIMESTAMP) \
$(OPENSSL_TIMESTAMP) \
@ -210,7 +202,7 @@ $(PATHCFGFILE) :
$(OPENAL_TIMESTAMP) : openal_download
@LAST_MODIF=$$(find ${OPENAL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
touch ${OPENAL_TIMESTAMP}; \
touch ${OPENAL_TIMESTAMP}; \
fi
openal_download :
@ -224,19 +216,19 @@ openal_download :
openal : $(OPENAL_LIB)
$(OPENAL_LIB): $(OPENAL_TIMESTAMP)
+ @REFRESH=0; \
+ @REFRESH=0; \
if [ ! -e ${OPENAL_TIMESTAMP_INT} ] ; then \
REFRESH=1; \
fi; \
if [ ${OPENAL_TIMESTAMP} -nt ${OPENAL_TIMESTAMP_INT} ] ; then \
REFRESH=1; \
REFRESH=1; \
fi; \
if [ $$REFRESH -ne 0 ] ; then \
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for openal detected building..."; \
cd ${OPENAL_DIR}; \
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \
APP_ABI=${TARGET_ABI} 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}" \
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \
@ -278,7 +270,7 @@ $(OGG_LIB): $(OGG_TIMESTAMP)
REFRESH=1; \
fi; \
if [ $$REFRESH -ne 0 ] ; then \
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for ogg detected building..."; \
cd ${OGG_DIR}; \
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \
@ -305,10 +297,11 @@ openssl_download :
@if [ ! -d ${OPENSSL_DIR} ] ; then \
echo "openssl sources missing, downloading..."; \
mkdir -p ${ROOT}/deps; \
cd ${ROOT}/deps ; \
cd ${ROOT}/deps; \
wget ${OPENSSL_URL} || exit 1; \
tar -xzf ${OPENSSL_BASEDIR}.tar.gz; \
cd ${OPENSSL_BASEDIR}; \
tar -xzf openssl-$(OPENSSL_VERSION).tar.gz; \
$(RM) -rf $(ROOT)/deps/openssl-$(OPENSSL_VERSION).tar.gz; \
mv openssl-$(OPENSSL_VERSION) openssl; \
fi
openssl : $(OPENSSL_LIB)
@ -325,11 +318,10 @@ $(OPENSSL_LIB): $(OPENSSL_TIMESTAMP) $(GMP_LIB)
if [ $$REFRESH -ne 0 ] ; then \
echo "changed timestamp for openssl detected building..."; \
cd ${OPENSSL_DIR}; \
ln -s ${OPENSSL_DIR} ../openssl; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-openssl; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
--install-dir=$${TOOLCHAIN}; \
--install-dir=$${TOOLCHAIN} --platform=${APP_PLATFORM}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
CC=${CROSS_PREFIX}gcc ./Configure enable-gmp -DL_ENDIAN -I${GMP_DIR} -L${GMP_DIR}/usr/lib android-${TARGET_ARCH};\
CC=${CROSS_PREFIX}gcc ANDROID_DEV=/tmp/ndk-${TARGET_HOST} make depend; \
@ -342,68 +334,13 @@ $(OPENSSL_LIB): $(OPENSSL_TIMESTAMP) $(GMP_LIB)
fi
clean_openssl :
$(RM) -rf ${OPENSSL_DIR}; \
$(RM) -rf $(ROOT)/deps/${OPENSSL_BASEDIR}.tar.gz; \
$(RM) -rf $(ROOT)/deps/openssl
$(LEVELDB_TIMESTAMP) : leveldb_download
@LAST_MODIF=$$(find ${LEVELDB_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
touch ${LEVELDB_TIMESTAMP}; \
fi
leveldb_download :
@if [ ! -d ${LEVELDB_DIR} ] ; then \
echo "leveldb sources missing, downloading..."; \
mkdir -p ${ROOT}/deps; \
cd ${ROOT}/deps ; \
git clone ${LEVELDB_URL_GIT} || exit 1; \
cd ${LEVELDB_DIR} || exit 1; \
git checkout ${LEVELDB_COMMIT} || exit 1; \
fi
leveldb : $(LEVELDB_LIB)
ifeq ($(HAVE_LEVELDB),1)
$(LEVELDB_LIB): $(LEVELDB_TIMESTAMP)
@REFRESH=0; \
if [ ! -e ${LEVELDB_TIMESTAMP_INT} ] ; then \
REFRESH=1; \
fi; \
if [ ${LEVELDB_TIMESTAMP} -nt ${LEVELDB_TIMESTAMP_INT} ] ; then \
REFRESH=1; \
fi; \
if [ $$REFRESH -ne 0 ] ; then \
export PATH=$${PATH}:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
echo "changed timestamp for leveldb detected building..."; \
cd deps/leveldb; \
export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-leveldb; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
--install-dir=$${TOOLCHAIN}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
export CC=${CROSS_PREFIX}gcc; \
export CXX=${CROSS_PREFIX}g++; \
export CFLAGS="$${CFLAGS} ${TARGET_CFLAGS_ADDON}"; \
export CPPFLAGS="$${CPPFLAGS} ${TARGET_CFLAGS_ADDON}"; \
export LDFLAGS="$${LDFLAGS} ${TARGET_LDFLAGS_ADDON}"; \
export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
$(MAKE) -s || exit 1; \
touch ${LEVELDB_TIMESTAMP}; \
touch ${LEVELDB_TIMESTAMP_INT}; \
$(RM) -rf $${TOOLCHAIN}; \
else \
echo "nothing to be done for leveldb"; \
fi
endif
clean_leveldb :
$(RM) -rf deps/leveldb
$(RM) -rf deps/openssl-$(OPENSSL_VERSION).tar.gz; \
$(RM) -rf deps/openssl
$(FREETYPE_TIMESTAMP) : freetype_download
@LAST_MODIF=$$(find ${FREETYPE_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
touch ${FREETYPE_TIMESTAMP}; \
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
touch ${FREETYPE_TIMESTAMP}; \
fi
freetype_download :
@ -432,9 +369,9 @@ $(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP)
fi; \
if [ $$REFRESH -ne 0 ] ; then \
mkdir -p ${FREETYPE_DIR}; \
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for freetype detected building..."; \
cd deps/freetype-${FREETYPE_VERSION}; \
cd deps/freetype; \
export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-freetype; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
@ -442,19 +379,10 @@ $(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP)
--install-dir=$${TOOLCHAIN}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
export CXX=${CROSS_PREFIX}g++; \
export CC=${CROSS_PREFIX}gcc; \
export AR=${CROSS_PREFIX}ar; \
export LD=${CROSS_PREFIX}ld; \
export AS=${CROSS_PREFIX}as; \
export NM=${CROSS_PREFIX}nm; \
export STRIP=${CROSS_PREFIX}strip; \
export RANLIB=${CROSS_PREFIX}ranlib; \
export OBJDUMP=${CROSS_PREFIX}objdump; \
export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
CC=${CROSS_PREFIX}gcc ./configure --host=${TARGET_HOST}-androideabi \
CC=${CROSS_PREFIX}gcc ./configure --host=${TARGET_HOST}-androideabi \
--prefix=${TOOLCHAIN} --with-png=no --with-harfbuzz=no || exit 1; \
CC=${CROSS_PREFIX}gcc ANDROID_DEV=/tmp/ndk-${TARGET_HOST}-freetype make || exit 1; \
# $(MAKE) -s || exit 1; \
touch ${FREETYPE_TIMESTAMP}; \
touch ${FREETYPE_TIMESTAMP_INT}; \
$(RM) -rf $${TOOLCHAIN}; \
@ -500,10 +428,9 @@ $(ICONV_LIB) : $(ICONV_TIMESTAMP)
fi; \
if [ $$REFRESH -ne 0 ] ; then \
mkdir -p ${ICONV_DIR}; \
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for iconv detected building..."; \
cd ${ICONV_DIR}; \
\
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-iconv; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
@ -512,7 +439,7 @@ $(ICONV_LIB) : $(ICONV_TIMESTAMP)
export CC=${CROSS_PREFIX}gcc; \
export CXX=${CROSS_PREFIX}g++; \
export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
./configure --host=${TARGET_HOST2} || exit 1; \
./configure --enable-static --disable-shared --host=${TARGET_HOST2} || exit 1; \
sed -i 's/LIBICONV_VERSION_INFO) /LIBICONV_VERSION_INFO) -avoid-version /g' lib/Makefile; \
grep "iconv_LDFLAGS" src/Makefile; \
$(MAKE) -s || exit 1; \
@ -525,6 +452,7 @@ $(ICONV_LIB) : $(ICONV_TIMESTAMP)
clean_iconv :
$(RM) -rf ${ICONV_DIR}
$(RM) -rf ${ICONV_DIR}-${ICONV_VERSION}
#Note: Texturehack patch is required for gpu's not supporting color format
# correctly. Known bad GPU:
@ -536,12 +464,16 @@ irrlicht_download :
echo "irrlicht sources missing, downloading..."; \
mkdir -p ${ROOT}/deps; \
cd deps; \
svn co ${IRRLICHT_URL_SVN} irrlicht || exit 1; \
wget ${IRRLICHT_URL_HTTP} || exit 1; \
unzip ${IRRLICHT_COMMIT}.zip || exit 1; \
rm ${IRRLICHT_COMMIT}.zip; \
mv irrlicht-${IRRLICHT_COMMIT} irrlicht; \
cd irrlicht; \
mkdir -p lib/Android; \
patch -p1 < ../../irrlicht-touchcount.patch || exit 1; \
patch -p1 < ../../irrlicht-back_button.patch || exit 1; \
patch -p1 < ../../irrlicht-texturehack.patch || exit 1; \
patch -p1 < ../../irrlicht-optimization.patch || exit 1; \
patch -p1 < ../../irrlicht-optimization.patch || exit 1; \
fi
$(IRRLICHT_TIMESTAMP) : irrlicht_download
@ -553,7 +485,7 @@ $(IRRLICHT_TIMESTAMP) : irrlicht_download
irrlicht : $(IRRLICHT_LIB)
$(IRRLICHT_LIB): $(IRRLICHT_TIMESTAMP) $(FREETYPE_LIB)
+ @REFRESH=0; \
+ @REFRESH=0; \
if [ ! -e ${IRRLICHT_TIMESTAMP_INT} ] ; then \
REFRESH=1; \
fi; \
@ -565,14 +497,11 @@ $(IRRLICHT_LIB): $(IRRLICHT_TIMESTAMP) $(FREETYPE_LIB)
fi; \
if [ $$REFRESH -ne 0 ] ; then \
mkdir -p ${IRRLICHT_DIR}; \
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for irrlicht detected building..."; \
cd deps/irrlicht/source/Irrlicht/Android; \
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \
APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} \
TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \
APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} || exit 1; \
touch ${IRRLICHT_TIMESTAMP}; \
touch ${IRRLICHT_TIMESTAMP_INT}; \
else \
@ -596,7 +525,7 @@ curl_download :
wget ${CURL_URL_HTTP} || exit 1; \
tar -xjf curl-${CURL_VERSION}.tar.bz2 || exit 1; \
rm curl-${CURL_VERSION}.tar.bz2; \
ln -s curl-${CURL_VERSION} curl; \
mv curl-${CURL_VERSION} curl; \
fi
curl : $(CURL_LIB)
@ -614,9 +543,9 @@ $(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
fi; \
if [ $$REFRESH -ne 0 ] ; then \
mkdir -p ${CURL_DIR}; \
export PATH="$${PATH}:${SDKFOLDER}/platform-tools:${ANDROID_NDK}"; \
export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for curl detected building..."; \
cd deps/curl-${CURL_VERSION}; \
cd deps/curl; \
export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-curl; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
@ -630,7 +559,7 @@ $(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
${TARGET_CFLAGS_ADDON}"; \
export CFLAGS="$${CFLAGS} ${TARGET_CFLAGS_ADDON}"; \
export LDFLAGS="$${LDFLAGS} -L${OPENSSL_DIR} ${TARGET_LDFLAGS_ADDON}"; \
./configure --host=${TARGET_HOST} --disable-shared --enable-static --with-ssl; \
./configure --host=${TARGET_HOST} --enable-static --disable-shared --with-ssl; \
$(MAKE) -s || exit 1; \
touch ${CURL_TIMESTAMP}; \
touch ${CURL_TIMESTAMP_INT}; \
@ -640,7 +569,6 @@ $(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
fi
clean_curl :
$(RM) -rf deps/curl-${CURL_VERSION} \
$(RM) -f deps/curl
$(GMP_TIMESTAMP) : gmp_download
@ -651,13 +579,13 @@ $(GMP_TIMESTAMP) : gmp_download
gmp_download :
@if [ ! -d "${GMP_DIR}" ] ; then \
echo "gmp sources missing, downloading..."; \
mkdir -p ${ROOT}/deps; \
cd deps; \
wget ${GMP_URL_HTTP} || exit 1; \
tar -xjf gmp-${GMP_VERSION}.tar.bz2 || exit 1; \
rm gmp-${GMP_VERSION}.tar.bz2; \
ln -s gmp-${GMP_VERSION} gmp; \
echo "gmp sources missing, downloading..."; \
mkdir -p ${ROOT}/deps; \
cd deps; \
wget ${GMP_URL_HTTP} || exit 1; \
tar -xjf gmp-${GMP_VERSION}.tar.bz2 || exit 1; \
rm gmp-${GMP_VERSION}.tar.bz2; \
mv gmp-${GMP_VERSION} gmp; \
fi
gmp : $(GMP_LIB)
@ -675,9 +603,9 @@ $(GMP_LIB): $(GMP_TIMESTAMP)
fi; \
if [ $$REFRESH -ne 0 ] ; then \
mkdir -p ${GMP_DIR}; \
export PATH="$${PATH}:${SDKFOLDER}/platform-tools:${ANDROID_NDK}"; \
export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for gmp detected building..."; \
cd deps/gmp-${GMP_VERSION}; \
cd deps/gmp; \
export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-gmp; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
@ -688,7 +616,7 @@ $(GMP_LIB): $(GMP_TIMESTAMP)
export CXX=${CROSS_PREFIX}g++; \
export LIBGMP_LDFLAGS="-avoid-version"; \
export LIBGMPXX_LDFLAGS="-avoid-version"; \
./configure --disable-static --host=${TARGET_HOST} --prefix=/usr; \
./configure --host=${TARGET_HOST} --prefix=/usr; \
$(MAKE) install DESTDIR=/${GMP_DIR} || exit 1; \
touch ${GMP_TIMESTAMP}; \
touch ${GMP_TIMESTAMP_INT}; \
@ -698,29 +626,31 @@ $(GMP_LIB): $(GMP_TIMESTAMP)
fi
clean_gmp:
$(RM) -rf deps/gmp-${GMP_VERSION} \
$(RM) -f deps/gmp
sqlite3_download: deps/${SQLITE3_FOLDER}/sqlite3.c
deps/${SQLITE3_FOLDER}/sqlite3.c :
cd deps; \
wget ${SQLITE3_URL}; \
unzip ${SQLITE3_FOLDER}.zip; \
ln -s ${SQLITE3_FOLDER} sqlite
sqlite3_download:
@if [ ! -d ${SQLITE3_DIR} ] ; then \
echo "SQLITE sources missing, downloading..."; \
mkdir -p ${ROOT}/deps; \
cd ${ROOT}/deps; \
wget ${SQLITE3_URL}; \
unzip sqlite-amalgamation-$(SQLITE3_VERSION).zip; \
rm sqlite-amalgamation-$(SQLITE3_VERSION).zip; \
ln -s ${SQLITE3_DIR} sqlite; \
fi
clean_sqlite3:
cd deps && $(RM) -rf ${SQLITE3_FOLDER} && $(RM) -f ${SQLITE3_FOLDER}.zip && \
cd deps && $(RM) -rf ${SQLITE3_DIR} && \
$(RM) -f sqlite
$(ASSETS_TIMESTAMP) : $(IRRLICHT_LIB)
@mkdir -p ${ROOT}/deps; \
for DIRNAME in {builtin,client,doc,fonts,games,mods,po,textures}; do \
LAST_MODIF=$$(find ${ROOT}/../../${DIRNAME} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
if [ $$(basename $$LAST_MODIF) != "timestamp" ]; then \
touch ${ROOT}/../../${DIRNAME}/timestamp; \
touch ${ASSETS_TIMESTAMP}; \
echo ${DIRNAME} changed $$LAST_MODIF; \
if [ $$(basename $$LAST_MODIF) != "timestamp" ]; then \
touch ${ROOT}/../../${DIRNAME}/timestamp; \
touch ${ASSETS_TIMESTAMP}; \
echo ${DIRNAME} changed $$LAST_MODIF; \
fi; \
done; \
LAST_MODIF=$$(find ${IRRLICHT_DIR}/media -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
@ -732,12 +662,63 @@ $(ASSETS_TIMESTAMP) : $(IRRLICHT_LIB)
echo "conf changed"; \
touch ${ASSETS_TIMESTAMP}; \
fi; \
if [ ${ROOT}/../../README.md -nt ${ASSETS_TIMESTAMP} ] ; then \
if [ ${ROOT}/../../README.md -nt ${ASSETS_TIMESTAMP} ] ; then \
touch ${ASSETS_TIMESTAMP}; \
fi; \
if [ ! -e $(ASSETS_TIMESTAMP) ] ; then \
touch $(ASSETS_TIMESTAMP); \
fi
$(LUAJIT_TIMESTAMP) : luajit_download
@LAST_MODIF=$$(find ${LUAJIT_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
touch ${LUAJIT_TIMESTAMP}; \
fi
luajit_download :
@if [ ! -d ${LUAJIT_DIR} ] ; then \
echo "luajit sources missing, downloading..."; \
mkdir -p ${ROOT}/deps; \
cd ${ROOT}/deps; \
git clone --branch ${LUAJIT_GIT_BRANCH} ${LUAJIT_URL_GIT} luajit || exit 1; \
fi
luajit : $(LUAJIT_LIB)
$(LUAJIT_LIB): $(LUAJIT_TIMESTAMP)
@REFRESH=0; \
if [ ! -e ${LUAJIT_TIMESTAMP_INT} ] ; then \
REFRESH=1; \
fi; \
if [ ! -e ${LUAJIT_LIB} ] ; then \
REFRESH=1; \
fi; \
if [ ${LUAJIT_TIMESTAMP} -nt ${LUAJIT_TIMESTAMP_INT} ] ; then \
REFRESH=1; \
fi; \
if [ $$REFRESH -ne 0 ] ; then \
mkdir -p ${LUAJIT_DIR}; \
export PATH=$$PATH:${ANDROID_NDK}; \
echo "changed timestamp for luajit detected building..."; \
cd ${LUAJIT_DIR}; \
export CROSS_PREFIX=${CROSS_PREFIX}; \
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-luajit; \
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
--install-dir=$${TOOLCHAIN}; \
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
export TARGET_FLAGS="${TARGET_CFLAGS_ADDON}"; \
export TARGET_LDFLAGS="${TARGET_LDFLAGS_ADDON}"; \
$(MAKE) CROSS=${CROSS_PREFIX} XCFLAGS="-DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI" HOST_CC="gcc -m32" BUILDMODE=static; \
touch ${LUAJIT_TIMESTAMP}; \
touch ${LUAJIT_TIMESTAMP_INT}; \
$(RM) -rf $${TOOLCHAIN}; \
else \
echo "nothing to be done for luajit"; \
fi
clean_luajit:
$(RM) -f deps/luajit
assets : $(ASSETS_TIMESTAMP)
@REFRESH=0; \
@ -780,7 +761,8 @@ assets : $(ASSETS_TIMESTAMP)
clean_assets :
@$(RM) -r assets
apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) $(LEVELDB_TARGET) \
apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) \
$(LUAJIT_LIB) \
$(OPENAL_LIB) $(OGG_LIB) prep_srcdir $(ROOT)/jni/src/android_version.h \
$(ROOT)/jni/src/android_version_githash.h sqlite3_download
@export NDEBUG=$$NDEBUG; $(MAKE) manifest; \
@ -788,15 +770,15 @@ apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) $
export ANDROID_HOME=${SDKFOLDER}; \
mkdir -p ${ROOT}/src; \
ndk-build NDK_MODULE_PATH=${NDK_MODULE_PATH} \
GPROF=${GPROF} APP_ABI=${TARGET_ABI} HAVE_LEVELDB=${HAVE_LEVELDB} \
GPROF=${GPROF} APP_ABI=${TARGET_ABI} \
APP_PLATFORM=${APP_PLATFORM} \
TARGET_LIBDIR=${TARGET_LIBDIR} \
TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" && \
# ant $$BUILD_TYPE && \
echo " Success! =)" \
# echo "APK: bin/MultiCraft-$$BUILD_TYPE.apk" && \
echo " Success! =)" \
# echo "APK: bin/MultiCraft-$$BUILD_TYPE.apk" && \
prep_srcdir :
@if [ ! -e ${ROOT}/jni/src ]; then \
@ -821,11 +803,10 @@ envpaths :
echo "export ANDROID_HOME=${SDKFOLDER}" >> and_env;
clean_all :
@$(MAKE) clean_apk; \
$(MAKE) clean_assets clean_iconv clean_irrlicht clean_leveldb clean_curl clean_openssl \
clean_openal clean_ogg clean_gmp clean_manifest; \
$(MAKE) clean_apk; \
$(MAKE) clean_assets clean_manifest; \
sleep 1; \
$(RM) -r gen libs obj deps bin Debug and_env
$(RM) -r gen libs obj deps 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; \

View File

@ -5,8 +5,8 @@
LOCAL_CFLAGS += -g -D_DEBUG
else
-LOCAL_CFLAGS += -fexpensive-optimizations -O3
+LOCAL_CFLAGS += -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mfloat-abi=hard -march=armv7-a -Ofast
+LOCAL_LDFLAGS = -Wl,--no-warn-mismatch -lm_hard
+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
+LOCAL_LDFLAGS = -Wl,--no-warn-mismatch,--gc-sections -lm_hard
endif
LOCAL_C_INCLUDES := ../../../include

View File

@ -7,13 +7,6 @@ LOCAL_MODULE := Irrlicht
LOCAL_SRC_FILES := deps/irrlicht/lib/Android/libIrrlicht.a
include $(PREBUILT_STATIC_LIBRARY)
ifeq ($(HAVE_LEVELDB), 1)
include $(CLEAR_VARS)
LOCAL_MODULE := LevelDB
LOCAL_SRC_FILES := deps/leveldb/libleveldb.a
include $(PREBUILT_STATIC_LIBRARY)
endif
include $(CLEAR_VARS)
LOCAL_MODULE := curl
LOCAL_SRC_FILES := deps/curl/lib/.libs/libcurl.a
@ -26,12 +19,12 @@ include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := iconv
LOCAL_SRC_FILES := deps/libiconv/lib/.libs/libiconv.so
include $(PREBUILT_SHARED_LIBRARY)
LOCAL_SRC_FILES := deps/libiconv/lib/.libs/libiconv.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := openal
LOCAL_SRC_FILES := deps/openal-soft/libs/$(TARGET_LIBDIR)/libopenal.so
LOCAL_SRC_FILES := deps/openal-soft/android/libs/$(TARGET_LIBDIR)/libopenal.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
@ -59,6 +52,11 @@ 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
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := multicraft
@ -73,7 +71,6 @@ LOCAL_CFLAGS := -D_IRR_ANDROID_PLATFORM_ \
-DUSE_CURL=1 \
-DUSE_SOUND=1 \
-DUSE_FREETYPE=1 \
-DUSE_LEVELDB=$(HAVE_LEVELDB) \
$(GPROF_DEF) \
-pipe -fstrict-aliasing
@ -81,8 +78,8 @@ ifndef NDEBUG
LOCAL_CFLAGS += -g -D_DEBUG -O0 -fno-omit-frame-pointer
else
LOCAL_CFLAGS += -mfpu=vfpv3-d16 -D_NDK_MATH_NO_SOFTFP=1 -mfloat-abi=hard -march=armv7-a -Ofast -fno-fast-math
LOCAL_LDFLAGS = -Wl,--no-warn-mismatch -lm_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_LDFLAGS = -Wl,--no-warn-mismatch,--gc-sections -lm_hard
# ToDo - disable for x86!
endif
@ -92,9 +89,6 @@ PROFILER_LIBS := android-ndk-profiler
LOCAL_CFLAGS += -pg
endif
# LOCAL_CFLAGS += -fsanitize=address
# LOCAL_LDFLAGS += -fsanitize=address
ifeq ($(TARGET_ARCH_ABI),x86)
LOCAL_CFLAGS += -fno-stack-protector
endif
@ -102,18 +96,17 @@ endif
LOCAL_C_INCLUDES := \
jni/src jni/src/sqlite \
jni/src/script \
jni/src/lua/src \
jni/src/json \
jni/src/cguittfont \
deps/irrlicht/include \
deps/libiconv/include \
deps/freetype/include \
deps/curl/include \
deps/openal-soft/jni/OpenAL/include \
deps/openal-soft/include \
deps/libvorbis-libogg-android/jni/include \
deps/gmp/usr/include \
deps/leveldb/include \
deps/sqlite/
deps/sqlite/ \
deps/luajit/src
LOCAL_SRC_FILES := \
jni/src/areastore.cpp \
@ -256,7 +249,6 @@ LOCAL_SRC_FILES := \
jni/src/unittest/test_voxelalgorithms.cpp \
jni/src/unittest/test_voxelmanipulator.cpp \
jni/src/touchscreengui.cpp \
jni/src/database-leveldb.cpp \
jni/src/settings.cpp \
jni/src/wieldmesh.cpp \
jni/src/client/clientlauncher.cpp \
@ -317,39 +309,6 @@ LOCAL_SRC_FILES += \
LOCAL_SRC_FILES += \
jni/src/cguittfont/xCGUITTFont.cpp
# lua
LOCAL_SRC_FILES += \
jni/src/lua/src/lapi.c \
jni/src/lua/src/lauxlib.c \
jni/src/lua/src/lbaselib.c \
jni/src/lua/src/lcode.c \
jni/src/lua/src/ldblib.c \
jni/src/lua/src/ldebug.c \
jni/src/lua/src/ldo.c \
jni/src/lua/src/ldump.c \
jni/src/lua/src/lfunc.c \
jni/src/lua/src/lgc.c \
jni/src/lua/src/linit.c \
jni/src/lua/src/liolib.c \
jni/src/lua/src/llex.c \
jni/src/lua/src/lmathlib.c \
jni/src/lua/src/lmem.c \
jni/src/lua/src/loadlib.c \
jni/src/lua/src/lobject.c \
jni/src/lua/src/lopcodes.c \
jni/src/lua/src/loslib.c \
jni/src/lua/src/lparser.c \
jni/src/lua/src/lstate.c \
jni/src/lua/src/lstring.c \
jni/src/lua/src/lstrlib.c \
jni/src/lua/src/ltable.c \
jni/src/lua/src/ltablib.c \
jni/src/lua/src/ltm.c \
jni/src/lua/src/lundump.c \
jni/src/lua/src/lvm.c \
jni/src/lua/src/lzio.c \
jni/src/lua/src/print.c
# SQLite3
LOCAL_SRC_FILES += deps/sqlite/sqlite3.c
@ -363,12 +322,9 @@ LOCAL_SRC_FILES += \
# JSONCPP
LOCAL_SRC_FILES += jni/src/json/jsoncpp.cpp
LOCAL_SHARED_LIBRARIES := iconv openal ogg vorbis gmp
LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto android_native_app_glue $(PROFILER_LIBS)
LOCAL_SHARED_LIBRARIES := openal ogg vorbis gmp
LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto iconv luajit android_native_app_glue $(PROFILER_LIBS)
ifeq ($(HAVE_LEVELDB), 1)
LOCAL_STATIC_LIBRARIES += LevelDB
endif
LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid
include $(BUILD_SHARED_LIBRARY)
@ -377,4 +333,4 @@ include $(BUILD_SHARED_LIBRARY)
ifdef GPROF
$(call import-module,android-ndk-profiler)
endif
$(call import-module,android/native_app_glue)
$(call import-module,android/native_app_glue)

View File

@ -3,7 +3,7 @@ local health_bar_definition =
{
hud_elem_type = "statbar",
position = { x=0.5, y=1 },
text = "heart.png",
text = "server_flags_damage.png",
number = 20,
direction = 0,
size = { x=24, y=24 },
@ -14,7 +14,7 @@ local breath_bar_definition =
{
hud_elem_type = "statbar",
position = { x=0.5, y=1 },
text = "bubble.png",
text = "halo.png",
number = 20,
direction = 0,
size = { x=24, y=24 },

View File

@ -346,31 +346,38 @@ void set_default_settings(Settings *settings)
settings->setDefault("enable_3d_clouds", "false");
settings->setDefault("fps_max", "40");
settings->setDefault("pause_fps_max", "10");
settings->setDefault("max_objects_per_block", "32");
settings->setDefault("max_objects_per_block", "20");
settings->setDefault("sqlite_synchronous", "1");
settings->setDefault("gui_scaling", "1.1");
settings->setDefault("curl_verify_cert","false");
settings->setDefault("mouse_sensitivity", "0.15");
settings->setDefault("hud_scaling", "0.9");
settings->setDefault("viewing_range", "25");
settings->setDefault("viewing_range", "30");
settings->setDefault("inventory_image_hack", "false");
settings->setDefault("doubletap_jump", "true");
settings->setDefault("mono_font_path", "/system/fonts/DroidSansMono.ttf");
settings->setDefault("fallback_font_path", "/system/fonts/DroidSans.ttf");
settings->setDefault("server_map_save_interval", "30");
settings->setDefault("client_unload_unused_data_timeout", "90");
settings->setDefault("active_block_range", "1");
settings->setDefault("chunksize", "3");
//check for device with small screen
//check for device with small screen
float x_inches = ((double) porting::getDisplaySize().X /
(160 * porting::getDisplayDensity()));
if (x_inches < 3.5) {
settings->setDefault("hud_scaling", "0.5");
settings->setDefault("mouse_sensitivity", "0.1");
settings->setDefault("font_size","12");
}
else if (x_inches < 5.5) {
settings->setDefault("hud_scaling", "0.6");
settings->setDefault("mouse_sensitivity", "0.1");
settings->setDefault("font_size","14");
}
else if (x_inches > 5.5) {
settings->setDefault("hud_scaling", "0.9");
settings->setDefault("mouse_sensitivity", "0.15");
}
std::stringstream anddroidfontsize;
anddroidfontsize << DEFAULT_FONT_SIZE / 3 * 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");
#endif
}

View File

@ -4221,7 +4221,6 @@ void Game::updateGui(float *statustext_time, const RunStats &stats,
guitext->setText(utf8_to_wide(os.str()).c_str());
guitext->setVisible(true);
} else if (flags.show_hud || flags.show_chat) {
#ifdef ANDROID
std::ostringstream os(std::ios_base::binary);
os << std::setprecision(1) << std::fixed
<< "(X: " << (player_position.X / BS)
@ -4230,12 +4229,6 @@ void Game::updateGui(float *statustext_time, const RunStats &stats,
<< ")";
guitext->setText(utf8_to_wide(os.str()).c_str());
guitext->setVisible(true);
#else
std::ostringstream os(std::ios_base::binary);
os << PROJECT_NAME_C " " << g_version_hash;
guitext->setText(utf8_to_wide(os.str()).c_str());
guitext->setVisible(true);
#endif
} else {
guitext->setVisible(false);
}

View File

@ -469,7 +469,7 @@ void Hud::drawHotbar(u16 playeritem) {
if ((player->hud_flags & HUD_FLAG_HEALTHBAR_VISIBLE)) {
drawStatbar(v2s32(floor(0.5 * (float)m_screensize.X + 0.5),
floor(1 * (float) m_screensize.Y + 0.5)),
HUD_CORNER_UPPER, 0, "heart.png",
HUD_CORNER_UPPER, 0, "server_flags_damage.png",
player->hp, v2s32((-10*24)-25,-(48+24+10)), v2s32(24,24));
}
@ -477,7 +477,7 @@ void Hud::drawHotbar(u16 playeritem) {
(player->getBreath() < 11)) {
drawStatbar(v2s32(floor(0.5 * (float)m_screensize.X + 0.5),
floor(1 * (float) m_screensize.Y + 0.5)),
HUD_CORNER_UPPER, 0, "bubble.png",
HUD_CORNER_UPPER, 0, "halo.png",
player->getBreath(), v2s32(25,-(48+24+10)), v2s32(24,24));
}
////////////////////////////////////////////////////////////////////////////

View File

@ -284,17 +284,17 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc)
/* init inventory button */
initButton(inventory_id,
rect<s32>(m_screensize.X-(button_size),
m_screensize.Y - (button_size),
m_screensize.Y-(button_size),
m_screensize.X,
m_screensize.Y),
L"inv", false, SLOW_BUTTON_REPEAT);
/* init drop button */
initButton(drop_id,
rect<s32>(m_screensize.X-(1*button_size),
m_screensize.Y/2-(2*button_size),
rect<s32>(m_screensize.X-(0.75*button_size),
m_screensize.Y/2-(1.75*button_size),
m_screensize.X,
m_screensize.Y/2-(1*button_size)),
m_screensize.Y/2-(0.75*button_size)),
L"drop", false, SLOW_BUTTON_REPEAT);
/* init crunch button */