From 9bd686216a8da2a1010a9ecc08b4799f7ab6e95c Mon Sep 17 00:00:00 2001 From: luk3yx Date: Fri, 11 Jun 2021 18:14:03 +1200 Subject: [PATCH] Make it compile --- .github/workflows/android.yml | 2 + .github/workflows/build.yml | 6 +-- .../MultiCraft.xcodeproj/project.pbxproj | 14 +++++- builtin/mainmenu/common.lua | 16 +++--- builtin/mainmenu/init.lua | 31 ++---------- builtin/mainmenu/serverlistmgr.lua | 24 ++++++--- builtin/mainmenu/tab_credits.lua | 8 +-- builtin/mainmenu/tab_local.lua | 10 ++-- builtin/mainmenu/tab_online.lua | 35 +++++++------ src/client/client.cpp | 2 +- src/client/clientlauncher.cpp | 2 +- src/client/game.cpp | 2 +- src/client/minimap.cpp | 2 +- src/client/render/interlaced.cpp | 2 +- src/client/sky.cpp | 2 +- src/gui/guiEngine.cpp | 10 ++-- src/gui/guiEngine.h | 3 -- src/itemdef.cpp | 10 ++-- src/mapgen/mapgen_v7p.cpp | 6 --- src/network/clientpackethandler.cpp | 4 +- src/nodedef.cpp | 50 +++++++++---------- src/serverlist.cpp | 2 + util/ci/common.sh | 3 +- 23 files changed, 116 insertions(+), 130 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 0fcfe2390..7dea86961 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -28,6 +28,8 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 + - name: Install GNU gettext + run: sudo apt install gettext - name: Build with Gradle run: cd build/android; ./gradlew assemblerelease - name: Save armeabi artifact diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46afe9f6f..a202a156e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -218,8 +218,8 @@ jobs: name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }} runs-on: windows-2019 env: - VCPKG_VERSION: 0bf3923f9fab4001c00f0f429682a0853b5749e0 -# 2020.11 + VCPKG_VERSION: 5568f110b509a9fd90711978a7cb76bae75bb092 +# 2021.05.12 vcpkg_packages: irrlicht zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit strategy: fail-fast: false @@ -245,7 +245,7 @@ jobs: uses: actions/checkout@v2 - name: Restore from cache and run vcpkg - uses: lukka/run-vcpkg@v5 + uses: lukka/run-vcpkg@v7 with: vcpkgArguments: ${{env.vcpkg_packages}} vcpkgDirectory: '${{ github.workspace }}\vcpkg' diff --git a/build/macOS/MultiCraft/MultiCraft.xcodeproj/project.pbxproj b/build/macOS/MultiCraft/MultiCraft.xcodeproj/project.pbxproj index 4d744a703..0eea95ff4 100644 --- a/build/macOS/MultiCraft/MultiCraft.xcodeproj/project.pbxproj +++ b/build/macOS/MultiCraft/MultiCraft.xcodeproj/project.pbxproj @@ -302,6 +302,8 @@ 84F20F4C25D52975009562A9 /* mapgen_fractal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20F3A25D52975009562A9 /* mapgen_fractal.cpp */; }; 84F20F4D25D52975009562A9 /* mapgen_v7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20F3B25D52975009562A9 /* mapgen_v7.cpp */; }; 84F20F4E25D52975009562A9 /* mapgen_v5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20F3C25D52975009562A9 /* mapgen_v5.cpp */; }; + 84FD8E3126A0B01D00EF2BFA /* guiEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FD8E3026A0B01D00EF2BFA /* guiEditBox.cpp */; }; + 84FD8E3426A0B04900EF2BFA /* guiScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84FD8E3326A0B04900EF2BFA /* guiScene.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -933,6 +935,10 @@ 84F20F3B25D52975009562A9 /* mapgen_v7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mapgen_v7.cpp; path = ../../../../src/mapgen/mapgen_v7.cpp; sourceTree = ""; }; 84F20F3C25D52975009562A9 /* mapgen_v5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mapgen_v5.cpp; path = ../../../../src/mapgen/mapgen_v5.cpp; sourceTree = ""; }; 84F20F3D25D52975009562A9 /* mapgen_v6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mapgen_v6.h; path = ../../../../src/mapgen/mapgen_v6.h; sourceTree = ""; }; + 84FD8E2F26A0B01D00EF2BFA /* guiEditBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiEditBox.h; path = ../../../../src/gui/guiEditBox.h; sourceTree = ""; }; + 84FD8E3026A0B01D00EF2BFA /* guiEditBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiEditBox.cpp; path = ../../../../src/gui/guiEditBox.cpp; sourceTree = ""; }; + 84FD8E3226A0B04900EF2BFA /* guiScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiScene.h; path = ../../../../src/gui/guiScene.h; sourceTree = ""; }; + 84FD8E3326A0B04900EF2BFA /* guiScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiScene.cpp; path = ../../../../src/gui/guiScene.cpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1058,6 +1064,8 @@ 84F20ED725D52955009562A9 /* guiChatConsole.h */, 84F20EF325D52957009562A9 /* guiConfirmRegistration.cpp */, 84F20ED325D52955009562A9 /* guiConfirmRegistration.h */, + 84FD8E3026A0B01D00EF2BFA /* guiEditBox.cpp */, + 84FD8E2F26A0B01D00EF2BFA /* guiEditBox.h */, 84F20ECB25D52954009562A9 /* guiEditBoxWithScrollbar.cpp */, 84F20EEE25D52957009562A9 /* guiEditBoxWithScrollbar.h */, 84F20EEB25D52957009562A9 /* guiEngine.cpp */, @@ -1077,6 +1085,8 @@ 84F20ECD25D52955009562A9 /* guiPasswordChange.h */, 84F20EF525D52957009562A9 /* guiPathSelectMenu.cpp */, 84F20EDA25D52955009562A9 /* guiPathSelectMenu.h */, + 84FD8E3326A0B04900EF2BFA /* guiScene.cpp */, + 84FD8E3226A0B04900EF2BFA /* guiScene.h */, 84F20EFD25D52958009562A9 /* guiScrollBar.cpp */, 84F20EDD25D52956009562A9 /* guiScrollBar.h */, 84F20EF625D52957009562A9 /* guiScrollContainer.cpp */, @@ -1212,7 +1222,6 @@ 84135B4A25D5264600CA4DCF /* emerge.h */, 84135B0C25D5263100CA4DCF /* environment.cpp */, 84135AD925D5261F00CA4DCF /* environment.h */, - 84135B1525D5263500CA4DCF /* mtevent.h */, 84135AF925D5262800CA4DCF /* exceptions.h */, 84135AFE25D5262B00CA4DCF /* face_position_cache.cpp */, 84135AEA25D5262200CA4DCF /* face_position_cache.h */, @@ -1263,6 +1272,7 @@ 84135AC725D5261C00CA4DCF /* modchannels.cpp */, 84135B4E25D5264700CA4DCF /* modchannels.h */, 84135AE925D5262200CA4DCF /* modifiedstate.h */, + 84135B1525D5263500CA4DCF /* mtevent.h */, 84135ACF25D5261D00CA4DCF /* nameidmapping.cpp */, 84135B4F25D5264800CA4DCF /* nameidmapping.h */, 84135AF325D5262600CA4DCF /* nodedef.cpp */, @@ -2063,6 +2073,7 @@ 84135B9025D5264C00CA4DCF /* metadata.cpp in Sources */, 84F20E2625D5282A009562A9 /* l_base.cpp in Sources */, 84135B6C25D5264B00CA4DCF /* emerge.cpp in Sources */, + 84FD8E3126A0B01D00EF2BFA /* guiEditBox.cpp in Sources */, 84F20E5525D5283F009562A9 /* mods.cpp in Sources */, 84F20E8225D52868009562A9 /* auth.cpp in Sources */, 84F20F4E25D52975009562A9 /* mapgen_v5.cpp in Sources */, @@ -2170,6 +2181,7 @@ 84F20E3A25D5282A009562A9 /* l_particles.cpp in Sources */, 84135B7A25D5264C00CA4DCF /* mapnode.cpp in Sources */, 84135B9A25D5264C00CA4DCF /* porting.cpp in Sources */, + 84FD8E3426A0B04900EF2BFA /* guiScene.cpp in Sources */, 84135C1F25D526D700CA4DCF /* mapblock_mesh.cpp in Sources */, 847C6D4B25D6F483008F5FC8 /* lutf8lib.c in Sources */, 84F20DD925D52812009562A9 /* s_env.cpp in Sources */, diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index a1ac00113..b221606c3 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -58,12 +58,12 @@ end -------------------------------------------------------------------------------- -function render_serverlist_row(spec, is_favorite, is_approved) +function render_serverlist_row(spec, is_favorite) -- Get information from non_mobile_servers. - if is_favorite and not spec.proto_min and menudata.non_mobile_servers and - spec.address and spec.port then + if is_favorite and not spec.proto_min and spec.address and spec.port and + serverlistmgr.non_mobile_servers then local id = ("%s:%s"):format(spec.address, spec.port) - spec = menudata.non_mobile_servers[id] or spec + spec = serverlistmgr.non_mobile_servers[id] or spec end local text = "" @@ -81,12 +81,10 @@ function render_serverlist_row(spec, is_favorite, is_approved) local details if is_favorite then details = "1," + elseif spec.server_id == "multicraft" then + details = "2," else - if is_approved then - details = "2," - else - details = "3," - end + details = "3," end if spec.lag then diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua index 913a15454..c244656f2 100644 --- a/builtin/mainmenu/init.lua +++ b/builtin/mainmenu/init.lua @@ -157,35 +157,10 @@ local function init_globals() ui.set_default("maintab") tv_main:show() + core.set_clouds(false) + mm_texture.set_dirt_bg() + ui.update() end --------------------------------------------------------------------------------- -local function init_globals() - -- Init gamedata - gamedata.worldindex = 0 - - menudata.worldlist = filterlist.create( - core.get_worlds, - compare_worlds, - -- Unique id comparison function - function(element, uid) - return element.name == uid - end, - -- Filter function - function(element, gameid) - return element.gameid == gameid - end - ) - - menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic) - menudata.worldlist:set_sortmode("alphabetic") - - -- Create main tabview - core.set_clouds(false) - mm_texture.set_dirt_bg() - menudata.init_tabs() --- core.sound_play("main_menu", true) -end - init_globals() diff --git a/builtin/mainmenu/serverlistmgr.lua b/builtin/mainmenu/serverlistmgr.lua index 964d0c584..cb6b3574f 100644 --- a/builtin/mainmenu/serverlistmgr.lua +++ b/builtin/mainmenu/serverlistmgr.lua @@ -18,22 +18,30 @@ serverlistmgr = {} -------------------------------------------------------------------------------- +serverlistmgr.mobile_only = PLATFORM == "Android" or PLATFORM == "iOS" local function order_server_list(list) local res = {} - --orders the favorite list after support + local non_mobile_servers = {} + local mobile = serverlistmgr.mobile_only + + -- orders the multicraft list before support for i = 1, #list do local fav = list[i] - if is_server_protocol_compat(fav.proto_min, fav.proto_max) then + if mobile and not fav.mobile_friendly then + non_mobile_servers[("%s:%s"):format(fav.address, fav.port)] = fav + elseif fav.server_id == "multicraft" then res[#res + 1] = fav end end for i = 1, #list do local fav = list[i] - if not is_server_protocol_compat(fav.proto_min, fav.proto_max) then + if (mobile and fav.mobile_friendly or not mobile) and + is_server_protocol_compat(fav.proto_min, fav.proto_max) and + fav.server_id ~= "multicraft" then res[#res + 1] = fav end end - return res + return res, non_mobile_servers end local public_downloading = false @@ -64,8 +72,11 @@ function serverlistmgr.sync() core.handle_async( function(param) local http = core.get_http_api() - local url = ("%s/list?proto_version_min=%d&proto_version_max=%d"):format( + local url = ("%s%s?proto_version_min=%d&proto_version_max=%d"):format( core.settings:get("serverlist_url"), + (PLATFORM == "Android" or PLATFORM == "iOS") and + core.decode_base64("OjMwMDAvc2VydmVybGlzdC5qc29u") or + core.decode_base64("L2xpc3Q"), core.get_min_supp_proto(), core.get_max_supp_proto()) @@ -80,9 +91,10 @@ function serverlistmgr.sync() nil, function(result) public_downloading = nil - local favs = order_server_list(result) + local favs, non_mobile_servers = order_server_list(result) if favs[1] then serverlistmgr.servers = favs + serverlistmgr.non_mobile_servers = non_mobile_servers end core.event_handler("Refresh") end diff --git a/builtin/mainmenu/tab_credits.lua b/builtin/mainmenu/tab_credits.lua index 010cc1dbe..e2c302699 100644 --- a/builtin/mainmenu/tab_credits.lua +++ b/builtin/mainmenu/tab_credits.lua @@ -114,8 +114,8 @@ return { caption = fgettext("Credits"), cbf_formspec = function(tabview, name, tabdata) local version = core.get_version() - return "label[0.1,-0.1;" .. - "MultiCraft Open Source Project, ver. " .. version.string .. "\n" .. + local fs = "label[0.1,-0.1;" .. + "MultiCraft Open Source, ver. " .. version.string .. "\n" .. "Copyright (C) 2014-2021 MultiCraft Development Team\n" .. "Licence: LGPLv3.0+ and CC-BY-SA 4.0, Home page: http://multicraft.world\n" .. "Created and Powered by Minetest Engine, ver. 5.4.1]" .. @@ -135,12 +135,12 @@ return { buildCreditList(previous_contributors) .. "," .. ";1]" - if PLATFORM ~= "Android" then + --[[if PLATFORM ~= "Android" then fs = fs .. "tooltip[userdata;" .. fgettext("Opens the directory that contains user-provided worlds, games, mods,\n" .. "and texture packs in a file manager / explorer.") .. "]" fs = fs .. "button[0,4.75;3.5,1;userdata;" .. fgettext("Open User Data Directory") .. "]" - end + end]] return fs end, diff --git a/builtin/mainmenu/tab_local.lua b/builtin/mainmenu/tab_local.lua index f18e8209c..949042062 100644 --- a/builtin/mainmenu/tab_local.lua +++ b/builtin/mainmenu/tab_local.lua @@ -19,13 +19,9 @@ local lang = core.settings:get("language") if not lang or lang == "" then lang = os.getenv("LANG") end local mobile = PLATFORM == "Android" or PLATFORM == "iOS" -local enable_gamebar = PLATFORM ~= "Android" -local current_game, singleplayer_refresh_gamebar - -if enable_gamebar then - function current_game() - local last_game_id = core.settings:get("menu_last_game") - local game = pkgmgr.find_by_gameid(last_game_id) +local function current_game() + local last_game_id = core.settings:get("menu_last_game") + local game = pkgmgr.find_by_gameid(last_game_id) return game end diff --git a/builtin/mainmenu/tab_online.lua b/builtin/mainmenu/tab_online.lua index b37c562df..53e9f1301 100644 --- a/builtin/mainmenu/tab_online.lua +++ b/builtin/mainmenu/tab_online.lua @@ -18,7 +18,6 @@ -------------------------------------------------------------------------------- local password_save = core.settings:get_bool("password_save") local password_tmp = "" -local mobile_only = PLATFORM == "Android" or PLATFORM == "iOS" local function get_formspec(tabview, name, tabdata) -- Update the cached supported proto info, @@ -46,7 +45,7 @@ local function get_formspec(tabview, name, tabdata) "image_button[5.59,-0.13;0.83,0.83;" .. esc(defaulttexturedir .. "refresh.png") .. ";btn_mp_refresh;;true;false]" .. "image_button[6.29,-0.13;0.83,0.83;" .. esc(defaulttexturedir .. - (not mobile_only and "online_pc" or "online_mobile") .. ".png") + (serverlistmgr.mobile_only and "online_mobile" or "online_pc") .. ".png") .. ";btn_mp_mobile;;true;false]" else search_panel = @@ -59,7 +58,7 @@ local function get_formspec(tabview, name, tabdata) local retval = -- Search - search_panel.. + search_panel.. -- Address / Port "label[7.1,-0.3;" .. fgettext("Address") .. ":" .. "]" .. @@ -93,7 +92,7 @@ local function get_formspec(tabview, name, tabdata) retval = retval .. "image_button[7.1,4.91;0.83,0.83;" .. esc(defaulttexturedir .. "trash.png") .. ";btn_delete_favorite;;true;false]" end - if fav_selected.description then + if selected.description then retval = retval .. "textarea[7.5,2.2;4.8,3;;" .. esc((gamedata.serverdescription or ""), true) .. ";]" end @@ -112,7 +111,7 @@ local function get_formspec(tabview, name, tabdata) image_column(fgettext("Server mode")) .. ",padding=0.5;" .. "color,span=1;" .. "text,padding=0.5]" .. - "table[-0.09,0.7;6.99,4.93;favourites;" + "table[-0.09,0.7;6.99,4.93;favorites;" if menudata.search_result then local favs = serverlistmgr.get_favorites() @@ -129,8 +128,7 @@ local function get_formspec(tabview, name, tabdata) retval = retval .. "," end - retval = retval .. render_serverlist_row(server, server.is_favorite, - server.server_id == "multicraft") + retval = retval .. render_serverlist_row(server, server.is_favorite) end elseif #serverlistmgr.servers > 0 then local favs = serverlistmgr.get_favorites() @@ -147,11 +145,10 @@ local function get_formspec(tabview, name, tabdata) end end end - retval = retval .. render_serverlist_row(menudata.favorites[1], (#favs > 0), - menudata.favorites[1].server_id == "multicraft") - for i = 2, #menudata.favorites do - retval = retval .. "," .. render_serverlist_row(menudata.favorites[i], - (i <= #favs), menudata.favorites[i].server_id == "multicraft") + + retval = retval .. render_serverlist_row(serverlistmgr.servers[1], (#favs > 0)) + for i = 2, #serverlistmgr.servers do + retval = retval .. "," .. render_serverlist_row(serverlistmgr.servers[i], (i <= #favs)) end end @@ -181,8 +178,8 @@ local function main_button_handler(tabview, fields, name, tabdata) end end - if fields.favourites then - local event = core.explode_table_event(fields.favourites) + if fields.favorites then + local event = core.explode_table_event(fields.favorites) local fav = serverlist[event.row] if event.type == "DCL" then @@ -277,6 +274,8 @@ local function main_button_handler(tabview, fields, name, tabdata) serverlistmgr.sync() tabdata.selected = nil + core.settings:set("address", "") + core.settings:set("remote_port", "30000") return true end @@ -353,7 +352,7 @@ local function main_button_handler(tabview, fields, name, tabdata) end if fields.btn_mp_mobile then - mobile_only = not mobile_only + serverlistmgr.mobile_only = not serverlistmgr.mobile_only serverlistmgr.sync() return true end @@ -402,8 +401,8 @@ local function main_button_handler(tabview, fields, name, tabdata) core.settings:set_bool("auto_connect", auto_connect) core.settings:set("connect_time", os.time()) core.settings:set("maintab_LAST", "online") - core.settings:set("address", fields.te_address) - core.settings:set("remote_port", fields.te_port) + core.settings:set("address", gamedata.address) + core.settings:set("remote_port", gamedata.port) core.start() return true @@ -419,7 +418,7 @@ end -------------------------------------------------------------------------------- return { name = "online", - caption = fgettext("Multiplayer"), + caption = fgettext("Join Game"), cbf_formspec = get_formspec, cbf_button_handler = main_button_handler, on_change = on_change diff --git a/src/client/client.cpp b/src/client/client.cpp index 186014033..ee21250c0 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -1617,7 +1617,7 @@ void Client::typeChatMessage(const std::wstring &message) LocalPlayer *player = m_env.getLocalPlayer(); if (!player) return; - std::wstring name = narrow_to_wide(player->getName()); + std::wstring name = utf8_to_wide(player->getName()); ChatMessage *chatMessage = new ChatMessage(CHATMESSAGE_TYPE_NORMAL, message, name); m_chat_queue.push(chatMessage); diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index f0f943256..49f14351c 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -496,7 +496,7 @@ bool ClientLauncher::launch_game(std::string &error_message, // If using simple singleplayer mode, override if (start_data.isSinglePlayer()) { - start_data.name = "singleplayer"; + start_data.name = "Player"; start_data.password = ""; start_data.socket_port = myrand_range(49152, 65535); } else { diff --git a/src/client/game.cpp b/src/client/game.cpp index 2beffce2b..9247f8701 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -4436,7 +4436,7 @@ void external_statustext(const char *text, float duration) { if (!g_game) return; - std::wstring s = narrow_to_wide(std::string(text)); + std::wstring s = utf8_to_wide(std::string(text)); g_game->customStatustext(s, duration); } #endif diff --git a/src/client/minimap.cpp b/src/client/minimap.cpp index 971b2846a..4cc8b82a2 100644 --- a/src/client/minimap.cpp +++ b/src/client/minimap.cpp @@ -631,7 +631,7 @@ void Minimap::drawMinimap(core::rect rect) { material.setFlag(video::EMF_TRILINEAR_FILTER, true); material.Lighting = false; material.TextureLayer[0].Texture = minimap_texture; - material.TextureLayer[1].Texture = data->is_radar ? 0 : data->heightmap_texture; + material.TextureLayer[1].Texture = data->heightmap_texture; if (m_enable_shaders && data->mode.type == MINIMAP_TYPE_SURFACE) { u16 sid = m_shdrsrc->getShader("minimap_shader", TILE_MATERIAL_ALPHA); diff --git a/src/client/render/interlaced.cpp b/src/client/render/interlaced.cpp index 0c3155c20..960d3fcf6 100644 --- a/src/client/render/interlaced.cpp +++ b/src/client/render/interlaced.cpp @@ -36,7 +36,7 @@ void RenderingCoreInterlaced::initMaterial() mat.UseMipMaps = false; mat.ZBuffer = false; mat.setFlag(video::EMF_ZWRITE_ENABLE, false); // ZWriteEnable is bool on early 1.9 but E_ZWRITE on later 1.9 - u32 shader = s->getShader("3d_interlaced_merge", TILE_MATERIAL_BASIC, 0); + u32 shader = s->getShader("3d_interlaced_merge", TILE_MATERIAL_BASIC); mat.MaterialType = s->getShaderInfo(shader).material; for (int k = 0; k < 3; ++k) { mat.TextureLayer[k].AnisotropicFilter = false; diff --git a/src/client/sky.cpp b/src/client/sky.cpp index 9e3f9b8a3..a25bce8da 100644 --- a/src/client/sky.cpp +++ b/src/client/sky.cpp @@ -68,7 +68,7 @@ Sky::Sky(s32 id, ITextureSource *tsrc, IShaderSource *ssrc) : // Create materials m_materials[0] = baseMaterial(); - m_materials[0].MaterialType = ssrc->getShaderInfo(ssrc->getShader("stars_shader", TILE_MATERIAL_ALPHA, 0)).material; + m_materials[0].MaterialType = ssrc->getShaderInfo(ssrc->getShader("stars_shader", TILE_MATERIAL_ALPHA)).material; m_materials[0].Lighting = true; m_materials[0].ColorMaterial = video::ECM_NONE; diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index 03c3705f6..276d094f8 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -186,8 +186,6 @@ GUIEngine::GUIEngine(JoystickController *joystick, m_script = new MainMenuScripting(this); - m_device = RenderingEngine::get_raw_device(); - try { m_script->setMainMenuData(&m_data->script_data); m_data->script_data.errormessage = ""; @@ -264,10 +262,11 @@ void GUIEngine::run() } while (RenderingEngine::run() && (!m_startgame) && (!m_kill)) { + IrrlichtDevice *device = RenderingEngine::get_raw_device(); #ifdef __IOS__ - if (m_device->isWindowMinimized()) + if (device->isWindowMinimized()) #else - if (!m_device->isWindowFocused()) + if (!device->isWindowFocused()) #endif { sleep_ms(50); @@ -310,7 +309,8 @@ void GUIEngine::run() driver->endScene(); - u32 frametime_min = 1000 / g_settings->getFloat("pause_fps_max") / 2; + u32 frametime_min = 1000 / g_settings->getFloat("fps_max_unfocused") + / 2; if (m_clouds_enabled) cloudPostProcess(frametime_min, device); diff --git a/src/gui/guiEngine.h b/src/gui/guiEngine.h index 6802c5474..4888c822a 100644 --- a/src/gui/guiEngine.h +++ b/src/gui/guiEngine.h @@ -217,9 +217,6 @@ private: /** scripting interface */ MainMenuScripting *m_script = nullptr; - /** irrlicht device */ - IrrlichtDevice *m_device = nullptr; - /** script basefolder */ std::string m_scriptdir = ""; diff --git a/src/itemdef.cpp b/src/itemdef.cpp index 60296f0fc..a7911e53e 100644 --- a/src/itemdef.cpp +++ b/src/itemdef.cpp @@ -161,10 +161,10 @@ void ItemDefinition::serialize(std::ostream &os, u16 protocol_version) const os << serializeString16(node_placement_prediction); if (version == 3) { - os << serializeString(sound_place.name); + os << serializeString16(sound_place.name); writeF1000(os, sound_place.gain); writeF1000(os, range); - os << serializeString(sound_place_failed.name); + os << serializeString16(sound_place_failed.name); writeF1000(os, sound_place_failed.gain); } else { // Version from ContentFeatures::serialize to keep in sync @@ -250,10 +250,10 @@ void ItemDefinition::deSerialize(std::istream &is) range = readF1000(is); sound_place_failed.deSerialize(is, cf_version); } - palette_image = deSerializeString(is); + palette_image = deSerializeString16(is); color = readARGB8(is); - inventory_overlay = deSerializeString(is); - wield_overlay = deSerializeString(is); + inventory_overlay = deSerializeString16(is); + wield_overlay = deSerializeString16(is); short_description = deSerializeString16(is); } catch(SerializationError &e) {}; } diff --git a/src/mapgen/mapgen_v7p.cpp b/src/mapgen/mapgen_v7p.cpp index 8d163c011..0508ad637 100644 --- a/src/mapgen/mapgen_v7p.cpp +++ b/src/mapgen/mapgen_v7p.cpp @@ -187,12 +187,6 @@ void MapgenV7P::makeChunk(BlockMakeData *data) // Pre-conditions assert(data->vmanip); assert(data->nodedef); - assert(data->blockpos_requested.X >= data->blockpos_min.X && - data->blockpos_requested.Y >= data->blockpos_min.Y && - data->blockpos_requested.Z >= data->blockpos_min.Z); - assert(data->blockpos_requested.X <= data->blockpos_max.X && - data->blockpos_requested.Y <= data->blockpos_max.Y && - data->blockpos_requested.Z <= data->blockpos_max.Z); this->generating = true; this->vm = data->vmanip; diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index c088d892e..57e3b9dac 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -950,12 +950,12 @@ void Client::handleCommand_DetachedInventory(NetworkPacket* pkt) std::string datastring(pkt->getString(0), pkt->getSize()); std::istringstream is(datastring, std::ios_base::binary); - std::string name = deSerializeString(is); + std::string name = deSerializeString16(is); infostream << "Client: Detached inventory update: \"" << name << "\"" << std::endl; - Inventory *inv = NULL; + Inventory *inv = nullptr; if (m_detached_inventories.count(name) > 0) inv = m_detached_inventories[name]; else { diff --git a/src/nodedef.cpp b/src/nodedef.cpp index 123a9f4d8..9b964b150 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -600,11 +600,11 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version) { if (version == 5) // In PROTOCOL_VERSION 13 { - name = deSerializeString(is); + name = deSerializeString16(is); groups.clear(); u32 groups_size = readU16(is); for(u32 i=0; ifirst); + os << serializeString16(i->first); writeS16(os, i->second); } writeU8(os, drawtype); @@ -1314,10 +1314,10 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version) const writeU8(os, diggable); writeU8(os, climbable); writeU8(os, buildable_to); - os << serializeString(""); // legacy: used to be metadata_name + os << serializeString16(""); // legacy: used to be metadata_name writeU8(os, liquid_type); - os << serializeString(liquid_alternative_flowing); - os << serializeString(liquid_alternative_source); + os << serializeString16(liquid_alternative_flowing); + os << serializeString16(liquid_alternative_source); writeU8(os, liquid_viscosity); writeU8(os, liquid_renewable); writeU8(os, light_source); @@ -1334,7 +1334,7 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version) const writeU8(os, leveled); writeU8(os, liquid_range); writeU8(os, waving); - os << serializeString(mesh); + os << serializeString16(mesh); collision_box.serialize(os, protocol_version); writeU8(os, floodable); writeU16(os, connects_to_ids.size()); diff --git a/src/serverlist.cpp b/src/serverlist.cpp index 6ae2e6422..acf166be3 100644 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include "convert_json.h" #include "httpfetch.h" +#include "util/base64.h" namespace ServerList { @@ -51,6 +52,7 @@ void sendAnnounce(AnnounceAction action, } if (action != AA_DELETE) { bool strict_checking = g_settings->getBool("strict_protocol_version_checking"); +#define y base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk") server["name"] = g_settings->get("server_name"); server["description"] = g_settings->get("server_description"); server["version"] = g_version_string; diff --git a/util/ci/common.sh b/util/ci/common.sh index 7523fa7ff..e50bf5bcd 100644 --- a/util/ci/common.sh +++ b/util/ci/common.sh @@ -5,8 +5,7 @@ install_linux_deps() { local pkgs=(libirrlicht-dev cmake libbz2-dev libpng-dev \ libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev \ libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev \ - gettext libpq-dev postgresql-server-dev-all libleveldb-dev \ - libcurl4-openssl-dev) + gettext libpq-dev libleveldb-dev libcurl4-openssl-dev) sudo apt-get update sudo apt-get install -y --no-install-recommends ${pkgs[@]} "$@"