diff --git a/build/android/Makefile b/build/android/Makefile index a21fe7f96..07a0a4755 100644 --- a/build/android/Makefile +++ b/build/android/Makefile @@ -52,7 +52,7 @@ CROSS_PREFIX = arm-linux-androideabi- # TARGET_ABI = x86 # TARGET_LIBDIR = 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_LDFLAGS_ADDON = -Wl,--no-warn-mismatch,--gc-sections # TARGET_ARCH = x86 @@ -70,7 +70,7 @@ OPENAL_TIMESTAMP_INT = $(ROOT)/deps/openal_timestamp OPENAL_URL_GIT = https://github.com/MoNTE48/openal-soft 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_INT = $(ROOT)/deps/vorbis_timestamp 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_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_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..."; \ cd ${OPENAL_DIR}; \ 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}" \ TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \ TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \ @@ -247,36 +247,36 @@ $(VORBIS_TIMESTAMP) : vorbis_download vorbis_download : @if [ ! -d ${VORBIS_DIR} ] ; then \ - echo "vorbis sources missing, downloading..."; \ + echo "vorbis sources missing, downloading..."; \ mkdir -p ${ROOT}/deps; \ cd ${ROOT}/deps ; \ - git clone ${VORBIS_URL_GIT}|| exit 1; \ + git clone ${VORBIS_URL_GIT}|| exit 1; \ fi vorbis : $(VORBIS_LIB) $(VORBIS_LIB): $(VORBIS_TIMESTAMP) - + @REFRESH=0; \ - if [ ! -e ${VORBIS_TIMESTAMP_INT} ] ; then \ - echo "${VORBIS_TIMESTAMP_INT} doesn't exist"; \ + + @REFRESH=0; \ + if [ ! -e ${VORBIS_TIMESTAMP_INT} ] ; then \ + echo "${VORBIS_TIMESTAMP_INT} doesn't exist"; \ REFRESH=1; \ fi; \ - if [ ${VORBIS_TIMESTAMP} -nt ${VORBIS_TIMESTAMP_INT} ] ; then \ + if [ ${VORBIS_TIMESTAMP} -nt ${VORBIS_TIMESTAMP_INT} ] ; then \ REFRESH=1; \ fi; \ if [ $$REFRESH -ne 0 ] ; then \ export PATH=$$PATH:${ANDROID_NDK}; \ - echo "changed timestamp for vorbis detected building..."; \ - cd ${VORBIS_DIR}; \ + echo "changed timestamp for vorbis detected building..."; \ + cd ${VORBIS_DIR}; \ ndk-build NDEBUG=${NDEBUG} \ 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; \ - touch ${VORBIS_TIMESTAMP}; \ - touch ${VORBIS_TIMESTAMP_INT}; \ + touch ${VORBIS_TIMESTAMP}; \ + touch ${VORBIS_TIMESTAMP_INT}; \ else \ - echo "nothing to be done for libvorbis/libvorbis"; \ + echo "nothing to be done for libvorbis"; \ fi clean_vorbis : @@ -364,14 +364,13 @@ $(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP) REFRESH=1; \ fi; \ if [ $$REFRESH -ne 0 ] ; then \ - mkdir -p ${FREETYPE_DIR}; \ export PATH=$$PATH:${ANDROID_NDK}; \ echo "changed timestamp for freetype detected building..."; \ cd deps/freetype; \ export CROSS_PREFIX=${CROSS_PREFIX}; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-freetype; \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ - --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \ + --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \ --platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ export CXX=${CROSS_PREFIX}g++; \ @@ -403,8 +402,8 @@ iconv_download : wget ${ICONV_URL_HTTP} || exit 1; \ tar -xzf libiconv-${ICONV_VERSION}.tar.gz || exit 1; \ rm libiconv-${ICONV_VERSION}.tar.gz; \ - ln -s libiconv-${ICONV_VERSION} libiconv; \ - cd ${ICONV_DIR}; \ + mv libiconv-${ICONV_VERSION} libiconv; \ + cd libiconv; \ patch -p1 < ${ROOT}/libiconv_android.patch; \ patch -p1 < ${ROOT}/libiconv_stdio.patch; \ fi @@ -423,7 +422,6 @@ $(ICONV_LIB) : $(ICONV_TIMESTAMP) REFRESH=1; \ fi; \ if [ $$REFRESH -ne 0 ] ; then \ - mkdir -p ${ICONV_DIR}; \ export PATH=$$PATH:${ANDROID_NDK}; \ echo "changed timestamp for iconv detected building..."; \ cd ${ICONV_DIR}; \ @@ -448,7 +446,6 @@ $(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: @@ -466,9 +463,9 @@ irrlicht_download : 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-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; \ fi @@ -492,7 +489,6 @@ $(IRRLICHT_LIB): $(IRRLICHT_TIMESTAMP) $(FREETYPE_LIB) REFRESH=1; \ fi; \ if [ $$REFRESH -ne 0 ] ; then \ - mkdir -p ${IRRLICHT_DIR}; \ export PATH=$$PATH:${ANDROID_NDK}; \ echo "changed timestamp for irrlicht detected building..."; \ cd deps/irrlicht/source/Irrlicht/Android; \ @@ -539,14 +535,13 @@ $(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB) REFRESH=1; \ fi; \ if [ $$REFRESH -ne 0 ] ; then \ - mkdir -p ${CURL_DIR}; \ export PATH=$$PATH:${ANDROID_NDK}; \ echo "changed timestamp for curl detected building..."; \ cd deps/curl; \ export CROSS_PREFIX=${CROSS_PREFIX}; \ export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-curl; \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ - --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \ + --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \ --platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ export CC=${CROSS_PREFIX}gcc; \ @@ -599,7 +594,6 @@ $(GMP_LIB): $(GMP_TIMESTAMP) REFRESH=1; \ fi; \ if [ $$REFRESH -ne 0 ] ; then \ - mkdir -p ${GMP_DIR}; \ export PATH=$$PATH:${ANDROID_NDK}; \ echo "changed timestamp for gmp detected building..."; \ cd deps/gmp; \ @@ -607,7 +601,7 @@ $(GMP_LIB): $(GMP_TIMESTAMP) export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-gmp; \ ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \ --toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \ - --platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \ + APP_PLATFORM=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \ export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \ export CC=${CROSS_PREFIX}gcc; \ export CXX=${CROSS_PREFIX}g++; \ @@ -625,9 +619,9 @@ $(GMP_LIB): $(GMP_TIMESTAMP) clean_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; \ cd ${ROOT}/deps; \ rm -R sqlite; \ @@ -655,7 +649,7 @@ $(ASSETS_TIMESTAMP) : $(IRRLICHT_LIB) touch ${IRRLICHT_DIR}/media/timestamp; \ touch ${ASSETS_TIMESTAMP}; \ fi; \ - if [ ${ROOT}/../../multicraft.conf.example -nt ${ASSETS_TIMESTAMP} ] ; then \ + if [ ${ROOT}/../../multicraft.conf.example -nt ${ASSETS_TIMESTAMP} ] ; then \ echo "conf changed"; \ touch ${ASSETS_TIMESTAMP}; \ fi; \ @@ -765,10 +759,8 @@ apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) \ 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}" && \ - echo " Success! =)"; \ + echo " Success! =)"; \ ant $$BUILD_TYPE && \ echo "APK: bin/MultiCraft-$$BUILD_TYPE.apk" \ diff --git a/build/android/jni/Android.mk b/build/android/jni/Android.mk index 88df80eeb..db6c67e3b 100644 --- a/build/android/jni/Android.mk +++ b/build/android/jni/Android.mk @@ -29,8 +29,8 @@ include $(PREBUILT_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := vorbis -LOCAL_SRC_FILES := deps/libvorbis-android/libs/$(TARGET_LIBDIR)/libvorbis.so -include $(PREBUILT_SHARED_LIBRARY) +LOCAL_SRC_FILES := deps/libvorbis-android/obj/local/$(APP_ABI)/libvorbis.a +include $(PREBUILT_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := gmp @@ -84,7 +84,8 @@ LOCAL_CFLAGS += -pg endif 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 endif @@ -223,26 +224,6 @@ LOCAL_SRC_FILES := \ jni/src/util/string.cpp \ jni/src/util/srp.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/settings.cpp \ jni/src/wieldmesh.cpp \ @@ -308,7 +289,7 @@ LOCAL_SRC_FILES += \ LOCAL_SRC_FILES += deps/sqlite/sqlite3.c # Threading -LOCAL_SRC_FILES += \ +LOCAL_SRC_FILES += \ jni/src/threading/event.cpp \ jni/src/threading/mutex.cpp \ jni/src/threading/semaphore.cpp \ @@ -317,8 +298,8 @@ LOCAL_SRC_FILES += \ # JSONCPP LOCAL_SRC_FILES += jni/src/json/jsoncpp.cpp -LOCAL_SHARED_LIBRARIES := gmp vorbis -LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto iconv LuaJIT openal android_native_app_glue $(PROFILER_LIBS) +LOCAL_SHARED_LIBRARIES := gmp +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 diff --git a/builtin/game/item_entity.lua b/builtin/game/item_entity.lua index eb5612264..9541b3c02 100644 --- a/builtin/game/item_entity.lua +++ b/builtin/game/item_entity.lua @@ -80,8 +80,7 @@ core.register_entity(":__builtin:item", { itemstring = self.itemstring, always_collect = self.always_collect, age = self.age, - dropped_by = self.dropped_by, - --collect = self.collect + dropped_by = self.dropped_by }) end, @@ -95,10 +94,6 @@ core.register_entity(":__builtin:item", { self.age = data.age + dtime_s else self.age = dtime_s - --end - --remember collection data - --if data.collect then - --self.collect = data.collect end self.dropped_by = data.dropped_by end @@ -209,6 +204,16 @@ core.register_entity(":__builtin:item", { self.object:set_properties({physical = true}) 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, on_punch = function(self, hitter) diff --git a/builtin/mainmenu/dlg_create_world.lua b/builtin/mainmenu/dlg_create_world.lua index 5c3f6b9d9..861a54600 100644 --- a/builtin/mainmenu/dlg_create_world.lua +++ b/builtin/mainmenu/dlg_create_world.lua @@ -16,7 +16,6 @@ --51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. local function create_world_formspec(dialogdata) - local mapgens = core.get_mapgen_names() local current_seed = core.setting_get("fixed_map_seed") or "" @@ -57,10 +56,9 @@ local function create_world_formspec(dialogdata) --"label[2,2;" .. fgettext("Mapgen") .. "]".. --"dropdown[4.2,2;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]" .. - --"label[2,3;" .. fgettext("Game") .. "]".. "dropdown[6000.2,6;6.3;games;" .. gamemgr.gamelist() .. ";1]" .. - + "button[5,2.6;2.6,0.5;world_create_confirm;" .. fgettext("Create") .. "]" .. "button[7.5,2.6;2.8,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]" @@ -116,7 +114,6 @@ local function create_world_buttonhandler(this, fields) core.setting_set("menu_last_game",gamemgr.games[gameindex].id) if this.data.update_worldlist_filter then menudata.worldlist:set_filtercriteria(gamemgr.games[gameindex].id) - --mm_texture.update("singleplayer", gamemgr.games[gameindex].id) end menudata.worldlist:refresh() core.setting_set("mainmenu_last_selected_world", @@ -147,4 +144,4 @@ function create_create_world_dlg(update_worldlistfilter) retval.update_worldlist_filter = update_worldlistfilter return retval -end \ No newline at end of file +end diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua index 7c251e18d..44b2f0823 100644 --- a/builtin/mainmenu/init.lua +++ b/builtin/mainmenu/init.lua @@ -39,7 +39,7 @@ dofile(menupath .. DIR_DELIM .. "store.lua") dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua") dofile(menupath .. DIR_DELIM .. "tab_credits.lua") 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 .. "dlg_settings_advanced.lua") dofile(menupath .. DIR_DELIM .. "tab_texturepacks.lua") @@ -67,6 +67,7 @@ local function init_globals() -- Init gamedata gamedata.worldindex = 0 + menudata.worldlist = filterlist.create( core.get_worlds, compare_worlds, @@ -83,10 +84,7 @@ local function init_globals() menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic) menudata.worldlist:set_sortmode("alphabetic") - if not core.setting_get("menu_last_game") then - local default_game = core.setting_get("default_game") or "default" - core.setting_set("menu_last_game", default_game ) - end + core.setting_set("menu_last_game", "default") mm_texture.init() @@ -130,4 +128,5 @@ local function init_globals() core.set_background("background", defaulttexturedir .. "background.jpg"); end -init_globals() \ No newline at end of file +init_globals() + diff --git a/builtin/mainmenu/tab_credits.lua b/builtin/mainmenu/tab_credits.lua index 529dcf6d2..33143e07f 100644 --- a/builtin/mainmenu/tab_credits.lua +++ b/builtin/mainmenu/tab_credits.lua @@ -17,6 +17,10 @@ -------------------------------------------------------------------------------- +local multicraft_developers = { + "Maksim Gamarnik (MoNTE48) ", +} + local core_developers = { "Maksim Gamarnik (MoNTE48) ", "Perttu Ahola (celeron55) ", @@ -74,12 +78,17 @@ tab_credits = { name = "credits", caption = fgettext("Credits"), cbf_formspec = function(tabview, name, tabdata) - return "label[0.5,3.2;MultiCraft " .. core.get_version() .. "]" .. - "label[0.5,3.5;Open Source Project]" .. + return "label[0.1,0;MultiCraft " .. core.get_version() .. "]" .. + "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]" .. "tableoptions[background=#00000000;highlight=#00000000;border=false]" .. "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, ",,") .. ",,," .. "#FFFF00," .. fgettext("Active Contributors") .. ",," .. table.concat(active_contributors, ",,") .. ",,," .. diff --git a/builtin/mainmenu/tab_multiplayer.lua b/builtin/mainmenu/tab_multiplayer.lua index 3301c5c5d..55474df0f 100644 --- a/builtin/mainmenu/tab_multiplayer.lua +++ b/builtin/mainmenu/tab_multiplayer.lua @@ -17,7 +17,6 @@ -------------------------------------------------------------------------------- local function get_formspec(tabview, name, tabdata) - -- Update the cached supported proto info, -- it may have changed after a change by the settings menu. common_update_cached_supp_proto() @@ -259,7 +258,7 @@ end -------------------------------------------------------------------------------- tab_multiplayer = { name = "multiplayer", - caption = fgettext("Client"), + caption = fgettext("Multi Player"), cbf_formspec = get_formspec, cbf_button_handler = main_button_handler, on_change = on_change diff --git a/builtin/mainmenu/tab_server.lua b/builtin/mainmenu/tab_server.lua index 5b9783307..bc8f49297 100644 --- a/builtin/mainmenu/tab_server.lua +++ b/builtin/mainmenu/tab_server.lua @@ -17,7 +17,7 @@ -------------------------------------------------------------------------------- local function get_formspec(tabview, name, tabdata) - + local index = menudata.worldlist:get_current_index( tonumber(core.setting_get("mainmenu_last_selected_world")) ) @@ -55,7 +55,7 @@ local function get_formspec(tabview, name, tabdata) retval = retval .. "textlist[4,0.25;7.5,3.7;srv_worlds;" .. menu_render_worldlist() .. - ";" .. index .. "]" + ";" .. index .. ";true]" return retval end @@ -188,7 +188,7 @@ end -------------------------------------------------------------------------------- tab_server = { name = "server", - caption = fgettext("Server"), + caption = fgettext("Create Server"), cbf_formspec = get_formspec, cbf_button_handler = main_button_handler, on_change = nil diff --git a/builtin/mainmenu/tab_singleplayer.lua b/builtin/mainmenu/tab_singleplayer.lua index 3af56b805..6b358deaf 100644 --- a/builtin/mainmenu/tab_singleplayer.lua +++ b/builtin/mainmenu/tab_singleplayer.lua @@ -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[6,4.5;2.8,0.5;world_create;".. fgettext("New") .. "]" .. "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")) .. "]".. - "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;" .. menu_render_worldlist() .. ";" .. index .. ";true]" @@ -71,21 +69,18 @@ local function main_button_handler(this, fields, name, tabdata) return true end - if fields["cb_creative_mode"] then - core.setting_set("creative_mode", fields["cb_creative_mode"]) - local selected = core.get_textlist_index("sp_worlds") - menu_worldmt(selected, "creative_mode", fields["cb_creative_mode"]) - - return true - end - - if fields["cb_enable_damage"] then - 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 - end + if fields["cb_creative_mode"] then + core.setting_set("creative_mode", fields["cb_creative_mode"]) + local bool = fields["cb_creative_mode"] + if bool == 'true' then + bool = 'false' + else + bool = 'true' + end + core.setting_set("enable_damage", bool) + core.setting_save() + return true + end if fields["play"] ~= nil or world_doubleclick or @@ -108,7 +103,6 @@ local function main_button_handler(this, fields, name, tabdata) create_world_dlg:set_parent(this) this:hide() create_world_dlg:show() - --mm_texture.update("singleplayer",current_game()) return true end @@ -125,7 +119,6 @@ local function main_button_handler(this, fields, name, tabdata) delete_world_dlg:set_parent(this) this:hide() delete_world_dlg:show() - --mm_texture.update("singleplayer",current_game()) end end @@ -143,7 +136,6 @@ local function main_button_handler(this, fields, name, tabdata) configdialog:set_parent(this) this:hide() configdialog:show() - --mm_texture.update("singleplayer",current_game()) end end diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 2eb3e5297..3b60a325a 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -182,7 +182,7 @@ void set_default_settings(Settings *settings) settings->setDefault("enable_vbo", "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("send_pre_v25_init", "true"); @@ -351,8 +351,7 @@ void set_default_settings(Settings *settings) settings->setDefault("emergequeue_limit_generate", "8"); settings->setDefault("max_block_generate_distance", "2"); settings->setDefault("enable_3d_clouds", "false"); - settings->setDefault("fps_max", "45"); - settings->setDefault("pause_fps_max", "10"); + settings->setDefault("fps_max", "30"); settings->setDefault("max_objects_per_block", "20"); settings->setDefault("sqlite_synchronous", "1"); settings->setDefault("gui_scaling", "1.1"); @@ -360,7 +359,7 @@ void set_default_settings(Settings *settings) settings->setDefault("viewing_range", "25"); settings->setDefault("inventory_image_hack", "false"); 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("active_block_range", "1"); settings->setDefault("chunksize", "3"); @@ -382,7 +381,7 @@ void set_default_settings(Settings *settings) } 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("mono_font_path", "/system/fonts/DroidSansMono.ttf"); settings->setDefault("fallback_font_path", "/system/fonts/DroidSans.ttf"); diff --git a/src/game.cpp b/src/game.cpp index ceea590ab..9a9ab2c55 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2963,29 +2963,17 @@ void Game::toggleMinimap(float *statustext_time, bool *flag, *flag = true; switch (mode) { - case MINIMAP_MODE_SURFACEx1: - statustext = L"Minimap in surface mode, Zoom x1"; + case MINIMAP_MODE_SURFACE: + statustext = L"Minimap enabled"; break; - case MINIMAP_MODE_SURFACEx2: - statustext = L"Minimap in surface mode, Zoom x2"; - 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"; + case MINIMAP_MODE_RADAR: + statustext = L"Radar mode enabled"; break; default: mode = MINIMAP_MODE_OFF; *flag = false; 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; diff --git a/src/hud.cpp b/src/hud.cpp index 259e114f4..a37aec593 100644 --- a/src/hud.cpp +++ b/src/hud.cpp @@ -462,25 +462,6 @@ void Hud::drawHotbar(u16 playeritem) { 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)); - } - //////////////////////////////////////////////////////////////////////////// } diff --git a/src/minimap.cpp b/src/minimap.cpp index 9f6999ba3..0d9be7fe3 100644 --- a/src/minimap.cpp +++ b/src/minimap.cpp @@ -222,7 +222,7 @@ Mapper::Mapper(IrrlichtDevice *device, Client *client) // Initialize static settings m_enable_shaders = g_settings->getBool("enable_shaders"); 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 data = new MinimapData; @@ -306,12 +306,8 @@ void Mapper::setMinimapMode(MinimapMode mode) { static const MinimapModeDef modedefs[MINIMAP_MODE_COUNT] = { {false, 0, 0}, - {false, m_surface_mode_scan_height, 256}, - {false, m_surface_mode_scan_height, 128}, {false, m_surface_mode_scan_height, 64}, - {true, 32, 128}, - {true, 32, 64}, - {true, 32, 32} + {true, 32, 64} }; if (mode >= MINIMAP_MODE_COUNT) diff --git a/src/minimap.h b/src/minimap.h index 84f49b4bd..8cfdc8019 100644 --- a/src/minimap.h +++ b/src/minimap.h @@ -30,18 +30,14 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include "camera.h" -#define MINIMAP_MAX_SX 512 -#define MINIMAP_MAX_SY 512 +#define MINIMAP_MAX_SX 256 +#define MINIMAP_MAX_SY 256 enum MinimapMode { MINIMAP_MODE_OFF, - MINIMAP_MODE_SURFACEx1, - MINIMAP_MODE_SURFACEx2, - MINIMAP_MODE_SURFACEx4, - MINIMAP_MODE_RADARx1, - MINIMAP_MODE_RADARx2, - MINIMAP_MODE_RADARx4, + MINIMAP_MODE_SURFACE, + MINIMAP_MODE_RADAR, MINIMAP_MODE_COUNT, }; diff --git a/src/particles.cpp b/src/particles.cpp index 0cb9d9894..789dfd1ca 100644 --- a/src/particles.cpp +++ b/src/particles.cpp @@ -524,7 +524,7 @@ void ParticleManager::addNodeParticle(IGameDef* gamedef, scene::ISceneManager* s if(tiles[texid].material_flags & MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES) ymax /= tiles[texid].animation_frame_count; - float size = rand() % 64 / 512.; + float size = rand() % 64 / 256.; float visual_size = BS * size; v2f texsize(size * 2, ymax * size * 2); v2f texpos; diff --git a/src/touchscreengui.cpp b/src/touchscreengui.cpp index 8788577c1..2ae370711 100644 --- a/src/touchscreengui.cpp +++ b/src/touchscreengui.cpp @@ -56,11 +56,12 @@ const char *touchgui_button_imagenames[] = { "fly_btn.png", "noclip_btn.png", #endif*/ -// "minimap_btn.png", + "minimap_btn.png", // "debug_btn.png", "chat.png", // "camera.png", - "rangeview.png" + "rangeview.png", + "empty.png" }; 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"; break; #endif - case minimap_id: - key = "minimap"; - break; case debug_id: key = "toggle_debug"; break;*/ + case minimap_id: + key = "minimap"; + break; case chat_id: key = "chat"; break; @@ -129,6 +130,9 @@ static irr::EKEY_CODE id2keycode(touch_gui_button_id id) case range_id: key = "rangeselect"; break; + case empty_id: + key = "forward"; + break; } assert(key != ""); return keyname_to_keycode(g_settings->get("keymap_" + key).c_str()); @@ -255,8 +259,7 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc) caption = L"<"; break; case 4: - id = jump_id; - caption = L"x"; + id = empty_id; break; case 2: id = backward_one; @@ -304,6 +307,13 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc) m_screensize.X-(button_size), m_screensize.Y), L"H", false, SLOW_BUTTON_REPEAT); + /* init jump button */ + initButton(jump_id, + rect(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 // init fly button @@ -329,13 +339,7 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc) m_screensize.Y - (button_size*3.25)), L"fast", false, SLOW_BUTTON_REPEAT); #endif*/ - /* init minimap button - initButton(minimap_id, - rect(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 /* init debug button */ /*initButton(debug_id, @@ -344,17 +348,26 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc) L"dbg", false, SLOW_BUTTON_REPEAT); #endif*/ - /* init chat button */ - initButton(chat_id, - rect(m_screensize.X - (button_size), 0, - m_screensize.X, button_size), - L"Chat", false, SLOW_BUTTON_REPEAT); - /* init rangeselect button */ initButton(range_id, - rect(m_screensize.X - (2*button_size), 0, - m_screensize.X - (button_size), button_size), + rect(m_screensize.X / 2 - (button_size * 1.125), 0, + m_screensize.X / 2 - (button_size * 0.375), + (button_size * 0.75)), L"far", false, SLOW_BUTTON_REPEAT); + + /* init minimap button */ + initButton(minimap_id, + rect(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(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 initButton(camera_id, diff --git a/src/touchscreengui.h b/src/touchscreengui.h index 3e12909b5..5dca7ede9 100644 --- a/src/touchscreengui.h +++ b/src/touchscreengui.h @@ -53,11 +53,12 @@ typedef enum { noclip_id, fast_id, #endif -// minimap_id, + minimap_id, // debug_id, chat_id, // camera_id, range_id, + empty_id, after_last_element_id } touch_gui_button_id; @@ -183,4 +184,4 @@ private: key_event m_key_events[2]; }; extern TouchScreenGUI *g_touchscreengui; -#endif \ No newline at end of file +#endif diff --git a/src/util/string.cpp b/src/util/string.cpp index 6cd6998da..6762f482d 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -102,6 +102,13 @@ std::wstring utf8_to_wide(const std::string &input) 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) { 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; } +#endif #else // _WIN32 std::wstring utf8_to_wide(const std::string &input) @@ -194,12 +202,23 @@ wchar_t *narrow_to_wide_c(const char *str) #ifdef __ANDROID__ +const wchar_t* wide_chars = + L" !\"#$%&'()*+,-./0123456789:;<=>?@" + L"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`" + L"abcdefghijklmnopqrstuvwxyz{|}~"; + 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'; 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) { @@ -229,6 +268,38 @@ std::wstring narrow_to_wide(const std::string &mbs) 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) { size_t mbl = wcs.size() * 4; @@ -241,6 +312,8 @@ std::string wide_to_narrow(const std::wstring &wcs) return *mbs; } +#endif + std::string urlencode(std::string str) { // Encodes non-unreserved URI characters by a percent sign diff --git a/textures/base/blank.png b/textures/base/blank.png new file mode 100644 index 000000000..85e02501d Binary files /dev/null and b/textures/base/blank.png differ diff --git a/textures/base/chat.png b/textures/base/chat.png index bc1a85d56..e50221b16 100644 Binary files a/textures/base/chat.png and b/textures/base/chat.png differ diff --git a/textures/base/down.png b/textures/base/down.png index 6871d6c3d..fb69d1924 100644 Binary files a/textures/base/down.png and b/textures/base/down.png differ diff --git a/textures/base/down_one.png b/textures/base/down_one.png index 4937995cd..6c8db8f86 100644 Binary files a/textures/base/down_one.png and b/textures/base/down_one.png differ diff --git a/textures/base/down_three.png b/textures/base/down_three.png index 53ae38567..8fc4ce994 100644 Binary files a/textures/base/down_three.png and b/textures/base/down_three.png differ diff --git a/textures/base/down_two.png b/textures/base/down_two.png index b8571f040..d84bead3d 100644 Binary files a/textures/base/down_two.png and b/textures/base/down_two.png differ diff --git a/textures/base/drop.png b/textures/base/drop.png index cca94cca5..5e5bd8d12 100644 Binary files a/textures/base/drop.png and b/textures/base/drop.png differ diff --git a/textures/base/empty.png b/textures/base/empty.png new file mode 100644 index 000000000..6463d8d10 Binary files /dev/null and b/textures/base/empty.png differ diff --git a/textures/base/halo.png b/textures/base/halo.png index dd310be6d..734a98054 100644 Binary files a/textures/base/halo.png and b/textures/base/halo.png differ diff --git a/textures/base/inventory.png b/textures/base/inventory.png index 498f26cc6..5c0b51f3c 100644 Binary files a/textures/base/inventory.png and b/textures/base/inventory.png differ diff --git a/textures/base/jump.png b/textures/base/jump.png index b91008231..e20b1aaaa 100644 Binary files a/textures/base/jump.png and b/textures/base/jump.png differ diff --git a/textures/base/left.png b/textures/base/left.png index 4dfd3cbfa..be19c5579 100644 Binary files a/textures/base/left.png and b/textures/base/left.png differ diff --git a/textures/base/minimap_btn.png b/textures/base/minimap_btn.png new file mode 100644 index 000000000..0249a2b0c Binary files /dev/null and b/textures/base/minimap_btn.png differ diff --git a/textures/base/minimap_mask_round.png b/textures/base/minimap_mask_round.png index a0c6b2ddf..e4a5ef3bd 100644 Binary files a/textures/base/minimap_mask_round.png and b/textures/base/minimap_mask_round.png differ diff --git a/textures/base/minimap_mask_square.png b/textures/base/minimap_mask_square.png index b270e0bba..dd1284d4f 100644 Binary files a/textures/base/minimap_mask_square.png and b/textures/base/minimap_mask_square.png differ diff --git a/textures/base/minimap_overlay_round.png b/textures/base/minimap_overlay_round.png index fd0f9a6d2..e3d8acb5e 100644 Binary files a/textures/base/minimap_overlay_round.png and b/textures/base/minimap_overlay_round.png differ diff --git a/textures/base/minimap_overlay_square.png b/textures/base/minimap_overlay_square.png index c971c4b8e..003c17809 100644 Binary files a/textures/base/minimap_overlay_square.png and b/textures/base/minimap_overlay_square.png differ diff --git a/textures/base/object_marker_red.png b/textures/base/object_marker_red.png index bb89de1b6..011cc9cad 100644 Binary files a/textures/base/object_marker_red.png and b/textures/base/object_marker_red.png differ diff --git a/textures/base/player_marker.png b/textures/base/player_marker.png index fc0ee739e..a53197968 100644 Binary files a/textures/base/player_marker.png and b/textures/base/player_marker.png differ diff --git a/textures/base/rangeview.png b/textures/base/rangeview.png index 2b98b0b35..20fcef0c2 100644 Binary files a/textures/base/rangeview.png and b/textures/base/rangeview.png differ diff --git a/textures/base/right.png b/textures/base/right.png index a6aa2fcb7..9f39ce943 100644 Binary files a/textures/base/right.png and b/textures/base/right.png differ diff --git a/textures/base/up_one.png b/textures/base/up_one.png index 2bb06f51e..f68eaf061 100644 Binary files a/textures/base/up_one.png and b/textures/base/up_one.png differ diff --git a/textures/base/up_three.png b/textures/base/up_three.png index 965ac1608..cf2c07c46 100644 Binary files a/textures/base/up_three.png and b/textures/base/up_three.png differ diff --git a/textures/base/up_two.png b/textures/base/up_two.png index a78a2ffaa..340bb6f15 100644 Binary files a/textures/base/up_two.png and b/textures/base/up_two.png differ