From 1f19f50fc5aa7ebe086e483abc330d5dec13af9f Mon Sep 17 00:00:00 2001 From: Ningyuan Li Date: Thu, 31 Oct 2024 20:01:07 +0900 Subject: [PATCH] Properly ships libSDL2 for webOS Updated some build config --- Makefile.webos | 9 ++++++--- gfx/drivers_context/sdl_gl_ctx.c | 2 +- input/drivers/sdl_input.c | 26 +++----------------------- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/Makefile.webos b/Makefile.webos index 4cf54469d4f6..d318172d8d68 100644 --- a/Makefile.webos +++ b/Makefile.webos @@ -5,10 +5,10 @@ ifneq ($(CROSS_COMPILE),arm-webos-linux-gnueabi-) endif ifdef SDKTARGETSYSROOT - $(warning OE-based toolchain isn't supported anymore. Please use https://github.com/webosbrew/native-toolchain) + $(warning "OE-based toolchain isn't supported anymore. Please use https://github.com/webosbrew/native-toolchain") STAGING_DIR = $(SDKTARGETSYSROOT) else ifndef STAGING_DIR - $(error Can't find buildroot based toolchain. Please use https://github.com/webosbrew/native-toolchain) + $(error "Can't find buildroot based toolchain. Please use https://github.com/webosbrew/native-toolchain") endif WEBOS_FREETYPE_CONFIG ?= $(STAGING_DIR)/usr/bin/freetype-config @@ -17,7 +17,7 @@ WEBOS_INC_DIR ?= $(STAGING_DIR)/usr/include WEBOS_LIB_DIR ?= $(STAGING_DIR)/usr/lib ADD_SDL2_LIB ?= 0 -SDL2_PREBUILT_ARCHIVE ?= https://github.com/webosbrew/SDL-webOS/releases/download/release-2.30.0-2/SDL2-2.30.0-webos.tar.gz +SDL2_PREBUILT_ARCHIVE ?= https://github.com/webosbrew/SDL-webOS/releases/download/release-2.30.8-webos.3/SDL2-2.30.8-webos-abi.tar.gz ######################### ######################### @@ -151,6 +151,7 @@ DEFINES += -DHAVE_FILTERS_BUILTIN DEFINES += -DHAVE_SDL2 DEFINES += -DHAVE_PULSE DEFINES += -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES +DEFINES += -DHAVE_NETWORKGAMEPAD DEFINES += -DHAVE_UPDATE_CORE_INFO PKG_CONFIG=pkg-config @@ -159,6 +160,8 @@ SDL2_CFLAGS := $(shell $(PKG_CONFIG) --cflags sdl2) SDL2_LIBS := $(shell $(PKG_CONFIG) --libs sdl2) OPENGLES_LIBS = -lGLESv2 PULSE_LIBS = $(shell $(PKG_CONFIG) --libs libpulse) +FREETYPE_CFLAGS := $(shell $(WEBOS_FREETYPE_CONFIG) --cflags) +FREETYPE_LIBS := $(shell $(WEBOS_FREETYPE_CONFIG) --libs) MMAP_LIBS = -lc NEON_CFLAGS = -mfpu=neon NEON_ASFLAGS = -mfpu=neon diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index 48ced425054b..2920cee070fe 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -109,7 +109,7 @@ static void *sdl_ctx_init(void *video_driver) #ifdef WEBOS SDL_SetHint(SDL_HINT_WEBOS_ACCESS_POLICY_KEYS_BACK, "true"); SDL_SetHint(SDL_HINT_WEBOS_ACCESS_POLICY_KEYS_EXIT, "true"); - SDL_SetHint(SDL_HINT_WEBOS_CURSOR_SLEEP_TIME, "1000"); + SDL_SetHint(SDL_HINT_WEBOS_CURSOR_SLEEP_TIME, "5000"); #endif /* Initialise graphics subsystem, if required */ diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c index 6cccb3eb8b78..1df093a81b9c 100644 --- a/input/drivers/sdl_input.c +++ b/input/drivers/sdl_input.c @@ -249,7 +249,7 @@ static int16_t sdl_input_state( if (idx == 0) { struct video_viewport vp; - bool screen = device == + bool screen = device == RARCH_DEVICE_POINTER_SCREEN; const int edge_detect = 32700; bool inside = false; @@ -275,7 +275,7 @@ static int16_t sdl_input_state( res_y = res_screen_y; } - inside = (res_x >= -edge_detect) + inside = (res_x >= -edge_detect) && (res_y >= -edge_detect) && (res_x <= edge_detect) && (res_y <= edge_detect); @@ -398,7 +398,7 @@ static void sdl_input_poll(void *data) switch ((int) event.key.keysym.scancode) { case SDL_WEBOS_SCANCODE_BACK: - /* Because webOS is sending DOWN/UP at the same time, + /* Because webOS is sending DOWN/UP at the same time, we save this flag for later */ sdl_webos_special_keymap[sdl_webos_spkey_back] |= event.type == SDL_KEYDOWN; code = RETROK_BACKSPACE; @@ -487,23 +487,3 @@ input_driver_t input_sdl = { NULL, NULL }; - -#ifdef WEBOS -SDL_bool SDL_webOSCursorVisibility(SDL_bool visible) -{ - static SDL_bool (*fn)(SDL_bool visible) = NULL; - static bool dlsym_called = false; - if (!dlsym_called) - { - fn = dlsym(RTLD_NEXT, "SDL_webOSCursorVisibility"); - dlsym_called = true; - } - if (!fn) - { - SDL_ShowCursor(SDL_DISABLE); - SDL_ShowCursor(SDL_ENABLE); - return SDL_TRUE; - } - return fn(visible); -} -#endif