Mobile: minor fixes
parent
c4d691600d
commit
26a5aed0c4
|
@ -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_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)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
|
|
|
@ -7,16 +7,14 @@ APP_MODULES := MultiCraft
|
||||||
|
|
||||||
APP_CPPFLAGS := -Ofast -fvisibility=hidden -Wno-extra-tokens
|
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)
|
#ifeq ($(APP_ABI),x86)
|
||||||
#APP_CPPFLAGS += -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32 -funroll-loops
|
#APP_CPPFLAGS += -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32 -funroll-loops
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ifndef NDEBUG
|
ifndef NDEBUG
|
||||||
APP_CPPFLAGS := -g -D_DEBUG -O0 -fno-omit-frame-pointer
|
APP_CPPFLAGS := -g -D_DEBUG -O0 -fno-omit-frame-pointer
|
||||||
|
else
|
||||||
|
APP_CPPFLAGS += -D__FILE__=__FILE_NAME__ -Wno-builtin-macro-redefined
|
||||||
endif
|
endif
|
||||||
|
|
||||||
APP_CPPFLAGS += -fexceptions #-Werror=shorten-64-to-32
|
APP_CPPFLAGS += -fexceptions #-Werror=shorten-64-to-32
|
||||||
|
|
|
@ -311,20 +311,26 @@ void GUIEngine::run()
|
||||||
|
|
||||||
driver->endScene();
|
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")
|
u32 frametime_min = 1000 / g_settings->getFloat("fps_max_unfocused")
|
||||||
/ 2;
|
/ 2;
|
||||||
|
|
||||||
|
#ifdef __IOS__
|
||||||
|
if (keyboardActive)
|
||||||
|
frametime_min = 1000 / g_settings->getFloat("fps_max");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (m_clouds_enabled)
|
if (m_clouds_enabled)
|
||||||
cloudPostProcess(frametime_min, device);
|
cloudPostProcess(frametime_min, device);
|
||||||
else
|
else
|
||||||
sleep_ms(frametime_min);
|
sleep_ms(frametime_min);
|
||||||
|
|
||||||
m_script->step();
|
m_script->step();
|
||||||
|
|
||||||
#if defined(__ANDROID__) || defined(__IOS__)
|
|
||||||
if (!porting::hasRealKeyboard())
|
|
||||||
m_menu->getAndroidUIInput();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ static bool isChild(gui::IGUIElement *tocheck, gui::IGUIElement *parent)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#if defined(__ANDROID__) || defined(__IOS__)
|
||||||
|
|
||||||
bool GUIModalMenu::simulateMouseEvent(
|
bool GUIModalMenu::simulateMouseEvent(
|
||||||
gui::IGUIElement *target, ETOUCH_INPUT_EVENT touch_event)
|
gui::IGUIElement *target, ETOUCH_INPUT_EVENT touch_event)
|
||||||
|
|
|
@ -102,7 +102,7 @@ private:
|
||||||
// wants to launch other menus
|
// wants to launch other menus
|
||||||
bool m_allow_focus_removal = false;
|
bool m_allow_focus_removal = false;
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#if defined(__ANDROID__) || defined(__IOS__)
|
||||||
irr_ptr<gui::IGUIElement> m_hovered;
|
irr_ptr<gui::IGUIElement> m_hovered;
|
||||||
|
|
||||||
bool simulateMouseEvent(gui::IGUIElement *target, ETOUCH_INPUT_EVENT touch_event);
|
bool simulateMouseEvent(gui::IGUIElement *target, ETOUCH_INPUT_EVENT touch_event);
|
||||||
|
|
|
@ -199,7 +199,6 @@ int main(int argc, char *argv[])
|
||||||
if (g_settings->getBool("enable_console"))
|
if (g_settings->getBool("enable_console"))
|
||||||
porting::attachOrCreateConsole();
|
porting::attachOrCreateConsole();
|
||||||
|
|
||||||
#if !defined(__ANDROID__) && !defined(__APPLE__) && !defined(NDEBUG)
|
|
||||||
// Run unit tests
|
// Run unit tests
|
||||||
if (cmd_args.getFlag("run-unittests")) {
|
if (cmd_args.getFlag("run-unittests")) {
|
||||||
#if BUILD_UNITTESTS
|
#if BUILD_UNITTESTS
|
||||||
|
@ -210,7 +209,6 @@ int main(int argc, char *argv[])
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
GameStartData game_params;
|
GameStartData game_params;
|
||||||
#ifdef SERVER
|
#ifdef SERVER
|
||||||
|
|
|
@ -914,8 +914,10 @@ void Peer::Drop()
|
||||||
UDPPeer::UDPPeer(u16 a_id, Address a_address, Connection* connection) :
|
UDPPeer::UDPPeer(u16 a_id, Address a_address, Connection* connection) :
|
||||||
Peer(a_address,a_id,connection)
|
Peer(a_address,a_id,connection)
|
||||||
{
|
{
|
||||||
|
#if !(defined(__ANDROID__) && defined(__aarch64__))
|
||||||
for (Channel &channel : channels)
|
for (Channel &channel : channels)
|
||||||
channel.setWindowSize(START_RELIABLE_WINDOW_SIZE);
|
channel.setWindowSize(START_RELIABLE_WINDOW_SIZE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UDPPeer::getAddress(MTProtocols type,Address& toset)
|
bool UDPPeer::getAddress(MTProtocols type,Address& toset)
|
||||||
|
|
|
@ -718,9 +718,14 @@ static bool open_uri(const std::string &uri)
|
||||||
openURIAndroid(uri);
|
openURIAndroid(uri);
|
||||||
return true;
|
return true;
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
|
#ifdef __IOS__
|
||||||
|
ioswrap_open_url(uri.c_str());
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
const char *argv[] = {"open", uri.c_str(), NULL};
|
const char *argv[] = {"open", uri.c_str(), NULL};
|
||||||
return posix_spawnp(NULL, "open", NULL, NULL, (char**)argv,
|
return posix_spawnp(NULL, "open", NULL, NULL, (char**)argv,
|
||||||
(*_NSGetEnviron())) == 0;
|
(*_NSGetEnviron())) == 0;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
const char *argv[] = {"xdg-open", uri.c_str(), NULL};
|
const char *argv[] = {"xdg-open", uri.c_str(), NULL};
|
||||||
return posix_spawnp(NULL, "xdg-open", NULL, NULL, (char**)argv, environ) == 0;
|
return posix_spawnp(NULL, "xdg-open", NULL, NULL, (char**)argv, environ) == 0;
|
||||||
|
|
Loading…
Reference in New Issue