From 39fdfdc54f05ea0958ddd32fab9c53244320bb85 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 22 May 2022 18:27:41 +0100 Subject: [PATCH] Rename *_scaling to real_*_scaling --- doc/lua_api.txt | 4 ++-- games/devtest/mods/testfullscreenfs/init.lua | 4 ++-- src/client/client.cpp | 4 ++-- src/clientdynamicinfo.h | 8 ++++---- src/network/serverpackethandler.cpp | 4 ++-- src/script/lua_api/l_server.cpp | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index ceb8139ff6114..e48f57829dd24 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -4793,11 +4793,11 @@ Utilities -- GUI Scaling multiplier -- Equal to the setting `gui_scaling` multiplied by `dpi / 96` - gui_scaling = 1, + real_gui_scaling = 1, -- HUD Scaling multiplier -- Equal to the setting `hud_scaling` multiplied by `dpi / 96` - hud_scaling = 1, + real_hud_scaling = 1, } * `minetest.mkdir(path)`: returns success. diff --git a/games/devtest/mods/testfullscreenfs/init.lua b/games/devtest/mods/testfullscreenfs/init.lua index 7f2a493609cc8..5cd7dd6495c1b 100644 --- a/games/devtest/mods/testfullscreenfs/init.lua +++ b/games/devtest/mods/testfullscreenfs/init.lua @@ -1,7 +1,7 @@ local function calculate_max_fs_size(window) return { - x = window.size.x / (0.5555 * 96 * window.gui_scaling), - y = window.size.y / (0.5555 * 96 * window.gui_scaling), + x = window.size.x / (0.5555 * 96 * window.real_gui_scaling), + y = window.size.y / (0.5555 * 96 * window.real_gui_scaling), } end diff --git a/src/client/client.cpp b/src/client/client.cpp index dfeb27ae02b0e..798b641fa1835 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -1367,8 +1367,8 @@ void Client::sendUpdateClientInfo(const ClientDynamicInfo& info) { NetworkPacket pkt(TOSERVER_UPDATE_CLIENT_INFO, 4*2 + 4 + 4); pkt << (u32)info.render_target_size.X << (u32)info.render_target_size.Y; - pkt << info.gui_scaling; - pkt << info.hud_scaling; + pkt << info.real_gui_scaling; + pkt << info.real_hud_scaling; Send(&pkt); } diff --git a/src/clientdynamicinfo.h b/src/clientdynamicinfo.h index 0ac6b728481d6..58dfb7a4b33ad 100644 --- a/src/clientdynamicinfo.h +++ b/src/clientdynamicinfo.h @@ -6,12 +6,12 @@ struct ClientDynamicInfo { v2u32 render_target_size; - f32 gui_scaling; - f32 hud_scaling; + f32 real_gui_scaling; + f32 real_hud_scaling; bool equal(const ClientDynamicInfo &other) const { return render_target_size == other.render_target_size && - abs(gui_scaling - other.gui_scaling) < 0.001f && - abs(hud_scaling - other.hud_scaling) < 0.001f; + abs(real_gui_scaling - other.real_gui_scaling) < 0.001f && + abs(real_hud_scaling - other.real_hud_scaling) < 0.001f; } }; diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index a150784e6eeab..102db82d52ca5 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -1846,8 +1846,8 @@ void Server::handleCommand_UpdateClientInfo(NetworkPacket *pkt) ClientDynamicInfo info; *pkt >> info.render_target_size.X; *pkt >> info.render_target_size.Y; - *pkt >> info.gui_scaling; - *pkt >> info.hud_scaling; + *pkt >> info.real_gui_scaling; + *pkt >> info.real_hud_scaling; session_t peer_id = pkt->getPeerId(); RemoteClient *client = getClient(peer_id, CS_Invalid); diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index 7678b3661ca02..5cdfbbeee85e2 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -291,12 +291,12 @@ int ModApiServer::l_get_player_window_information(lua_State *L) push_v2u32(L, dynamic->render_target_size); lua_settable(L, dyn_table); - lua_pushstring(L, "gui_scaling"); - lua_pushnumber(L, dynamic->gui_scaling); + lua_pushstring(L, "real_gui_scaling"); + lua_pushnumber(L, dynamic->real_gui_scaling); lua_settable(L, dyn_table); - lua_pushstring(L, "hud_scaling"); - lua_pushnumber(L, dynamic->hud_scaling); + lua_pushstring(L, "real_hud_scaling"); + lua_pushnumber(L, dynamic->real_hud_scaling); lua_settable(L, dyn_table); }