diff --git a/build/android/native/jni/Android.mk b/build/android/native/jni/Android.mk index 77cab536c..b16d1a16e 100644 --- a/build/android/native/jni/Android.mk +++ b/build/android/native/jni/Android.mk @@ -239,7 +239,7 @@ LOCAL_SRC_FILES += $(wildcard ../../../lib/luachacha/*.c) LOCAL_STATIC_LIBRARIES += Curl Gettext Freetype Irrlicht LevelDB OpenAL mbedTLS mbedx509 mbedcrypto Vorbis LuaJIT android_native_app_glue $(PROFILER_LIBS) -LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES +LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES -lz include $(BUILD_SHARED_LIBRARY) diff --git a/build/android/native/jni/Application.mk b/build/android/native/jni/Application.mk index 6b5e18807..0aa0d5f4a 100644 --- a/build/android/native/jni/Application.mk +++ b/build/android/native/jni/Application.mk @@ -7,16 +7,14 @@ APP_MODULES := MultiCraft APP_CPPFLAGS := -Ofast -fvisibility=hidden -Wno-extra-tokens -ifeq ($(APP_ABI),armeabi-v7a) -APP_CPPFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -endif - #ifeq ($(APP_ABI),x86) #APP_CPPFLAGS += -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32 -funroll-loops #endif ifndef NDEBUG APP_CPPFLAGS := -g -D_DEBUG -O0 -fno-omit-frame-pointer +else +APP_CPPFLAGS += -D__FILE__=__FILE_NAME__ -Wno-builtin-macro-redefined endif APP_CPPFLAGS += -fexceptions #-Werror=shorten-64-to-32 diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index ecdafb511..a82bb3bb9 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -311,20 +311,26 @@ void GUIEngine::run() driver->endScene(); +#if defined(__ANDROID__) || defined(__IOS__) + bool keyboardActive; + if (!porting::hasRealKeyboard()) + keyboardActive = m_menu->getAndroidUIInput(); +#endif + u32 frametime_min = 1000 / g_settings->getFloat("fps_max_unfocused") / 2; +#ifdef __IOS__ + if (keyboardActive) + frametime_min = 1000 / g_settings->getFloat("fps_max"); +#endif + if (m_clouds_enabled) cloudPostProcess(frametime_min, device); else sleep_ms(frametime_min); m_script->step(); - -#if defined(__ANDROID__) || defined(__IOS__) - if (!porting::hasRealKeyboard()) - m_menu->getAndroidUIInput(); -#endif } } diff --git a/src/gui/modalMenu.cpp b/src/gui/modalMenu.cpp index 15d76b924..35aa0a6c6 100644 --- a/src/gui/modalMenu.cpp +++ b/src/gui/modalMenu.cpp @@ -183,7 +183,7 @@ static bool isChild(gui::IGUIElement *tocheck, gui::IGUIElement *parent) return false; } -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__IOS__) bool GUIModalMenu::simulateMouseEvent( gui::IGUIElement *target, ETOUCH_INPUT_EVENT touch_event) diff --git a/src/gui/modalMenu.h b/src/gui/modalMenu.h index 28de93db8..895f91dfc 100644 --- a/src/gui/modalMenu.h +++ b/src/gui/modalMenu.h @@ -102,7 +102,7 @@ private: // wants to launch other menus bool m_allow_focus_removal = false; -#ifdef __ANDROID__ +#if defined(__ANDROID__) || defined(__IOS__) irr_ptr m_hovered; bool simulateMouseEvent(gui::IGUIElement *target, ETOUCH_INPUT_EVENT touch_event); diff --git a/src/main.cpp b/src/main.cpp index 150e6aecf..0fd8416d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -199,7 +199,6 @@ int main(int argc, char *argv[]) if (g_settings->getBool("enable_console")) porting::attachOrCreateConsole(); -#if !defined(__ANDROID__) && !defined(__APPLE__) && !defined(NDEBUG) // Run unit tests if (cmd_args.getFlag("run-unittests")) { #if BUILD_UNITTESTS @@ -210,7 +209,6 @@ int main(int argc, char *argv[]) << std::endl; #endif } -#endif GameStartData game_params; #ifdef SERVER diff --git a/src/network/connection.cpp b/src/network/connection.cpp index 060cbcb18..e0736a613 100644 --- a/src/network/connection.cpp +++ b/src/network/connection.cpp @@ -914,8 +914,10 @@ void Peer::Drop() UDPPeer::UDPPeer(u16 a_id, Address a_address, Connection* connection) : Peer(a_address,a_id,connection) { +#if !(defined(__ANDROID__) && defined(__aarch64__)) for (Channel &channel : channels) channel.setWindowSize(START_RELIABLE_WINDOW_SIZE); +#endif } bool UDPPeer::getAddress(MTProtocols type,Address& toset) diff --git a/src/porting.cpp b/src/porting.cpp index 0eecce6ae..f3f52a2c9 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -718,9 +718,14 @@ static bool open_uri(const std::string &uri) openURIAndroid(uri); return true; #elif defined(__APPLE__) +#ifdef __IOS__ + ioswrap_open_url(uri.c_str()); + return true; +#else const char *argv[] = {"open", uri.c_str(), NULL}; return posix_spawnp(NULL, "open", NULL, NULL, (char**)argv, (*_NSGetEnviron())) == 0; +#endif #else const char *argv[] = {"xdg-open", uri.c_str(), NULL}; return posix_spawnp(NULL, "xdg-open", NULL, NULL, (char**)argv, environ) == 0;