Mobile: minor fixes

master
MoNTE48 2022-01-27 00:26:37 +01:00
parent c4d691600d
commit 26a5aed0c4
8 changed files with 23 additions and 14 deletions

View File

@ -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)

View File

@ -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

View File

@ -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
}
}

View File

@ -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)

View File

@ -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<gui::IGUIElement> m_hovered;
bool simulateMouseEvent(gui::IGUIElement *target, ETOUCH_INPUT_EVENT touch_event);

View File

@ -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

View File

@ -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)

View File

@ -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;