diff --git a/Apple/MultiCraft/MultiCraft.xcodeproj/project.pbxproj b/Apple/MultiCraft/MultiCraft.xcodeproj/project.pbxproj index f13ec878d..369231d32 100644 --- a/Apple/MultiCraft/MultiCraft.xcodeproj/project.pbxproj +++ b/Apple/MultiCraft/MultiCraft.xcodeproj/project.pbxproj @@ -380,7 +380,7 @@ 84135B2225D5263A00CA4DCF /* texture_override.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = texture_override.h; path = ../../../src/texture_override.h; sourceTree = ""; }; 84135B2325D5263A00CA4DCF /* gettext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gettext.cpp; path = ../../../src/gettext.cpp; sourceTree = ""; }; 84135B2425D5263A00CA4DCF /* metadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = metadata.h; path = ../../../src/metadata.h; sourceTree = ""; }; - 84135B2525D5263B00CA4DCF /* defaultsettings.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = defaultsettings.cpp; path = ../../../src/defaultsettings.cpp; sourceTree = ""; }; + 84135B2525D5263B00CA4DCF /* defaultsettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = defaultsettings.cpp; path = ../../../src/defaultsettings.cpp; sourceTree = ""; }; 84135B2625D5263B00CA4DCF /* mapnode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mapnode.h; path = ../../../src/mapnode.h; sourceTree = ""; }; 84135B2725D5263B00CA4DCF /* irr_aabb3d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = irr_aabb3d.h; path = ../../../src/irr_aabb3d.h; sourceTree = ""; }; 84135B2825D5263C00CA4DCF /* craftdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = craftdef.h; path = ../../../src/craftdef.h; sourceTree = ""; }; @@ -2231,6 +2231,7 @@ "VERSION_EXTRA=\"\"", "DEVELOPMENT_BUILD=1", ); + GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", "${SRCROOT}/../../src", @@ -2250,6 +2251,9 @@ "${SRCROOT}/../deps/libvorbis/include", ); INFOPLIST_FILE = MultiCraft/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.adventure-games"; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 Minetest.org. All rights reserved."; + INFOPLIST_KEY_NSPrincipalClass = NSApplication; MACOSX_DEPLOYMENT_TARGET = 10.11; MARKETING_VERSION = 2.0.5; OTHER_LDFLAGS = ( @@ -2301,6 +2305,7 @@ "VERSION_EXTRA=\"\"", "DEVELOPMENT_BUILD=0", ); + GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", "${SRCROOT}/../../src", @@ -2320,6 +2325,9 @@ "${SRCROOT}/../deps/libvorbis/include", ); INFOPLIST_FILE = MultiCraft/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.adventure-games"; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 MultiCraft Studio OÜ. All rights reserved."; + INFOPLIST_KEY_NSPrincipalClass = NSApplication; MACOSX_DEPLOYMENT_TARGET = 10.11; MARKETING_VERSION = 2.0.5; OTHER_LDFLAGS = ( diff --git a/Apple/MultiCraft/MultiCraft/Assets.xcassets/AppIcon.appiconset/512х512@2x.png b/Apple/MultiCraft/MultiCraft/Assets.xcassets/AppIcon.appiconset/512х512@2x.png index 2640bfe85..6cf54dd44 100644 Binary files a/Apple/MultiCraft/MultiCraft/Assets.xcassets/AppIcon.appiconset/512х512@2x.png and b/Apple/MultiCraft/MultiCraft/Assets.xcassets/AppIcon.appiconset/512х512@2x.png differ diff --git a/Apple/MultiCraft/MultiCraft/Info.plist b/Apple/MultiCraft/MultiCraft/Info.plist index af071bcff..811787f41 100644 --- a/Apple/MultiCraft/MultiCraft/Info.plist +++ b/Apple/MultiCraft/MultiCraft/Info.plist @@ -22,18 +22,10 @@ $(CURRENT_PROJECT_VERSION) ITSAppUsesNonExemptEncryption - LSApplicationCategoryType - public.app-category.adventure-games LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHighResolutionCapable - NSHumanReadableCopyright - Copyright © 2023 MultiCraft Studio OÜ. All rights reserved. - NSPrincipalClass - NSApplication - NSSupportsAutomaticTermination - NSSupportsSuddenTermination diff --git a/Apple/MultiCraft/MultiCraft/wrapper.h b/Apple/MultiCraft/MultiCraft/wrapper.h index f82c4e963..4021d87aa 100644 --- a/Apple/MultiCraft/MultiCraft/wrapper.h +++ b/Apple/MultiCraft/MultiCraft/wrapper.h @@ -6,6 +6,8 @@ extern "C" { const char *get_secret_key(const char *key); +float get_screen_scale(); + #ifdef __cplusplus } #endif diff --git a/Apple/MultiCraft/MultiCraft/wrapper.m b/Apple/MultiCraft/MultiCraft/wrapper.m index d09aec1ec..e44c924e1 100644 --- a/Apple/MultiCraft/MultiCraft/wrapper.m +++ b/Apple/MultiCraft/MultiCraft/wrapper.m @@ -1,3 +1,4 @@ +@import AppKit; @import Foundation; #import "wrapper.h" @@ -6,3 +7,8 @@ const char *get_secret_key(const char *key) { return "dummy"; } + +float get_screen_scale() +{ + return [NSScreen mainScreen].backingScaleFactor; +} diff --git a/Apple/scripts/SDL2.sh b/Apple/scripts/SDL2.sh index c1401a7e4..69333c3b1 100755 --- a/Apple/scripts/SDL2.sh +++ b/Apple/scripts/SDL2.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -SDL2_VERSION=release-2.28.3 +SDL2_VERSION=release-2.28.4 . scripts/sdk.sh mkdir -p deps; cd deps diff --git a/Apple/scripts/gettext.sh b/Apple/scripts/gettext.sh index 061a28833..0b935cd66 100755 --- a/Apple/scripts/gettext.sh +++ b/Apple/scripts/gettext.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -GETTEXT_VERSION=0.22 +GETTEXT_VERSION=0.22.3 . scripts/sdk.sh mkdir -p deps; cd deps diff --git a/Apple/scripts/libjpeg.sh b/Apple/scripts/libjpeg.sh index faec12a4e..915ae66f3 100755 --- a/Apple/scripts/libjpeg.sh +++ b/Apple/scripts/libjpeg.sh @@ -1,15 +1,13 @@ #!/bin/bash -e -JPEG_VERSION=3.0.0 +JPEG_VERSION=3.0.1 . scripts/sdk.sh mkdir -p deps; cd deps if [ ! -d libjpeg-src ]; then - wget https://download.sourceforge.net/libjpeg-turbo/libjpeg-turbo-$JPEG_VERSION.tar.gz - tar -xzf libjpeg-turbo-$JPEG_VERSION.tar.gz - mv libjpeg-turbo-$JPEG_VERSION libjpeg-src - rm libjpeg-turbo-$JPEG_VERSION.tar.gz + git clone -b $JPEG_VERSION --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo libjpeg-src + mkdir libjpeg-src/build fi rm -rf libjpeg diff --git a/Apple/scripts/locale.sh b/Apple/scripts/locale.sh index 31b6a5a51..f78874d92 100755 --- a/Apple/scripts/locale.sh +++ b/Apple/scripts/locale.sh @@ -6,10 +6,15 @@ if [ ! -d MultiCraft/MultiCraft.xcodeproj ]; then fi DEST=$(pwd)/assets/locale +broken_langs=(fil gd gl dv eo he hi jbo kn ko kk ky ms_Arab nn pt_BR sr_Cyrl sr_Latn zh_CN zh_TW) pushd ../po for lang in *; do [ ${#lang} -ne 2 ] && continue + # Skip broken languages + if [[ " ${broken_langs[@]} " =~ " ${lang} " ]]; then + continue + fi mopath=$DEST/$lang/LC_MESSAGES mkdir -p $mopath pushd $lang @@ -21,9 +26,5 @@ for lang in *; do done popd +# Remove hidden files and directories find $DEST -type d,f -name '.*' -print0 | xargs -0 -- rm -rf - -# remove broken languages -for broken_lang in dv eo he hi kn ko ms_Arab nn pt_BR sr_* zh_*; do - rm -rf $DEST/$broken_lang -done diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp index ce8f5faa5..7d23bd9c7 100644 --- a/src/client/renderingengine.cpp +++ b/src/client/renderingengine.cpp @@ -781,7 +781,7 @@ v2u32 RenderingEngine::getDisplaySize() #else // __ANDROID__/__IOS__ float RenderingEngine::getDisplayDensity() { - static const float density = porting::getDisplayDensity(); + static const float density = porting::getScreenScale(); return density; } diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 3628d00f1..cb31e0c87 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -30,12 +30,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client/renderingengine.h" #endif -#ifdef __APPLE__ #ifdef __IOS__ -#import "SDVersion.h" -#else -#import -#endif +#import "wrapper.h" #endif void set_default_settings() @@ -507,7 +503,7 @@ void set_default_settings() settings->setDefault("keymap_camera_mode", "KEY_KEY_C"); settings->setDefault("vsync", "true"); - int ScaleFactor = (int) [NSScreen mainScreen].backingScaleFactor; + int ScaleFactor = porting::getScreenScale(); settings->setDefault("screen_dpi", std::to_string(ScaleFactor * 72)); if (ScaleFactor >= 2) { settings->setDefault("hud_scaling", "1.5"); diff --git a/src/porting.cpp b/src/porting.cpp index 43bc1368e..b05b9e1fa 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -751,6 +751,12 @@ std::string getSecretKey(const std::string &key) { return std::string(get_secret_key(key.c_str())); } + +float getScreenScale() +{ + static const float retval = get_screen_scale(); + return retval; +} #endif float getTotalSystemMemory() diff --git a/src/porting.h b/src/porting.h index 29d3dfed4..33558c3d4 100644 --- a/src/porting.h +++ b/src/porting.h @@ -360,6 +360,8 @@ bool open_url(const std::string &url); #if defined(__APPLE__) std::string getSecretKey(const std::string &key); + +float getScreenScale(); #endif /** diff --git a/src/porting_android.cpp b/src/porting_android.cpp index 1a699bc24..4c36ef3ff 100644 --- a/src/porting_android.cpp +++ b/src/porting_android.cpp @@ -328,8 +328,7 @@ void notifyExitGame() jnienv->ExceptionClear(); } -#ifndef SERVER -float getDisplayDensity() +float getScreenScale() { static bool firstRun = true; static float value = 0; @@ -347,7 +346,6 @@ float getDisplayDensity() return value; } -#endif // ndef SERVER void finishGame(const std::string &exc) { diff --git a/src/porting_android.h b/src/porting_android.h index 204b8636d..2c6ca72f7 100644 --- a/src/porting_android.h +++ b/src/porting_android.h @@ -82,9 +82,10 @@ void notifyServerConnect(bool is_multiplayer); */ void notifyExitGame(); -#ifndef SERVER -float getDisplayDensity(); -#endif +/** + * get screen density + */ +float getScreenScale(); /** * call Android function to finish