diff --git a/build/android/app/build.gradle b/build/android/app/build.gradle index 7856a45c4..db5da29e3 100644 --- a/build/android/app/build.gradle +++ b/build/android/app/build.gradle @@ -2,13 +2,13 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 32 + compileSdkVersion 33 buildToolsVersion '33.0.0' - ndkVersion '23.2.8568313' + ndkVersion '25.0.8775105' defaultConfig { applicationId 'com.multicraft.game' minSdkVersion 21 - targetSdkVersion 32 + targetSdkVersion 33 versionName "${versionMajor}.${versionMinor}.${versionPatch}" versionCode project.versionCode } @@ -136,7 +136,7 @@ dependencies { /* Third-party libraries */ implementation 'androidx.appcompat:appcompat:1.4.2' implementation 'androidx.appcompat:appcompat-resources:1.4.2' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.0' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1' implementation 'androidx.work:work-runtime-ktx:2.7.1' implementation 'com.google.android.material:material:1.6.1' } diff --git a/build/android/app/src/main/AndroidManifest.xml b/build/android/app/src/main/AndroidManifest.xml index f10ffb170..16ce6a63c 100644 --- a/build/android/app/src/main/AndroidManifest.xml +++ b/build/android/app/src/main/AndroidManifest.xml @@ -28,6 +28,7 @@ NSHighResolutionCapable NSHumanReadableCopyright - Copyright © 2020 Maksym Hamarnyk. All rights reserved. + Copyright © 2022 MultiCraft Studio OÜ. All rights reserved. NSPrincipalClass NSApplication NSSupportsAutomaticTermination diff --git a/build/macOS/Podfile b/build/macOS/Podfile index 872d56cbf..37b666619 100644 --- a/build/macOS/Podfile +++ b/build/macOS/Podfile @@ -15,6 +15,7 @@ post_install do |installer| config.build_settings['GCC_SYMBOL_PRIVATE_EXTERN'] = 'YES' config.build_settings['GCC_UNROLL_LOOPS'] = 'YES' config.build_settings['LLVM_LTO'] = 'YES' + config.build_settings['DEAD_CODE_STRIPPING'] = 'YES' config.build_settings['ENABLE_BITCODE'] = 'NO' config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.11' config.build_settings['OTHER_CFLAGS'] = ['$(inherited)', '-fvisibility-inlines-hidden', '-fdata-sections', '-ffunction-sections', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables'] diff --git a/build/macOS/deps/openal.sh b/build/macOS/deps/openal.sh index 755c341e3..bdfaea903 100755 --- a/build/macOS/deps/openal.sh +++ b/build/macOS/deps/openal.sh @@ -1,7 +1,7 @@ #!/bin/bash -e . sdk.sh -OPENAL_VERSION=1.22.0 +OPENAL_VERSION=1.22.2 if [ ! -d openal-src ]; then wget https://github.com/kcat/openal-soft/archive/$OPENAL_VERSION.tar.gz diff --git a/builtin/game/hunger.lua b/builtin/game/hunger.lua index 24335ec36..fcc02b0ae 100644 --- a/builtin/game/hunger.lua +++ b/builtin/game/hunger.lua @@ -344,7 +344,6 @@ end hud.register("hunger", { hud_elem_type = "statbar", position = {x = 0.5, y = 1}, - alignment = {x = -1, y = -1}, offset = {x = 8, y = -94}, size = {x = 24, y = 24}, text = "hunger.png", diff --git a/builtin/game/statbars.lua b/builtin/game/statbars.lua index 33ecac181..3cf5b1727 100644 --- a/builtin/game/statbars.lua +++ b/builtin/game/statbars.lua @@ -5,7 +5,6 @@ local disable_health = false local health_bar_definition = { hud_elem_type = "statbar", position = {x = 0.5, y = 1}, - alignment = {x = -1, y = -1}, offset = {x = -247, y = -94}, size = {x = 24, y = 24}, text = "heart.png", @@ -16,7 +15,6 @@ local health_bar_definition = { local breath_bar_definition = { hud_elem_type = "statbar", position = {x = 0.5, y = 1}, - alignment = {x = -1, y = -1}, offset = {x = 8, y = -120}, size = {x = 24, y = 24}, text = "bubble.png", diff --git a/src/client/game.cpp b/src/client/game.cpp index 98cea3b64..4510fe022 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1415,7 +1415,11 @@ bool Game::createClient(const GameStartData &start_data) /* Pre-calculated values */ +#ifndef HAVE_TOUCHSCREENGUI video::ITexture *t = texture_src->getTexture("crack_anylength.png"); +#else + video::ITexture *t = texture_src->getTexture("crack_anylength_touch.png"); +#endif if (t) { v2u32 size = t->getOriginalSize(); crack_animation_length = size.Y / size.X; @@ -4546,7 +4550,6 @@ extern "C" void external_statustext(const char *text) { if (!g_game) return; - std::wstring s = utf8_to_wide(std::string(text)); - g_game->customStatustext(s); + g_game->customStatustext(utf8_to_wide_c(text)); } #endif diff --git a/src/client/tile.cpp b/src/client/tile.cpp index 2e3f97056..d0b4ed9d4 100644 --- a/src/client/tile.cpp +++ b/src/client/tile.cpp @@ -1038,10 +1038,15 @@ bool hasNPotSupport() return supported; } #else -// gles3 has NPotSupport, but this is using too many resources +// gles3 has NPotSupport and used on iOS by default bool hasNPotSupport() { +#ifdef __IOS__ + static const std::string &driverstring = g_settings->get("video_driver"); + return (driverstring != "ogles1"); +#else return false; +#endif } #endif @@ -1247,7 +1252,7 @@ bool TextureSource::generateImagePart(std::string part_of_name, It is an image with a number of cracking stages horizontally tiled. */ -#ifndef HAVE_TOUCHSCREENGUI +#ifndef HAVE_TOUCHSCREENGUI video::IImage *img_crack = m_sourcecache.getOrLoad( "crack_anylength.png"); #else diff --git a/src/debug.cpp b/src/debug.cpp index a29761136..a5391346c 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -56,12 +56,16 @@ void sanity_check_fn(const char *assertion, const char *file, errorstream << file << ":" << line << ": " << function << ": An engine assumption '" << assertion << "' failed." << std::endl; -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__IOS__) std::string capture = "An engine assumption failed: \"" + std::string(assertion) + "\" in file: " + std::string(file) + ":" + std::to_string(line) + " (" + std::string(function) + ")"; +#ifdef __ANDROID__ porting::finishGame(capture); +#elif defined(__IOS__) + ioswrap_finish_game(capture.c_str()); +#endif #else abort(); #endif @@ -79,12 +83,16 @@ void fatal_error_fn(const char *msg, const char *file, errorstream << file << ":" << line << ": " << function << ": A fatal error occurred: " << msg << std::endl; -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__IOS__) std::string capture = "A fatal error occurred: \"" + std::string(msg) + "\" in file: " + std::string(file) + ":" + std::to_string(line) + " (" + std::string(function) + ")"; +#ifdef __ANDROID__ porting::finishGame(capture); +#elif defined(__IOS__) + ioswrap_finish_game(capture.c_str()); +#endif #else abort(); #endif diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 668030896..96d197b4a 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -718,6 +718,12 @@ void set_default_settings() // iPad settings->setDefault("mouse_sensitivity", "0.3"); settings->setDefault("selectionbox_width", "6"); + + if SDVersion12and9Inch { + std::string font_big = std::to_string(TTF_DEFAULT_FONT_SIZE + 1); + settings->setDefault("font_size", font_big); + settings->setDefault("fallback_font_size", font_big); + } } // Settings for the Rounded Screen and Home Bar diff --git a/textures/base/pack/crack_anylength_touch.png b/textures/base/pack/crack_anylength_touch.png index 499cdc1b2..ee04fbca3 100644 Binary files a/textures/base/pack/crack_anylength_touch.png and b/textures/base/pack/crack_anylength_touch.png differ