ver. 1.1.2.3

This commit is contained in:
Maksim Gamarnik 2016-04-08 20:43:15 +03:00
parent 292a778b06
commit 44f98aa061
42 changed files with 210 additions and 189 deletions

View File

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

View File

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

View File

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

View File

@ -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,7 +56,6 @@ 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]" ..
@ -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",

View File

@ -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()
@ -131,3 +129,4 @@ local function init_globals()
end
init_globals()

View File

@ -17,6 +17,10 @@
--------------------------------------------------------------------------------
local multicraft_developers = {
"Maksim Gamarnik (MoNTE48) <MoNTE48@mail.ua>",
}
local core_developers = {
"Maksim Gamarnik (MoNTE48) <MoNTE48@mail.ua>",
"Perttu Ahola (celeron55) <celeron55@gmail.com>",
@ -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, ",,") .. ",,," ..

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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));
}
////////////////////////////////////////////////////////////////////////////
}

View File

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

View File

@ -30,18 +30,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <vector>
#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,
};

View File

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

View File

@ -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<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
// 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<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
/* init debug button */
/*initButton(debug_id,
@ -344,18 +348,27 @@ void TouchScreenGUI::init(ISimpleTextureSource* tsrc)
L"dbg", false, SLOW_BUTTON_REPEAT);
#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 */
initButton(range_id,
rect<s32>(m_screensize.X - (2*button_size), 0,
m_screensize.X - (button_size), button_size),
rect<s32>(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<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
initButton(camera_id,
rect<s32>(0, 0,

View File

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

View File

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

BIN
textures/base/blank.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 B

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 643 B

BIN
textures/base/empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 236 B