ver. 1.1.2.3
@ -52,7 +52,7 @@ CROSS_PREFIX = arm-linux-androideabi-
|
|||||||
# 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 -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
|
# TARGET_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections
|
||||||
# TARGET_ARCH = x86
|
# TARGET_ARCH = x86
|
||||||
@ -70,7 +70,7 @@ OPENAL_TIMESTAMP_INT = $(ROOT)/deps/openal_timestamp
|
|||||||
OPENAL_URL_GIT = https://github.com/MoNTE48/openal-soft
|
OPENAL_URL_GIT = https://github.com/MoNTE48/openal-soft
|
||||||
|
|
||||||
VORBIS_DIR = $(ROOT)/deps/libvorbis-android
|
VORBIS_DIR = $(ROOT)/deps/libvorbis-android
|
||||||
VORBIS_LIB = $(VORBIS_DIR)/libs/$(TARGET_ABI)/libvorbis.so
|
VORBIS_LIB = $(VORBIS_DIR)/obj/local/$(TARGET_ABI)/libvorbis.a
|
||||||
VORBIS_TIMESTAMP = $(VORBIS_DIR)/timestamp
|
VORBIS_TIMESTAMP = $(VORBIS_DIR)/timestamp
|
||||||
VORBIS_TIMESTAMP_INT = $(ROOT)/deps/vorbis_timestamp
|
VORBIS_TIMESTAMP_INT = $(ROOT)/deps/vorbis_timestamp
|
||||||
VORBIS_URL_GIT = https://github.com/MoNTE48/libvorbis-android
|
VORBIS_URL_GIT = https://github.com/MoNTE48/libvorbis-android
|
||||||
@ -118,7 +118,7 @@ ICONV_TIMESTAMP = $(ICONV_DIR)/timestamp
|
|||||||
ICONV_TIMESTAMP_INT = $(ROOT)/deps/iconv_timestamp
|
ICONV_TIMESTAMP_INT = $(ROOT)/deps/iconv_timestamp
|
||||||
ICONV_URL_HTTP = http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$(ICONV_VERSION).tar.gz
|
ICONV_URL_HTTP = http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$(ICONV_VERSION).tar.gz
|
||||||
|
|
||||||
SQLITE3_VERSION= 3120000
|
SQLITE3_VERSION= 3120100
|
||||||
SQLITE3_DIR = $(ROOT)/deps/sqlite
|
SQLITE3_DIR = $(ROOT)/deps/sqlite
|
||||||
SQLITE3_URL = http://www.sqlite.org/2016/sqlite-amalgamation-$(SQLITE3_VERSION).zip
|
SQLITE3_URL = http://www.sqlite.org/2016/sqlite-amalgamation-$(SQLITE3_VERSION).zip
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ $(OPENAL_LIB): $(OPENAL_TIMESTAMP)
|
|||||||
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-build NDEBUG=${NDEBUG} \
|
||||||
APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} TARGET_ARCH_ABI=${TARGET_ABI} \
|
APP_ABI=${TARGET_ABI} 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}" \
|
||||||
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \
|
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \
|
||||||
@ -276,7 +276,7 @@ $(VORBIS_LIB): $(VORBIS_TIMESTAMP)
|
|||||||
touch ${VORBIS_TIMESTAMP}; \
|
touch ${VORBIS_TIMESTAMP}; \
|
||||||
touch ${VORBIS_TIMESTAMP_INT}; \
|
touch ${VORBIS_TIMESTAMP_INT}; \
|
||||||
else \
|
else \
|
||||||
echo "nothing to be done for libvorbis/libvorbis"; \
|
echo "nothing to be done for libvorbis"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean_vorbis :
|
clean_vorbis :
|
||||||
@ -364,7 +364,6 @@ $(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP)
|
|||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ $$REFRESH -ne 0 ] ; then \
|
if [ $$REFRESH -ne 0 ] ; then \
|
||||||
mkdir -p ${FREETYPE_DIR}; \
|
|
||||||
export PATH=$$PATH:${ANDROID_NDK}; \
|
export PATH=$$PATH:${ANDROID_NDK}; \
|
||||||
echo "changed timestamp for freetype detected building..."; \
|
echo "changed timestamp for freetype detected building..."; \
|
||||||
cd deps/freetype; \
|
cd deps/freetype; \
|
||||||
@ -403,8 +402,8 @@ iconv_download :
|
|||||||
wget ${ICONV_URL_HTTP} || exit 1; \
|
wget ${ICONV_URL_HTTP} || exit 1; \
|
||||||
tar -xzf libiconv-${ICONV_VERSION}.tar.gz || exit 1; \
|
tar -xzf libiconv-${ICONV_VERSION}.tar.gz || exit 1; \
|
||||||
rm libiconv-${ICONV_VERSION}.tar.gz; \
|
rm libiconv-${ICONV_VERSION}.tar.gz; \
|
||||||
ln -s libiconv-${ICONV_VERSION} libiconv; \
|
mv libiconv-${ICONV_VERSION} libiconv; \
|
||||||
cd ${ICONV_DIR}; \
|
cd libiconv; \
|
||||||
patch -p1 < ${ROOT}/libiconv_android.patch; \
|
patch -p1 < ${ROOT}/libiconv_android.patch; \
|
||||||
patch -p1 < ${ROOT}/libiconv_stdio.patch; \
|
patch -p1 < ${ROOT}/libiconv_stdio.patch; \
|
||||||
fi
|
fi
|
||||||
@ -423,7 +422,6 @@ $(ICONV_LIB) : $(ICONV_TIMESTAMP)
|
|||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ $$REFRESH -ne 0 ] ; then \
|
if [ $$REFRESH -ne 0 ] ; then \
|
||||||
mkdir -p ${ICONV_DIR}; \
|
|
||||||
export PATH=$$PATH:${ANDROID_NDK}; \
|
export PATH=$$PATH:${ANDROID_NDK}; \
|
||||||
echo "changed timestamp for iconv detected building..."; \
|
echo "changed timestamp for iconv detected building..."; \
|
||||||
cd ${ICONV_DIR}; \
|
cd ${ICONV_DIR}; \
|
||||||
@ -448,7 +446,6 @@ $(ICONV_LIB) : $(ICONV_TIMESTAMP)
|
|||||||
|
|
||||||
clean_iconv :
|
clean_iconv :
|
||||||
$(RM) -rf ${ICONV_DIR}
|
$(RM) -rf ${ICONV_DIR}
|
||||||
$(RM) -rf ${ICONV_DIR}-${ICONV_VERSION}
|
|
||||||
|
|
||||||
#Note: Texturehack patch is required for gpu's not supporting color format
|
#Note: Texturehack patch is required for gpu's not supporting color format
|
||||||
# correctly. Known bad GPU:
|
# correctly. Known bad GPU:
|
||||||
@ -492,7 +489,6 @@ $(IRRLICHT_LIB): $(IRRLICHT_TIMESTAMP) $(FREETYPE_LIB)
|
|||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ $$REFRESH -ne 0 ] ; then \
|
if [ $$REFRESH -ne 0 ] ; then \
|
||||||
mkdir -p ${IRRLICHT_DIR}; \
|
|
||||||
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; \
|
||||||
@ -539,7 +535,6 @@ $(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
|
|||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ $$REFRESH -ne 0 ] ; then \
|
if [ $$REFRESH -ne 0 ] ; then \
|
||||||
mkdir -p ${CURL_DIR}; \
|
|
||||||
export PATH=$$PATH:${ANDROID_NDK}; \
|
export PATH=$$PATH:${ANDROID_NDK}; \
|
||||||
echo "changed timestamp for curl detected building..."; \
|
echo "changed timestamp for curl detected building..."; \
|
||||||
cd deps/curl; \
|
cd deps/curl; \
|
||||||
@ -599,7 +594,6 @@ $(GMP_LIB): $(GMP_TIMESTAMP)
|
|||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ $$REFRESH -ne 0 ] ; then \
|
if [ $$REFRESH -ne 0 ] ; then \
|
||||||
mkdir -p ${GMP_DIR}; \
|
|
||||||
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; \
|
||||||
@ -607,7 +601,7 @@ $(GMP_LIB): $(GMP_TIMESTAMP)
|
|||||||
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}; \
|
APP_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; \
|
||||||
export CXX=${CROSS_PREFIX}g++; \
|
export CXX=${CROSS_PREFIX}g++; \
|
||||||
@ -625,9 +619,9 @@ $(GMP_LIB): $(GMP_TIMESTAMP)
|
|||||||
clean_gmp:
|
clean_gmp:
|
||||||
$(RM) -R deps/gmp
|
$(RM) -R deps/gmp
|
||||||
|
|
||||||
sqlite3_download: deps/${SQLITE3_FOLDER}/sqlite3.c
|
sqlite3_download: deps/sqlite/sqlite3.c
|
||||||
|
|
||||||
deps/${SQLITE3_FOLDER}/sqlite3.c :
|
deps/sqlite/sqlite3.c :
|
||||||
mkdir -p ${ROOT}/deps; \
|
mkdir -p ${ROOT}/deps; \
|
||||||
cd ${ROOT}/deps; \
|
cd ${ROOT}/deps; \
|
||||||
rm -R sqlite; \
|
rm -R sqlite; \
|
||||||
@ -765,8 +759,6 @@ apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) \
|
|||||||
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} \
|
||||||
TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
|
|
||||||
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
|
|
||||||
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" && \
|
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" && \
|
||||||
echo " Success! =)"; \
|
echo " Success! =)"; \
|
||||||
ant $$BUILD_TYPE && \
|
ant $$BUILD_TYPE && \
|
||||||
|
@ -29,8 +29,8 @@ include $(PREBUILT_STATIC_LIBRARY)
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := vorbis
|
LOCAL_MODULE := vorbis
|
||||||
LOCAL_SRC_FILES := deps/libvorbis-android/libs/$(TARGET_LIBDIR)/libvorbis.so
|
LOCAL_SRC_FILES := deps/libvorbis-android/obj/local/$(APP_ABI)/libvorbis.a
|
||||||
include $(PREBUILT_SHARED_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := gmp
|
LOCAL_MODULE := gmp
|
||||||
@ -84,7 +84,8 @@ LOCAL_CFLAGS += -pg
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||||
LOCAL_CFLAGS += -fno-stack-protector
|
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_LDFLAGS = -Wl,--no-warn-mismatch,--gc-sections
|
||||||
LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true
|
LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -223,26 +224,6 @@ LOCAL_SRC_FILES := \
|
|||||||
jni/src/util/string.cpp \
|
jni/src/util/string.cpp \
|
||||||
jni/src/util/srp.cpp \
|
jni/src/util/srp.cpp \
|
||||||
jni/src/util/timetaker.cpp \
|
jni/src/util/timetaker.cpp \
|
||||||
jni/src/unittest/test.cpp \
|
|
||||||
jni/src/unittest/test_collision.cpp \
|
|
||||||
jni/src/unittest/test_compression.cpp \
|
|
||||||
jni/src/unittest/test_connection.cpp \
|
|
||||||
jni/src/unittest/test_filepath.cpp \
|
|
||||||
jni/src/unittest/test_inventory.cpp \
|
|
||||||
jni/src/unittest/test_mapnode.cpp \
|
|
||||||
jni/src/unittest/test_nodedef.cpp \
|
|
||||||
jni/src/unittest/test_noderesolver.cpp \
|
|
||||||
jni/src/unittest/test_noise.cpp \
|
|
||||||
jni/src/unittest/test_objdef.cpp \
|
|
||||||
jni/src/unittest/test_profiler.cpp \
|
|
||||||
jni/src/unittest/test_random.cpp \
|
|
||||||
jni/src/unittest/test_schematic.cpp \
|
|
||||||
jni/src/unittest/test_serialization.cpp \
|
|
||||||
jni/src/unittest/test_settings.cpp \
|
|
||||||
jni/src/unittest/test_socket.cpp \
|
|
||||||
jni/src/unittest/test_utilities.cpp \
|
|
||||||
jni/src/unittest/test_voxelalgorithms.cpp \
|
|
||||||
jni/src/unittest/test_voxelmanipulator.cpp \
|
|
||||||
jni/src/touchscreengui.cpp \
|
jni/src/touchscreengui.cpp \
|
||||||
jni/src/settings.cpp \
|
jni/src/settings.cpp \
|
||||||
jni/src/wieldmesh.cpp \
|
jni/src/wieldmesh.cpp \
|
||||||
@ -317,8 +298,8 @@ LOCAL_SRC_FILES += \
|
|||||||
# JSONCPP
|
# JSONCPP
|
||||||
LOCAL_SRC_FILES += jni/src/json/jsoncpp.cpp
|
LOCAL_SRC_FILES += jni/src/json/jsoncpp.cpp
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := gmp vorbis
|
LOCAL_SHARED_LIBRARIES := gmp
|
||||||
LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto iconv LuaJIT openal android_native_app_glue $(PROFILER_LIBS)
|
LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto iconv LuaJIT openal vorbis android_native_app_glue $(PROFILER_LIBS)
|
||||||
|
|
||||||
LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid -lOpenSLES
|
LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid -lOpenSLES
|
||||||
|
|
||||||
|
@ -80,8 +80,7 @@ core.register_entity(":__builtin:item", {
|
|||||||
itemstring = self.itemstring,
|
itemstring = self.itemstring,
|
||||||
always_collect = self.always_collect,
|
always_collect = self.always_collect,
|
||||||
age = self.age,
|
age = self.age,
|
||||||
dropped_by = self.dropped_by,
|
dropped_by = self.dropped_by
|
||||||
--collect = self.collect
|
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -95,10 +94,6 @@ core.register_entity(":__builtin:item", {
|
|||||||
self.age = data.age + dtime_s
|
self.age = data.age + dtime_s
|
||||||
else
|
else
|
||||||
self.age = dtime_s
|
self.age = dtime_s
|
||||||
--end
|
|
||||||
--remember collection data
|
|
||||||
--if data.collect then
|
|
||||||
--self.collect = data.collect
|
|
||||||
end
|
end
|
||||||
self.dropped_by = data.dropped_by
|
self.dropped_by = data.dropped_by
|
||||||
end
|
end
|
||||||
@ -209,6 +204,16 @@ core.register_entity(":__builtin:item", {
|
|||||||
self.object:set_properties({physical = true})
|
self.object:set_properties({physical = true})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if nn == "default:lava_flowing" or nn == "default:lava_source" then
|
||||||
|
minetest.sound_play("default_cool_lava", {
|
||||||
|
pos=self.object:getpos(),
|
||||||
|
max_hear_distance = 6,
|
||||||
|
gain = 0.5
|
||||||
|
})
|
||||||
|
self.object:remove()
|
||||||
|
return
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_punch = function(self, hitter)
|
on_punch = function(self, hitter)
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
local function create_world_formspec(dialogdata)
|
local function create_world_formspec(dialogdata)
|
||||||
|
|
||||||
local mapgens = core.get_mapgen_names()
|
local mapgens = core.get_mapgen_names()
|
||||||
|
|
||||||
local current_seed = core.setting_get("fixed_map_seed") or ""
|
local current_seed = core.setting_get("fixed_map_seed") or ""
|
||||||
@ -57,7 +56,6 @@ local function create_world_formspec(dialogdata)
|
|||||||
--"label[2,2;" .. fgettext("Mapgen") .. "]"..
|
--"label[2,2;" .. fgettext("Mapgen") .. "]"..
|
||||||
--"dropdown[4.2,2;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]" ..
|
--"dropdown[4.2,2;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]" ..
|
||||||
|
|
||||||
--"label[2,3;" .. fgettext("Game") .. "]"..
|
|
||||||
"dropdown[6000.2,6;6.3;games;" .. gamemgr.gamelist() ..
|
"dropdown[6000.2,6;6.3;games;" .. gamemgr.gamelist() ..
|
||||||
";1]" ..
|
";1]" ..
|
||||||
|
|
||||||
@ -116,7 +114,6 @@ local function create_world_buttonhandler(this, fields)
|
|||||||
core.setting_set("menu_last_game",gamemgr.games[gameindex].id)
|
core.setting_set("menu_last_game",gamemgr.games[gameindex].id)
|
||||||
if this.data.update_worldlist_filter then
|
if this.data.update_worldlist_filter then
|
||||||
menudata.worldlist:set_filtercriteria(gamemgr.games[gameindex].id)
|
menudata.worldlist:set_filtercriteria(gamemgr.games[gameindex].id)
|
||||||
--mm_texture.update("singleplayer", gamemgr.games[gameindex].id)
|
|
||||||
end
|
end
|
||||||
menudata.worldlist:refresh()
|
menudata.worldlist:refresh()
|
||||||
core.setting_set("mainmenu_last_selected_world",
|
core.setting_set("mainmenu_last_selected_world",
|
||||||
|
@ -39,7 +39,7 @@ dofile(menupath .. DIR_DELIM .. "store.lua")
|
|||||||
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
|
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
|
||||||
dofile(menupath .. DIR_DELIM .. "tab_credits.lua")
|
dofile(menupath .. DIR_DELIM .. "tab_credits.lua")
|
||||||
if not (PLATFORM == "Android") then
|
if not (PLATFORM == "Android") then
|
||||||
dofile(menupath .. DIR_DELIM .. "modmgr.lua")
|
dofile(menupath .. DIR_DELIM .. "modmgr.lua")
|
||||||
dofile(menupath .. DIR_DELIM .. "tab_settings.lua")
|
dofile(menupath .. DIR_DELIM .. "tab_settings.lua")
|
||||||
dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua")
|
dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua")
|
||||||
dofile(menupath .. DIR_DELIM .. "tab_texturepacks.lua")
|
dofile(menupath .. DIR_DELIM .. "tab_texturepacks.lua")
|
||||||
@ -67,6 +67,7 @@ local function init_globals()
|
|||||||
-- Init gamedata
|
-- Init gamedata
|
||||||
gamedata.worldindex = 0
|
gamedata.worldindex = 0
|
||||||
|
|
||||||
|
|
||||||
menudata.worldlist = filterlist.create(
|
menudata.worldlist = filterlist.create(
|
||||||
core.get_worlds,
|
core.get_worlds,
|
||||||
compare_worlds,
|
compare_worlds,
|
||||||
@ -83,10 +84,7 @@ local function init_globals()
|
|||||||
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
|
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
|
||||||
menudata.worldlist:set_sortmode("alphabetic")
|
menudata.worldlist:set_sortmode("alphabetic")
|
||||||
|
|
||||||
if not core.setting_get("menu_last_game") then
|
core.setting_set("menu_last_game", "default")
|
||||||
local default_game = core.setting_get("default_game") or "default"
|
|
||||||
core.setting_set("menu_last_game", default_game )
|
|
||||||
end
|
|
||||||
|
|
||||||
mm_texture.init()
|
mm_texture.init()
|
||||||
|
|
||||||
@ -131,3 +129,4 @@ local function init_globals()
|
|||||||
end
|
end
|
||||||
|
|
||||||
init_globals()
|
init_globals()
|
||||||
|
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
local multicraft_developers = {
|
||||||
|
"Maksim Gamarnik (MoNTE48) <MoNTE48@mail.ua>",
|
||||||
|
}
|
||||||
|
|
||||||
local core_developers = {
|
local core_developers = {
|
||||||
"Maksim Gamarnik (MoNTE48) <MoNTE48@mail.ua>",
|
"Maksim Gamarnik (MoNTE48) <MoNTE48@mail.ua>",
|
||||||
"Perttu Ahola (celeron55) <celeron55@gmail.com>",
|
"Perttu Ahola (celeron55) <celeron55@gmail.com>",
|
||||||
@ -74,12 +78,17 @@ tab_credits = {
|
|||||||
name = "credits",
|
name = "credits",
|
||||||
caption = fgettext("Credits"),
|
caption = fgettext("Credits"),
|
||||||
cbf_formspec = function(tabview, name, tabdata)
|
cbf_formspec = function(tabview, name, tabdata)
|
||||||
return "label[0.5,3.2;MultiCraft " .. core.get_version() .. "]" ..
|
return "label[0.1,0;MultiCraft " .. core.get_version() .. "]" ..
|
||||||
"label[0.5,3.5;Open Source Project]" ..
|
"label[0.1,0.3;Open Source Project]" ..
|
||||||
|
"label[0.1,2.0;https://github.com/]" ..
|
||||||
|
"label[0.1,2.3;MultiCraftProject]" ..
|
||||||
|
"label[0.1,5.0;LGPLv3.0+ and CC-BY-SA 3.0]" ..
|
||||||
"tablecolumns[color;text]" ..
|
"tablecolumns[color;text]" ..
|
||||||
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
|
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
|
||||||
"table[3.5,-0.25;8.5,5.8;list_credits;" ..
|
"table[3.5,-0.25;8.5,5.8;list_credits;" ..
|
||||||
"#FFFF00," .. fgettext("Core Developers") .. ",," ..
|
"#FFFF00," .. fgettext("MultiCraft Developers") .. ",," ..
|
||||||
|
table.concat(multicraft_developers, ",,") .. ",,," ..
|
||||||
|
"#FFFF00," .. fgettext("Minetest Developers") .. ",," ..
|
||||||
table.concat(core_developers, ",,") .. ",,," ..
|
table.concat(core_developers, ",,") .. ",,," ..
|
||||||
"#FFFF00," .. fgettext("Active Contributors") .. ",," ..
|
"#FFFF00," .. fgettext("Active Contributors") .. ",," ..
|
||||||
table.concat(active_contributors, ",,") .. ",,," ..
|
table.concat(active_contributors, ",,") .. ",,," ..
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
local function get_formspec(tabview, name, tabdata)
|
local function get_formspec(tabview, name, tabdata)
|
||||||
|
|
||||||
-- Update the cached supported proto info,
|
-- Update the cached supported proto info,
|
||||||
-- it may have changed after a change by the settings menu.
|
-- it may have changed after a change by the settings menu.
|
||||||
common_update_cached_supp_proto()
|
common_update_cached_supp_proto()
|
||||||
@ -259,7 +258,7 @@ end
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
tab_multiplayer = {
|
tab_multiplayer = {
|
||||||
name = "multiplayer",
|
name = "multiplayer",
|
||||||
caption = fgettext("Client"),
|
caption = fgettext("Multi Player"),
|
||||||
cbf_formspec = get_formspec,
|
cbf_formspec = get_formspec,
|
||||||
cbf_button_handler = main_button_handler,
|
cbf_button_handler = main_button_handler,
|
||||||
on_change = on_change
|
on_change = on_change
|
||||||
|
@ -55,7 +55,7 @@ local function get_formspec(tabview, name, tabdata)
|
|||||||
retval = retval ..
|
retval = retval ..
|
||||||
"textlist[4,0.25;7.5,3.7;srv_worlds;" ..
|
"textlist[4,0.25;7.5,3.7;srv_worlds;" ..
|
||||||
menu_render_worldlist() ..
|
menu_render_worldlist() ..
|
||||||
";" .. index .. "]"
|
";" .. index .. ";true]"
|
||||||
|
|
||||||
return retval
|
return retval
|
||||||
end
|
end
|
||||||
@ -188,7 +188,7 @@ end
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
tab_server = {
|
tab_server = {
|
||||||
name = "server",
|
name = "server",
|
||||||
caption = fgettext("Server"),
|
caption = fgettext("Create Server"),
|
||||||
cbf_formspec = get_formspec,
|
cbf_formspec = get_formspec,
|
||||||
cbf_button_handler = main_button_handler,
|
cbf_button_handler = main_button_handler,
|
||||||
on_change = nil
|
on_change = nil
|
||||||
|
@ -34,10 +34,8 @@ local function get_formspec(tabview, name, tabdata)
|
|||||||
"button[3.5,4.5;2.6,0.5;world_delete;".. fgettext("Delete") .. "]" ..
|
"button[3.5,4.5;2.6,0.5;world_delete;".. fgettext("Delete") .. "]" ..
|
||||||
"button[6,4.5;2.8,0.5;world_create;".. fgettext("New") .. "]" ..
|
"button[6,4.5;2.8,0.5;world_create;".. fgettext("New") .. "]" ..
|
||||||
"button[8.7,4.5;3.30,0.5;play;".. fgettext("Play") .. "]" ..
|
"button[8.7,4.5;3.30,0.5;play;".. fgettext("Play") .. "]" ..
|
||||||
"checkbox[0.0,4;cb_creative_mode;".. fgettext("Creative Inventory") .. ";" ..
|
"checkbox[0.0,4.25;cb_creative_mode;".. fgettext("Creative Mode") .. ";" ..
|
||||||
dump(core.setting_getbool("creative_mode")) .. "]"..
|
dump(core.setting_getbool("creative_mode")) .. "]"..
|
||||||
"checkbox[0.0,4.5;cb_enable_damage;".. fgettext("Survival Mode") .. ";" ..
|
|
||||||
dump(core.setting_getbool("enable_damage")) .. "]"..
|
|
||||||
"textlist[0,0;11.75,3.7;sp_worlds;" ..
|
"textlist[0,0;11.75,3.7;sp_worlds;" ..
|
||||||
menu_render_worldlist() ..
|
menu_render_worldlist() ..
|
||||||
";" .. index .. ";true]"
|
";" .. index .. ";true]"
|
||||||
@ -73,17 +71,14 @@ local function main_button_handler(this, fields, name, tabdata)
|
|||||||
|
|
||||||
if fields["cb_creative_mode"] then
|
if fields["cb_creative_mode"] then
|
||||||
core.setting_set("creative_mode", fields["cb_creative_mode"])
|
core.setting_set("creative_mode", fields["cb_creative_mode"])
|
||||||
local selected = core.get_textlist_index("sp_worlds")
|
local bool = fields["cb_creative_mode"]
|
||||||
menu_worldmt(selected, "creative_mode", fields["cb_creative_mode"])
|
if bool == 'true' then
|
||||||
|
bool = 'false'
|
||||||
return true
|
else
|
||||||
|
bool = 'true'
|
||||||
end
|
end
|
||||||
|
core.setting_set("enable_damage", bool)
|
||||||
if fields["cb_enable_damage"] then
|
core.setting_save()
|
||||||
core.setting_set("enable_damage", fields["cb_enable_damage"])
|
|
||||||
local selected = core.get_textlist_index("sp_worlds")
|
|
||||||
menu_worldmt(selected, "enable_damage", fields["cb_enable_damage"])
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -108,7 +103,6 @@ local function main_button_handler(this, fields, name, tabdata)
|
|||||||
create_world_dlg:set_parent(this)
|
create_world_dlg:set_parent(this)
|
||||||
this:hide()
|
this:hide()
|
||||||
create_world_dlg:show()
|
create_world_dlg:show()
|
||||||
--mm_texture.update("singleplayer",current_game())
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -125,7 +119,6 @@ local function main_button_handler(this, fields, name, tabdata)
|
|||||||
delete_world_dlg:set_parent(this)
|
delete_world_dlg:set_parent(this)
|
||||||
this:hide()
|
this:hide()
|
||||||
delete_world_dlg:show()
|
delete_world_dlg:show()
|
||||||
--mm_texture.update("singleplayer",current_game())
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -143,7 +136,6 @@ local function main_button_handler(this, fields, name, tabdata)
|
|||||||
configdialog:set_parent(this)
|
configdialog:set_parent(this)
|
||||||
this:hide()
|
this:hide()
|
||||||
configdialog:show()
|
configdialog:show()
|
||||||
--mm_texture.update("singleplayer",current_game())
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ void set_default_settings(Settings *settings)
|
|||||||
settings->setDefault("enable_vbo", "true");
|
settings->setDefault("enable_vbo", "true");
|
||||||
|
|
||||||
settings->setDefault("enable_minimap", "true");
|
settings->setDefault("enable_minimap", "true");
|
||||||
settings->setDefault("minimap_shape_round", "true");
|
settings->setDefault("minimap_shape_round", "false");
|
||||||
settings->setDefault("minimap_double_scan_height", "false");
|
settings->setDefault("minimap_double_scan_height", "false");
|
||||||
|
|
||||||
settings->setDefault("send_pre_v25_init", "true");
|
settings->setDefault("send_pre_v25_init", "true");
|
||||||
@ -351,8 +351,7 @@ void set_default_settings(Settings *settings)
|
|||||||
settings->setDefault("emergequeue_limit_generate", "8");
|
settings->setDefault("emergequeue_limit_generate", "8");
|
||||||
settings->setDefault("max_block_generate_distance", "2");
|
settings->setDefault("max_block_generate_distance", "2");
|
||||||
settings->setDefault("enable_3d_clouds", "false");
|
settings->setDefault("enable_3d_clouds", "false");
|
||||||
settings->setDefault("fps_max", "45");
|
settings->setDefault("fps_max", "30");
|
||||||
settings->setDefault("pause_fps_max", "10");
|
|
||||||
settings->setDefault("max_objects_per_block", "20");
|
settings->setDefault("max_objects_per_block", "20");
|
||||||
settings->setDefault("sqlite_synchronous", "1");
|
settings->setDefault("sqlite_synchronous", "1");
|
||||||
settings->setDefault("gui_scaling", "1.1");
|
settings->setDefault("gui_scaling", "1.1");
|
||||||
@ -360,7 +359,7 @@ void set_default_settings(Settings *settings)
|
|||||||
settings->setDefault("viewing_range", "25");
|
settings->setDefault("viewing_range", "25");
|
||||||
settings->setDefault("inventory_image_hack", "false");
|
settings->setDefault("inventory_image_hack", "false");
|
||||||
settings->setDefault("doubletap_jump", "true");
|
settings->setDefault("doubletap_jump", "true");
|
||||||
settings->setDefault("server_map_save_interval", "15");
|
settings->setDefault("server_map_save_interval", "20");
|
||||||
settings->setDefault("client_unload_unused_data_timeout", "30");
|
settings->setDefault("client_unload_unused_data_timeout", "30");
|
||||||
settings->setDefault("active_block_range", "1");
|
settings->setDefault("active_block_range", "1");
|
||||||
settings->setDefault("chunksize", "3");
|
settings->setDefault("chunksize", "3");
|
||||||
@ -382,7 +381,7 @@ void set_default_settings(Settings *settings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::stringstream anddroidfontsize;
|
std::stringstream anddroidfontsize;
|
||||||
anddroidfontsize << DEFAULT_FONT_SIZE / 2.9 * x_inches;
|
anddroidfontsize << DEFAULT_FONT_SIZE / 2.5 * x_inches;
|
||||||
settings->setDefault("font_size", anddroidfontsize.str());
|
settings->setDefault("font_size", anddroidfontsize.str());
|
||||||
settings->setDefault("mono_font_path", "/system/fonts/DroidSansMono.ttf");
|
settings->setDefault("mono_font_path", "/system/fonts/DroidSansMono.ttf");
|
||||||
settings->setDefault("fallback_font_path", "/system/fonts/DroidSans.ttf");
|
settings->setDefault("fallback_font_path", "/system/fonts/DroidSans.ttf");
|
||||||
|
22
src/game.cpp
@ -2963,29 +2963,17 @@ void Game::toggleMinimap(float *statustext_time, bool *flag,
|
|||||||
|
|
||||||
*flag = true;
|
*flag = true;
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case MINIMAP_MODE_SURFACEx1:
|
case MINIMAP_MODE_SURFACE:
|
||||||
statustext = L"Minimap in surface mode, Zoom x1";
|
statustext = L"Minimap enabled";
|
||||||
break;
|
break;
|
||||||
case MINIMAP_MODE_SURFACEx2:
|
case MINIMAP_MODE_RADAR:
|
||||||
statustext = L"Minimap in surface mode, Zoom x2";
|
statustext = L"Radar mode enabled";
|
||||||
break;
|
|
||||||
case MINIMAP_MODE_SURFACEx4:
|
|
||||||
statustext = L"Minimap in surface mode, Zoom x4";
|
|
||||||
break;
|
|
||||||
case MINIMAP_MODE_RADARx1:
|
|
||||||
statustext = L"Minimap in radar mode, Zoom x1";
|
|
||||||
break;
|
|
||||||
case MINIMAP_MODE_RADARx2:
|
|
||||||
statustext = L"Minimap in radar mode, Zoom x2";
|
|
||||||
break;
|
|
||||||
case MINIMAP_MODE_RADARx4:
|
|
||||||
statustext = L"Minimap in radar mode, Zoom x4";
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mode = MINIMAP_MODE_OFF;
|
mode = MINIMAP_MODE_OFF;
|
||||||
*flag = false;
|
*flag = false;
|
||||||
statustext = (hud_flags & HUD_FLAG_MINIMAP_VISIBLE) ?
|
statustext = (hud_flags & HUD_FLAG_MINIMAP_VISIBLE) ?
|
||||||
L"Minimap hidden" : L"Minimap disabled by server";
|
L"Minimap disabled" : L"Minimap disabled by server";
|
||||||
}
|
}
|
||||||
|
|
||||||
*statustext_time = 0;
|
*statustext_time = 0;
|
||||||
|
19
src/hud.cpp
@ -462,25 +462,6 @@ void Hud::drawHotbar(u16 playeritem) {
|
|||||||
drawItems(secondpos, hotbar_itemcount, hotbar_itemcount/2, mainlist, playeritem + 1, 0);
|
drawItems(secondpos, hotbar_itemcount, hotbar_itemcount/2, mainlist, playeritem + 1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////// compatibility code to be removed //////////////
|
|
||||||
// this is ugly as hell but there's no other way to keep compatibility to
|
|
||||||
// old servers
|
|
||||||
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, "server_flags_damage.png",
|
|
||||||
player->hp, v2s32((-10*24)-25,-(48+24+10)), v2s32(24,24));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((player->hud_flags & HUD_FLAG_BREATHBAR_VISIBLE) &&
|
|
||||||
(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, "halo.png",
|
|
||||||
player->getBreath(), v2s32(25,-(48+24+10)), v2s32(24,24));
|
|
||||||
}
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ Mapper::Mapper(IrrlichtDevice *device, Client *client)
|
|||||||
// Initialize static settings
|
// Initialize static settings
|
||||||
m_enable_shaders = g_settings->getBool("enable_shaders");
|
m_enable_shaders = g_settings->getBool("enable_shaders");
|
||||||
m_surface_mode_scan_height =
|
m_surface_mode_scan_height =
|
||||||
g_settings->getBool("minimap_double_scan_height") ? 256 : 128;
|
g_settings->getBool("minimap_double_scan_height") ? 128 : 64;
|
||||||
|
|
||||||
// Initialize minimap data
|
// Initialize minimap data
|
||||||
data = new MinimapData;
|
data = new MinimapData;
|
||||||
@ -306,12 +306,8 @@ void Mapper::setMinimapMode(MinimapMode mode)
|
|||||||
{
|
{
|
||||||
static const MinimapModeDef modedefs[MINIMAP_MODE_COUNT] = {
|
static const MinimapModeDef modedefs[MINIMAP_MODE_COUNT] = {
|
||||||
{false, 0, 0},
|
{false, 0, 0},
|
||||||
{false, m_surface_mode_scan_height, 256},
|
|
||||||
{false, m_surface_mode_scan_height, 128},
|
|
||||||
{false, m_surface_mode_scan_height, 64},
|
{false, m_surface_mode_scan_height, 64},
|
||||||
{true, 32, 128},
|
{true, 32, 64}
|
||||||
{true, 32, 64},
|
|
||||||
{true, 32, 32}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (mode >= MINIMAP_MODE_COUNT)
|
if (mode >= MINIMAP_MODE_COUNT)
|
||||||
|
@ -30,18 +30,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
|
|
||||||
#define MINIMAP_MAX_SX 512
|
#define MINIMAP_MAX_SX 256
|
||||||
#define MINIMAP_MAX_SY 512
|
#define MINIMAP_MAX_SY 256
|
||||||
|
|
||||||
|
|
||||||
enum MinimapMode {
|
enum MinimapMode {
|
||||||
MINIMAP_MODE_OFF,
|
MINIMAP_MODE_OFF,
|
||||||
MINIMAP_MODE_SURFACEx1,
|
MINIMAP_MODE_SURFACE,
|
||||||
MINIMAP_MODE_SURFACEx2,
|
MINIMAP_MODE_RADAR,
|
||||||
MINIMAP_MODE_SURFACEx4,
|
|
||||||
MINIMAP_MODE_RADARx1,
|
|
||||||
MINIMAP_MODE_RADARx2,
|
|
||||||
MINIMAP_MODE_RADARx4,
|
|
||||||
MINIMAP_MODE_COUNT,
|
MINIMAP_MODE_COUNT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -524,7 +524,7 @@ void ParticleManager::addNodeParticle(IGameDef* gamedef, scene::ISceneManager* s
|
|||||||
if(tiles[texid].material_flags & MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES)
|
if(tiles[texid].material_flags & MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES)
|
||||||
ymax /= tiles[texid].animation_frame_count;
|
ymax /= tiles[texid].animation_frame_count;
|
||||||
|
|
||||||
float size = rand() % 64 / 512.;
|
float size = rand() % 64 / 256.;
|
||||||
float visual_size = BS * size;
|
float visual_size = BS * size;
|
||||||
v2f texsize(size * 2, ymax * size * 2);
|
v2f texsize(size * 2, ymax * size * 2);
|
||||||
v2f texpos;
|
v2f texpos;
|
||||||
|
@ -56,11 +56,12 @@ const char *touchgui_button_imagenames[] = {
|
|||||||
"fly_btn.png",
|
"fly_btn.png",
|
||||||
"noclip_btn.png",
|
"noclip_btn.png",
|
||||||
#endif*/
|
#endif*/
|
||||||
// "minimap_btn.png",
|
"minimap_btn.png",
|
||||||
// "debug_btn.png",
|
// "debug_btn.png",
|
||||||
"chat.png",
|
"chat.png",
|
||||||
// "camera.png",
|
// "camera.png",
|
||||||
"rangeview.png"
|
"rangeview.png",
|
||||||
|
"empty.png"
|
||||||
};
|
};
|
||||||
|
|
||||||
static irr::EKEY_CODE id2keycode(touch_gui_button_id id)
|
static irr::EKEY_CODE id2keycode(touch_gui_button_id id)
|
||||||
@ -114,12 +115,12 @@ static irr::EKEY_CODE id2keycode(touch_gui_button_id id)
|
|||||||
key = "fast";
|
key = "fast";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case minimap_id:
|
|
||||||
key = "minimap";
|
|
||||||
break;
|
|
||||||
case debug_id:
|
case debug_id:
|
||||||
key = "toggle_debug";
|
key = "toggle_debug";
|
||||||
break;*/
|
break;*/
|
||||||
|
case minimap_id:
|
||||||
|
key = "minimap";
|
||||||
|
break;
|
||||||
case chat_id:
|
case chat_id:
|
||||||
key = "chat";
|
key = "chat";
|
||||||
break;
|
break;
|
||||||
@ -129,6 +130,9 @@ static irr::EKEY_CODE id2keycode(touch_gui_button_id id)
|
|||||||
case range_id:
|
case range_id:
|
||||||
key = "rangeselect";
|
key = "rangeselect";
|
||||||
break;
|
break;
|
||||||
|
case empty_id:
|
||||||
|
key = "forward";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
assert(key != "");
|
assert(key != "");
|
||||||
return keyname_to_keycode(g_settings->get("keymap_" + key).c_str());
|
return keyname_to_keycode(g_settings->get("keymap_" + key).c_str());
|
||||||
@ -255,8 +259,7 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc)
|
|||||||
caption = L"<";
|
caption = L"<";
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
id = jump_id;
|
id = empty_id;
|
||||||
caption = L"x";
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
id = backward_one;
|
id = backward_one;
|
||||||
@ -304,6 +307,13 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc)
|
|||||||
m_screensize.X-(button_size),
|
m_screensize.X-(button_size),
|
||||||
m_screensize.Y),
|
m_screensize.Y),
|
||||||
L"H", false, SLOW_BUTTON_REPEAT);
|
L"H", false, SLOW_BUTTON_REPEAT);
|
||||||
|
/* init jump button */
|
||||||
|
initButton(jump_id,
|
||||||
|
rect<s32>(m_screensize.X-(button_size*2),
|
||||||
|
m_screensize.Y-(button_size*2),
|
||||||
|
m_screensize.X-(button_size),
|
||||||
|
m_screensize.Y-(button_size)),
|
||||||
|
L"x", false, SLOW_BUTTON_REPEAT);
|
||||||
|
|
||||||
/*#ifdef ENABLE_ANDROID_NOCLIP
|
/*#ifdef ENABLE_ANDROID_NOCLIP
|
||||||
// init fly button
|
// init fly button
|
||||||
@ -329,13 +339,7 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc)
|
|||||||
m_screensize.Y - (button_size*3.25)),
|
m_screensize.Y - (button_size*3.25)),
|
||||||
L"fast", false, SLOW_BUTTON_REPEAT);
|
L"fast", false, SLOW_BUTTON_REPEAT);
|
||||||
#endif*/
|
#endif*/
|
||||||
/* init minimap button
|
|
||||||
initButton(minimap_id,
|
|
||||||
rect<s32>(m_screensize.X - (0.75*button_size),
|
|
||||||
m_screensize.Y - (4*button_size),
|
|
||||||
m_screensize.X,
|
|
||||||
m_screensize.Y - (button_size*3.25)),
|
|
||||||
L"minimap", false, SLOW_BUTTON_REPEAT);*/
|
|
||||||
/*#ifndef NDEBUG
|
/*#ifndef NDEBUG
|
||||||
/* init debug button */
|
/* init debug button */
|
||||||
/*initButton(debug_id,
|
/*initButton(debug_id,
|
||||||
@ -344,18 +348,27 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc)
|
|||||||
L"dbg", false, SLOW_BUTTON_REPEAT);
|
L"dbg", false, SLOW_BUTTON_REPEAT);
|
||||||
#endif*/
|
#endif*/
|
||||||
|
|
||||||
/* init chat button */
|
|
||||||
initButton(chat_id,
|
|
||||||
rect<s32>(m_screensize.X - (button_size), 0,
|
|
||||||
m_screensize.X, button_size),
|
|
||||||
L"Chat", false, SLOW_BUTTON_REPEAT);
|
|
||||||
|
|
||||||
/* init rangeselect button */
|
/* init rangeselect button */
|
||||||
initButton(range_id,
|
initButton(range_id,
|
||||||
rect<s32>(m_screensize.X - (2*button_size), 0,
|
rect<s32>(m_screensize.X / 2 - (button_size * 1.125), 0,
|
||||||
m_screensize.X - (button_size), button_size),
|
m_screensize.X / 2 - (button_size * 0.375),
|
||||||
|
(button_size * 0.75)),
|
||||||
L"far", false, SLOW_BUTTON_REPEAT);
|
L"far", false, SLOW_BUTTON_REPEAT);
|
||||||
|
|
||||||
|
/* init minimap button */
|
||||||
|
initButton(minimap_id,
|
||||||
|
rect<s32>(m_screensize.X / 2 - (button_size * 0.375), 0,
|
||||||
|
m_screensize.X / 2 + (button_size * 0.375),
|
||||||
|
(button_size * 0.75)),
|
||||||
|
L"minimap", false, SLOW_BUTTON_REPEAT);
|
||||||
|
|
||||||
|
/* init chat button */
|
||||||
|
initButton(chat_id,
|
||||||
|
rect<s32>(m_screensize.X / 2 + (button_size * 0.375), 0,
|
||||||
|
m_screensize.X / 2 + (button_size * 1.125),
|
||||||
|
(button_size * 0.75)),
|
||||||
|
L"Chat", false, SLOW_BUTTON_REPEAT);
|
||||||
|
|
||||||
/* init camera button
|
/* init camera button
|
||||||
initButton(camera_id,
|
initButton(camera_id,
|
||||||
rect<s32>(0, 0,
|
rect<s32>(0, 0,
|
||||||
|
@ -53,11 +53,12 @@ typedef enum {
|
|||||||
noclip_id,
|
noclip_id,
|
||||||
fast_id,
|
fast_id,
|
||||||
#endif
|
#endif
|
||||||
// minimap_id,
|
minimap_id,
|
||||||
// debug_id,
|
// debug_id,
|
||||||
chat_id,
|
chat_id,
|
||||||
// camera_id,
|
// camera_id,
|
||||||
range_id,
|
range_id,
|
||||||
|
empty_id,
|
||||||
after_last_element_id
|
after_last_element_id
|
||||||
} touch_gui_button_id;
|
} touch_gui_button_id;
|
||||||
|
|
||||||
|
@ -102,6 +102,13 @@ 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);
|
||||||
@ -128,6 +135,7 @@ 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)
|
||||||
@ -194,12 +202,23 @@ 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)
|
||||||
{
|
{
|
||||||
if (wc == L'\n') {
|
for (unsigned int j = 0; j < (sizeof(wide_chars)/sizeof(wchar_t));j++) {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,7 +235,27 @@ int mbtowc(wchar_t *pwc, const char *s, size_t n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
std::wstring narrow_to_wide(const std::string &mbs) {
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
@ -229,6 +268,38 @@ 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;
|
||||||
@ -241,6 +312,8 @@ 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
|
||||||
|
BIN
textures/base/blank.png
Normal file
After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 304 B |
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 297 B |
Before Width: | Height: | Size: 267 B After Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 643 B |
BIN
textures/base/empty.png
Normal file
After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 96 B After Width: | Height: | Size: 96 B |
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 219 B |
BIN
textures/base/minimap_btn.png
Normal file
After Width: | Height: | Size: 365 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 993 B |
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 145 B |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 695 B |
Before Width: | Height: | Size: 82 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 400 B |
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 236 B |