From 15099f8e4f660f722fb2f5e257d8248107a33735 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 16 Mar 2013 09:55:08 +0100 Subject: [PATCH] RGUI builds on PC. --- Makefile | 6 ++++++ frontend/menu/menu_settings.c | 2 ++ frontend/menu/rgui.c | 8 +++++++- frontend/menu/utils/file_list.c | 8 -------- frontend/menu/utils/file_list.h | 9 ++++++++- qb/config.libs.sh | 2 +- qb/config.params.sh | 1 + 7 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 7121691591..6b9a637007 100644 --- a/Makefile +++ b/Makefile @@ -78,6 +78,10 @@ ifneq ($(findstring Linux,$(OS)),) JOYCONFIG_OBJ += input/linuxraw_joypad.o endif +ifeq ($(HAVE_RGUI), 1) + OBJ += frontend/menu/rgui.o frontend/menu/utils/file_list.o frontend/menu/menu_settings.o +endif + ifeq ($(HAVE_THREADS), 1) OBJ += autosave.o thread.o gfx/thread_wrapper.o ifeq ($(findstring Haiku,$(OS)),) @@ -386,6 +390,8 @@ uninstall: clean: rm -f *.o + rm -f frontend/menu/*.o + rm -f frontend/menu/utils/*.o rm -f audio/*.o rm -f conf/*.o rm -f gfx/*.o diff --git a/frontend/menu/menu_settings.c b/frontend/menu/menu_settings.c index e74c338d93..0a168da29e 100644 --- a/frontend/menu/menu_settings.c +++ b/frontend/menu/menu_settings.c @@ -19,6 +19,8 @@ #include #include "../../general.h" +#include "../../gfx/gfx_common.h" +#include "../../file.h" #include "menu_settings.h" void menu_settings_set(unsigned setting) diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index 8b93357b16..7d1a99946b 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -26,6 +26,8 @@ #include "menu_settings.h" #include "../../general.h" #include "../../gfx/gfx_common.h" +#include "../../config.def.h" +#include "../../file.h" #ifdef HAVE_OPENGL #include "../../gfx/gl_common.h" @@ -892,7 +894,11 @@ static int rgui_settings_toggle_setting(unsigned setting, rgui_action_t action, g_settings.input.device[port]--; else if (action == RGUI_ACTION_RIGHT) g_settings.input.device[port]++; - g_settings.input.device[port] %= DEVICE_LAST; + + // DEVICE_LAST can be 0, avoid modulo. + if (g_settings.input.device[port] >= DEVICE_LAST) + g_settings.input.device[port] -= DEVICE_LAST; + if (driver.input->set_keybinds) { unsigned keybind_action = (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS); diff --git a/frontend/menu/utils/file_list.c b/frontend/menu/utils/file_list.c index c04a972ea0..79f2547dfc 100644 --- a/frontend/menu/utils/file_list.c +++ b/frontend/menu/utils/file_list.c @@ -28,14 +28,6 @@ struct rgui_file size_t directory_ptr; }; -struct rgui_list -{ - struct rgui_file *list; - - size_t capacity; - size_t size; -}; - void rgui_list_push(void *userdata, const char *path, unsigned type, size_t directory_ptr) { diff --git a/frontend/menu/utils/file_list.h b/frontend/menu/utils/file_list.h index 1b7429c4c0..860948741b 100644 --- a/frontend/menu/utils/file_list.h +++ b/frontend/menu/utils/file_list.h @@ -21,7 +21,14 @@ extern "C" { #endif -typedef struct rgui_list rgui_list_t; +struct rgui_file; +typedef struct rgui_list +{ + struct rgui_file *list; + + size_t capacity; + size_t size; +} rgui_list_t; void rgui_list_free(rgui_list_t *list); diff --git a/qb/config.libs.sh b/qb/config.libs.sh index 3a8adfaa37..1be04bf083 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -206,6 +206,6 @@ check_macro NEON __ARM_NEON__ add_define_make OS "$OS" # Creates config.mk and config.h. -VARS="ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL OPENGL GLES VG EGL KMS GBM DRM DYLIB GETOPT_LONG THREADS CG LIBXML2 SDL_IMAGE ZLIB DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE FREETYPE XVIDEO X11 XEXT XF86VM XINERAMA NETPLAY NETWORK_CMD STDIN_CMD COMMAND SOCKET_LEGACY FBO STRL PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 FFMPEG_AVCODEC_ENCODE_VIDEO2 SINC BSV_MOVIE VIDEOCORE NEON" +VARS="RGUI ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL OPENGL GLES VG EGL KMS GBM DRM DYLIB GETOPT_LONG THREADS CG LIBXML2 SDL_IMAGE ZLIB DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE FREETYPE XVIDEO X11 XEXT XF86VM XINERAMA NETPLAY NETWORK_CMD STDIN_CMD COMMAND SOCKET_LEGACY FBO STRL PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 FFMPEG_AVCODEC_ENCODE_VIDEO2 SINC BSV_MOVIE VIDEOCORE NEON" create_config_make config.mk $VARS create_config_header config.h $VARS diff --git a/qb/config.params.sh b/qb/config.params.sh index b8981bd621..fa038f16a9 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -1,3 +1,4 @@ +HAVE_RGUI=no # Enable RGUI HAVE_DYNAMIC=yes # Disable dynamic loading of libretro library HAVE_SDL=auto # SDL support HAVE_LIBRETRO= # libretro library used