Merge branch 'master' of github.com:libretro/RetroArch into inputconfig

Conflicts:
	frontend/menu/menu_common.h
	frontend/menu/rgui.c
This commit is contained in:
Themaister 2013-09-30 17:50:05 +02:00
commit b4a648ca8a
23 changed files with 1354 additions and 1770 deletions

View File

@ -89,7 +89,7 @@ ifneq ($(findstring Linux,$(OS)),)
endif
ifeq ($(HAVE_RGUI), 1)
OBJ += frontend/menu/menu_common.o frontend/menu/menu_context.o frontend/menu/rgui.o frontend/menu/history.o
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o frontend/menu/rgui.o frontend/menu/history.o
endif
ifeq ($(HAVE_THREADS), 1)

View File

@ -66,7 +66,7 @@ endif
ifeq ($(HAVE_RGUI), 1)
DEFINES += -DHAVE_RGUI
OBJ += frontend/menu/menu_common.o frontend/menu/menu_context.o frontend/menu/rgui.o frontend/menu/history.o
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o frontend/menu/rgui.o frontend/menu/history.o
endif
ifeq ($(HAVE_SDL), 1)

View File

@ -101,7 +101,7 @@ JLIBS =
ifeq ($(HAVE_RGUI), 1)
DEFINES += -DHAVE_RGUI
OBJ += frontend/menu/menu_common.o frontend/menu/menu_context.o frontend/menu/rgui.o frontend/menu/history.o
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o frontend/menu/rgui.o frontend/menu/history.o
endif
ifeq ($(HAVE_SDL), 1)

View File

@ -286,9 +286,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
@ -305,11 +305,12 @@
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "$(SRCROOT)/OSX/RetroArch-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = "";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DHAVE_RARCH_MAIN_WRAP",
@ -342,9 +343,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
@ -355,11 +356,13 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_VERSION = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "$(SRCROOT)/OSX/RetroArch-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = "";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DNS_BLOCK_ASSERTIONS=1",
"-DNDEBUG",

View File

@ -348,7 +348,7 @@ retro_proc_address_t driver_get_proc_address(const char *sym)
void global_init_drivers(void)
{
init_drivers_pre(); // Set driver.* function callbacks.
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
driver.video->start(); // Statically starts video driver. Sets driver.video_data.
#endif
driver.input_data = driver.input->init();

View File

@ -366,7 +366,7 @@ typedef struct video_poke_interface
void (*set_aspect_ratio)(void *data, unsigned aspectratio_index);
void (*apply_state_changes)(void *data);
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
void (*set_texture_frame)(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha); // Update texture.
void (*set_texture_enable)(void *data, bool enable, bool full_screen); // Enable/disable rendering.
#endif
@ -390,7 +390,7 @@ typedef struct video_driver
void (*free)(void *data);
const char *ident;
#if defined(HAVE_RMENU) || defined(HAVE_RGUI)
#if defined(HAVE_RMENU) || defined(HAVE_RGUI) || defined(HAVE_RMENU_XUI)
void (*start)(void);
void (*restart)(void);
#endif

View File

@ -96,6 +96,41 @@ void shader_manager_init(rgui_handle_t *rgui)
}
}
void shader_manager_set_preset(struct gfx_shader *shader, enum rarch_shader_type type, const char *path)
{
RARCH_LOG("Setting RGUI shader: %s.\n", path ? path : "N/A (stock)");
bool ret = video_set_shader_func(type, path);
if (ret)
{
// Makes sure that we use RGUI CGP shader on driver reinit.
// Only do this when the cgp actually works to avoid potential errors.
strlcpy(g_settings.video.shader_path, path ? path : "",
sizeof(g_settings.video.shader_path));
g_settings.video.shader_enable = true;
if (path && shader)
{
// Load stored CGP into RGUI menu on success.
// Used when a preset is directly loaded.
// No point in updating when the CGP was created from RGUI itself.
config_file_t *conf = config_file_new(path);
if (conf)
{
gfx_shader_read_conf_cgp(conf, shader);
gfx_shader_resolve_relative(shader, path);
config_file_free(conf);
}
rgui->need_refresh = true;
}
}
else
{
RARCH_ERR("Setting RGUI CGP failed.\n");
g_settings.video.shader_enable = false;
}
}
void shader_manager_get_str(struct gfx_shader *shader,
char *type_str, size_t type_str_size, unsigned type)
{
@ -502,8 +537,7 @@ void menu_ticker_line(char *buf, size_t len, unsigned index, const char *str, bo
}
}
#ifndef HAVE_RMENU_XUI
#if defined(HAVE_RMENU) || defined(HAVE_RGUI)
#if defined(HAVE_RMENU) || defined(HAVE_RGUI) || defined(HAVE_RMENU_XUI)
static uint64_t rgui_input(void)
{
uint64_t input_state = 0;
@ -652,7 +686,6 @@ deinit:
return false;
}
#endif
#endif
// Quite intrusive and error prone.
// Likely to have lots of small bugs.

View File

@ -235,6 +235,34 @@ void menu_poll_bind_get_rested_axes(struct rgui_bind_state *state);
void menu_poll_bind_state(struct rgui_bind_state *state);
bool menu_poll_find_trigger(struct rgui_bind_state *state, struct rgui_bind_state *new_state);
#ifdef GEKKO
enum
{
GX_RESOLUTIONS_512_192 = 0,
GX_RESOLUTIONS_598_200,
GX_RESOLUTIONS_640_200,
GX_RESOLUTIONS_384_224,
GX_RESOLUTIONS_448_224,
GX_RESOLUTIONS_480_224,
GX_RESOLUTIONS_512_224,
GX_RESOLUTIONS_340_232,
GX_RESOLUTIONS_512_232,
GX_RESOLUTIONS_512_236,
GX_RESOLUTIONS_336_240,
GX_RESOLUTIONS_384_240,
GX_RESOLUTIONS_512_240,
GX_RESOLUTIONS_576_224,
GX_RESOLUTIONS_608_224,
GX_RESOLUTIONS_640_224,
GX_RESOLUTIONS_530_240,
GX_RESOLUTIONS_640_240,
GX_RESOLUTIONS_512_448,
GX_RESOLUTIONS_640_448,
GX_RESOLUTIONS_640_480,
GX_RESOLUTIONS_LAST,
};
#endif
typedef struct
{
uint64_t old_input_state;
@ -290,20 +318,25 @@ typedef struct
extern rgui_handle_t *rgui;
#ifdef GEKKO
extern unsigned rgui_gx_resolutions[GX_RESOLUTIONS_LAST][2];
extern unsigned rgui_current_gx_resolution;
#endif
void menu_init(void);
bool menu_iterate(void);
void menu_free(void);
#ifndef HAVE_RMENU_XUI
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
int rgui_input_postprocess(void *data, uint64_t old_state);
#endif
#endif
#ifdef HAVE_SHADER_MANAGER
void shader_manager_init(rgui_handle_t *rgui);
void shader_manager_get_str(struct gfx_shader *shader,
char *type_str, size_t type_str_size, unsigned type);
void shader_manager_set_preset(struct gfx_shader *shader,
enum rarch_shader_type type, const char *path);
#endif
void menu_ticker_line(char *buf, size_t len, unsigned tick, const char *str, bool selected);
@ -319,6 +352,9 @@ bool menu_replace_config(const char *path);
bool menu_save_new_config(void);
int menu_set_settings(unsigned setting, unsigned action);
extern const unsigned rgui_controller_lut[];
#ifdef __cplusplus
}
#endif

View File

@ -55,7 +55,7 @@ bool menu_ctx_init_first(const menu_ctx_driver_t **driver, rgui_handle_t **handl
if (h)
{
*driver = menu_ctx_drivers[i];
*handle = h;
*handle = (rgui_handle_t*)h;
return true;
}
}

View File

@ -0,0 +1,999 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
* Copyright (C) 2011-2013 - Daniel De Matteis
* Copyright (C) 2012-2013 - Michael Lelli
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <string.h>
#include "../../file.h"
#include "menu_common.h"
#ifdef GEKKO
#define MAX_GAMMA_SETTING 2
#else
#define MAX_GAMMA_SETTING 1
#endif
const unsigned rgui_controller_lut[] = {
RETRO_DEVICE_ID_JOYPAD_UP,
RETRO_DEVICE_ID_JOYPAD_DOWN,
RETRO_DEVICE_ID_JOYPAD_LEFT,
RETRO_DEVICE_ID_JOYPAD_RIGHT,
RETRO_DEVICE_ID_JOYPAD_A,
RETRO_DEVICE_ID_JOYPAD_B,
RETRO_DEVICE_ID_JOYPAD_X,
RETRO_DEVICE_ID_JOYPAD_Y,
RETRO_DEVICE_ID_JOYPAD_START,
RETRO_DEVICE_ID_JOYPAD_SELECT,
RETRO_DEVICE_ID_JOYPAD_L,
RETRO_DEVICE_ID_JOYPAD_R,
RETRO_DEVICE_ID_JOYPAD_L2,
RETRO_DEVICE_ID_JOYPAD_R2,
RETRO_DEVICE_ID_JOYPAD_L3,
RETRO_DEVICE_ID_JOYPAD_R3,
};
#ifdef HAVE_SHADER_MANAGER
static enum rarch_shader_type shader_manager_get_type(const struct gfx_shader *shader)
{
// All shader types must be the same, or we cannot use it.
enum rarch_shader_type type = RARCH_SHADER_NONE;
for (unsigned i = 0; i < shader->passes; i++)
{
enum rarch_shader_type pass_type = gfx_shader_parse_type(shader->pass[i].source.cg,
RARCH_SHADER_NONE);
switch (pass_type)
{
case RARCH_SHADER_CG:
case RARCH_SHADER_GLSL:
if (type == RARCH_SHADER_NONE)
type = pass_type;
else if (type != pass_type)
return RARCH_SHADER_NONE;
break;
default:
return RARCH_SHADER_NONE;
}
}
return type;
}
#endif
int menu_set_settings(unsigned setting, unsigned action)
{
unsigned port = rgui->current_pad;
switch (setting)
{
case RGUI_SETTINGS_REWIND_ENABLE:
if (action == RGUI_ACTION_OK ||
action == RGUI_ACTION_LEFT ||
action == RGUI_ACTION_RIGHT)
{
settings_set(1ULL << S_REWIND);
if (g_settings.rewind_enable)
rarch_init_rewind();
else
rarch_deinit_rewind();
}
else if (action == RGUI_ACTION_START)
{
g_settings.rewind_enable = false;
rarch_deinit_rewind();
}
break;
#ifdef HAVE_SCREENSHOTS
case RGUI_SETTINGS_GPU_SCREENSHOT:
if (action == RGUI_ACTION_OK ||
action == RGUI_ACTION_LEFT ||
action == RGUI_ACTION_RIGHT)
g_settings.video.gpu_screenshot = !g_settings.video.gpu_screenshot;
else if (action == RGUI_ACTION_START)
g_settings.video.gpu_screenshot = true;
break;
#endif
case RGUI_SETTINGS_REWIND_GRANULARITY:
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_RIGHT)
settings_set(1ULL << S_REWIND_GRANULARITY_INCREMENT);
else if (action == RGUI_ACTION_LEFT)
settings_set(1ULL << S_REWIND_GRANULARITY_DECREMENT);
else if (action == RGUI_ACTION_START)
settings_set(1ULL << S_DEF_REWIND_GRANULARITY);
break;
case RGUI_SETTINGS_CONFIG_SAVE_ON_EXIT:
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_RIGHT
|| action == RGUI_ACTION_LEFT)
{
g_extern.config_save_on_exit = !g_extern.config_save_on_exit;
}
else if (action == RGUI_ACTION_START)
g_extern.config_save_on_exit = true;
break;
#if defined(HAVE_THREADS) && !defined(RARCH_CONSOLE)
case RGUI_SETTINGS_SRAM_AUTOSAVE:
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_RIGHT || action == RGUI_ACTION_LEFT)
{
rarch_deinit_autosave();
g_settings.autosave_interval = (!g_settings.autosave_interval) * 10;
if (g_settings.autosave_interval)
rarch_init_autosave();
}
else if (action == RGUI_ACTION_START)
{
rarch_deinit_autosave();
g_settings.autosave_interval = 0;
}
break;
#endif
case RGUI_SETTINGS_SAVESTATE_SAVE:
case RGUI_SETTINGS_SAVESTATE_LOAD:
if (action == RGUI_ACTION_OK)
{
if (setting == RGUI_SETTINGS_SAVESTATE_SAVE)
rarch_save_state();
else
rarch_load_state();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
return -1;
}
else if (action == RGUI_ACTION_START)
settings_set(1ULL << S_DEF_SAVE_STATE);
else if (action == RGUI_ACTION_LEFT)
settings_set(1ULL << S_SAVESTATE_DECREMENT);
else if (action == RGUI_ACTION_RIGHT)
settings_set(1ULL << S_SAVESTATE_INCREMENT);
break;
#ifdef HAVE_SCREENSHOTS
case RGUI_SETTINGS_SCREENSHOT:
if (action == RGUI_ACTION_OK)
rarch_take_screenshot();
break;
#endif
case RGUI_SETTINGS_RESTART_GAME:
if (action == RGUI_ACTION_OK)
{
rarch_game_reset();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
return -1;
}
break;
case RGUI_SETTINGS_AUDIO_MUTE:
if (action == RGUI_ACTION_START)
settings_set(1ULL << S_DEF_AUDIO_MUTE);
else
settings_set(1ULL << S_AUDIO_MUTE);
break;
case RGUI_SETTINGS_AUDIO_CONTROL_RATE_DELTA:
if (action == RGUI_ACTION_START)
settings_set(1ULL << S_DEF_AUDIO_CONTROL_RATE);
else if (action == RGUI_ACTION_LEFT)
settings_set(1ULL << S_AUDIO_CONTROL_RATE_DECREMENT);
else if (action == RGUI_ACTION_RIGHT)
settings_set(1ULL << S_AUDIO_CONTROL_RATE_INCREMENT);
break;
case RGUI_SETTINGS_DEBUG_TEXT:
if (action == RGUI_ACTION_START || action == RGUI_ACTION_LEFT)
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
else if (action == RGUI_ACTION_RIGHT)
g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW);
break;
case RGUI_SETTINGS_DISK_INDEX:
{
const struct retro_disk_control_callback *control = &g_extern.system.disk_control;
unsigned num_disks = control->get_num_images();
unsigned current = control->get_image_index();
int step = 0;
if (action == RGUI_ACTION_RIGHT || action == RGUI_ACTION_OK)
step = 1;
else if (action == RGUI_ACTION_LEFT)
step = -1;
if (step)
{
unsigned next_index = (current + num_disks + 1 + step) % (num_disks + 1);
rarch_disk_control_set_eject(true, false);
rarch_disk_control_set_index(next_index);
rarch_disk_control_set_eject(false, false);
}
break;
}
case RGUI_SETTINGS_RESTART_EMULATOR:
if (action == RGUI_ACTION_OK)
{
#if defined(GEKKO) && defined(HW_RVL)
fill_pathname_join(g_extern.fullpath, default_paths.core_dir, SALAMANDER_FILE,
sizeof(g_extern.fullpath));
#endif
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN);
return -1;
}
break;
case RGUI_SETTINGS_RESUME_GAME:
if (action == RGUI_ACTION_OK)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
return -1;
}
break;
case RGUI_SETTINGS_QUIT_RARCH:
if (action == RGUI_ACTION_OK)
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
return -1;
}
break;
case RGUI_SETTINGS_SAVE_CONFIG:
if (action == RGUI_ACTION_OK)
menu_save_new_config();
break;
#ifdef HAVE_OVERLAY
case RGUI_SETTINGS_OVERLAY_PRESET:
switch (action)
{
case RGUI_ACTION_OK:
rgui_list_push(rgui->menu_stack, g_extern.overlay_dir, setting, rgui->selection_ptr);
rgui->selection_ptr = 0;
rgui->need_refresh = true;
break;
#ifndef __QNX__ // FIXME: Why ifndef QNX?
case RGUI_ACTION_START:
if (driver.overlay)
input_overlay_free(driver.overlay);
driver.overlay = NULL;
*g_settings.input.overlay = '\0';
break;
#endif
default:
break;
}
break;
case RGUI_SETTINGS_OVERLAY_OPACITY:
{
bool changed = true;
switch (action)
{
case RGUI_ACTION_LEFT:
settings_set(1ULL << S_INPUT_OVERLAY_OPACITY_DECREMENT);
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
settings_set(1ULL << S_INPUT_OVERLAY_OPACITY_INCREMENT);
break;
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_INPUT_OVERLAY_OPACITY);
break;
default:
changed = false;
break;
}
if (changed && driver.overlay)
input_overlay_set_alpha_mod(driver.overlay,
g_settings.input.overlay_opacity);
break;
}
case RGUI_SETTINGS_OVERLAY_SCALE:
{
bool changed = true;
switch (action)
{
case RGUI_ACTION_LEFT:
settings_set(1ULL << S_INPUT_OVERLAY_SCALE_DECREMENT);
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
settings_set(1ULL << S_INPUT_OVERLAY_SCALE_INCREMENT);
break;
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_INPUT_OVERLAY_SCALE);
break;
default:
changed = false;
break;
}
if (changed && driver.overlay)
input_overlay_set_scale_factor(driver.overlay,
g_settings.input.overlay_scale);
break;
}
#endif
// controllers
case RGUI_SETTINGS_BIND_PLAYER:
if (action == RGUI_ACTION_START)
rgui->current_pad = 0;
else if (action == RGUI_ACTION_LEFT)
{
if (rgui->current_pad != 0)
rgui->current_pad--;
}
else if (action == RGUI_ACTION_RIGHT)
{
if (rgui->current_pad < MAX_PLAYERS - 1)
rgui->current_pad++;
}
port = rgui->current_pad;
break;
case RGUI_SETTINGS_BIND_DEVICE:
// If set_keybinds is supported, we do it more fancy, and scroll through
// a list of supported devices directly.
if (driver.input->set_keybinds)
{
g_settings.input.device[port] += DEVICE_LAST;
if (action == RGUI_ACTION_START)
g_settings.input.device[port] = 0;
else if (action == RGUI_ACTION_LEFT)
g_settings.input.device[port]--;
else if (action == RGUI_ACTION_RIGHT)
g_settings.input.device[port]++;
// DEVICE_LAST can be 0, avoid modulo.
if (g_settings.input.device[port] >= DEVICE_LAST)
g_settings.input.device[port] -= DEVICE_LAST;
unsigned keybind_action = (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS);
switch (g_settings.input.dpad_emulation[port])
{
case ANALOG_DPAD_LSTICK:
keybind_action |= (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
case ANALOG_DPAD_RSTICK:
keybind_action |= (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
break;
case ANALOG_DPAD_NONE:
keybind_action |= (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
break;
default:
break;
}
driver.input->set_keybinds(driver.input_data, g_settings.input.device[port], port, 0,
keybind_action);
}
else
{
// When only straight g_settings.input.joypad_map[] style
// mapping is supported.
int *p = &g_settings.input.joypad_map[port];
if (action == RGUI_ACTION_START)
*p = port;
else if (action == RGUI_ACTION_LEFT)
(*p)--;
else if (action == RGUI_ACTION_RIGHT)
(*p)++;
if (*p < -1)
*p = -1;
else if (*p >= MAX_PLAYERS)
*p = MAX_PLAYERS - 1;
}
break;
case RGUI_SETTINGS_BIND_DEVICE_TYPE:
{
static const unsigned device_types[] = {
RETRO_DEVICE_NONE,
RETRO_DEVICE_JOYPAD,
RETRO_DEVICE_ANALOG,
RETRO_DEVICE_MOUSE,
RETRO_DEVICE_JOYPAD_MULTITAP,
RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE,
RETRO_DEVICE_LIGHTGUN_JUSTIFIER,
RETRO_DEVICE_LIGHTGUN_JUSTIFIERS,
};
unsigned current_device = g_settings.input.libretro_device[port];
unsigned current_index = 0;
for (unsigned i = 0; i < ARRAY_SIZE(device_types); i++)
{
if (current_device == device_types[i])
{
current_index = i;
break;
}
}
bool updated = true;
switch (action)
{
case RGUI_ACTION_START:
current_device = RETRO_DEVICE_JOYPAD;
break;
case RGUI_ACTION_LEFT:
current_device = device_types[(current_index + ARRAY_SIZE(device_types) - 1) % ARRAY_SIZE(device_types)];
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
current_device = device_types[(current_index + 1) % ARRAY_SIZE(device_types)];
break;
default:
updated = false;
}
if (updated)
{
g_settings.input.libretro_device[port] = current_device;
pretro_set_controller_port_device(port, current_device);
}
break;
}
case RGUI_SETTINGS_BIND_DPAD_EMULATION:
g_settings.input.dpad_emulation[port] += ANALOG_DPAD_LAST;
if (action == RGUI_ACTION_START)
g_settings.input.dpad_emulation[port] = ANALOG_DPAD_LSTICK;
else if (action == RGUI_ACTION_LEFT)
g_settings.input.dpad_emulation[port]--;
else if (action == RGUI_ACTION_RIGHT)
g_settings.input.dpad_emulation[port]++;
g_settings.input.dpad_emulation[port] %= ANALOG_DPAD_LAST;
if (driver.input->set_keybinds)
{
unsigned keybind_action = 0;
switch (g_settings.input.dpad_emulation[port])
{
case ANALOG_DPAD_LSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
case ANALOG_DPAD_RSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
break;
case ANALOG_DPAD_NONE:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
break;
default:
break;
}
if (keybind_action)
driver.input->set_keybinds(driver.input_data, g_settings.input.device[port], port, 0,
keybind_action);
}
break;
case RGUI_SETTINGS_CUSTOM_BIND_ALL:
if (action == RGUI_ACTION_OK)
{
rgui->binds.target = &g_settings.input.binds[port][0];
rgui->binds.begin = RGUI_SETTINGS_BIND_BEGIN;
rgui->binds.last = RGUI_SETTINGS_BIND_LAST;
rgui_list_push(rgui->menu_stack, "", RGUI_SETTINGS_CUSTOM_BIND, rgui->selection_ptr);
menu_poll_bind_get_rested_axes(&rgui->binds);
menu_poll_bind_state(&rgui->binds);
}
break;
case RGUI_SETTINGS_CUSTOM_BIND_DEFAULT_ALL:
if (action == RGUI_ACTION_OK)
{
struct retro_keybind *target = &g_settings.input.binds[port][0];
rgui->binds.begin = RGUI_SETTINGS_BIND_BEGIN;
rgui->binds.last = RGUI_SETTINGS_BIND_LAST;
for (unsigned i = RGUI_SETTINGS_BIND_BEGIN; i < RGUI_SETTINGS_BIND_LAST; i++, target++)
{
target->joykey = NO_BTN;
target->joyaxis = AXIS_NONE;
}
}
break;
case RGUI_SETTINGS_BIND_UP:
case RGUI_SETTINGS_BIND_DOWN:
case RGUI_SETTINGS_BIND_LEFT:
case RGUI_SETTINGS_BIND_RIGHT:
case RGUI_SETTINGS_BIND_A:
case RGUI_SETTINGS_BIND_B:
case RGUI_SETTINGS_BIND_X:
case RGUI_SETTINGS_BIND_Y:
case RGUI_SETTINGS_BIND_START:
case RGUI_SETTINGS_BIND_SELECT:
case RGUI_SETTINGS_BIND_L:
case RGUI_SETTINGS_BIND_R:
case RGUI_SETTINGS_BIND_L2:
case RGUI_SETTINGS_BIND_R2:
case RGUI_SETTINGS_BIND_L3:
case RGUI_SETTINGS_BIND_R3:
case RGUI_SETTINGS_BIND_ANALOG_LEFT_X_PLUS:
case RGUI_SETTINGS_BIND_ANALOG_LEFT_X_MINUS:
case RGUI_SETTINGS_BIND_ANALOG_LEFT_Y_PLUS:
case RGUI_SETTINGS_BIND_ANALOG_LEFT_Y_MINUS:
case RGUI_SETTINGS_BIND_ANALOG_RIGHT_X_PLUS:
case RGUI_SETTINGS_BIND_ANALOG_RIGHT_X_MINUS:
case RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_PLUS:
case RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_MINUS:
case RGUI_SETTINGS_BIND_MENU_TOGGLE:
if (driver.input->set_keybinds)
{
unsigned keybind_action = KEYBINDS_ACTION_NONE;
if (action == RGUI_ACTION_START)
keybind_action = (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BIND);
else if (action == RGUI_ACTION_LEFT)
keybind_action = (1ULL << KEYBINDS_ACTION_DECREMENT_BIND);
else if (action == RGUI_ACTION_RIGHT)
keybind_action = (1ULL << KEYBINDS_ACTION_INCREMENT_BIND);
// FIXME: The array indices here look totally wrong ... Fixed it so it looks kind of sane for now.
if (keybind_action != KEYBINDS_ACTION_NONE)
driver.input->set_keybinds(driver.input_data, g_settings.input.device[port], port,
setting - RGUI_SETTINGS_BIND_BEGIN, keybind_action);
}
else
{
struct retro_keybind *bind = &g_settings.input.binds[port][setting - RGUI_SETTINGS_BIND_BEGIN];
if (action == RGUI_ACTION_OK)
{
rgui->binds.begin = setting;
rgui->binds.last = setting;
rgui->binds.target = bind;
rgui->binds.player = port;
rgui_list_push(rgui->menu_stack, "", RGUI_SETTINGS_CUSTOM_BIND, rgui->selection_ptr);
menu_poll_bind_get_rested_axes(&rgui->binds);
menu_poll_bind_state(&rgui->binds);
}
else if (action == RGUI_ACTION_START)
{
bind->joykey = NO_BTN;
bind->joyaxis = AXIS_NONE;
}
}
break;
case RGUI_BROWSER_DIR_PATH:
if (action == RGUI_ACTION_START)
{
*g_settings.rgui_browser_directory = '\0';
*rgui->base_path = '\0';
}
break;
#ifdef HAVE_SCREENSHOTS
case RGUI_SCREENSHOT_DIR_PATH:
if (action == RGUI_ACTION_START)
*g_settings.screenshot_directory = '\0';
break;
#endif
case RGUI_SAVEFILE_DIR_PATH:
if (action == RGUI_ACTION_START)
*g_extern.savefile_dir = '\0';
break;
#ifdef HAVE_OVERLAY
case RGUI_OVERLAY_DIR_PATH:
if (action == RGUI_ACTION_START)
*g_extern.overlay_dir = '\0';
break;
#endif
case RGUI_SAVESTATE_DIR_PATH:
if (action == RGUI_ACTION_START)
*g_extern.savestate_dir = '\0';
break;
#ifdef HAVE_DYNAMIC
case RGUI_LIBRETRO_DIR_PATH:
if (action == RGUI_ACTION_START)
*rgui->libretro_dir = '\0';
break;
#endif
case RGUI_CONFIG_DIR_PATH:
if (action == RGUI_ACTION_START)
*g_settings.rgui_config_directory = '\0';
break;
case RGUI_SHADER_DIR_PATH:
if (action == RGUI_ACTION_START)
*g_settings.video.shader_dir = '\0';
break;
case RGUI_SYSTEM_DIR_PATH:
if (action == RGUI_ACTION_START)
*g_settings.system_directory = '\0';
break;
case RGUI_SETTINGS_VIDEO_ROTATION:
if (action == RGUI_ACTION_START)
{
settings_set(1ULL << S_DEF_ROTATION);
video_set_rotation_func((g_settings.video.rotation + g_extern.system.rotation) % 4);
}
else if (action == RGUI_ACTION_LEFT)
{
settings_set(1ULL << S_ROTATION_DECREMENT);
video_set_rotation_func((g_settings.video.rotation + g_extern.system.rotation) % 4);
}
else if (action == RGUI_ACTION_RIGHT)
{
settings_set(1ULL << S_ROTATION_INCREMENT);
video_set_rotation_func((g_settings.video.rotation + g_extern.system.rotation) % 4);
}
break;
case RGUI_SETTINGS_VIDEO_FILTER:
if (action == RGUI_ACTION_START)
settings_set(1ULL << S_DEF_HW_TEXTURE_FILTER);
else
settings_set(1ULL << S_HW_TEXTURE_FILTER);
if (driver.video_poke->set_filtering)
driver.video_poke->set_filtering(driver.video_data, 1, g_settings.video.smooth);
break;
case RGUI_SETTINGS_VIDEO_GAMMA:
if (action == RGUI_ACTION_START)
{
g_extern.console.screen.gamma_correction = 0;
if (driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
}
else if (action == RGUI_ACTION_LEFT)
{
if(g_extern.console.screen.gamma_correction > 0)
{
g_extern.console.screen.gamma_correction--;
if (driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
}
}
else if (action == RGUI_ACTION_RIGHT)
{
if(g_extern.console.screen.gamma_correction < MAX_GAMMA_SETTING)
{
g_extern.console.screen.gamma_correction++;
if (driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
}
}
break;
case RGUI_SETTINGS_VIDEO_INTEGER_SCALE:
if (action == RGUI_ACTION_START)
settings_set(1ULL << S_DEF_SCALE_INTEGER);
else if (action == RGUI_ACTION_LEFT ||
action == RGUI_ACTION_RIGHT ||
action == RGUI_ACTION_OK)
settings_set(1ULL << S_SCALE_INTEGER_TOGGLE);
if (driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
break;
case RGUI_SETTINGS_VIDEO_ASPECT_RATIO:
if (action == RGUI_ACTION_START)
settings_set(1ULL << S_DEF_ASPECT_RATIO);
else if (action == RGUI_ACTION_LEFT)
settings_set(1ULL << S_ASPECT_RATIO_DECREMENT);
else if (action == RGUI_ACTION_RIGHT)
settings_set(1ULL << S_ASPECT_RATIO_INCREMENT);
if (driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
break;
case RGUI_SETTINGS_TOGGLE_FULLSCREEN:
if (action == RGUI_ACTION_OK)
rarch_set_fullscreen(!g_settings.video.fullscreen);
break;
#ifdef GEKKO
case RGUI_SETTINGS_VIDEO_RESOLUTION:
if (action == RGUI_ACTION_LEFT)
{
if(rgui_current_gx_resolution > 0)
{
rgui_current_gx_resolution--;
gx_set_video_mode(rgui_gx_resolutions[rgui_current_gx_resolution][0], rgui_gx_resolutions[rgui_current_gx_resolution][1]);
}
}
else if (action == RGUI_ACTION_RIGHT)
{
if (rgui_current_gx_resolution < GX_RESOLUTIONS_LAST - 1)
{
#ifdef HW_RVL
if ((rgui_current_gx_resolution + 1) > GX_RESOLUTIONS_640_480)
if (CONF_GetVideo() != CONF_VIDEO_PAL)
return 0;
#endif
rgui_current_gx_resolution++;
gx_set_video_mode(rgui_gx_resolutions[rgui_current_gx_resolution][0],
rgui_gx_resolutions[rgui_current_gx_resolution][1]);
}
}
break;
#endif
#ifdef HW_RVL
case RGUI_SETTINGS_VIDEO_SOFT_FILTER:
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_SOFT_FILTER_ENABLE);
if (driver.video_poke->apply_state_changes)
driver.video_poke->apply_state_changes(driver.video_data);
break;
#endif
case RGUI_SETTINGS_VIDEO_VSYNC:
switch (action)
{
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_VIDEO_VSYNC);
break;
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
settings_set(1ULL << S_VIDEO_VSYNC_TOGGLE);
break;
default:
break;
}
break;
case RGUI_SETTINGS_VIDEO_HARD_SYNC:
switch (action)
{
case RGUI_ACTION_START:
g_settings.video.hard_sync = false;
break;
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
g_settings.video.hard_sync = !g_settings.video.hard_sync;
break;
default:
break;
}
break;
case RGUI_SETTINGS_VIDEO_BLACK_FRAME_INSERTION:
switch (action)
{
case RGUI_ACTION_START:
g_settings.video.black_frame_insertion = false;
break;
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
g_settings.video.black_frame_insertion = !g_settings.video.black_frame_insertion;
break;
default:
break;
}
break;
case RGUI_SETTINGS_VIDEO_CROP_OVERSCAN:
switch (action)
{
case RGUI_ACTION_START:
g_settings.video.crop_overscan = true;
break;
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
g_settings.video.crop_overscan = !g_settings.video.crop_overscan;
break;
default:
break;
}
break;
case RGUI_SETTINGS_VIDEO_WINDOW_SCALE_X:
case RGUI_SETTINGS_VIDEO_WINDOW_SCALE_Y:
{
float *scale = setting == RGUI_SETTINGS_VIDEO_WINDOW_SCALE_X ? &g_settings.video.xscale : &g_settings.video.yscale;
float old_scale = *scale;
switch (action)
{
case RGUI_ACTION_START:
*scale = 3.0f;
break;
case RGUI_ACTION_LEFT:
*scale -= 1.0f;
break;
case RGUI_ACTION_RIGHT:
*scale += 1.0f;
break;
default:
break;
}
*scale = roundf(*scale);
*scale = max(*scale, 1.0f);
if (old_scale != *scale && !g_settings.video.fullscreen)
rarch_set_fullscreen(g_settings.video.fullscreen); // Reinit video driver.
break;
}
case RGUI_SETTINGS_VIDEO_SWAP_INTERVAL:
{
unsigned old = g_settings.video.swap_interval;
switch (action)
{
case RGUI_ACTION_START:
g_settings.video.swap_interval = 1;
break;
case RGUI_ACTION_LEFT:
g_settings.video.swap_interval--;
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
g_settings.video.swap_interval++;
break;
default:
break;
}
g_settings.video.swap_interval = min(g_settings.video.swap_interval, 4);
g_settings.video.swap_interval = max(g_settings.video.swap_interval, 1);
if (old != g_settings.video.swap_interval && driver.video && driver.video_data)
video_set_nonblock_state_func(false); // This will update the current swap interval. Since we're in RGUI now, always apply VSync.
break;
}
case RGUI_SETTINGS_VIDEO_HARD_SYNC_FRAMES:
switch (action)
{
case RGUI_ACTION_START:
g_settings.video.hard_sync_frames = 0;
break;
case RGUI_ACTION_LEFT:
if (g_settings.video.hard_sync_frames > 0)
g_settings.video.hard_sync_frames--;
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
if (g_settings.video.hard_sync_frames < 3)
g_settings.video.hard_sync_frames++;
break;
default:
break;
}
break;
case RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO:
switch (action)
{
case RGUI_ACTION_START:
g_extern.measure_data.frame_time_samples_count = 0;
break;
case RGUI_ACTION_OK:
{
double refresh_rate = 0.0;
double deviation = 0.0;
unsigned sample_points = 0;
if (driver_monitor_fps_statistics(&refresh_rate, &deviation, &sample_points))
{
driver_set_monitor_refresh_rate(refresh_rate);
// Incase refresh rate update forced non-block video.
video_set_nonblock_state_func(false);
}
break;
}
default:
break;
}
break;
#ifdef HAVE_SHADER_MANAGER
case RGUI_SETTINGS_SHADER_PASSES:
switch (action)
{
case RGUI_ACTION_START:
rgui->shader.passes = 0;
break;
case RGUI_ACTION_LEFT:
if (rgui->shader.passes)
rgui->shader.passes--;
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
if (rgui->shader.passes < RGUI_MAX_SHADERS)
rgui->shader.passes++;
break;
default:
break;
}
#ifndef HAVE_RMENU
rgui->need_refresh = true;
#endif
break;
case RGUI_SETTINGS_SHADER_APPLY:
{
if (!driver.video->set_shader || action != RGUI_ACTION_OK)
return 0;
RARCH_LOG("Applying shader ...\n");
enum rarch_shader_type type = shader_manager_get_type(&rgui->shader);
if (rgui->shader.passes && type != RARCH_SHADER_NONE)
{
const char *conf_path = type == RARCH_SHADER_GLSL ? rgui->default_glslp : rgui->default_cgp;
char cgp_path[PATH_MAX];
const char *shader_dir = *g_settings.video.shader_dir ?
g_settings.video.shader_dir : g_settings.system_directory;
fill_pathname_join(cgp_path, shader_dir, conf_path, sizeof(cgp_path));
config_file_t *conf = config_file_new(NULL);
if (!conf)
return 0;
gfx_shader_write_conf_cgp(conf, &rgui->shader);
config_file_write(conf, cgp_path);
config_file_free(conf);
shader_manager_set_preset(NULL, type, cgp_path);
}
else
{
type = gfx_shader_parse_type("", DEFAULT_SHADER_TYPE);
if (type == RARCH_SHADER_NONE)
{
#if defined(HAVE_GLSL)
type = RARCH_SHADER_GLSL;
#elif defined(HAVE_CG) || defined(HAVE_HLSL)
type = RARCH_SHADER_CG;
#endif
}
shader_manager_set_preset(NULL, type, NULL);
}
}
break;
#endif
default:
break;
}
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -279,25 +279,22 @@ static void render_text(void *data)
rgui_handle_t *rgui = (rgui_handle_t*)data;
font_params_t font_parms = {0};
char title[256];
char msg[128];
char label[64];
font_parms.x = POSITION_X;
font_parms.y = CURRENT_PATH_Y_POSITION;
font_parms.scale = CURRENT_PATH_FONT_SIZE;
font_parms.color = WHITE;
switch(rgui->menu_type)
{
#ifdef HAVE_SHADER_MANAGER
case SHADER_CHOICE:
strlcpy(title, "Shaders", sizeof(title));
break;
case CGP_CHOICE:
strlcpy(title, "CGP", sizeof(title));
break;
#endif
case BORDER_CHOICE:
strlcpy(title, "Borders", sizeof(title));
break;
case LIBRETRO_CHOICE:
strlcpy(title, "Libretro", sizeof(title));
break;
case PATH_SAVESTATES_DIR_CHOICE:
case PATH_DEFAULT_ROM_DIR_CHOICE:
#ifdef HAVE_XML
@ -305,110 +302,65 @@ static void render_text(void *data)
#endif
case PATH_SRAM_DIR_CHOICE:
case PATH_SYSTEM_DIR_CHOICE:
strlcpy(title, "Path", sizeof(title));
break;
case INGAME_MENU:
strlcpy(title, "Menu", sizeof(title));
break;
case INGAME_MENU_CORE_OPTIONS:
strlcpy(title, "Core", sizeof(title));
case FILE_BROWSER_MENU:
if (rgui->menu_type == LIBRETRO_CHOICE)
strlcpy(label, "CORE SELECTION", sizeof(label));
else
strlcpy(label, "PATH", sizeof(label));
snprintf(msg, sizeof(msg), "%s %s", label, rgui->browser->current_dir.directory_path);
break;
case INGAME_MENU_LOAD_GAME_HISTORY:
strlcpy(title, "History", sizeof(title));
strlcpy(msg, "LOAD HISTORY", sizeof(msg));
break;
case INGAME_MENU:
strlcpy(msg, "MENU", sizeof(msg));
break;
case INGAME_MENU_CORE_OPTIONS:
strlcpy(msg, "CORE OPTIONS", sizeof(msg));
break;
case INGAME_MENU_VIDEO_OPTIONS:
case INGAME_MENU_VIDEO_OPTIONS_MODE:
strlcpy(title, "Video", sizeof(title));
strlcpy(msg, "VIDEO OPTIONS", sizeof(msg));
break;
#ifdef HAVE_SHADER_MANAGER
case INGAME_MENU_SHADER_OPTIONS:
case INGAME_MENU_SHADER_OPTIONS_MODE:
strlcpy(title, "Shader", sizeof(title));
strlcpy(msg, "SHADER OPTIONS", sizeof(msg));
break;
#endif
case INGAME_MENU_INPUT_OPTIONS:
case INGAME_MENU_INPUT_OPTIONS_MODE:
strlcpy(title, "Input", sizeof(title));
strlcpy(msg, "INPUT OPTIONS", sizeof(msg));
break;
case INGAME_MENU_CUSTOM_RATIO:
strlcpy(title, "Resize", sizeof(title));
break;
case INGAME_MENU_SCREENSHOT:
strlcpy(title, "Menu", sizeof(title));
break;
case FILE_BROWSER_MENU:
strlcpy(title, "Game", sizeof(title));
strlcpy(msg, "CUSTOM RATIO", sizeof(msg));
break;
case INGAME_MENU_SETTINGS:
case INGAME_MENU_SETTINGS_MODE:
strlcpy(title, "Settings", sizeof(title));
strlcpy(msg, "MENU SETTINGS", sizeof(msg));
break;
case INGAME_MENU_AUDIO_OPTIONS:
case INGAME_MENU_AUDIO_OPTIONS_MODE:
strlcpy(title, "Audio", sizeof(title));
strlcpy(msg, "AUDIO OPTIONS", sizeof(msg));
break;
case INGAME_MENU_PATH_OPTIONS:
case INGAME_MENU_PATH_OPTIONS_MODE:
strlcpy(title, "Path", sizeof(title));
strlcpy(msg, "PATH OPTIONS", sizeof(msg));
break;
}
switch(rgui->menu_type)
{
#ifdef HAVE_SHADER_MANAGER
case SHADER_CHOICE:
case CGP_CHOICE:
#endif
case BORDER_CHOICE:
case LIBRETRO_CHOICE:
case PATH_SAVESTATES_DIR_CHOICE:
case PATH_DEFAULT_ROM_DIR_CHOICE:
#ifdef HAVE_XML
case PATH_CHEATS_DIR_CHOICE:
#endif
case PATH_SRAM_DIR_CHOICE:
case PATH_SYSTEM_DIR_CHOICE:
case FILE_BROWSER_MENU:
snprintf(msg, sizeof(msg), "PATH: %s", rgui->browser->current_dir.directory_path);
if (driver.video_poke->set_osd_msg && msg[0] != '\0')
driver.video_poke->set_osd_msg(driver.video_data, msg, &font_parms);
font_params_t font_parms = {0};
font_parms.x = POSITION_X;
font_parms.y = CURRENT_PATH_Y_POSITION;
font_parms.scale = CURRENT_PATH_FONT_SIZE;
font_parms.color = WHITE;
if (driver.video_poke->set_osd_msg)
driver.video_poke->set_osd_msg(driver.video_data, msg, &font_parms);
break;
}
font_parms.x = CORE_MSG_POSITION_X;
font_parms.x = POSITION_X;
font_parms.y = CORE_MSG_POSITION_Y;
font_parms.scale = CORE_MSG_FONT_SIZE;
font_parms.color = WHITE;
if (driver.video_poke->set_osd_msg)
driver.video_poke->set_osd_msg(driver.video_data, rgui->info.library_name, &font_parms);
#ifdef __CELLOS_LV2__
font_parms.x = POSITION_X;
font_parms.y = 0.05f;
font_parms.scale = 1.4f;
font_parms.color = WHITE;
if (driver.video_poke->set_osd_msg)
driver.video_poke->set_osd_msg(driver.video_data, title, &font_parms);
font_parms.x = 0.80f;
font_parms.y = 0.015f;
font_parms.scale = 0.82f;
font_parms.color = WHITE;
snprintf(msg, sizeof(msg), "v%s", PACKAGE_VERSION);
snprintf(msg, sizeof(msg), "%s - %s %s", PACKAGE_VERSION, rgui->info.library_name, rgui->info.library_version);
if (driver.video_poke->set_osd_msg)
driver.video_poke->set_osd_msg(driver.video_data, msg, &font_parms);
#endif
bool render_browser = false;
bool render_ingame_menu_resize = false;
@ -635,6 +587,7 @@ static int select_directory(void *data, uint64_t action)
rgui_handle_t *rgui = (rgui_handle_t*)data;
char path[PATH_MAX];
(void)path;
bool ret = true;
bool is_dir = filebrowser_iterate(rgui->browser, FILEBROWSER_ACTION_PATH_ISDIR);
@ -820,8 +773,10 @@ static void rgui_init_textures(void)
true, menu_texture->width, menu_texture->height, 1.0f);
}
static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t action)
static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t action_ori)
{
unsigned action = (unsigned)action_ori;
switch (switchvalue)
{
#ifdef __CELLOS_LV2__
@ -904,47 +859,9 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
}
break;
case SETTING_ASPECT_RATIO:
switch (action)
{
case RGUI_ACTION_LEFT:
settings_set(1ULL << S_ASPECT_RATIO_DECREMENT);
if (driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
break;
case RGUI_ACTION_RIGHT:
settings_set(1ULL << S_ASPECT_RATIO_INCREMENT);
if (driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
break;
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_ASPECT_RATIO);
if (driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_VIDEO_ASPECT_RATIO, action);
case SETTING_HW_TEXTURE_FILTER:
switch (action)
{
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
settings_set(1ULL << S_HW_TEXTURE_FILTER);
if (driver.video_poke->set_filtering)
driver.video_poke->set_filtering(driver.video_data, 1, g_settings.video.smooth);
break;
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_HW_TEXTURE_FILTER);
if (driver.video_poke->set_filtering)
driver.video_poke->set_filtering(driver.video_data, 1, g_settings.video.smooth);
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_VIDEO_FILTER, action);
#ifdef _XBOX1
case SETTING_FLICKER_FILTER:
switch (action)
@ -980,23 +897,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
break;
#endif
case SETTING_REFRESH_RATE:
switch (action)
{
case RGUI_ACTION_LEFT:
settings_set(1ULL << S_REFRESH_RATE_DECREMENT);
driver_set_monitor_refresh_rate(g_settings.video.refresh_rate);
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
settings_set(1ULL << S_REFRESH_RATE_INCREMENT);
driver_set_monitor_refresh_rate(g_settings.video.refresh_rate);
break;
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_REFRESH_RATE);
driver_set_monitor_refresh_rate(g_settings.video.refresh_rate);
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO, action);
case SETTING_TRIPLE_BUFFERING:
switch (action)
{
@ -1067,18 +968,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
break;
#endif
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
switch (action)
{
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
settings_set(1ULL << S_INFO_DEBUG_MSG_TOGGLE);
break;
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_INFO_DEBUG_MSG);
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_DEBUG_TEXT, action);
case SETTING_EMU_SHOW_INFO_MSG:
switch (action)
{
@ -1093,56 +983,11 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
}
break;
case SETTING_REWIND_ENABLED:
switch (action)
{
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
settings_set(1ULL << S_REWIND);
if (g_settings.rewind_enable)
rarch_init_rewind();
else
rarch_deinit_rewind();
break;
case RGUI_ACTION_START:
if (g_settings.rewind_enable)
{
g_settings.rewind_enable = false;
rarch_deinit_rewind();
}
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_REWIND_ENABLE, action);
case SETTING_REWIND_GRANULARITY:
switch (action)
{
case RGUI_ACTION_LEFT:
if (g_settings.rewind_granularity > 1)
g_settings.rewind_granularity--;
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
g_settings.rewind_granularity++;
break;
case RGUI_ACTION_START:
g_settings.rewind_granularity = 1;
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_REWIND_GRANULARITY, action);
case SETTING_EMU_AUDIO_MUTE:
switch (action)
{
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
settings_set(1ULL << S_AUDIO_MUTE);
break;
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_AUDIO_MUTE);
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_AUDIO_MUTE, action);
#ifdef _XBOX1
case SETTING_EMU_AUDIO_SOUND_VOLUME_LEVEL:
switch (action)
@ -1261,76 +1106,9 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
}
break;
case SETTING_CONTROLS_NUMBER:
switch (action)
{
case RGUI_ACTION_LEFT:
if (rgui->current_pad != 0)
rgui->current_pad--;
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
if (rgui->current_pad < 6)
rgui->current_pad++;
break;
case RGUI_ACTION_START:
rgui->current_pad = 0;
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_BIND_PLAYER, action);
case SETTING_DPAD_EMULATION:
switch (action)
{
case RGUI_ACTION_LEFT:
if (driver.input->set_keybinds)
{
unsigned keybind_action = 0;
switch(g_settings.input.dpad_emulation[rgui->current_pad])
{
case ANALOG_DPAD_NONE:
break;
case ANALOG_DPAD_LSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
break;
case ANALOG_DPAD_RSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
default:
break;
}
if (keybind_action)
driver.input->set_keybinds(driver.input_data, g_settings.input.device[rgui->current_pad], rgui->current_pad, 0, keybind_action);
}
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
if (driver.input->set_keybinds)
{
unsigned keybind_action = 0;
switch(g_settings.input.dpad_emulation[rgui->current_pad])
{
case ANALOG_DPAD_NONE:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
case ANALOG_DPAD_LSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
break;
case ANALOG_DPAD_RSTICK:
break;
}
if (keybind_action)
driver.input->set_keybinds(driver.input_data, g_settings.input.device[rgui->current_pad], rgui->current_pad, 0, keybind_action);
}
break;
case RGUI_ACTION_START:
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, g_settings.input.device[rgui->current_pad], rgui->current_pad, 0, (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK));
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_BIND_DPAD_EMULATION, action);
case SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_UP:
set_keybind_digital(RETRO_DEVICE_ID_JOYPAD_UP, action);
break;
@ -1393,55 +1171,11 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
}
break;
case INGAME_MENU_LOAD_STATE:
switch (action)
{
case RGUI_ACTION_OK:
rarch_load_state();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
return -1;
case RGUI_ACTION_LEFT:
rarch_state_slot_decrease();
break;
case RGUI_ACTION_RIGHT:
rarch_state_slot_increase();
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_SAVESTATE_LOAD, action);
case INGAME_MENU_SAVE_STATE:
switch (action)
{
case RGUI_ACTION_OK:
rarch_save_state();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
return -1;
case RGUI_ACTION_LEFT:
rarch_state_slot_decrease();
break;
case RGUI_ACTION_RIGHT:
rarch_state_slot_increase();
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_SAVESTATE_SAVE, action);
case SETTING_ROTATION:
switch (action)
{
case RGUI_ACTION_LEFT:
settings_set(1ULL << S_ROTATION_DECREMENT);
video_set_rotation_func((g_extern.system.rotation + g_settings.video.rotation) % 4);
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
settings_set(1ULL << S_ROTATION_INCREMENT);
video_set_rotation_func((g_extern.system.rotation + g_settings.video.rotation) % 4);
break;
case RGUI_ACTION_START:
settings_set(1ULL << S_DEF_ROTATION);
video_set_rotation_func((g_extern.system.rotation + g_settings.video.rotation) % 4);
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_VIDEO_ROTATION, action);
case SETTING_CUSTOM_VIEWPORT:
if (action == RGUI_ACTION_OK)
menu_stack_push(INGAME_MENU_CUSTOM_RATIO, false);
@ -1459,13 +1193,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
menu_stack_push(INGAME_MENU_SCREENSHOT, false);
break;
case INGAME_MENU_RETURN_TO_GAME:
if (action == RGUI_ACTION_OK)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
return -1;
}
break;
return menu_set_settings(RGUI_SETTINGS_RESUME_GAME, action);
case INGAME_MENU_CHANGE_GAME:
if (action == RGUI_ACTION_OK)
menu_stack_push(FILE_BROWSER_MENU, false);
@ -1479,7 +1207,6 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
{
rarch_game_reset();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
return -1;
}
break;
@ -1495,21 +1222,16 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
if (action == RGUI_ACTION_OK)
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN);
g_extern.lifecycle_mode_state |= (1ULL << MODE_EXITSPAWN_MULTIMAN);
return -1;
}
break;
#endif
case INGAME_MENU_SAVE_CONFIG:
return menu_set_settings(RGUI_SETTINGS_SAVE_CONFIG, action);
case INGAME_MENU_QUIT_RETROARCH:
if (action == RGUI_ACTION_OK)
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
return -1;
}
break;
return menu_set_settings(RGUI_SETTINGS_QUIT_RARCH, action);
case INGAME_MENU_VIDEO_OPTIONS_MODE:
if (action == RGUI_ACTION_OK)
menu_stack_push(INGAME_MENU_VIDEO_OPTIONS, false);
@ -1564,22 +1286,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
#endif
break;
case SHADERMAN_SHADER_PASSES:
switch (action)
{
case RGUI_ACTION_LEFT:
if (rgui->shader.passes)
rgui->shader.passes--;
break;
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
if (rgui->shader.passes < RGUI_MAX_SHADERS)
rgui->shader.passes++;
break;
case RGUI_ACTION_START:
rgui->shader.passes= 0;
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_SHADER_PASSES, action);
case SHADERMAN_SHADER_0:
case SHADERMAN_SHADER_1:
case SHADERMAN_SHADER_2:
@ -1671,45 +1378,10 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
}
break;
case SHADERMAN_APPLY_CHANGES:
switch (action)
{
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
case RGUI_ACTION_START:
{
bool ret = false;
char cgp_path[PATH_MAX];
if (rgui->shader.passes)
{
const char *shader_dir = *g_settings.video.shader_dir ?
g_settings.video.shader_dir : g_settings.system_directory;
fill_pathname_join(cgp_path, shader_dir, "rgui.cgp", sizeof(cgp_path));
config_file_t *conf = config_file_new(NULL);
if (!conf)
return 0;
gfx_shader_write_conf_cgp(conf, &rgui->shader);
config_file_write(conf, cgp_path);
config_file_free(conf);
}
else
cgp_path[0] = '\0';
ret = video_set_shader_func(RARCH_SHADER_CG, (cgp_path[0] != '\0') ? cgp_path : NULL);
if (ret)
g_settings.video.shader_enable = true;
else
{
RARCH_ERR("Setting RGUI CGP failed.\n");
g_settings.video.shader_enable = false;
}
}
break;
}
break;
return menu_set_settings(RGUI_SETTINGS_SHADER_APPLY, action);
#endif
default:
break;
}
return 0;
@ -2066,6 +1738,10 @@ static int select_setting(void *data, uint64_t action)
strlcpy(setting_text, "", sizeof(setting_text));
break;
#endif
case INGAME_MENU_SAVE_CONFIG:
strlcpy(text, "Save Config", sizeof(text));
strlcpy(setting_text, "...", sizeof(setting_text));
break;
case INGAME_MENU_QUIT_RETROARCH:
strlcpy(text, "Quit RetroArch", sizeof(text));
strlcpy(setting_text, "", sizeof(setting_text));
@ -2181,6 +1857,13 @@ static int select_setting(void *data, uint64_t action)
if (driver.video_poke->set_osd_msg)
driver.video_poke->set_osd_msg(driver.video_data, setting_text_buf, &font_parms);
if (i != rgui->selection_ptr)
continue;
#ifdef HAVE_MENU_PANEL
menu_panel->y = y_increment;
#endif
}
switch (action)
@ -2205,17 +1888,19 @@ static int select_setting(void *data, uint64_t action)
case RGUI_ACTION_CANCEL:
if (rgui->menu_type == INGAME_MENU)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
return -1;
}
menu_stack_pop(rgui->menu_type);
break;
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_OK:
ret = set_setting_action(rgui->menu_type, rgui->selection_ptr, action);
break;
}
ret = set_setting_action(rgui->menu_type, rgui->selection_ptr, action);
return ret;
}
@ -2483,9 +2168,7 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
if ((rgui->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
g_extern.main_is_init)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME_EXIT);
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
ret = -1;
}
@ -2495,11 +2178,6 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
if (quit)
ret = -1;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME_EXIT))
{
menu_stack_pop(rgui->menu_type);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_INGAME_EXIT);
}
return ret;
}
@ -2579,6 +2257,9 @@ static int rgui_iterate(void *data, unsigned action)
if (ret == 0)
render_text(rgui);
if (ret == -1)
menu_stack_pop(rgui->menu_type);
return ret;
}

View File

@ -132,6 +132,7 @@ enum
#ifdef HAVE_MULTIMAN
INGAME_MENU_RETURN_TO_MULTIMAN,
#endif
INGAME_MENU_SAVE_CONFIG,
INGAME_MENU_QUIT_RETROARCH,
INGAME_MENU_END,
#ifdef HAVE_SHADER_MANAGER

View File

@ -255,8 +255,7 @@ HRESULT CRetroArchFileBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled
filebrowser_set_root_and_ext(rgui->browser, rgui->info.valid_extensions,
default_paths.filebrowser_startup_dir);
uint64_t action = (1ULL << DEVICE_NAV_B);
filebrowser_fetch_directory_entries(action);
filebrowser_fetch_directory_entries(FILEBROWSER_ACTION_OK);
return 0;
}
@ -279,9 +278,8 @@ HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
else if(rgui->browser->list->elems[index].attr.b)
{
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
uint64_t action = (1ULL << DEVICE_NAV_B);
filebrowser_set_root_and_ext(rgui->browser, rgui->info.valid_extensions, path);
filebrowser_fetch_directory_entries(action);
filebrowser_fetch_directory_entries(FILEBROWSER_ACTION_OK);
}
}
@ -465,14 +463,34 @@ static void init_menulist(unsigned menu_id)
}
}
static unsigned xui_input_to_rgui_action(unsigned input)
{
switch (input)
{
case XUI_CONTROL_NAVIGATE_LEFT:
return RGUI_ACTION_LEFT;
case XUI_CONTROL_NAVIGATE_RIGHT:
return RGUI_ACTION_RIGHT;
case XUI_CONTROL_NAVIGATE_UP:
return RGUI_ACTION_UP;
case XUI_CONTROL_NAVIGATE_DOWN:
return RGUI_ACTION_DOWN;
case XUI_CONTROL_NAVIGATE_OK:
return RGUI_ACTION_OK;
}
return RGUI_ACTION_NOOP;
}
HRESULT CRetroArchLoadGameHistory::OnControlNavigate(
XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
{
unsigned current_index = XuiListGetCurSel(m_menulist, NULL);
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
if (input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_OK)
{
load_menu_game_history(current_index);
process_input_ret = -1;
@ -480,12 +498,12 @@ HRESULT CRetroArchLoadGameHistory::OnControlNavigate(
bHandled = TRUE;
switch(pControlNavigateData->nControlNavigate)
switch (action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case XUI_CONTROL_NAVIGATE_RIGHT:
case XUI_CONTROL_NAVIGATE_UP:
case XUI_CONTROL_NAVIGATE_DOWN:
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_UP:
case RGUI_ACTION_DOWN:
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
break;
default:
@ -513,13 +531,15 @@ HRESULT CRetroArchFileBrowser::OnControlNavigate(
XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
{
bHandled = TRUE;
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
switch(pControlNavigateData->nControlNavigate)
switch(action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case XUI_CONTROL_NAVIGATE_RIGHT:
case XUI_CONTROL_NAVIGATE_UP:
case XUI_CONTROL_NAVIGATE_DOWN:
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_UP:
case RGUI_ACTION_DOWN:
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
break;
default:
@ -532,14 +552,16 @@ HRESULT CRetroArchFileBrowser::OnControlNavigate(
HRESULT CRetroArchShaderBrowser::OnControlNavigate(
XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
{
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
bHandled = TRUE;
switch(pControlNavigateData->nControlNavigate)
switch(action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case XUI_CONTROL_NAVIGATE_RIGHT:
case XUI_CONTROL_NAVIGATE_UP:
case XUI_CONTROL_NAVIGATE_DOWN:
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_UP:
case RGUI_ACTION_DOWN:
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
break;
default:
@ -552,14 +574,16 @@ HRESULT CRetroArchShaderBrowser::OnControlNavigate(
HRESULT CRetroArchCoreBrowser::OnControlNavigate(
XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
{
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
bHandled = TRUE;
switch(pControlNavigateData->nControlNavigate)
switch(action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case XUI_CONTROL_NAVIGATE_RIGHT:
case XUI_CONTROL_NAVIGATE_UP:
case XUI_CONTROL_NAVIGATE_DOWN:
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_UP:
case RGUI_ACTION_DOWN:
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
break;
default:
@ -569,6 +593,8 @@ HRESULT CRetroArchCoreBrowser::OnControlNavigate(
return 0;
}
HRESULT CRetroArchControls::OnControlNavigate(
XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled)
{
@ -594,61 +620,17 @@ HRESULT CRetroArchControls::OnControlNavigate(
current_index = XuiListGetCurSel(m_menulist, NULL);
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
switch(current_index)
{
case SETTING_CONTROLS_DPAD_EMULATION:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
{
if (driver.input->set_keybinds)
{
unsigned keybind_action = 0;
switch(g_settings.input.dpad_emulation[rgui->current_pad])
{
case ANALOG_DPAD_NONE:
break;
case ANALOG_DPAD_LSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
break;
case ANALOG_DPAD_RSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
}
if (keybind_action)
driver.input->set_keybinds(driver.input_data, g_settings.input.device[rgui->current_pad],
rgui->current_pad, 0, keybind_action);
}
}
else if (input == XUI_CONTROL_NAVIGATE_RIGHT)
{
if (driver.input->set_keybinds)
{
unsigned keybind_action = 0;
switch(g_settings.input.dpad_emulation[rgui->current_pad])
{
case ANALOG_DPAD_NONE:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
case ANALOG_DPAD_LSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
break;
case ANALOG_DPAD_RSTICK:
break;
}
if (keybind_action)
driver.input->set_keybinds(driver.input_data, g_settings.input.device[rgui->current_pad],
rgui->current_pad, 0, keybind_action);
}
}
menu_set_settings(RGUI_SETTINGS_BIND_DPAD_EMULATION, action);
break;
case SETTING_CONTROLS_DEFAULT_ALL:
break;
default:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
if (action == RGUI_ACTION_LEFT)
{
struct platform_bind key_label;
strlcpy(key_label.desc, "Unknown", sizeof(key_label.desc));
@ -667,7 +649,7 @@ HRESULT CRetroArchControls::OnControlNavigate(
mbstowcs(strw_buffer, button, sizeof(strw_buffer) / sizeof(wchar_t));
XuiListSetText(m_menulist, current_index, strw_buffer);
}
else if (input == XUI_CONTROL_NAVIGATE_RIGHT)
else if (action == RGUI_ACTION_RIGHT)
{
struct platform_bind key_label;
strlcpy(key_label.desc, "Unknown", sizeof(key_label.desc));
@ -757,36 +739,21 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
current_index = XuiListGetCurSel(m_menulist, NULL);
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
switch(current_index)
{
case INGAME_MENU_REWIND_ENABLED:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
settings_set(1ULL << S_REWIND);
else if (input == XUI_CONTROL_NAVIGATE_RIGHT ||
input == XUI_CONTROL_NAVIGATE_OK)
settings_set(1ULL << S_REWIND);
if (g_settings.rewind_enable)
rarch_init_rewind();
else
rarch_deinit_rewind();
menu_set_settings(RGUI_SETTINGS_REWIND_ENABLE, action);
XuiListSetText(m_menulist, INGAME_MENU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
break;
case INGAME_MENU_REWIND_GRANULARITY:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
{
if (g_settings.rewind_granularity > 1)
g_settings.rewind_granularity--;
}
else if (input == XUI_CONTROL_NAVIGATE_RIGHT ||
input == XUI_CONTROL_NAVIGATE_OK)
g_settings.rewind_granularity++;
menu_set_settings(RGUI_SETTINGS_REWIND_GRANULARITY, action);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_REWIND_GRANULARITY, sizeof(strw_buffer));
XuiListSetText(m_menulist, INGAME_MENU_REWIND_GRANULARITY, strw_buffer);
break;
case SETTING_EMU_SHOW_INFO_MSG:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
if (action == RGUI_ACTION_LEFT)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INFO_DRAW);
@ -794,8 +761,7 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
g_extern.lifecycle_mode_state |= (1ULL << MODE_INFO_DRAW);
XuiListSetText(m_menulist, SETTING_EMU_SHOW_INFO_MSG, (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW)) ? L"Info messages: ON" : L"Info messages: OFF");
}
else if (input == XUI_CONTROL_NAVIGATE_RIGHT ||
input == XUI_CONTROL_NAVIGATE_OK)
else if (action == RGUI_ACTION_RIGHT || action == RGUI_ACTION_OK)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INFO_DRAW);
@ -805,23 +771,8 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
}
break;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW);
XuiListSetText(m_menulist, SETTING_EMU_SHOW_DEBUG_INFO_MSG, (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)) ? L"Debug Info messages: ON" : L"Debug Info messages: OFF");
}
else if (input == XUI_CONTROL_NAVIGATE_RIGHT ||
input == XUI_CONTROL_NAVIGATE_OK)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW))
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_FPS_DRAW);
else
g_extern.lifecycle_mode_state |= (1ULL << MODE_FPS_DRAW);
XuiListSetText(m_menulist, SETTING_EMU_SHOW_DEBUG_INFO_MSG, (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)) ? L"Debug Info messages: ON" : L"Debug Info messages: OFF");
}
menu_set_settings(RGUI_SETTINGS_DEBUG_TEXT, action);
XuiListSetText(m_menulist, SETTING_EMU_SHOW_DEBUG_INFO_MSG, (g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)) ? L"Debug Info messages: ON" : L"Debug Info messages: OFF");
break;
default:
break;
@ -829,12 +780,12 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
bHandled = TRUE;
switch(pControlNavigateData->nControlNavigate)
switch(action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case XUI_CONTROL_NAVIGATE_RIGHT:
case XUI_CONTROL_NAVIGATE_UP:
case XUI_CONTROL_NAVIGATE_DOWN:
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_UP:
case RGUI_ACTION_DOWN:
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
break;
default:
@ -895,25 +846,22 @@ HRESULT CRetroArchCoreOptions::OnControlNavigate(XUIMessageControlNavigate *pCon
{
unsigned current_index = XuiListGetCurSel(m_menulist, NULL);
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
size_t opts = core_option_size(g_extern.system.core_options);
if ((current_index < opts) && opts > 0)
if (g_extern.system.core_options)
{
bool update_item = false;
switch(pControlNavigateData->nControlNavigate)
switch (action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case RGUI_ACTION_LEFT:
core_option_prev(g_extern.system.core_options, current_index);
update_item = true;
break;
case XUI_CONTROL_NAVIGATE_RIGHT:
case RGUI_ACTION_RIGHT:
core_option_next(g_extern.system.core_options, current_index);
update_item = true;
break;
default:
break;
}
if (update_item)
@ -931,12 +879,12 @@ HRESULT CRetroArchCoreOptions::OnControlNavigate(XUIMessageControlNavigate *pCon
bHandled = TRUE;
switch(pControlNavigateData->nControlNavigate)
switch(action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case XUI_CONTROL_NAVIGATE_RIGHT:
case XUI_CONTROL_NAVIGATE_UP:
case XUI_CONTROL_NAVIGATE_DOWN:
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_UP:
case RGUI_ACTION_DOWN:
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
break;
default:
@ -966,28 +914,24 @@ HRESULT CRetroArchAudioOptions::OnControlNavigate(XUIMessageControlNavigate *pCo
{
int current_index = XuiListGetCurSel(m_menulist, NULL);
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
switch (current_index)
{
case MENU_XUI_ITEM_AUDIO_MUTE_AUDIO:
if (input == XUI_CONTROL_NAVIGATE_LEFT ||
input == XUI_CONTROL_NAVIGATE_RIGHT ||
input == XUI_CONTROL_NAVIGATE_OK)
{
settings_set(1ULL << S_AUDIO_MUTE);
XuiListSetText(m_menulist, MENU_XUI_ITEM_AUDIO_MUTE_AUDIO, g_extern.audio_data.mute ? L"Mute Audio : ON" : L"Mute Audio : OFF");
}
menu_set_settings(RGUI_SETTINGS_AUDIO_MUTE, action);
XuiListSetText(m_menulist, MENU_XUI_ITEM_AUDIO_MUTE_AUDIO, g_extern.audio_data.mute ? L"Mute Audio : ON" : L"Mute Audio : OFF");
break;
}
bHandled = TRUE;
switch(pControlNavigateData->nControlNavigate)
switch(action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case XUI_CONTROL_NAVIGATE_RIGHT:
case XUI_CONTROL_NAVIGATE_UP:
case XUI_CONTROL_NAVIGATE_DOWN:
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_UP:
case RGUI_ACTION_DOWN:
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
break;
default:
@ -1055,26 +999,18 @@ HRESULT CRetroArchVideoOptions::OnControlNavigate(XUIMessageControlNavigate *pCo
current_index = XuiListGetCurSel(m_menulist, NULL);
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
switch (current_index)
{
case MENU_XUI_ITEM_HW_TEXTURE_FILTER:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
{
g_settings.video.smooth = !g_settings.video.smooth;
XuiListSetText(m_menulist, MENU_XUI_ITEM_HW_TEXTURE_FILTER, g_settings.video.smooth ? L"Default Filter: Linear" : L"Default Filter: Nearest");
}
else if (input == XUI_CONTROL_NAVIGATE_RIGHT ||
input == XUI_CONTROL_NAVIGATE_OK)
{
g_settings.video.smooth = !g_settings.video.smooth;
XuiListSetText(m_menulist, MENU_XUI_ITEM_HW_TEXTURE_FILTER, g_settings.video.smooth ? L"Default Filter: Linear" : L"Default Filter: Nearest");
}
menu_set_settings(RGUI_SETTINGS_VIDEO_FILTER, action);
XuiListSetText(m_menulist, MENU_XUI_ITEM_HW_TEXTURE_FILTER, g_settings.video.smooth ? L"Default Filter: Linear" : L"Default Filter: Nearest");
break;
case MENU_XUI_ITEM_GAMMA_CORRECTION_ENABLED:
if (input == XUI_CONTROL_NAVIGATE_LEFT ||
input == XUI_CONTROL_NAVIGATE_RIGHT ||
input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_LEFT ||
action == RGUI_ACTION_RIGHT ||
action == RGUI_ACTION_OK)
{
g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1;
XuiListSetText(m_menulist, MENU_XUI_ITEM_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
@ -1082,53 +1018,26 @@ HRESULT CRetroArchVideoOptions::OnControlNavigate(XUIMessageControlNavigate *pCo
}
break;
case MENU_XUI_ITEM_ASPECT_RATIO:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
{
settings_set(1ULL << S_ASPECT_RATIO_DECREMENT);
aspectratio_changed = true;
}
else if (input == XUI_CONTROL_NAVIGATE_RIGHT ||
input == XUI_CONTROL_NAVIGATE_OK)
{
settings_set(1ULL << S_ASPECT_RATIO_INCREMENT);
aspectratio_changed = true;
}
menu_set_settings(RGUI_SETTINGS_VIDEO_ASPECT_RATIO, action);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
XuiListSetText(m_menulist, MENU_XUI_ITEM_ASPECT_RATIO, strw_buffer);
break;
case MENU_XUI_ITEM_ORIENTATION:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
{
settings_set(1ULL << S_ROTATION_DECREMENT);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
XuiListSetText(m_menulist, MENU_XUI_ITEM_ORIENTATION, strw_buffer);
driver.video->set_rotation(driver.video_data, g_settings.video.rotation);
}
else if (input == XUI_CONTROL_NAVIGATE_RIGHT ||
input == XUI_CONTROL_NAVIGATE_OK)
{
settings_set(1ULL << S_ROTATION_INCREMENT);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
XuiListSetText(m_menulist, MENU_XUI_ITEM_ORIENTATION, strw_buffer);
driver.video->set_rotation(driver.video_data, g_settings.video.rotation);
}
menu_set_settings(RGUI_SETTINGS_VIDEO_ROTATION, action);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
XuiListSetText(m_menulist, MENU_XUI_ITEM_ORIENTATION, strw_buffer);
driver.video->set_rotation(driver.video_data, g_settings.video.rotation);
break;
}
if(aspectratio_changed)
{
if (driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
XuiListSetText(m_menulist, MENU_XUI_ITEM_ASPECT_RATIO, strw_buffer);
}
bHandled = TRUE;
switch(pControlNavigateData->nControlNavigate)
switch(action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case XUI_CONTROL_NAVIGATE_RIGHT:
case XUI_CONTROL_NAVIGATE_UP:
case XUI_CONTROL_NAVIGATE_DOWN:
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_UP:
case RGUI_ACTION_DOWN:
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
break;
default:
@ -1161,8 +1070,7 @@ HRESULT CRetroArchShaderBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandl
GetChildById(L"XuiTxtBottom", &m_menutitlebottom);
filebrowser_set_root_and_ext(rgui->browser, "cg", "game:\\media\\shaders");
uint64_t action = (1ULL << DEVICE_NAV_B);
filebrowser_fetch_directory_entries(action);
filebrowser_fetch_directory_entries(FILEBROWSER_ACTION_OK);
return 0;
}
@ -1182,8 +1090,7 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand
wcstombs(str_buffer, (const wchar_t *)XuiListGetText(m_menulist, index), sizeof(str_buffer));
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
filebrowser_set_root_and_ext(rgui->browser, "cg", path);
uint64_t action = (1ULL << DEVICE_NAV_B);
filebrowser_fetch_directory_entries(action);
filebrowser_fetch_directory_entries(FILEBROWSER_ACTION_OK);
}
}
@ -1199,8 +1106,7 @@ HRESULT CRetroArchCoreBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled
GetChildById(L"XuiTxtBottom", &m_menutitlebottom);
filebrowser_set_root_and_ext(rgui->browser, "xex|XEX", "game:");
uint64_t action = (1ULL << DEVICE_NAV_B);
filebrowser_fetch_directory_entries(action);
filebrowser_fetch_directory_entries(FILEBROWSER_ACTION_OK);
return 0;
}
@ -1227,8 +1133,7 @@ HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
{
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
filebrowser_set_root_and_ext(rgui->browser, "xex|XEX", path);
uint64_t action = (1ULL << DEVICE_NAV_B);
filebrowser_fetch_directory_entries(action);
filebrowser_fetch_directory_entries(FILEBROWSER_ACTION_OK);
}
}
@ -1262,13 +1167,14 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
current_index= XuiListGetCurSel(m_menulist, NULL);
unsigned input = pControlNavigateData->nControlNavigate;
unsigned action = xui_input_to_rgui_action(input);
HXUIOBJ current_obj = current_menu;
switch (current_index)
{
case INGAME_MENU_CHANGE_LIBRETRO_CORE:
if (input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_OK)
{
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_libretrocore_browser.xur", NULL, &current_menu);
@ -1279,7 +1185,7 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
}
break;
case INGAME_MENU_LOAD_GAME_HISTORY_MODE:
if (input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_OK)
{
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_load_game_history.xur", NULL, &current_menu);
@ -1290,7 +1196,7 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
}
break;
case INGAME_MENU_CHANGE_GAME:
if (input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_OK)
{
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_filebrowser.xur", NULL, &current_menu);
@ -1301,7 +1207,7 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
}
break;
case INGAME_MENU_CORE_OPTIONS_MODE:
if (input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_OK)
{
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_core_options.xur", NULL, &current_menu);
@ -1312,7 +1218,7 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
}
break;
case INGAME_MENU_VIDEO_OPTIONS_MODE:
if (input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_OK)
{
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_video_options.xur", NULL, &current_menu);
@ -1323,7 +1229,7 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
}
break;
case INGAME_MENU_AUDIO_OPTIONS_MODE:
if (input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_OK)
{
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_audio_options.xur", NULL, &current_menu);
@ -1334,7 +1240,7 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
}
break;
case INGAME_MENU_INPUT_OPTIONS_MODE:
if (input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_OK)
{
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_controls.xur", NULL, &current_menu);
@ -1347,7 +1253,7 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
case INGAME_MENU_PATH_OPTIONS_MODE:
break;
case INGAME_MENU_SETTINGS_MODE:
if (input == XUI_CONTROL_NAVIGATE_OK)
if (action == RGUI_ACTION_OK)
{
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_settings.xur", NULL, &current_menu);
@ -1358,21 +1264,14 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
}
break;
case INGAME_MENU_LOAD_STATE:
process_input_ret = menu_set_settings(RGUI_SETTINGS_SAVESTATE_LOAD, action);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
XuiListSetText(m_menulist, INGAME_MENU_LOAD_STATE, strw_buffer);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
XuiListSetText(m_menulist, INGAME_MENU_SAVE_STATE, strw_buffer);
break;
case INGAME_MENU_SAVE_STATE:
if (input == XUI_CONTROL_NAVIGATE_LEFT)
rarch_state_slot_decrease();
else if (input == XUI_CONTROL_NAVIGATE_RIGHT)
rarch_state_slot_increase();
else if (input == XUI_CONTROL_NAVIGATE_OK)
{
if (current_index == INGAME_MENU_LOAD_STATE)
rarch_load_state();
else if (current_index == INGAME_MENU_SAVE_STATE)
rarch_save_state();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
process_input_ret = -1;
}
process_input_ret = menu_set_settings(RGUI_SETTINGS_SAVESTATE_SAVE, action);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer));
XuiListSetText(m_menulist, INGAME_MENU_LOAD_STATE, strw_buffer);
menu_settings_create_menu_item_label_w(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer));
@ -1381,37 +1280,24 @@ HRESULT CRetroArchMain::OnControlNavigate(XUIMessageControlNavigate *pControlNav
case INGAME_MENU_SCREENSHOT_MODE:
break;
case INGAME_MENU_RETURN_TO_GAME:
if (input == XUI_CONTROL_NAVIGATE_OK)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
process_input_ret = -1;
}
process_input_ret = menu_set_settings(RGUI_SETTINGS_RESUME_GAME, action);
break;
case INGAME_MENU_RESET:
if (input == XUI_CONTROL_NAVIGATE_OK)
{
rarch_game_reset();
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
process_input_ret = -1;
}
process_input_ret = menu_set_settings(RGUI_SETTINGS_RESTART_GAME, action);
break;
case INGAME_MENU_QUIT_RETROARCH:
if (input == XUI_CONTROL_NAVIGATE_OK)
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
process_input_ret = -1;
}
process_input_ret = menu_set_settings(RGUI_SETTINGS_QUIT_RARCH, action);
break;
}
bHandled = TRUE;
switch(pControlNavigateData->nControlNavigate)
switch(action)
{
case XUI_CONTROL_NAVIGATE_LEFT:
case XUI_CONTROL_NAVIGATE_RIGHT:
case XUI_CONTROL_NAVIGATE_UP:
case XUI_CONTROL_NAVIGATE_DOWN:
case RGUI_ACTION_LEFT:
case RGUI_ACTION_RIGHT:
case RGUI_ACTION_UP:
case RGUI_ACTION_DOWN:
pControlNavigateData->hObjDest = pControlNavigateData->hObjSource;
break;
default:
@ -1550,42 +1436,11 @@ static void ingame_menu_resize (void)
}
}
bool menu_iterate(void)
static int rgui_iterate(void *data, unsigned action)
{
xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data;
rgui_handle_t *rgui = (rgui_handle_t*)data;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_PREINIT))
{
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_PREINIT);
/* FIXME - hack for now */
rgui->delay_count = 0;
}
rgui->trigger_state = 0;
XINPUT_STATE state;
XInputGetState(0, &state);
if((state.Gamepad.wButtons & XINPUT_GAMEPAD_B) && current_menu != root_menu)
rgui->trigger_state = RGUI_ACTION_CANCEL;
else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_A))
rgui->trigger_state = RGUI_ACTION_OK;
/* FIXME - hack for now */
if (rgui->delay_count > 30)
{
bool rmenu_enable = ((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) &&
(state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB)
) && g_extern.main_is_init;
if (rmenu_enable)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
process_input_ret = -1;
}
}
if (rgui->trigger_state == RGUI_ACTION_CANCEL)
if (action == RGUI_ACTION_OK)
{
XuiSceneNavigateBack(current_menu, root_menu, XUSER_INDEX_ANY);
current_menu = root_menu;
@ -1593,31 +1448,7 @@ bool menu_iterate(void)
init_menulist(INGAME_MENU_MAIN_MODE);
}
#if 0
if (input_loop == INPUT_LOOP_RESIZE_MODE)
ingame_menu_resize();
#endif
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, true, true);
rarch_render_cached_frame();
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, false, true);
/* FIXME - hack for now */
rgui->delay_count++;
if(process_input_ret != 0)
goto deinit;
return true;
deinit:
process_input_ret = 0;
return false;
return 0;
}
bool menu_iterate_xui(void)
@ -1644,8 +1475,33 @@ bool menu_iterate_xui(void)
return true;
}
int rgui_input_postprocess(void *data, uint64_t old_state)
{
rgui_handle_t *rgui = (rgui_handle_t*)data;
bool quit = false;
bool resize = false;
unsigned width;
unsigned height;
unsigned frame_count;
if ((rgui->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
g_extern.main_is_init)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
process_input_ret = -1;
}
if (quit)
process_input_ret = -1;
int process_input_ret_old = process_input_ret;
process_input_ret = 0;
return process_input_ret_old;
}
const menu_ctx_driver_t menu_ctx_rmenu_xui = {
NULL,
rgui_iterate,
rgui_init,
rgui_free,
"rmenu_xui",

View File

@ -113,7 +113,6 @@ enum menu_enums
MODE_MENU_WIDESCREEN,
MODE_MENU_HD,
MODE_MENU_PREINIT,
MODE_MENU_INGAME_EXIT,
MODE_INFO_DRAW,
MODE_FPS_DRAW,
MODE_EXTLAUNCH_MULTIMAN,
@ -284,7 +283,7 @@ struct settings
uint16_t network_cmd_port;
bool stdin_cmd_enable;
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
char rgui_browser_directory[PATH_MAX];
char rgui_config_directory[PATH_MAX];
#endif

View File

@ -237,7 +237,7 @@ typedef struct gl
struct scaler_ctx pbo_readback_scaler;
#endif
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
GLuint rgui_texture;
bool rgui_texture_enable;
bool rgui_texture_full_screen;

View File

@ -527,6 +527,7 @@ MENU
#ifdef HAVE_MENU
#include "../frontend/menu/menu_common.c"
#include "../frontend/menu/menu_context.c"
#include "../frontend/menu/menu_settings.c"
#include "../frontend/menu/history.c"
#if defined(HAVE_RMENU_GUI)

View File

@ -113,7 +113,7 @@
<MinimalRebuild>true</MinimalRebuild>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>_DEBUG;_XBOX;HAVE_XINPUT2;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;RARCH_CONSOLE;HAVE_RMENU;HAVE_RMENU_XUI;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_XBOX;HAVE_XINPUT2;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
</ClCompile>
<Link>
@ -151,7 +151,7 @@
<PREfast>AnalyzeOnly</PREfast>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>_DEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;RARCH_CONSOLE;HAVE_RMENU;HAVE_RMENU_XUI;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;WANT_RPNG</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;WANT_RPNG</PreprocessorDefinitions>
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
</ClCompile>
<Link>
@ -190,7 +190,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU;HAVE_RMENU_XUI;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
</ClCompile>
<Link>
@ -234,7 +234,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU;HAVE_RMENU_XUI;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -275,7 +275,7 @@
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;RARCH_CONSOLE=1;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU;HAVE_RMENU_XUI;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;RARCH_CONSOLE=1;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -316,7 +316,7 @@
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU;HAVE_RMENU_XUI;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -777,4 +777,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -190,6 +190,7 @@
<ClCompile Include="..\..\frontend\menu\history.c" />
<ClCompile Include="..\..\frontend\menu\rgui.c" />
<ClCompile Include="..\..\frontend\menu\menu_common.c" />
<ClCompile Include="..\..\frontend\menu\menu_settings.c" />
<ClCompile Include="..\..\frontend\menu\menu_context.c" />
<ClCompile Include="..\..\gfx\d3d9\d3d9.cpp" />
<ClCompile Include="..\..\gfx\d3d9\render_chain.cpp" />

View File

@ -69,7 +69,7 @@ static void check_fast_forward_button(void)
old_hold_button_state = new_hold_button_state;
}
#if defined(HAVE_SCREENSHOTS) && !defined(_XBOX)
#if defined(HAVE_SCREENSHOTS) && !defined(_XBOX1)
static bool take_screenshot_viewport(void)
{
struct rarch_viewport vp = {0};

View File

@ -289,7 +289,7 @@ void config_set_defaults(void)
*g_settings.system_directory = '\0';
*g_settings.input.autoconfig_dir = '\0';
*g_settings.input.overlay = '\0';
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
*g_settings.rgui_browser_directory = '\0';
*g_settings.rgui_config_directory = '\0';
#endif
@ -351,7 +351,7 @@ void config_set_defaults(void)
g_extern.config_save_on_exit = config_save_on_exit;
#if defined(HAVE_RMENU) || defined(HAVE_RGUI)
#if defined(HAVE_RMENU) || defined(HAVE_RGUI) || defined(HAVE_RMENU_XUI)
/* Avoid reloading config on every ROM load */
g_extern.block_config_read = true;
#endif
@ -1045,7 +1045,7 @@ bool config_save_file(const char *path)
config_set_string(conf, "savestate_directory", *g_extern.savestate_dir ? g_extern.savestate_dir : "default");
config_set_string(conf, "video_shader_dir", *g_settings.video.shader_dir ? g_settings.video.shader_dir : "default");
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
config_set_string(conf, "rgui_browser_directory", *g_settings.rgui_browser_directory ? g_settings.rgui_browser_directory : "default");
config_set_string(conf, "rgui_config_directory", *g_settings.rgui_config_directory ? g_settings.rgui_config_directory : "default");
#endif

View File

@ -334,7 +334,6 @@ void xdk_d3d_deinit_fbo(void *data)
void xdk_d3d_init_fbo(void *data)
{
HRESULT ret;
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
#if 0
@ -387,7 +386,9 @@ void xdk_d3d_generate_pp(D3DPRESENT_PARAMETERS *d3dpp, const video_info_t *video
d3d->base_size = video->rgb32 ? sizeof(uint32_t) : sizeof(uint16_t);
unsigned width, height;
d3d->ctx_driver->get_video_size(&width, &height);
if (d3d->ctx_driver)
d3d->ctx_driver->get_video_size(&width, &height);
d3dpp->BackBufferWidth = d3d->win_width = width;
d3dpp->BackBufferHeight = d3d->win_height = height;
@ -764,7 +765,7 @@ static bool texture_image_render(struct texture_image *out_img,
}
#endif
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
#ifdef HAVE_MENU_PANEL
extern struct texture_image *menu_panel;
@ -985,7 +986,7 @@ NULL, NULL, NULL, 0);
}
#endif
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
#if defined(HAVE_RMENU_XUI) || defined(HAVE_RGUI)
if (d3d->rgui_texture_enable)
@ -1067,7 +1068,7 @@ static void xdk_d3d_apply_state_changes(void *data)
d3d->should_resize = true;
}
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
static void xdk_d3d_set_texture_frame(void *data,
const void *frame, bool rgb32, unsigned width, unsigned height,
float alpha)
@ -1104,7 +1105,7 @@ static const video_poke_interface_t d3d_poke_interface = {
#endif
xdk_d3d_set_aspect_ratio,
xdk_d3d_apply_state_changes,
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
xdk_d3d_set_texture_frame,
xdk_d3d_set_texture_enable,
#endif

View File

@ -67,7 +67,7 @@ typedef struct xdk_d3d_video
LPDIRECT3DTEXTURE lpTexture_ot;
IDirect3DVertexDeclaration9* v_decl;
#endif
#if defined(HAVE_RGUI) || defined(HAVE_RMENU)
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
bool rgui_texture_enable;
bool rgui_texture_full_screen;
#endif