mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 02:43:03 +00:00
Merge branch 'master' into translation-update-script
This commit is contained in:
commit
1b395e664f
@ -5,6 +5,7 @@
|
||||
- CHEEVOS: Don't block Sameboy core because it only exposes some memory
|
||||
- CHEEVOS: Support for extended Sega CD memory
|
||||
- CHEEVOS: Show RetroAchievements Hash in content information list
|
||||
- CHEEVOS: If the core says it's exposing SYSTEM_RAM, give it the benefit of the doubt
|
||||
- DISK CONTROL: Add disk labels to 'disk inserted' notifications
|
||||
- EMSCRIPTEN: Recreate input event listeners properly
|
||||
- FFMPEG CORE: Fix crash on seeking when using HW decoding in some cases
|
||||
@ -12,6 +13,8 @@
|
||||
- LOCALIZATION: Update Polish translation
|
||||
- LOCALIZATION: Update Spanish translation
|
||||
- MENU/WIDGETS: Allow notifications to use full screen width when not displaying menu
|
||||
- MENU/WIDGETS: DPI-based scaling
|
||||
- MENU/OZONE: Add DPI-based scaling
|
||||
- NETPLAY/MENU/BUGFIX: Fix Netplay Stateless Mode doesn't save. Affects other netplay settings which can be overridden by commandline option
|
||||
- NETPLAY/ROOMS/BUGFIX: Prevent out-of-bounds array indexing when displaying/selecting netplay rooms in menus
|
||||
- VIDEO: Set hardware 'Bilinear filtering' off by default
|
||||
|
@ -282,7 +282,6 @@ endif
|
||||
|
||||
ifeq ($(HAVE_RUNAHEAD), 1)
|
||||
DEFINES += -DHAVE_RUNAHEAD
|
||||
OBJ += runahead/mylist.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_CC_RESAMPLER), 1)
|
||||
@ -1544,6 +1543,7 @@ ifeq ($(HAVE_SHADERS_COMMON), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_BUILTINGLSLANG), 1)
|
||||
NEED_CXX_LINKER = 1
|
||||
HAVE_GLSLANG_COMMON = 1
|
||||
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#include "../../retroarch.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#define FRAMES(x) (x / (sizeof(float) * 2))
|
||||
@ -97,13 +96,13 @@ static void shutdown_cb(void *data)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int parse_ports(char **dest_ports, const char **jports)
|
||||
static int parse_ports(const char *audio_device,
|
||||
char **dest_ports, const char **jports)
|
||||
{
|
||||
int i;
|
||||
char *save = NULL;
|
||||
int parsed = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
char *audio_device_cpy = strdup(settings->arrays.audio_device);
|
||||
char *audio_device_cpy = strdup(audio_device);
|
||||
const char *con = strtok_r(audio_device_cpy, ",", &save);
|
||||
|
||||
if (con)
|
||||
@ -146,7 +145,8 @@ static size_t find_buffersize(jack_t *jd, int latency, unsigned out_rate)
|
||||
return buffer_frames * sizeof(jack_default_audio_sample_t);
|
||||
}
|
||||
|
||||
static void *ja_init(const char *device, unsigned rate, unsigned latency,
|
||||
static void *ja_init(const char *device,
|
||||
unsigned rate, unsigned latency,
|
||||
unsigned block_frames,
|
||||
unsigned *new_rate)
|
||||
{
|
||||
@ -203,7 +203,7 @@ static void *ja_init(const char *device, unsigned rate, unsigned latency,
|
||||
}
|
||||
}
|
||||
|
||||
parsed = parse_ports(dest_ports, jports);
|
||||
parsed = parse_ports(device, dest_ports, jports);
|
||||
|
||||
if (jack_activate(jd->client) < 0)
|
||||
{
|
||||
|
@ -32,7 +32,9 @@
|
||||
static const int sample_rate = 48000;
|
||||
static const int max_num_samples = sample_rate;
|
||||
static const int num_channels = 2;
|
||||
#ifndef HAVE_LIBNX
|
||||
static const size_t sample_buffer_size = ((max_num_samples * num_channels * sizeof(uint16_t)) + 0xfff) & ~0xfff;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -98,7 +100,9 @@ static ssize_t switch_audio_write(void *data, const void *buf, size_t size)
|
||||
|
||||
while (!swa->current_buffer)
|
||||
{
|
||||
#ifndef HAVE_LIBNX
|
||||
uint32_t handle_idx = 0;
|
||||
#endif
|
||||
num = 0;
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
@ -236,7 +240,9 @@ static void *switch_audio_init(const char *device,
|
||||
{
|
||||
unsigned i;
|
||||
char names[8][0x20];
|
||||
#ifndef HAVE_LIBNX
|
||||
uint32_t num_names = 0;
|
||||
#endif
|
||||
switch_audio_t *swa = (switch_audio_t*) calloc(1, sizeof(*swa));
|
||||
|
||||
if (!swa)
|
||||
@ -333,8 +339,9 @@ fail_audio_output:
|
||||
/* TODO/FIXME - fix libnx codepath */
|
||||
#ifndef HAVE_LIBNX
|
||||
audio_ipc_output_close(&swa->output);
|
||||
#endif
|
||||
fail_audio_ipc:
|
||||
#endif
|
||||
|
||||
/* TODO/FIXME - fix libnx codepath */
|
||||
#ifndef HAVE_LIBNX
|
||||
audio_ipc_finalize();
|
||||
|
@ -39,7 +39,6 @@ static const size_t thread_stack_size = 1024 * 8;
|
||||
static const int thread_preferred_cpu = 2;
|
||||
static const int channel_count = 2;
|
||||
static const size_t sample_size = sizeof(uint16_t);
|
||||
static const size_t frame_size = channel_count * sample_size;
|
||||
|
||||
#define AUDIO_BUFFER_COUNT 2
|
||||
|
||||
@ -144,8 +143,10 @@ static void *switch_thread_audio_init(const char *device, unsigned rate, unsigne
|
||||
Result rc;
|
||||
unsigned i;
|
||||
uint32_t prio;
|
||||
#ifndef HAVE_LIBNX
|
||||
char names[8][0x20];
|
||||
uint32_t num_names = 0;
|
||||
#endif
|
||||
switch_thread_audio_t *swa = (switch_thread_audio_t *)calloc(1, sizeof(*swa));
|
||||
|
||||
if (!swa)
|
||||
|
@ -411,12 +411,32 @@ static int rcheevos_parse(const char* json)
|
||||
*/
|
||||
if (!rcheevos_patch_address(0, rcheevos_locals.patchdata.console_id))
|
||||
{
|
||||
/* Special case: the sameboy core exposes the RAM at $8000, but not the ROM at $0000. NES and
|
||||
* Gameboy achievements do attempt to map the entire bus, and it's unlikely that an achievement
|
||||
* will reference the ROM data, so if the RAM is still present, allow the core to load. If any
|
||||
* achievements do reference the ROM data, they'll be marked "Unsupported" individually.
|
||||
*/
|
||||
if (!rcheevos_patch_address(0x8000, rcheevos_locals.patchdata.console_id))
|
||||
int delay_judgment = 0;
|
||||
|
||||
rarch_system_info_t* system = runloop_get_system_info();
|
||||
if (system->mmaps.num_descriptors == 0)
|
||||
{
|
||||
/* Special case: the mupen64plus-nx core doesn't initialize the RAM immediately. To avoid a race
|
||||
* condition - if the core says there's SYSTEM_RAM, but the pointer is NULL, proceed. If the memory
|
||||
* isn't exposed when the achievements start processing, they'll be marked "Unsupported" individually.
|
||||
*/
|
||||
retro_ctx_memory_info_t meminfo;
|
||||
meminfo.id = RETRO_MEMORY_SYSTEM_RAM;
|
||||
core_get_memory(&meminfo);
|
||||
|
||||
delay_judgment |= (meminfo.size > 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Special case: the sameboy core exposes the RAM at $8000, but not the ROM at $0000. NES and
|
||||
* Gameboy achievements do attempt to map the entire bus, and it's unlikely that an achievement
|
||||
* will reference the ROM data, so if the RAM is still present, allow the core to load. If any
|
||||
* achievements do reference the ROM data, they'll be marked "Unsupported" individually.
|
||||
*/
|
||||
delay_judgment |= (rcheevos_patch_address(0x8000, rcheevos_locals.patchdata.console_id) != NULL);
|
||||
}
|
||||
|
||||
if (!delay_judgment)
|
||||
{
|
||||
CHEEVOS_ERR(RCHEEVOS_TAG "No memory exposed by core\n");
|
||||
|
||||
|
86
config.def.h
86
config.def.h
@ -868,7 +868,7 @@ static const int netplay_check_frames = 600;
|
||||
|
||||
static const bool netplay_use_mitm_server = false;
|
||||
|
||||
static const char *netplay_mitm_server = "nyc";
|
||||
#define DEFAULT_NETPLAY_MITM_SERVER "nyc"
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
static const unsigned netplay_share_digital = RARCH_NETPLAY_SHARE_DIGITAL_NO_PREFERENCE;
|
||||
@ -970,6 +970,12 @@ static const unsigned playlist_entry_remove_enable = PLAYLIST_ENTRY_REMOVE_ENABL
|
||||
/* Default scale factor for non-frambuffer-based menu
|
||||
* drivers and menu widgets */
|
||||
#define DEFAULT_MENU_SCALE_FACTOR 1.0f
|
||||
/* Specifies whether menu widgets should be scaled
|
||||
* automatically using the default menu scale factor */
|
||||
#define DEFAULT_MENU_WIDGET_SCALE_AUTO true
|
||||
/* Default scale factor for menu widgets when widget
|
||||
* auto scaling is disabled */
|
||||
#define DEFAULT_MENU_WIDGET_SCALE_FACTOR 1.0f
|
||||
|
||||
/* Log level for the frontend */
|
||||
#define DEFAULT_FRONTEND_LOG_LEVEL 1
|
||||
@ -1072,8 +1078,10 @@ static const enum resampler_quality audio_resampler_quality_level = RESAMPLER_QU
|
||||
#endif
|
||||
|
||||
/* MIDI */
|
||||
static const char *midi_input = "Off";
|
||||
static const char *midi_output = "Off";
|
||||
#define DEFAULT_MIDI_INPUT "Off"
|
||||
|
||||
#define DEFAULT_MIDI_OUTPUT "Off"
|
||||
|
||||
static const unsigned midi_volume = 100;
|
||||
|
||||
/* Only applies to Android 7.0 (API 24) and up */
|
||||
@ -1099,95 +1107,95 @@ static const bool enable_device_vibration = false;
|
||||
#endif
|
||||
|
||||
#if defined(HAKCHI)
|
||||
static const char buildbot_server_url[] = "http://hakchicloud.com/Libretro_Cores/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://hakchicloud.com/Libretro_Cores/"
|
||||
#elif defined(ANDROID)
|
||||
#if defined(ANDROID_ARM_V7)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/"
|
||||
#elif defined(ANDROID_ARM)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/armeabi/"
|
||||
#elif defined(ANDROID_AARCH64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/arm64-v8a/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/arm64-v8a/"
|
||||
#elif defined(ANDROID_X86)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/x86/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/x86/"
|
||||
#elif defined(ANDROID_X64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/x86_64/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/x86_64/"
|
||||
#else
|
||||
static const char buildbot_server_url[] = "";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL ""
|
||||
#endif
|
||||
#elif defined(__QNX__)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/blackberry/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/blackberry/latest/"
|
||||
#elif defined(IOS)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/apple/ios/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/apple/ios/latest/"
|
||||
#elif defined(OSX)
|
||||
#if defined(__x86_64__)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/apple/osx/x86_64/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/apple/osx/x86_64/latest/"
|
||||
#elif defined(__i386__) || defined(__i486__) || defined(__i686__)
|
||||
static const char buildbot_server_url[] = "http://bot.libretro.com/nightly/apple/osx/x86/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://bot.libretro.com/nightly/apple/osx/x86/latest/"
|
||||
#else
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/apple/osx/ppc/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/apple/osx/ppc/latest/"
|
||||
#endif
|
||||
#elif defined(_WIN32) && !defined(_XBOX)
|
||||
#if _MSC_VER >= 1910
|
||||
#ifndef __WINRT__
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/x64/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/x64/latest/"
|
||||
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/x86/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/x86/latest/"
|
||||
#elif defined(__arm__) || defined(_M_ARM)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/arm/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/arm/latest/"
|
||||
#elif defined(__aarch64__) || defined(_M_ARM64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/arm64/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-desktop/arm64/latest/"
|
||||
#endif
|
||||
#else
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/x64/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/x64/latest/"
|
||||
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/x86/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/x86/latest/"
|
||||
#elif defined(__arm__) || defined(_M_ARM)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/arm/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/arm/latest/"
|
||||
#elif defined(__aarch64__) || defined(_M_ARM64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/arm64/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2017-uwp/arm64/latest/"
|
||||
#endif
|
||||
#endif
|
||||
#elif _MSC_VER == 1600
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2010/x86_64/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2010/x86_64/latest/"
|
||||
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2010/x86/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2010/x86/latest/"
|
||||
#endif
|
||||
#elif _MSC_VER == 1400
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2005/x86/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2005/x86/latest/"
|
||||
#elif _MSC_VER == 1310
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2003/x86/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows-msvc2003/x86/latest/"
|
||||
#else
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows/x86_64/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows/x86_64/latest/"
|
||||
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows/x86/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/windows/x86/latest/"
|
||||
#endif
|
||||
#endif
|
||||
#elif defined(__linux__)
|
||||
#if defined(__x86_64__)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/linux/x86_64/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/linux/x86_64/latest/"
|
||||
#elif defined(__i386__) || defined(__i486__) || defined(__i686__)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/linux/x86/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/linux/x86/latest/"
|
||||
#elif defined(__arm__) && __ARM_ARCH == 7 && defined(__ARM_PCS_VFP)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/linux/armhf/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/linux/armhf/latest/"
|
||||
#else
|
||||
static const char buildbot_server_url[] = "";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL ""
|
||||
#endif
|
||||
#elif defined(WIIU)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/nintendo/wiiu/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/nintendo/wiiu/latest/"
|
||||
#elif defined(HAVE_LIBNX)
|
||||
static const char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/nintendo/switch/libnx/latest/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/nintendo/switch/libnx/latest/"
|
||||
#elif defined(__CELLOS_LV2__) && defined(DEX_BUILD)
|
||||
static const char buildbot_server_url[] = "http://libretro.xbins.org/libretro/nightly/playstation/ps3/latest/dex-ps3/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://libretro.xbins.org/libretro/nightly/playstation/ps3/latest/dex-ps3/"
|
||||
#elif defined(__CELLOS_LV2__) && defined(CEX_BUILD)
|
||||
static const char buildbot_server_url[] = "http://libretro.xbins.org/libretro/nightly/playstation/ps3/latest/cex-ps3/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://libretro.xbins.org/libretro/nightly/playstation/ps3/latest/cex-ps3/"
|
||||
#elif defined(__CELLOS_LV2__) && defined(ODE_BUILD)
|
||||
static const char buildbot_server_url[] = "http://libretro.xbins.org/libretro/nightly/playstation/ps3/latest/ode-ps3/";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL "http://libretro.xbins.org/libretro/nightly/playstation/ps3/latest/ode-ps3/"
|
||||
#else
|
||||
static const char buildbot_server_url[] = "";
|
||||
#define DEFAULT_BUILDBOT_SERVER_URL ""
|
||||
#endif
|
||||
|
||||
#define DEFAULT_BUILDBOT_ASSETS_SERVER_URL "http://buildbot.libretro.com/assets/"
|
||||
|
@ -623,6 +623,11 @@ static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_NULL;
|
||||
#define SETTING_OVERRIDE(override_setting) \
|
||||
tmp[count-1].override = override_setting
|
||||
|
||||
/* Forward declarations */
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
static void config_parse_file(global_t *global);
|
||||
#endif
|
||||
|
||||
struct defaults g_defaults;
|
||||
|
||||
/**
|
||||
@ -1166,8 +1171,8 @@ static struct config_array_setting *populate_settings_array(settings_t *settings
|
||||
SETTING_ARRAY("led_driver", settings->arrays.led_driver, false, NULL, true);
|
||||
SETTING_ARRAY("netplay_mitm_server", settings->arrays.netplay_mitm_server, false, NULL, true);
|
||||
SETTING_ARRAY("midi_driver", settings->arrays.midi_driver, false, NULL, true);
|
||||
SETTING_ARRAY("midi_input", settings->arrays.midi_input, true, midi_input, true);
|
||||
SETTING_ARRAY("midi_output", settings->arrays.midi_output, true, midi_output, true);
|
||||
SETTING_ARRAY("midi_input", settings->arrays.midi_input, true, DEFAULT_MIDI_INPUT, true);
|
||||
SETTING_ARRAY("midi_output", settings->arrays.midi_output, true, DEFAULT_MIDI_OUTPUT, true);
|
||||
SETTING_ARRAY("youtube_stream_key", settings->arrays.youtube_stream_key, true, NULL, true);
|
||||
SETTING_ARRAY("twitch_stream_key", settings->arrays.twitch_stream_key, true, NULL, true);
|
||||
SETTING_ARRAY("discord_app_id", settings->arrays.discord_app_id, true, DEFAULT_DISCORD_APP_ID, true);
|
||||
@ -1418,7 +1423,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("keyboard_gamepad_enable", &settings->bools.input_keyboard_gamepad_enable, true, true, false);
|
||||
SETTING_BOOL("core_set_supports_no_game_enable", &settings->bools.set_supports_no_game_enable, true, true, false);
|
||||
SETTING_BOOL("audio_enable", &settings->bools.audio_enable, true, DEFAULT_AUDIO_ENABLE, false);
|
||||
SETTING_BOOL("menu_enable_widgets", &settings->bools.menu_enable_widgets, true, DEFAULT_MENU_ENABLE_WIDGETS, false);
|
||||
SETTING_BOOL("menu_enable_widgets", &settings->bools.menu_enable_widgets, true, DEFAULT_MENU_ENABLE_WIDGETS, false);
|
||||
SETTING_BOOL("menu_widget_scale_auto", &settings->bools.menu_widget_scale_auto, true, DEFAULT_MENU_WIDGET_SCALE_AUTO, false);
|
||||
SETTING_BOOL("audio_enable_menu", &settings->bools.audio_enable_menu, true, audio_enable_menu, false);
|
||||
SETTING_BOOL("audio_enable_menu_ok", &settings->bools.audio_enable_menu_ok, true, audio_enable_menu_ok, false);
|
||||
SETTING_BOOL("audio_enable_menu_cancel", &settings->bools.audio_enable_menu_cancel, true, audio_enable_menu_cancel, false);
|
||||
@ -1694,6 +1700,7 @@ static struct config_float_setting *populate_settings_float(settings_t *settings
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_FLOAT("menu_scale_factor", &settings->floats.menu_scale_factor, true, DEFAULT_MENU_SCALE_FACTOR, false);
|
||||
SETTING_FLOAT("menu_widget_scale_factor", &settings->floats.menu_widget_scale_factor, true, DEFAULT_MENU_WIDGET_SCALE_FACTOR, false);
|
||||
SETTING_FLOAT("menu_wallpaper_opacity", &settings->floats.menu_wallpaper_opacity, true, menu_wallpaper_opacity, false);
|
||||
SETTING_FLOAT("menu_framebuffer_opacity", &settings->floats.menu_framebuffer_opacity, true, menu_framebuffer_opacity, false);
|
||||
SETTING_FLOAT("menu_footer_opacity", &settings->floats.menu_footer_opacity, true, menu_footer_opacity, false);
|
||||
@ -1979,7 +1986,7 @@ void config_set_defaults(void *data)
|
||||
const char *def_location = config_get_default_location();
|
||||
const char *def_record = config_get_default_record();
|
||||
const char *def_midi = config_get_default_midi();
|
||||
const char *def_mitm = netplay_mitm_server;
|
||||
const char *def_mitm = DEFAULT_NETPLAY_MITM_SERVER;
|
||||
struct config_float_setting *float_settings = populate_settings_float (settings, &float_settings_size);
|
||||
struct config_bool_setting *bool_settings = populate_settings_bool (settings, &bool_settings_size);
|
||||
struct config_int_setting *int_settings = populate_settings_int (settings, &int_settings_size);
|
||||
@ -2165,7 +2172,7 @@ void config_set_defaults(void *data)
|
||||
}
|
||||
}
|
||||
|
||||
strlcpy(settings->paths.network_buildbot_url, buildbot_server_url,
|
||||
strlcpy(settings->paths.network_buildbot_url, DEFAULT_BUILDBOT_SERVER_URL,
|
||||
sizeof(settings->paths.network_buildbot_url));
|
||||
strlcpy(settings->paths.network_buildbot_assets_url,
|
||||
DEFAULT_BUILDBOT_ASSETS_SERVER_URL,
|
||||
@ -2420,12 +2427,10 @@ void config_set_defaults(void *data)
|
||||
free(temp_str);
|
||||
}
|
||||
|
||||
if (midi_input)
|
||||
strlcpy(settings->arrays.midi_input,
|
||||
midi_input, sizeof(settings->arrays.midi_input));
|
||||
if (midi_output)
|
||||
strlcpy(settings->arrays.midi_output,
|
||||
midi_output, sizeof(settings->arrays.midi_output));
|
||||
strlcpy(settings->arrays.midi_input,
|
||||
DEFAULT_MIDI_INPUT, sizeof(settings->arrays.midi_input));
|
||||
strlcpy(settings->arrays.midi_output,
|
||||
DEFAULT_MIDI_OUTPUT, sizeof(settings->arrays.midi_output));
|
||||
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
/* Avoid reloading config on every content load */
|
||||
@ -3597,9 +3602,8 @@ success:
|
||||
* Loads a config file and reads all the values into memory.
|
||||
*
|
||||
*/
|
||||
void config_parse_file(void *data)
|
||||
static void config_parse_file(global_t *global)
|
||||
{
|
||||
global_t *global = (global_t*)data;
|
||||
if (path_is_empty(RARCH_PATH_CONFIG))
|
||||
{
|
||||
RARCH_LOG("[config] Loading default config.\n");
|
||||
|
@ -151,6 +151,7 @@ typedef struct settings
|
||||
/* Menu */
|
||||
bool filter_by_current_core;
|
||||
bool menu_enable_widgets;
|
||||
bool menu_widget_scale_auto;
|
||||
bool menu_show_start_screen;
|
||||
bool menu_pause_libretro;
|
||||
bool menu_savestate_resume;
|
||||
@ -405,6 +406,7 @@ typedef struct settings
|
||||
float video_msg_bgcolor_opacity;
|
||||
|
||||
float menu_scale_factor;
|
||||
float menu_widget_scale_factor;
|
||||
float menu_wallpaper_opacity;
|
||||
float menu_framebuffer_opacity;
|
||||
float menu_footer_opacity;
|
||||
@ -809,14 +811,6 @@ const char *config_get_midi_driver_options(void);
|
||||
|
||||
const char *config_get_default_record(void);
|
||||
|
||||
/**
|
||||
* config_parse_file:
|
||||
*
|
||||
* Loads a config file and reads all the values into memory.
|
||||
*
|
||||
*/
|
||||
void config_parse_file(void *data);
|
||||
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
/**
|
||||
* config_load_override:
|
||||
@ -889,6 +883,8 @@ bool config_overlay_enable_default(void);
|
||||
|
||||
void config_set_defaults(void *data);
|
||||
|
||||
void config_load(void *data);
|
||||
|
||||
settings_t *config_get_ptr(void);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
@ -236,7 +236,6 @@ void disk_control_get_image_label(
|
||||
|
||||
error:
|
||||
label[0] = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
/***********/
|
||||
|
@ -624,5 +624,7 @@ frontend_ctx_driver_t frontend_ctx_ctr =
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"ctr",
|
||||
};
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include <streams/file_stream.h>
|
||||
#include <rhash.h>
|
||||
#include <features/features_cpu.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../menu/menu_driver.h"
|
||||
@ -111,6 +112,10 @@ typedef enum
|
||||
CFAllDomainsMask = 0x0ffff /* All domains: all of the above and future items */
|
||||
} CFDomainMask;
|
||||
|
||||
#if (defined(OSX) && !(defined(__ppc__) || defined(__ppc64__)))
|
||||
static int speak_pid = 0;
|
||||
#endif
|
||||
|
||||
static char darwin_cpu_model_name[64] = {0};
|
||||
|
||||
static NSSearchPathDirectory NSConvertFlagsCF(unsigned flags)
|
||||
@ -808,6 +813,144 @@ static const char* frontend_darwin_get_cpu_model_name(void)
|
||||
return darwin_cpu_model_name;
|
||||
}
|
||||
|
||||
#if (defined(OSX) && !(defined(__ppc__) || defined(__ppc64__)))
|
||||
static char* accessibility_mac_language_code(const char* language)
|
||||
{
|
||||
if (string_is_equal(language,"en"))
|
||||
return "Alex";
|
||||
else if (string_is_equal(language,"it"))
|
||||
return "Alice";
|
||||
else if (string_is_equal(language,"sv"))
|
||||
return "Alva";
|
||||
else if (string_is_equal(language,"fr"))
|
||||
return "Amelie";
|
||||
else if (string_is_equal(language,"de"))
|
||||
return "Anna";
|
||||
else if (string_is_equal(language,"he"))
|
||||
return "Carmit";
|
||||
else if (string_is_equal(language,"id"))
|
||||
return "Damayanti";
|
||||
else if (string_is_equal(language,"es"))
|
||||
return "Diego";
|
||||
else if (string_is_equal(language,"nl"))
|
||||
return "Ellen";
|
||||
else if (string_is_equal(language,"ro"))
|
||||
return "Ioana";
|
||||
else if (string_is_equal(language,"pt_pt"))
|
||||
return "Joana";
|
||||
else if (string_is_equal(language,"pt_bt") || string_is_equal(language,"pt"))
|
||||
return "Luciana";
|
||||
else if (string_is_equal(language,"th"))
|
||||
return "Kanya";
|
||||
else if (string_is_equal(language,"ja"))
|
||||
return "Kyoko";
|
||||
else if (string_is_equal(language,"sk"))
|
||||
return "Laura";
|
||||
else if (string_is_equal(language,"hi"))
|
||||
return "Lekha";
|
||||
else if (string_is_equal(language,"ar"))
|
||||
return "Maged";
|
||||
else if (string_is_equal(language,"hu"))
|
||||
return "Mariska";
|
||||
else if (string_is_equal(language,"zh_tw") || string_is_equal(language,"zh"))
|
||||
return "Mei-Jia";
|
||||
else if (string_is_equal(language,"el"))
|
||||
return "Melina";
|
||||
else if (string_is_equal(language,"ru"))
|
||||
return "Milena";
|
||||
else if (string_is_equal(language,"nb"))
|
||||
return "Nora";
|
||||
else if (string_is_equal(language,"da"))
|
||||
return "Sara";
|
||||
else if (string_is_equal(language,"fi"))
|
||||
return "Satu";
|
||||
else if (string_is_equal(language,"zh_hk"))
|
||||
return "Sin-ji";
|
||||
else if (string_is_equal(language,"zh_cn"))
|
||||
return "Ting-Ting";
|
||||
else if (string_is_equal(language,"tr"))
|
||||
return "Yelda";
|
||||
else if (string_is_equal(language,"ko"))
|
||||
return "Yuna";
|
||||
else if (string_is_equal(language,"pl"))
|
||||
return "Zosia";
|
||||
else if (string_is_equal(language,"cs"))
|
||||
return "Zuzana";
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
static bool is_narrator_running_macos(void)
|
||||
{
|
||||
return (kill(speak_pid, 0) == 0);
|
||||
}
|
||||
|
||||
static bool accessibility_speak_macos(int speed,
|
||||
const char* speak_text, int priority)
|
||||
{
|
||||
int pid;
|
||||
const char *voice = get_user_language_iso639_1(false);
|
||||
char* language_speaker = accessibility_mac_language_code(voice);
|
||||
char* speeds[10] = {"80", "100", "125", "150", "170", "210", "260", "310", "380", "450"};
|
||||
|
||||
if (speed < 1)
|
||||
speed = 1;
|
||||
else if (speed > 10)
|
||||
speed = 10;
|
||||
|
||||
if (priority < 10 && speak_pid > 0)
|
||||
{
|
||||
/* check if old pid is running */
|
||||
if (is_narrator_running_macos())
|
||||
return true;
|
||||
}
|
||||
|
||||
if (speak_pid > 0)
|
||||
{
|
||||
/* Kill the running say */
|
||||
kill(speak_pid, SIGTERM);
|
||||
speak_pid = 0;
|
||||
}
|
||||
|
||||
pid = fork();
|
||||
if (pid < 0)
|
||||
{
|
||||
/* error */
|
||||
RARCH_LOG("ERROR: could not fork for say command.\n");
|
||||
}
|
||||
else if (pid > 0)
|
||||
{
|
||||
/* parent process */
|
||||
speak_pid = pid;
|
||||
|
||||
/* Tell the system that we'll ignore the exit status of the child
|
||||
* process. This prevents zombie processes. */
|
||||
signal(SIGCHLD,SIG_IGN);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* child process: replace process with the say command */
|
||||
if (strlen(language_speaker)> 0)
|
||||
{
|
||||
char* cmd[] = {"say", "-v", NULL,
|
||||
NULL, "-r", NULL, NULL};
|
||||
cmd[2] = language_speaker;
|
||||
cmd[3] = (char *) speak_text;
|
||||
cmd[5] = speeds[speed-1];
|
||||
execvp("say", cmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
char* cmd[] = {"say", NULL, "-r", NULL, NULL};
|
||||
cmd[1] = (char*) speak_text;
|
||||
cmd[3] = speeds[speed-1];
|
||||
execvp("say",cmd);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_darwin = {
|
||||
frontend_darwin_get_environment_settings,
|
||||
NULL, /* init */
|
||||
@ -841,5 +984,12 @@ frontend_ctx_driver_t frontend_ctx_darwin = {
|
||||
NULL,
|
||||
#endif
|
||||
NULL, /* get_user_language */
|
||||
#if (defined(OSX) && !(defined(__ppc__) || defined(__ppc64__)))
|
||||
is_narrator_running_macos, /* is_narrator_running */
|
||||
accessibility_speak_macos, /* accessibility_speak */
|
||||
#else
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
#endif
|
||||
"darwin",
|
||||
};
|
||||
|
@ -73,5 +73,7 @@ frontend_ctx_driver_t frontend_ctx_dos = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"dos",
|
||||
};
|
||||
|
@ -240,5 +240,7 @@ frontend_ctx_driver_t frontend_ctx_emscripten = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"emscripten"
|
||||
};
|
||||
|
@ -567,5 +567,7 @@ frontend_ctx_driver_t frontend_ctx_gx = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"gx",
|
||||
};
|
||||
|
@ -374,5 +374,7 @@ frontend_ctx_driver_t frontend_ctx_orbis = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"orbis",
|
||||
};
|
||||
|
@ -416,5 +416,7 @@ frontend_ctx_driver_t frontend_ctx_ps2 = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"null",
|
||||
};
|
||||
|
@ -645,5 +645,7 @@ frontend_ctx_driver_t frontend_ctx_ps3 = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"ps3",
|
||||
};
|
||||
|
@ -596,9 +596,13 @@ frontend_ctx_driver_t frontend_ctx_psp = {
|
||||
NULL, /* get_cpu_model_name */
|
||||
#ifdef VITA
|
||||
frontend_psp_get_user_language,
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"vita",
|
||||
#else
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"psp",
|
||||
#endif
|
||||
};
|
||||
|
@ -213,5 +213,7 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"qnx",
|
||||
};
|
||||
|
@ -94,7 +94,6 @@ void libnx_apply_overclock(void)
|
||||
|
||||
static void on_applet_hook(AppletHookType hook, void *param)
|
||||
{
|
||||
u32 performance_mode;
|
||||
AppletFocusState focus_state;
|
||||
|
||||
/* Exit request */
|
||||
@ -131,9 +130,11 @@ static void on_applet_hook(AppletHookType hook, void *param)
|
||||
|
||||
/* Performance mode */
|
||||
case AppletHookType_OnPerformanceMode:
|
||||
/* 0 == Handheld, 1 == Docked
|
||||
* Since CPU doesn't change we just re-apply */
|
||||
performance_mode = appletGetPerformanceMode();
|
||||
{
|
||||
/* 0 == Handheld, 1 == Docked
|
||||
* Since CPU doesn't change we just re-apply */
|
||||
u32 performance_mode = appletGetPerformanceMode();
|
||||
}
|
||||
libnx_apply_overclock();
|
||||
break;
|
||||
|
||||
@ -318,17 +319,20 @@ static void frontend_switch_deinit(void *data)
|
||||
static void frontend_switch_exec(const char *path, bool should_load_game)
|
||||
{
|
||||
char game_path[PATH_MAX-4];
|
||||
#ifndef IS_SALAMANDER
|
||||
const char *arg_data[3];
|
||||
int args = 0;
|
||||
|
||||
game_path[0] = NULL;
|
||||
arg_data[0] = NULL;
|
||||
|
||||
arg_data[args] = elf_path_cst;
|
||||
arg_data[args + 1] = NULL;
|
||||
args++;
|
||||
#endif
|
||||
|
||||
game_path[0] = NULL;
|
||||
|
||||
RARCH_LOG("Attempt to load core: [%s].\n", path);
|
||||
|
||||
#ifndef IS_SALAMANDER
|
||||
if (should_load_game && !path_is_empty(RARCH_PATH_CONTENT))
|
||||
{
|
||||
@ -618,8 +622,6 @@ char *realpath(const char *name, char *resolved)
|
||||
|
||||
for (start = end = name; *start; start = end)
|
||||
{
|
||||
int n;
|
||||
|
||||
/* Skip sequence of multiple path-separators. */
|
||||
while (*start == '/')
|
||||
++start;
|
||||
@ -921,5 +923,7 @@ frontend_ctx_driver_t frontend_ctx_switch =
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"switch",
|
||||
};
|
||||
|
@ -119,6 +119,10 @@ static const char *proc_acpi_ac_adapter_path = "/proc/acpi/ac_adapter";
|
||||
static char unix_cpu_model_name[64] = {0};
|
||||
#endif
|
||||
|
||||
#if (defined(__linux__) || defined(__unix__)) && !defined(ANDROID)
|
||||
static int speak_pid = 0;
|
||||
#endif
|
||||
|
||||
static volatile sig_atomic_t unix_sighandler_quit;
|
||||
|
||||
#ifndef ANDROID
|
||||
@ -2431,6 +2435,74 @@ enum retro_language frontend_unix_get_user_language(void)
|
||||
return lang;
|
||||
}
|
||||
|
||||
#if (defined(__linux__) || defined(__unix__)) && !defined(ANDROID)
|
||||
static bool is_narrator_running_unix(void)
|
||||
{
|
||||
return (kill(speak_pid, 0) == 0);
|
||||
}
|
||||
|
||||
static bool accessibility_speak_unix(int speed,
|
||||
const char* speak_text, int priority)
|
||||
{
|
||||
int pid;
|
||||
const char *language = get_user_language_iso639_1(true);
|
||||
char* voice_out = (char *)malloc(3+strlen(language));
|
||||
char* speed_out = (char *)malloc(3+3);
|
||||
const char* speeds[10] = {"80", "100", "125", "150", "170", "210", "260", "310", "380", "450"};
|
||||
|
||||
if (speed < 1)
|
||||
speed = 1;
|
||||
else if (speed > 10)
|
||||
speed = 10;
|
||||
|
||||
strlcpy(voice_out, "-v", 3);
|
||||
strlcat(voice_out, language, 5);
|
||||
|
||||
strlcpy(speed_out, "-s", 3);
|
||||
strlcat(speed_out, speeds[speed-1], 6);
|
||||
|
||||
if (priority < 10 && speak_pid > 0)
|
||||
{
|
||||
/* check if old pid is running */
|
||||
if (is_narrator_running_unix())
|
||||
return true;
|
||||
}
|
||||
|
||||
if (speak_pid > 0)
|
||||
{
|
||||
/* Kill the running espeak */
|
||||
kill(speak_pid, SIGTERM);
|
||||
speak_pid = 0;
|
||||
}
|
||||
|
||||
pid = fork();
|
||||
if (pid < 0)
|
||||
{
|
||||
/* error */
|
||||
RARCH_LOG("ERROR: could not fork for espeak.\n");
|
||||
}
|
||||
else if (pid > 0)
|
||||
{
|
||||
/* parent process */
|
||||
speak_pid = pid;
|
||||
|
||||
/* Tell the system that we'll ignore the exit status of the child
|
||||
* process. This prevents zombie processes. */
|
||||
signal(SIGCHLD,SIG_IGN);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* child process: replace process with the espeak command */
|
||||
char* cmd[] = { (char*) "espeak", NULL, NULL, NULL, NULL};
|
||||
cmd[1] = voice_out;
|
||||
cmd[2] = speed_out;
|
||||
cmd[3] = (char *) speak_text;
|
||||
execvp("espeak", cmd);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_unix = {
|
||||
frontend_unix_get_env, /* environment_get */
|
||||
frontend_unix_init, /* init */
|
||||
@ -2477,6 +2549,13 @@ frontend_ctx_driver_t frontend_ctx_unix = {
|
||||
frontend_unix_set_sustained_performance_mode,
|
||||
frontend_unix_get_cpu_model_name,
|
||||
frontend_unix_get_user_language,
|
||||
#if (defined(__linux__) || defined(__unix__)) && !defined(ANDROID)
|
||||
is_narrator_running_unix,
|
||||
accessibility_speak_unix,
|
||||
#else
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
#endif
|
||||
#ifdef ANDROID
|
||||
"android"
|
||||
#else
|
||||
|
@ -477,5 +477,7 @@ frontend_ctx_driver_t frontend_ctx_uwp = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
frontend_uwp_get_cpu_model_name,
|
||||
frontend_uwp_get_user_language,
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"uwp"
|
||||
};
|
||||
|
@ -326,6 +326,8 @@ frontend_ctx_driver_t frontend_ctx_wiiu =
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"wiiu",
|
||||
NULL, /* get_video_driver */
|
||||
};
|
||||
|
@ -71,6 +71,8 @@ VOID (WINAPI *DragAcceptFiles_func)(HWND, BOOL);
|
||||
static bool dwm_composition_disabled = false;
|
||||
static bool console_needs_free = false;
|
||||
|
||||
static bool pi_set = false;
|
||||
|
||||
#if defined(HAVE_LANGEXTRA) && !defined(_XBOX)
|
||||
#if (defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500) || !defined(_MSC_VER)
|
||||
struct win32_lang_pair
|
||||
@ -193,10 +195,7 @@ static bool gfx_init_dwm(void)
|
||||
#endif
|
||||
|
||||
if (mmcss)
|
||||
{
|
||||
RARCH_LOG("Setting multimedia scheduling for DWM.\n");
|
||||
mmcss(TRUE);
|
||||
}
|
||||
|
||||
inited = true;
|
||||
return true;
|
||||
@ -206,12 +205,13 @@ static void gfx_set_dwm(void)
|
||||
{
|
||||
HRESULT ret;
|
||||
HRESULT (WINAPI *composition_enable)(UINT);
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool disable_composition = settings->bools.video_disable_composition;
|
||||
|
||||
if (!gfx_init_dwm())
|
||||
return;
|
||||
|
||||
if (settings->bools.video_disable_composition == dwm_composition_disabled)
|
||||
if (disable_composition == dwm_composition_disabled)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
@ -225,10 +225,10 @@ static void gfx_set_dwm(void)
|
||||
return;
|
||||
}
|
||||
|
||||
ret = composition_enable(!settings->bools.video_disable_composition);
|
||||
ret = composition_enable(!disable_composition);
|
||||
if (FAILED(ret))
|
||||
RARCH_ERR("Failed to set composition state ...\n");
|
||||
dwm_composition_disabled = settings->bools.video_disable_composition;
|
||||
dwm_composition_disabled = disable_composition;
|
||||
}
|
||||
|
||||
static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
|
||||
@ -720,6 +720,145 @@ static bool frontend_win32_set_fork(enum frontend_fork fork_mode)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
static const char *accessibility_win_language_code(const char* language)
|
||||
{
|
||||
if (string_is_equal(language,"en"))
|
||||
return "Microsoft David Desktop";
|
||||
else if (string_is_equal(language,"it"))
|
||||
return "Microsoft Cosimo Desktop";
|
||||
else if (string_is_equal(language,"sv"))
|
||||
return "Microsoft Bengt Desktop";
|
||||
else if (string_is_equal(language,"fr"))
|
||||
return "Microsoft Paul Desktop";
|
||||
else if (string_is_equal(language,"de"))
|
||||
return "Microsoft Stefan Desktop";
|
||||
else if (string_is_equal(language,"he"))
|
||||
return "Microsoft Hemant Desktop";
|
||||
else if (string_is_equal(language,"id"))
|
||||
return "Microsoft Asaf Desktop";
|
||||
else if (string_is_equal(language,"es"))
|
||||
return "Microsoft Pablo Desktop";
|
||||
else if (string_is_equal(language,"nl"))
|
||||
return "Microsoft Frank Desktop";
|
||||
else if (string_is_equal(language,"ro"))
|
||||
return "Microsoft Andrei Desktop";
|
||||
else if (string_is_equal(language,"pt_pt"))
|
||||
return "Microsoft Helia Desktop";
|
||||
else if (string_is_equal(language,"pt_bt") || string_is_equal(language,"pt"))
|
||||
return "Microsoft Daniel Desktop";
|
||||
else if (string_is_equal(language,"th"))
|
||||
return "Microsoft Pattara Desktop";
|
||||
else if (string_is_equal(language,"ja"))
|
||||
return "Microsoft Ichiro Desktop";
|
||||
else if (string_is_equal(language,"sk"))
|
||||
return "Microsoft Filip Desktop";
|
||||
else if (string_is_equal(language,"hi"))
|
||||
return "Microsoft Hemant Desktop";
|
||||
else if (string_is_equal(language,"ar"))
|
||||
return "Microsoft Naayf Desktop";
|
||||
else if (string_is_equal(language,"hu"))
|
||||
return "Microsoft Szabolcs Desktop";
|
||||
else if (string_is_equal(language,"zh_tw") || string_is_equal(language,"zh"))
|
||||
return "Microsoft Zhiwei Desktop";
|
||||
else if (string_is_equal(language,"el"))
|
||||
return "Microsoft Stefanos Desktop";
|
||||
else if (string_is_equal(language,"ru"))
|
||||
return "Microsoft Pavel Desktop";
|
||||
else if (string_is_equal(language,"nb"))
|
||||
return "Microsoft Jon Desktop";
|
||||
else if (string_is_equal(language,"da"))
|
||||
return "Microsoft Helle Desktop";
|
||||
else if (string_is_equal(language,"fi"))
|
||||
return "Microsoft Heidi Desktop";
|
||||
else if (string_is_equal(language,"zh_hk"))
|
||||
return "Microsoft Danny Desktop";
|
||||
else if (string_is_equal(language,"zh_cn"))
|
||||
return "Microsoft Kangkang Desktop";
|
||||
else if (string_is_equal(language,"tr"))
|
||||
return "Microsoft Tolga Desktop";
|
||||
else if (string_is_equal(language,"ko"))
|
||||
return "Microsoft Heami Desktop";
|
||||
else if (string_is_equal(language,"pl"))
|
||||
return "Microsoft Adam Desktop";
|
||||
else if (string_is_equal(language,"cs"))
|
||||
return "Microsoft Jakub Desktop";
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
static bool terminate_win32_process(PROCESS_INFORMATION pi)
|
||||
{
|
||||
TerminateProcess(pi.hProcess,0);
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
return true;
|
||||
}
|
||||
|
||||
static PROCESS_INFORMATION g_pi;
|
||||
|
||||
static bool create_win32_process(char* cmd)
|
||||
{
|
||||
STARTUPINFO si;
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
memset(&g_pi, 0, sizeof(g_pi));
|
||||
|
||||
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, CREATE_NO_WINDOW,
|
||||
NULL, NULL, &si, &g_pi))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool is_narrator_running_windows(void)
|
||||
{
|
||||
DWORD status = 0;
|
||||
if (pi_set == false)
|
||||
return false;
|
||||
if (GetExitCodeProcess(&g_pi, &status) && status == STILL_ACTIVE)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool accessibility_speak_windows(int speed,
|
||||
const char* speak_text, int priority)
|
||||
{
|
||||
char cmd[1200];
|
||||
const char *voice = get_user_language_iso639_1(true);
|
||||
const char *language = accessibility_win_language_code(voice);
|
||||
bool res = false;
|
||||
const char* speeds[10] = {"-10", "-7.5", "-5", "-2.5", "0", "2", "4", "6", "8", "10"};
|
||||
|
||||
if (speed < 1)
|
||||
speed = 1;
|
||||
else if (speed > 10)
|
||||
speed = 10;
|
||||
|
||||
if (priority < 10)
|
||||
{
|
||||
if (is_narrator_running_windows())
|
||||
return true;
|
||||
}
|
||||
|
||||
if (strlen(language) > 0)
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.SelectVoice(\\\"%s\\\"); $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", language, speeds[speed-1], (char*) speak_text);
|
||||
else
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"powershell.exe -NoProfile -WindowStyle Hidden -Command \"Add-Type -AssemblyName System.Speech; $synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; $synth.Rate = %s; $synth.Speak(\\\"%s\\\");\"", speeds[speed-1], (char*) speak_text);
|
||||
if (pi_set)
|
||||
terminate_win32_process(g_pi);
|
||||
res = create_win32_process(cmd);
|
||||
if (!res)
|
||||
{
|
||||
pi_set = false;
|
||||
return true;
|
||||
}
|
||||
pi_set = true;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
frontend_ctx_driver_t frontend_ctx_win32 = {
|
||||
frontend_win32_environment_get,
|
||||
frontend_win32_init,
|
||||
@ -757,5 +896,12 @@ frontend_ctx_driver_t frontend_ctx_win32 = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
frontend_win32_get_cpu_model_name,
|
||||
frontend_win32_get_user_language,
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
is_narrator_running_windows,
|
||||
accessibility_speak_windows,
|
||||
#else
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
#endif
|
||||
"win32"
|
||||
};
|
||||
|
@ -181,7 +181,7 @@ static void frontend_xdk_get_environment_settings(int *argc, char *argv[],
|
||||
|
||||
if (
|
||||
!string_is_empty(extracted_path)
|
||||
&& (strstr(extracted_path, "Pool") == NULL)
|
||||
&& (!strstr(extracted_path, "Pool"))
|
||||
/* Hack. Unknown problem */)
|
||||
{
|
||||
/* Auto-start game */
|
||||
@ -440,5 +440,7 @@ frontend_ctx_driver_t frontend_ctx_xdk = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"xdk",
|
||||
};
|
||||
|
@ -96,5 +96,7 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"xenon",
|
||||
};
|
||||
|
@ -70,6 +70,8 @@ static frontend_ctx_driver_t frontend_ctx_null = {
|
||||
NULL, /* set_sustained_performance_mode */
|
||||
NULL, /* get_cpu_model_name */
|
||||
NULL, /* get_user_language */
|
||||
NULL, /* is_narrator_running */
|
||||
NULL, /* accessibility_speak */
|
||||
"null",
|
||||
NULL, /* get_video_driver */
|
||||
};
|
||||
@ -553,4 +555,12 @@ enum retro_language frontend_driver_get_user_language(void)
|
||||
return RETRO_LANGUAGE_ENGLISH;
|
||||
return frontend->get_user_language();
|
||||
}
|
||||
|
||||
bool frontend_driver_is_narrator_running(void)
|
||||
{
|
||||
frontend_ctx_driver_t *frontend = frontend_get_ptr();
|
||||
if (!frontend || !frontend->is_narrator_running)
|
||||
return false;
|
||||
return frontend->is_narrator_running();
|
||||
}
|
||||
#endif
|
||||
|
@ -110,6 +110,9 @@ typedef struct frontend_ctx_driver
|
||||
void (*set_sustained_performance_mode)(bool on);
|
||||
const char* (*get_cpu_model_name)(void);
|
||||
enum retro_language (*get_user_language)(void);
|
||||
bool (*is_narrator_running)(void);
|
||||
bool (*accessibility_speak)(int speed,
|
||||
const char* speak_text, int priority);
|
||||
|
||||
const char *ident;
|
||||
|
||||
|
@ -27,7 +27,7 @@ uint32_t g_connector_id = 0;
|
||||
int g_drm_fd = 0;
|
||||
uint32_t g_crtc_id = 0;
|
||||
|
||||
drmModeCrtc *g_orig_crtc = NULL;
|
||||
drmModeCrtc *g_orig_crtc = NULL;
|
||||
|
||||
static drmModeRes *g_drm_resources = NULL;
|
||||
drmModeConnector *g_drm_connector = NULL;
|
||||
|
@ -1584,6 +1584,7 @@ static bool vulkan_context_init_gpu(gfx_ctx_vulkan_data_t *vk)
|
||||
VkPhysicalDevice *gpus = NULL;
|
||||
union string_list_elem_attr attr = {0};
|
||||
settings_t *settings = config_get_ptr();
|
||||
int gpu_index = settings->ints.vulkan_gpu_index;
|
||||
|
||||
if (vkEnumeratePhysicalDevices(vk->context.instance,
|
||||
&gpu_count, NULL) != VK_SUCCESS)
|
||||
@ -1633,14 +1634,14 @@ static bool vulkan_context_init_gpu(gfx_ctx_vulkan_data_t *vk)
|
||||
|
||||
video_driver_set_gpu_api_devices(GFX_CTX_VULKAN_API, vulkan_gpu_list);
|
||||
|
||||
if (0 <= settings->ints.vulkan_gpu_index && settings->ints.vulkan_gpu_index < (int)gpu_count)
|
||||
if (0 <= gpu_index && gpu_index < (int)gpu_count)
|
||||
{
|
||||
RARCH_LOG("[Vulkan]: Using GPU index %d.\n", settings->ints.vulkan_gpu_index);
|
||||
vk->context.gpu = gpus[settings->ints.vulkan_gpu_index];
|
||||
RARCH_LOG("[Vulkan]: Using GPU index %d.\n", gpu_index);
|
||||
vk->context.gpu = gpus[gpu_index];
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_WARN("[Vulkan]: Invalid GPU index %d, using first device found.\n", settings->ints.vulkan_gpu_index);
|
||||
RARCH_WARN("[Vulkan]: Invalid GPU index %d, using first device found.\n", gpu_index);
|
||||
vk->context.gpu = gpus[0];
|
||||
}
|
||||
|
||||
|
@ -575,23 +575,6 @@ static bool win32_drag_query_file(HWND hwnd, WPARAM wparam)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void win32_set_position_from_config(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME);
|
||||
int title_bar_height = GetSystemMetrics(SM_CYCAPTION);
|
||||
|
||||
if (!settings->bools.video_window_save_positions)
|
||||
return;
|
||||
|
||||
g_win32_pos_x = settings->uints.window_position_x;
|
||||
g_win32_pos_y = settings->uints.window_position_y;
|
||||
g_win32_pos_width = settings->uints.window_position_width
|
||||
+ border_thickness * 2;
|
||||
g_win32_pos_height = settings->uints.window_position_height
|
||||
+ border_thickness * 2 + title_bar_height;
|
||||
}
|
||||
|
||||
static void win32_save_position(void)
|
||||
{
|
||||
RECT rect;
|
||||
@ -943,16 +926,15 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
||||
return 0;
|
||||
}
|
||||
return DefWindowProc(hwnd, message, wparam, lparam);
|
||||
case WM_MOVE:
|
||||
win32_save_position();
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
case WM_DESTROY:
|
||||
case WM_QUIT:
|
||||
win32_save_position();
|
||||
|
||||
g_win32_quit = true;
|
||||
*quit = true;
|
||||
/* fall-through */
|
||||
case WM_MOVE:
|
||||
win32_save_position();
|
||||
break;
|
||||
case WM_SIZE:
|
||||
/* Do not send resize message if we minimize. */
|
||||
@ -1515,7 +1497,17 @@ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use,
|
||||
|
||||
if (settings->bools.video_window_save_positions)
|
||||
{
|
||||
win32_set_position_from_config();
|
||||
/* Set position from config */
|
||||
int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME);
|
||||
int title_bar_height = GetSystemMetrics(SM_CYCAPTION);
|
||||
|
||||
g_win32_pos_x = settings->uints.window_position_x;
|
||||
g_win32_pos_y = settings->uints.window_position_y;
|
||||
g_win32_pos_width = settings->uints.window_position_width
|
||||
+ border_thickness * 2;
|
||||
g_win32_pos_height = settings->uints.window_position_height
|
||||
+ border_thickness * 2 + title_bar_height;
|
||||
|
||||
if (g_win32_pos_width != 0 && g_win32_pos_height != 0)
|
||||
position_set_from_config = true;
|
||||
}
|
||||
|
@ -19,30 +19,11 @@
|
||||
#include "../video_display_server.h"
|
||||
#include "../../frontend/drivers/platform_unix.h"
|
||||
|
||||
static void* android_display_server_init(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void android_display_server_destroy(void *data)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static bool android_display_server_set_window_opacity(void *data, unsigned opacity)
|
||||
{
|
||||
(void)data;
|
||||
(void)opacity;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool android_display_server_set_window_progress(void *data, int progress, bool finished)
|
||||
{
|
||||
(void)data;
|
||||
(void)progress;
|
||||
(void)finished;
|
||||
return true;
|
||||
}
|
||||
static void* android_display_server_init(void) { return NULL; }
|
||||
static void android_display_server_destroy(void *data) { }
|
||||
static bool android_display_server_set_window_opacity(void *data, unsigned opacity) { return true; }
|
||||
static bool android_display_server_set_window_progress(void *data, int progress, bool finished) { return true; }
|
||||
static uint32_t android_display_server_get_flags(void *data) { return 0; }
|
||||
|
||||
static void android_display_server_set_screen_orientation(enum rotation rotation)
|
||||
{
|
||||
@ -56,13 +37,6 @@ static void android_display_server_set_screen_orientation(enum rotation rotation
|
||||
g_android->setScreenOrientation, rotation);
|
||||
}
|
||||
|
||||
static uint32_t android_display_server_get_flags(void *data)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
const video_display_server_t dispserv_android = {
|
||||
android_display_server_init,
|
||||
android_display_server_destroy,
|
||||
|
@ -785,8 +785,9 @@ static void gl2_create_fbo_texture(gl_t *gl,
|
||||
bool fp_fbo = false;
|
||||
bool smooth = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
GLuint base_filt = settings->bools.video_smooth ? GL_LINEAR : GL_NEAREST;
|
||||
GLuint base_mip_filt = settings->bools.video_smooth ?
|
||||
bool video_smooth = settings->bools.video_smooth;
|
||||
GLuint base_filt = video_smooth ? GL_LINEAR : GL_NEAREST;
|
||||
GLuint base_mip_filt = video_smooth ?
|
||||
GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST;
|
||||
unsigned mip_level = i + 2;
|
||||
bool mipmapped = gl->shader->mipmap_input(gl->shader_data, mip_level);
|
||||
|
@ -23,10 +23,12 @@
|
||||
|
||||
#include "../../libretro-common/include/libretro_gskit_ps2.h"
|
||||
|
||||
#define GS_TEXT GS_SETREG_RGBAQ(0x80,0x80,0x80,0x80,0x00) // turn white GS Screen
|
||||
#define GS_BLACK GS_SETREG_RGBAQ(0x00,0x00,0x00,0x00,0x00) // turn white GS Screen
|
||||
/* turn white GS Screen */
|
||||
#define GS_TEXT GS_SETREG_RGBAQ(0x80,0x80,0x80,0x80,0x00)
|
||||
/* turn white GS Screen */
|
||||
#define GS_BLACK GS_SETREG_RGBAQ(0x00,0x00,0x00,0x00,0x00)
|
||||
|
||||
#define NTSC_WIDTH 640
|
||||
#define NTSC_WIDTH 640
|
||||
#define NTSC_HEIGHT 448
|
||||
|
||||
typedef struct ps2_video
|
||||
@ -35,8 +37,11 @@ typedef struct ps2_video
|
||||
GSTEXTURE *menuTexture;
|
||||
GSTEXTURE *coreTexture;
|
||||
bool clearVRAM;
|
||||
bool clearVRAM_font; /* I need to create this additional field to be used in the font driver*/
|
||||
struct retro_hw_render_interface_gskit_ps2 iface; /* Palette in the cores */
|
||||
/* I need to create this additional field
|
||||
* to be used in the font driver*/
|
||||
bool clearVRAM_font;
|
||||
/* Palette in the cores */
|
||||
struct retro_hw_render_interface_gskit_ps2 iface;
|
||||
|
||||
bool menuVisible;
|
||||
bool fullscreen;
|
||||
@ -49,21 +54,21 @@ typedef struct ps2_video
|
||||
int core_filter;
|
||||
} ps2_video_t;
|
||||
|
||||
// PRIVATE METHODS
|
||||
/* PRIVATE METHODS */
|
||||
static GSGLOBAL *init_GSGlobal(void)
|
||||
{
|
||||
GSGLOBAL *gsGlobal = gsKit_init_global();
|
||||
GSGLOBAL *gsGlobal = gsKit_init_global();
|
||||
|
||||
gsGlobal->Mode = GS_MODE_NTSC;
|
||||
gsGlobal->Interlace = GS_INTERLACED;
|
||||
gsGlobal->Field = GS_FIELD;
|
||||
gsGlobal->Width = NTSC_WIDTH;
|
||||
gsGlobal->Height = NTSC_HEIGHT;
|
||||
gsGlobal->Mode = GS_MODE_NTSC;
|
||||
gsGlobal->Interlace = GS_INTERLACED;
|
||||
gsGlobal->Field = GS_FIELD;
|
||||
gsGlobal->Width = NTSC_WIDTH;
|
||||
gsGlobal->Height = NTSC_HEIGHT;
|
||||
|
||||
gsGlobal->PSM = GS_PSM_CT16;
|
||||
gsGlobal->PSMZ = GS_PSMZ_16;
|
||||
gsGlobal->PSM = GS_PSM_CT16;
|
||||
gsGlobal->PSMZ = GS_PSMZ_16;
|
||||
gsGlobal->DoubleBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->ZBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->ZBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->PrimAlphaEnable = GS_SETTING_OFF;
|
||||
|
||||
dmaKit_init(D_CTRL_RELE_OFF,D_CTRL_MFD_OFF, D_CTRL_STS_UNSPEC,
|
||||
@ -87,70 +92,80 @@ static GSTEXTURE * prepare_new_texture(void)
|
||||
|
||||
static void init_ps2_video(ps2_video_t *ps2)
|
||||
{
|
||||
ps2->gsGlobal = init_GSGlobal();
|
||||
ps2->gsGlobal = init_GSGlobal();
|
||||
ps2->menuTexture = prepare_new_texture();
|
||||
ps2->coreTexture = prepare_new_texture();
|
||||
|
||||
/* Used for cores that supports palette */
|
||||
ps2->iface.interface_type = RETRO_HW_RENDER_INTERFACE_GSKIT_PS2;
|
||||
ps2->iface.interface_type = RETRO_HW_RENDER_INTERFACE_GSKIT_PS2;
|
||||
ps2->iface.interface_version = RETRO_HW_RENDER_INTERFACE_GSKIT_PS2_VERSION;
|
||||
ps2->iface.coreTexture = ps2->coreTexture;
|
||||
ps2->iface.coreTexture = ps2->coreTexture;
|
||||
}
|
||||
|
||||
static void deinitTexture(GSTEXTURE *texture)
|
||||
{
|
||||
texture->Mem = NULL;
|
||||
texture->Mem = NULL;
|
||||
texture->Clut = NULL;
|
||||
}
|
||||
|
||||
static bool texture_need_prepare(GSTEXTURE *texture, int width, int height, int PSM)
|
||||
static bool texture_need_prepare(GSTEXTURE *texture,
|
||||
int width, int height, int PSM)
|
||||
{
|
||||
return texture->Width != width || texture->Height != height || texture->PSM != PSM;
|
||||
return texture->Width != width ||
|
||||
texture->Height != height ||
|
||||
texture->PSM != PSM;
|
||||
}
|
||||
|
||||
static void transfer_texture(GSTEXTURE *texture, const void *frame,
|
||||
int width, int height, int PSM, int filter, bool color_correction)
|
||||
{
|
||||
texture->Width = width;
|
||||
texture->Width = width;
|
||||
texture->Height = height;
|
||||
texture->PSM = PSM;
|
||||
texture->PSM = PSM;
|
||||
texture->Filter = filter;
|
||||
texture->Mem = (void *)frame;
|
||||
texture->Mem = (void *)frame;
|
||||
}
|
||||
|
||||
static void vram_alloc(GSGLOBAL *gsGlobal, GSTEXTURE *texture)
|
||||
{
|
||||
uint32_t size = gsKit_texture_size(texture->Width, texture->Height, texture->PSM);
|
||||
uint32_t size = gsKit_texture_size(texture->Width,
|
||||
texture->Height, texture->PSM);
|
||||
texture->Vram = gsKit_vram_alloc(gsGlobal, size, GSKIT_ALLOC_USERBUFFER);
|
||||
if(texture->Vram == GSKIT_ALLOC_ERROR) {
|
||||
|
||||
if(texture->Vram == GSKIT_ALLOC_ERROR)
|
||||
{
|
||||
printf("VRAM Allocation Failed. Will not upload texture.\n");
|
||||
}
|
||||
|
||||
if (texture->Clut) {
|
||||
if (texture->Clut)
|
||||
{
|
||||
/* Right now just supporting 16 x 16 = 256 colours */
|
||||
size = gsKit_texture_size(16, 16, texture->ClutPSM);
|
||||
size = gsKit_texture_size(16, 16, texture->ClutPSM);
|
||||
texture->VramClut = gsKit_vram_alloc(gsGlobal, size , GSKIT_ALLOC_USERBUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
static void prim_texture(GSGLOBAL *gsGlobal, GSTEXTURE *texture, int zPosition, bool force_aspect, struct retro_hw_ps2_insets padding)
|
||||
{
|
||||
float x1, y1, x2, y2;
|
||||
float visible_width = texture->Width - padding.left - padding.right;
|
||||
float visible_height = texture->Height - padding.top - padding.bottom;
|
||||
if (force_aspect) {
|
||||
float width_proportion = (float)gsGlobal->Width / (float)visible_width;
|
||||
float x1, y1, x2, y2;
|
||||
float visible_width = texture->Width - padding.left - padding.right;
|
||||
float visible_height = texture->Height - padding.top - padding.bottom;
|
||||
|
||||
if (force_aspect)
|
||||
{
|
||||
float width_proportion = (float)gsGlobal->Width / (float)visible_width;
|
||||
float height_proportion = (float)gsGlobal->Height / (float)visible_height;
|
||||
float delta = MIN(width_proportion, height_proportion);
|
||||
float newWidth = visible_width * delta;
|
||||
float newHeight = visible_height * delta;
|
||||
float delta = MIN(width_proportion, height_proportion);
|
||||
float newWidth = visible_width * delta;
|
||||
float newHeight = visible_height * delta;
|
||||
|
||||
x1 = (gsGlobal->Width - newWidth) / 2.0f;
|
||||
y1 = (gsGlobal->Height - newHeight) / 2.0f;
|
||||
x2 = newWidth + x1;
|
||||
y2 = newHeight + y1;
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
x1 = 0.0f;
|
||||
y1 = 0.0f;
|
||||
x2 = gsGlobal->Width;
|
||||
@ -158,38 +173,44 @@ static void prim_texture(GSGLOBAL *gsGlobal, GSTEXTURE *texture, int zPosition,
|
||||
}
|
||||
|
||||
gsKit_prim_sprite_texture( gsGlobal, texture,
|
||||
x1, //X1
|
||||
y1, // Y1
|
||||
padding.left, // U1
|
||||
padding.top, // V1
|
||||
x2, // X2
|
||||
y2, // Y2
|
||||
texture->Width - padding.right, // U2
|
||||
texture->Height - padding.bottom, // V2
|
||||
zPosition,
|
||||
GS_TEXT);
|
||||
x1, /* X1 */
|
||||
y1, /* Y1 */
|
||||
padding.left, /* U1 */
|
||||
padding.top, /* V1 */
|
||||
x2, /* X2 */
|
||||
y2, /* Y2 */
|
||||
texture->Width - padding.right, /* U2 */
|
||||
texture->Height - padding.bottom, /* V2 */
|
||||
zPosition,
|
||||
GS_TEXT);
|
||||
}
|
||||
|
||||
static void clearVRAMIfNeeded(ps2_video_t *ps2, const void *frame, int width, int height)
|
||||
static void clearVRAMIfNeeded(ps2_video_t *ps2,
|
||||
const void *frame, int width, int height)
|
||||
{
|
||||
if (!ps2->clearVRAM) {
|
||||
if(frame && frame != RETRO_HW_FRAME_BUFFER_VALID) {
|
||||
bool coreVRAMClear = false;
|
||||
coreVRAMClear = texture_need_prepare(ps2->coreTexture, width, height, ps2->PSM);
|
||||
if (!ps2->clearVRAM)
|
||||
{
|
||||
if(frame && frame != RETRO_HW_FRAME_BUFFER_VALID)
|
||||
{
|
||||
bool coreVRAMClear = texture_need_prepare(
|
||||
ps2->coreTexture, width, height, ps2->PSM);
|
||||
ps2->clearVRAM = ps2->clearVRAM || coreVRAMClear;
|
||||
}
|
||||
}
|
||||
|
||||
if (ps2->clearVRAM) {
|
||||
if (ps2->clearVRAM)
|
||||
{
|
||||
gsKit_vram_clear(ps2->gsGlobal);
|
||||
ps2->iface.updatedPalette = true;
|
||||
ps2->clearVRAM_font = true; /* we need to upload also palette in the font driver */
|
||||
/* we need to upload also palette in the font driver */
|
||||
ps2->clearVRAM_font = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void refreshScreen(ps2_video_t *ps2)
|
||||
{
|
||||
if (ps2->vsync) {
|
||||
if (ps2->vsync)
|
||||
{
|
||||
gsKit_sync_flip(ps2->gsGlobal);
|
||||
}
|
||||
gsKit_queue_exec(ps2->gsGlobal);
|
||||
@ -199,22 +220,30 @@ static void refreshScreen(ps2_video_t *ps2)
|
||||
ps2->clearVRAM = false;
|
||||
}
|
||||
|
||||
static void ps2_texture_upload(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, bool sendPalette)
|
||||
static void ps2_texture_upload(GSGLOBAL *gsGlobal, GSTEXTURE *Texture,
|
||||
bool sendPalette)
|
||||
{
|
||||
gsKit_setup_tbw(Texture);
|
||||
|
||||
if (Texture->PSM == GS_PSM_T8) {
|
||||
if (Texture->PSM == GS_PSM_T8)
|
||||
{
|
||||
gsKit_texture_send(Texture->Mem, Texture->Width, Texture->Height, Texture->Vram, Texture->PSM, Texture->TBW, GS_CLUT_TEXTURE);
|
||||
if (sendPalette) {
|
||||
if (sendPalette)
|
||||
{
|
||||
gsKit_texture_send(Texture->Clut, 16, 16, Texture->VramClut, Texture->ClutPSM, 1, GS_CLUT_PALLETE);
|
||||
}
|
||||
|
||||
} else if (Texture->PSM == GS_PSM_T4) {
|
||||
}
|
||||
else if (Texture->PSM == GS_PSM_T4)
|
||||
{
|
||||
gsKit_texture_send(Texture->Mem, Texture->Width, Texture->Height, Texture->Vram, Texture->PSM, Texture->TBW, GS_CLUT_TEXTURE);
|
||||
if (sendPalette) {
|
||||
if (sendPalette)
|
||||
{
|
||||
gsKit_texture_send(Texture->Clut, 8, 2, Texture->VramClut, Texture->ClutPSM, 1, GS_CLUT_PALLETE);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
gsKit_texture_send(Texture->Mem, Texture->Width, Texture->Height, Texture->Vram, Texture->PSM, Texture->TBW, GS_CLUT_NONE);
|
||||
}
|
||||
}
|
||||
@ -222,31 +251,32 @@ static void ps2_texture_upload(GSGLOBAL *gsGlobal, GSTEXTURE *Texture, bool send
|
||||
static void *ps2_gfx_init(const video_info_t *video,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
void *ps2input = NULL;
|
||||
*input_data = NULL;
|
||||
(void)video;
|
||||
|
||||
void *ps2input = NULL;
|
||||
ps2_video_t *ps2 = (ps2_video_t*)calloc(1, sizeof(ps2_video_t));
|
||||
|
||||
*input_data = NULL;
|
||||
|
||||
if (!ps2)
|
||||
return NULL;
|
||||
|
||||
init_ps2_video(ps2);
|
||||
if (video->font_enable) {
|
||||
if (video->font_enable)
|
||||
font_driver_init_osd(ps2, false, video->is_threaded, FONT_DRIVER_RENDER_PS2);
|
||||
}
|
||||
ps2->PSM = (video->rgb32 ? GS_PSM_CT32 : GS_PSM_CT16);
|
||||
ps2->fullscreen = video->fullscreen;
|
||||
ps2->core_filter = video->smooth ? GS_FILTER_LINEAR : GS_FILTER_NEAREST;
|
||||
ps2->force_aspect = video->force_aspect;
|
||||
ps2->vsync = video->vsync;
|
||||
ps2->clearVRAM = true;
|
||||
|
||||
if (input && input_data) {
|
||||
ps2->PSM = (video->rgb32 ? GS_PSM_CT32 : GS_PSM_CT16);
|
||||
ps2->fullscreen = video->fullscreen;
|
||||
ps2->core_filter = video->smooth ? GS_FILTER_LINEAR : GS_FILTER_NEAREST;
|
||||
ps2->force_aspect = video->force_aspect;
|
||||
ps2->vsync = video->vsync;
|
||||
ps2->clearVRAM = true;
|
||||
|
||||
if (input && input_data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
ps2input = input_ps2.init(settings->arrays.input_joypad_driver);
|
||||
*input = ps2input ? &input_ps2 : NULL;
|
||||
*input_data = ps2input;
|
||||
ps2input = input_ps2.init(
|
||||
settings->arrays.input_joypad_driver);
|
||||
*input = ps2input ? &input_ps2 : NULL;
|
||||
*input_data = ps2input;
|
||||
}
|
||||
|
||||
return ps2;
|
||||
@ -262,7 +292,8 @@ static bool ps2_gfx_frame(void *data, const void *frame,
|
||||
return false;
|
||||
|
||||
#if defined(DEBUG)
|
||||
if (frame_count%60==0) {
|
||||
if (frame_count%60==0)
|
||||
{
|
||||
printf("ps2_gfx_frame %lu\n", frame_count);
|
||||
}
|
||||
#endif
|
||||
@ -270,36 +301,44 @@ static bool ps2_gfx_frame(void *data, const void *frame,
|
||||
clearVRAMIfNeeded(ps2, frame, width, height);
|
||||
gsKit_clear(ps2->gsGlobal, GS_BLACK);
|
||||
|
||||
if (frame) {
|
||||
if (frame)
|
||||
{
|
||||
bool sendPalette = false;
|
||||
struct retro_hw_ps2_insets padding = empty_ps2_insets;
|
||||
if (frame != RETRO_HW_FRAME_BUFFER_VALID){ /* Checking if the transfer is done in the core */
|
||||
if (frame != RETRO_HW_FRAME_BUFFER_VALID)
|
||||
{
|
||||
/* Checking if the transfer is done in the core */
|
||||
/* calculate proper width based in the pitch */
|
||||
int bytes_per_pixel = (ps2->PSM == GS_PSM_CT32) ? 4 : 2;
|
||||
int real_width = pitch / bytes_per_pixel;
|
||||
int real_width = pitch / bytes_per_pixel;
|
||||
|
||||
transfer_texture(ps2->coreTexture, frame, real_width, height, ps2->PSM, ps2->core_filter, 1);
|
||||
padding.right = real_width - width;
|
||||
} else {
|
||||
sendPalette = ps2->iface.updatedPalette;
|
||||
|
||||
padding.right = real_width - width;
|
||||
}
|
||||
else
|
||||
{
|
||||
sendPalette = ps2->iface.updatedPalette;
|
||||
ps2->iface.updatedPalette = false;
|
||||
padding = ps2->iface.padding;
|
||||
if (ps2->iface.clearTexture) {
|
||||
if (ps2->iface.clearTexture)
|
||||
ps2->iface.clearTexture = false;
|
||||
}
|
||||
}
|
||||
if(ps2->clearVRAM) {
|
||||
|
||||
if(ps2->clearVRAM)
|
||||
vram_alloc(ps2->gsGlobal, ps2->coreTexture);
|
||||
}
|
||||
|
||||
ps2_texture_upload(ps2->gsGlobal, ps2->coreTexture, sendPalette);
|
||||
prim_texture(ps2->gsGlobal, ps2->coreTexture, 1, ps2->force_aspect, padding);
|
||||
}
|
||||
|
||||
if (ps2->menuVisible) {
|
||||
if (ps2->menuVisible)
|
||||
{
|
||||
bool texture_empty = !ps2->menuTexture->Width || !ps2->menuTexture->Height;
|
||||
if (!texture_empty) {
|
||||
if(ps2->clearVRAM) {
|
||||
if (!texture_empty)
|
||||
{
|
||||
if(ps2->clearVRAM)
|
||||
vram_alloc(ps2->gsGlobal, ps2->menuTexture);
|
||||
}
|
||||
gsKit_texture_upload(ps2->gsGlobal, ps2->menuTexture);
|
||||
prim_texture(ps2->gsGlobal, ps2->menuTexture, 2, ps2->fullscreen, empty_ps2_insets);
|
||||
}
|
||||
@ -330,30 +369,10 @@ static void ps2_gfx_set_nonblock_state(void *data, bool toggle)
|
||||
ps2->vsync = !toggle;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_alive(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_focus(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_suppress_screensaver(void *data, bool enable)
|
||||
{
|
||||
(void)data;
|
||||
(void)enable;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool ps2_gfx_has_windowed(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return true;
|
||||
}
|
||||
static bool ps2_gfx_alive(void *data) { return true; }
|
||||
static bool ps2_gfx_focus(void *data) { return true; }
|
||||
static bool ps2_gfx_suppress_screensaver(void *data, bool enable) { return false; }
|
||||
static bool ps2_gfx_has_windowed(void *data) { return false; }
|
||||
|
||||
static void ps2_gfx_free(void *data)
|
||||
{
|
||||
@ -376,14 +395,7 @@ static void ps2_gfx_free(void *data)
|
||||
}
|
||||
|
||||
static bool ps2_gfx_set_shader(void *data,
|
||||
enum rarch_shader_type type, const char *path)
|
||||
{
|
||||
(void)data;
|
||||
(void)type;
|
||||
(void)path;
|
||||
|
||||
return false;
|
||||
}
|
||||
enum rarch_shader_type type, const char *path) { return false; }
|
||||
|
||||
static void ps2_set_filtering(void *data, unsigned index, bool smooth)
|
||||
{
|
||||
@ -393,13 +405,13 @@ static void ps2_set_filtering(void *data, unsigned index, bool smooth)
|
||||
}
|
||||
|
||||
static void ps2_set_texture_frame(void *data, const void *frame, bool rgb32,
|
||||
unsigned width, unsigned height, float alpha)
|
||||
unsigned width, unsigned height, float alpha)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
|
||||
bool color_correction = false;
|
||||
int PSM = (rgb32 ? GS_PSM_CT32 : GS_PSM_CT16);
|
||||
bool texture_changed = texture_need_prepare(ps2->menuTexture, width, height, PSM);
|
||||
int PSM = (rgb32 ? GS_PSM_CT32 : GS_PSM_CT16);
|
||||
bool texture_changed = texture_need_prepare(ps2->menuTexture, width, height, PSM);
|
||||
|
||||
transfer_texture(ps2->menuTexture, frame, width, height, PSM, ps2->menu_filter, color_correction);
|
||||
ps2->clearVRAM = ps2->clearVRAM || texture_changed;
|
||||
@ -408,24 +420,27 @@ static void ps2_set_texture_frame(void *data, const void *frame, bool rgb32,
|
||||
static void ps2_set_texture_enable(void *data, bool enable, bool fullscreen)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
if (ps2->menuVisible != enable) {
|
||||
|
||||
if (ps2->menuVisible != enable)
|
||||
{
|
||||
/* If Menu change status, CLEAR VRAM */
|
||||
ps2->clearVRAM = true;
|
||||
ps2->iface.clearTexture = true;
|
||||
ps2->clearVRAM = true;
|
||||
ps2->iface.clearTexture = true;
|
||||
ps2->iface.updatedPalette = true;
|
||||
}
|
||||
ps2->menuVisible = enable;
|
||||
ps2->fullscreen = fullscreen;
|
||||
ps2->fullscreen = fullscreen;
|
||||
}
|
||||
|
||||
static bool ps2_get_hw_render_interface(void* data,
|
||||
const struct retro_hw_render_interface** iface)
|
||||
{
|
||||
ps2_video_t* ps2 = (ps2_video_t*)data;
|
||||
ps2->iface.clearTexture = ps2->clearVRAM;
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
ps2->iface.clearTexture = ps2->clearVRAM;
|
||||
ps2->iface.updatedPalette = true;
|
||||
ps2->iface.padding = empty_ps2_insets;
|
||||
*iface = (const struct retro_hw_render_interface*)&ps2->iface;
|
||||
ps2->iface.padding = empty_ps2_insets;
|
||||
*iface =
|
||||
(const struct retro_hw_render_interface*)&ps2->iface;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -580,7 +580,7 @@ static void switch_set_texture_frame(
|
||||
struct scaler_ctx *sctx = NULL;
|
||||
|
||||
if (sw->menu_texture.pixels)
|
||||
realloc(sw->menu_texture.pixels, sz);
|
||||
sw->menu_texture.pixels = realloc(sw->menu_texture.pixels, sz);
|
||||
else
|
||||
sw->menu_texture.pixels = malloc(sz);
|
||||
|
||||
|
@ -1118,7 +1118,7 @@ static void vulkan_init_readback(vk_t *vk)
|
||||
* not initialized yet.
|
||||
*/
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool recording_enabled = recording_is_enabled();
|
||||
bool recording_enabled = recording_is_enabled();
|
||||
vk->readback.streamed = settings->bools.video_gpu_record && recording_enabled;
|
||||
|
||||
if (!vk->readback.streamed)
|
||||
|
@ -47,10 +47,8 @@ void switch_ctx_destroy(void *data)
|
||||
}
|
||||
|
||||
static void switch_ctx_get_video_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
switch_ctx_data_t *ctx_nx = (switch_ctx_data_t *)data;
|
||||
|
||||
switch (appletGetOperationMode())
|
||||
{
|
||||
default:
|
||||
@ -305,7 +303,42 @@ bool switch_ctx_get_metrics(void *data,
|
||||
switch (type)
|
||||
{
|
||||
case DISPLAY_METRIC_DPI:
|
||||
*value = 236.87; /* FIXME: Don't hardcode this value */
|
||||
/* FIXME: DPI values should be obtained by querying
|
||||
* the hardware - these hard-coded values are a kludge */
|
||||
switch (appletGetOperationMode())
|
||||
{
|
||||
case AppletOperationMode_Docked:
|
||||
/* Docked mode
|
||||
* > Resolution: 1920x1080
|
||||
* > Screen Size: 39 inch
|
||||
* - Have to make an assumption here. We select
|
||||
* a 'default' screen size of 39 inches which
|
||||
* corresponds to the optimal diagonal screen
|
||||
* size for HD television as reported in:
|
||||
* "HDTV displays: subjective effects of scanning
|
||||
* standards and domestic picture sizes,"
|
||||
* N. E. Tanton and M. A. Stone,
|
||||
* BBC Research Department Report 1989/09,
|
||||
* January 1989
|
||||
* This agrees with the median recorded TV
|
||||
* size in:
|
||||
* "A Survey of UK Television Viewing Conditions,"
|
||||
* Katy C. Noland and Louise H. Truong,
|
||||
* BBC R&D White Paper WHP 287 January 2015
|
||||
* > DPI: sqrt((1920 * 1920) + (1080 * 1080)) / 39
|
||||
*/
|
||||
*value = 56.48480f;
|
||||
break;
|
||||
case AppletOperationMode_Handheld:
|
||||
default:
|
||||
/* Handheld mode
|
||||
* > Resolution: 1280x720
|
||||
* > Screen size: 6.2 inch
|
||||
* > DPI: sqrt((1280 * 1280) + (720 * 720)) / 6.2
|
||||
*/
|
||||
*value = 236.8717f;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
@ -46,7 +46,7 @@ static void *switch_font_init_font(void *data, const char *font_path,
|
||||
if (!font)
|
||||
return NULL;
|
||||
|
||||
if (!font_renderer_create_default((const void **)&font->font_driver,
|
||||
if (!font_renderer_create_default(&font->font_driver,
|
||||
&font->font_data, font_path, font_size))
|
||||
{
|
||||
RARCH_WARN("Couldn't initialize font renderer.\n");
|
||||
@ -250,73 +250,83 @@ static void switch_font_render_msg(
|
||||
void *data, const char *msg,
|
||||
const struct font_params *params)
|
||||
{
|
||||
float x, y, scale, drop_mod, drop_alpha;
|
||||
int drop_x, drop_y;
|
||||
unsigned max_glyphs;
|
||||
float x, y, scale;
|
||||
enum text_alignment text_align;
|
||||
unsigned color, color_dark, r, g, b,
|
||||
alpha, r_dark, g_dark, b_dark, alpha_dark;
|
||||
unsigned color, r, g, b, alpha;
|
||||
switch_font_t *font = (switch_font_t *)data;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
#if 0
|
||||
int drop_x, drop_y;
|
||||
float drop_mod, drop_alpha;
|
||||
unsigned max_glyphs;
|
||||
unsigned color_dark, r_dark, g_dark, b_dark, alpha_dark;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
#endif
|
||||
|
||||
if (!font || !msg || msg && !*msg)
|
||||
if (!font || !msg || (msg && !*msg))
|
||||
return;
|
||||
|
||||
if (params)
|
||||
{
|
||||
x = params->x;
|
||||
y = params->y;
|
||||
scale = params->scale;
|
||||
x = params->x;
|
||||
y = params->y;
|
||||
scale = params->scale;
|
||||
text_align = params->text_align;
|
||||
drop_x = params->drop_x;
|
||||
drop_y = params->drop_y;
|
||||
drop_mod = params->drop_mod;
|
||||
|
||||
#if 0
|
||||
drop_x = params->drop_x;
|
||||
drop_y = params->drop_y;
|
||||
drop_alpha = params->drop_alpha;
|
||||
drop_mod = params->drop_mod;
|
||||
#endif
|
||||
|
||||
r = FONT_COLOR_GET_RED(params->color);
|
||||
g = FONT_COLOR_GET_GREEN(params->color);
|
||||
b = FONT_COLOR_GET_BLUE(params->color);
|
||||
alpha = FONT_COLOR_GET_ALPHA(params->color);
|
||||
r = FONT_COLOR_GET_RED(params->color);
|
||||
g = FONT_COLOR_GET_GREEN(params->color);
|
||||
b = FONT_COLOR_GET_BLUE(params->color);
|
||||
alpha = FONT_COLOR_GET_ALPHA(params->color);
|
||||
|
||||
color = params->color;
|
||||
color = params->color;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = 0.0f;
|
||||
y = 0.0f;
|
||||
scale = 1.0f;
|
||||
x = 0.0f;
|
||||
y = 0.0f;
|
||||
scale = 1.0f;
|
||||
text_align = TEXT_ALIGN_LEFT;
|
||||
|
||||
r = (video_info->font_msg_color_r * 255);
|
||||
g = (video_info->font_msg_color_g * 255);
|
||||
b = (video_info->font_msg_color_b * 255);
|
||||
alpha = 255;
|
||||
color = COLOR_ABGR(r, g, b, alpha);
|
||||
r = (video_info->font_msg_color_r * 255);
|
||||
g = (video_info->font_msg_color_g * 255);
|
||||
b = (video_info->font_msg_color_b * 255);
|
||||
alpha = 255;
|
||||
color = COLOR_ABGR(r, g, b, alpha);
|
||||
|
||||
drop_x = -2;
|
||||
drop_y = -2;
|
||||
drop_mod = 0.3f;
|
||||
#if 0
|
||||
drop_x = -2;
|
||||
drop_y = -2;
|
||||
drop_mod = 0.3f;
|
||||
drop_alpha = 1.0f;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
max_glyphs = strlen(msg);
|
||||
|
||||
/*if (drop_x || drop_y)
|
||||
max_glyphs *= 2;
|
||||
if (drop_x || drop_y)
|
||||
max_glyphs *= 2;
|
||||
|
||||
if (drop_x || drop_y)
|
||||
{
|
||||
r_dark = r * drop_mod;
|
||||
g_dark = g * drop_mod;
|
||||
b_dark = b * drop_mod;
|
||||
alpha_dark = alpha * drop_alpha;
|
||||
color_dark = COLOR_ABGR(r_dark, g_dark, b_dark, alpha_dark);
|
||||
if (drop_x || drop_y)
|
||||
{
|
||||
r_dark = r * drop_mod;
|
||||
g_dark = g * drop_mod;
|
||||
b_dark = b * drop_mod;
|
||||
alpha_dark = alpha * drop_alpha;
|
||||
color_dark = COLOR_ABGR(r_dark, g_dark, b_dark, alpha_dark);
|
||||
|
||||
switch_font_render_message(video_info, font, msg, scale, color_dark,
|
||||
x + scale * drop_x / width, y +
|
||||
scale * drop_y / height, text_align);
|
||||
}*/
|
||||
switch_font_render_message(video_info, font, msg, scale, color_dark,
|
||||
x + scale * drop_x / width, y +
|
||||
scale * drop_y / height, text_align);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch_font_render_message(video_info, font, msg, scale,
|
||||
color, x, y, text_align);
|
||||
|
@ -304,23 +304,9 @@ static const char *font_renderer_ft_get_default_font(void)
|
||||
return "";
|
||||
#else
|
||||
size_t i;
|
||||
#if 0
|
||||
char asset_path[PATH_MAX_LENGTH];
|
||||
#endif
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(font_paths); i++)
|
||||
{
|
||||
#if 0
|
||||
/* Check if we are getting the font from the assets directory. */
|
||||
if (string_is_equal(font_paths[i], "assets://pkg/osd-font.ttf"))
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
fill_pathname_join(asset_path,
|
||||
settings->paths.directory_assets, "pkg/osd-font.ttf", PATH_MAX_LENGTH);
|
||||
font_paths[i] = asset_path;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (path_is_valid(font_paths[i]))
|
||||
return font_paths[i];
|
||||
}
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "../common/d3d_common.h"
|
||||
#include "../drivers/d3d_shaders/opaque.cg.d3d9.h"
|
||||
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
|
||||
#include "../video_shader_parse.h"
|
||||
#include "../../managers/state_manager.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
|
@ -1159,13 +1159,15 @@ void font_driver_init_osd(
|
||||
bool is_threaded,
|
||||
enum font_driver_render_api api)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *path_font = settings->paths.path_font;
|
||||
float video_font_size = settings->floats.video_font_size;
|
||||
if (video_font_driver)
|
||||
return;
|
||||
|
||||
video_font_driver = font_driver_init_first(video_data,
|
||||
*settings->paths.path_font ? settings->paths.path_font : NULL,
|
||||
settings->floats.video_font_size, threading_hint, is_threaded, api);
|
||||
*path_font ? path_font : NULL,
|
||||
video_font_size, threading_hint, is_threaded, api);
|
||||
|
||||
if (!video_font_driver)
|
||||
RARCH_ERR("[font]: Failed to initialize OSD font.\n");
|
||||
|
@ -583,6 +583,7 @@ bool video_shader_resolve_parameters(config_file_t *conf,
|
||||
* See: video_shader_read_preset
|
||||
**/
|
||||
bool video_shader_write_preset(const char *path,
|
||||
const char *shader_dir,
|
||||
const struct video_shader *shader, bool reference)
|
||||
{
|
||||
/* We need to clean up paths to be able to properly process them
|
||||
@ -596,7 +597,7 @@ bool video_shader_write_preset(const char *path,
|
||||
|
||||
fill_pathname_join(
|
||||
preset_dir,
|
||||
config_get_ptr()->paths.directory_video_shader,
|
||||
shader_dir,
|
||||
"presets",
|
||||
sizeof(preset_dir));
|
||||
|
||||
|
@ -170,6 +170,7 @@ struct video_shader
|
||||
* See: video_shader_read_preset
|
||||
**/
|
||||
bool video_shader_write_preset(const char *path,
|
||||
const char *shader_dir,
|
||||
const struct video_shader *shader, bool reference);
|
||||
|
||||
/**
|
||||
|
@ -1379,10 +1379,6 @@ MENU
|
||||
#include "../libretro-common/net/net_http_parse.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RUNAHEAD
|
||||
#include "../runahead/mylist.c"
|
||||
#endif
|
||||
|
||||
/*============================================================
|
||||
DEPENDENCIES
|
||||
============================================================ */
|
||||
|
@ -963,6 +963,8 @@ static bool switch_input_set_sensor_state(void *data, unsigned port,
|
||||
sw->sixaxis_handles_count[port] = handles_count;
|
||||
}
|
||||
return true;
|
||||
case RETRO_SENSOR_DUMMY:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -63,7 +63,7 @@ bool input_remapping_load_file(void *data, const char *path)
|
||||
"l3", "r3", "l_x+", "l_x-", "l_y+", "l_y-", "r_x+", "r_x-", "r_y+", "r_y-" };
|
||||
|
||||
old_analog_dpad_mode[i] = settings->uints.input_analog_dpad_mode[i];
|
||||
old_libretro_device[i] = settings->uints.input_libretro_device[i];
|
||||
old_libretro_device[i] = settings->uints.input_libretro_device[i];
|
||||
|
||||
s1[0] = '\0';
|
||||
s2[0] = '\0';
|
||||
@ -243,19 +243,16 @@ bool input_remapping_save_file(const char *path)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool input_remapping_remove_file(const char *path)
|
||||
bool input_remapping_remove_file(const char *path,
|
||||
const char *dir_input_remapping)
|
||||
{
|
||||
bool ret = false;
|
||||
size_t path_size = PATH_MAX_LENGTH * sizeof(char);
|
||||
char *buf = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
char *remap_file = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
buf[0] = remap_file[0] = '\0';
|
||||
|
||||
fill_pathname_join(buf, settings->paths.directory_input_remapping,
|
||||
path, path_size);
|
||||
buf[0] = remap_file[0] = '\0';
|
||||
|
||||
fill_pathname_join(buf, dir_input_remapping, path, path_size);
|
||||
fill_pathname_noext(remap_file, buf, ".rmp", path_size);
|
||||
|
||||
ret = filestream_delete(remap_file) == 0 ? true : false;
|
||||
|
@ -45,7 +45,8 @@ bool input_remapping_load_file(void *data, const char *path);
|
||||
**/
|
||||
bool input_remapping_save_file(const char *path);
|
||||
|
||||
bool input_remapping_remove_file(const char *path);
|
||||
bool input_remapping_remove_file(const char *path,
|
||||
const char *dir_input_remapping);
|
||||
|
||||
void input_remapping_set_defaults(bool deinit);
|
||||
|
||||
|
@ -1620,6 +1620,20 @@ int menu_hash_get_help_fr_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
"Les nombres sont décrits en images."
|
||||
);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_INPUT_TURBO_MODE:
|
||||
snprintf(s, len,
|
||||
"Mode turbo.\n"
|
||||
" \n"
|
||||
"Sélectionne le comportement général du mode turbo."
|
||||
);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_INPUT_TURBO_DEFAULT_BUTTON:
|
||||
snprintf(s, len,
|
||||
"Touche turbo par défaut.\n"
|
||||
" \n"
|
||||
"Touche active par défaut pour le mode turbo 'Touche unique'.\n"
|
||||
);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_INPUT_DUTY_CYCLE:
|
||||
snprintf(s, len,
|
||||
"Cycle de répétition des touches.\n"
|
||||
@ -1960,7 +1974,7 @@ int menu_hash_get_help_fr_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
" \n"
|
||||
"Maintenir le turbo tout en appuyant sur une \n"
|
||||
"autre touche permet à la touche d'entrer dans \n"
|
||||
"un mode turbo où l'état du bouton est modulé \n"
|
||||
"un mode turbo où son état est modulé \n"
|
||||
"avec un signal périodique. \n"
|
||||
" \n"
|
||||
"La modulation s'arrête lorsque la touche \n"
|
||||
|
@ -42,10 +42,6 @@ MSG_HASH(
|
||||
MSG_UNKNOWN_COMPILER,
|
||||
"Compilateur inconnu"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_NATIVE,
|
||||
"Native"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_DEVICE_DISCONNECTED_FROM_PORT,
|
||||
"Périphérique déconnecté du port"
|
||||
@ -292,7 +288,7 @@ MSG_HASH(
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_NETPLAY_TAB,
|
||||
"Salons de jeu en réseau"
|
||||
"Jeu en réseau"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_ASK_ARCHIVE,
|
||||
@ -808,13 +804,45 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS,
|
||||
"Dossiers"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISK_TRAY_EJECT,
|
||||
"Éjecter le disque"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_DISK_TRAY_EJECT,
|
||||
"Ouvre le plateau du lecteur de disque virtuel et retire le disque actuellement chargé. REMARQUE : Si RetroArch est configuré pour se mettre en pause lorsque le menu est actif, certains cœurs peuvent ne pas enregistrer les modifications à moins que le contenu ne soit repris pendant quelques secondes après chaque action liée au contrôle du disque."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISK_TRAY_INSERT,
|
||||
"Insérer le disque"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_DISK_TRAY_INSERT,
|
||||
"Insère le disque correspondant au 'Numéro du disque actuel' et ferme le plateau du lecteur de disque virtuel. REMARQUE : Si RetroArch est configuré pour se mettre en pause lorsque le menu est actif, certains cœurs peuvent ne pas enregistrer les modifications à moins que le contenu ne soit repris pendant quelques secondes après chaque action liée au contrôle du disque."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISK_INDEX,
|
||||
"Numéro du disque"
|
||||
"Numéro du disque actuel"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_DISK_INDEX,
|
||||
"Sélectionne le disque actuel dans la liste des images disponibles. Le disque sera chargé si 'Insérer le disque' est sélectionné."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISK_IMAGE_APPEND,
|
||||
"Charger un nouveau disque"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_DISK_IMAGE_APPEND,
|
||||
"Éjecte le disque actuel, sélectionne un nouveau disque dans le système de fichiers, puis l'insère et ferme le plateau du lecteur de disque virtuel. REMARQUE : C'est une fonctionnalité obsolète. Il est plutôt recommandé de charger des titres multi-disques via des listes de lecture M3U, qui permettent la sélection du disque en utilisant les options 'Éjecter/Insérer le disque' et 'Numéro du disque actuel'."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISK_OPTIONS,
|
||||
"Contrôle de disque"
|
||||
"Contrôle du disque"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_NO_DISK,
|
||||
"Aucun disque sélectionné"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DONT_CARE,
|
||||
@ -880,6 +908,10 @@ MSG_HASH(
|
||||
MSG_ALL_CORES_UPDATED,
|
||||
"Tous les cœurs installés sont à jour"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_NUM_CORES_UPDATED,
|
||||
"cœurs mis à jour : "
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_SCALE_FACTOR,
|
||||
"Facteur de mise à l'échelle du menu"
|
||||
@ -1565,6 +1597,14 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_TURBO_PERIOD,
|
||||
"Délai d'activation du turbo "
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_TURBO_MODE,
|
||||
"Mode turbo"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_TURBO_DEFAULT_BUTTON,
|
||||
"Touche turbo par défaut"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_USER_BINDS,
|
||||
"Touches du port %u"
|
||||
@ -2159,6 +2199,14 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_NETWORK_ON_DEMAND_THUMBNAILS,
|
||||
"Télécharge automatiquement les miniatures manquantes lors de la navigation dans les listes de lecture. Affecte grandement les performances."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_NETWORK_HOSTING_SETTINGS,
|
||||
"Hôte"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_SUBSYSTEM_SETTINGS,
|
||||
"Sous-systèmes"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_NETWORK_SETTINGS,
|
||||
"Réseau"
|
||||
@ -2365,7 +2413,15 @@ MSG_HASH(
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MENU_SAVESTATE_RESUME,
|
||||
"Ferme le menu automatiquement et reprends le contenu actuel après la sélection de 'Sauvegarde instantanée' ou 'Charger une sauvegarde instantanée' depuis le menu rapide. Désactiver cette option peut améliorer les performances de sauvegarde instantanée sur des appareils très lents."
|
||||
"Ferme automatiquement le menu et reprends le contenu actuel après la sélection de 'Sauvegarde instantanée' ou 'Charger une sauvegarde instantanée' depuis le menu rapide. Désactiver cette option peut améliorer les performances de sauvegarde instantanée sur des appareils très lents."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_INSERT_DISK_RESUME,
|
||||
"Reprendre le contenu après le changement du disque"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MENU_INSERT_DISK_RESUME,
|
||||
"Ferme automatiquement le menu et reprends le contenu actuel après la sélection de 'Insérer le disque' ou 'Charger un nouveau disque' depuis le menu de contrôle du disque."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PAUSE_NONACTIVE,
|
||||
@ -2459,6 +2515,22 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_THUMBNAIL_MODE_DEFAULT,
|
||||
"Par défaut du système"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_CLEAN_PLAYLIST,
|
||||
"Nettoyer la liste de lecture"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_CLEAN_PLAYLIST,
|
||||
"Supprime les entrées invalides/en double et valide les associations aux cœurs."
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_PLAYLIST_MANAGER_CLEANING_PLAYLIST,
|
||||
"Nettoyage de la liste de lecture : "
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_PLAYLIST_MANAGER_PLAYLIST_CLEANED,
|
||||
"Liste de lecture nettoyée : "
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_POINTER_ENABLE,
|
||||
"Prise en charge du tactile"
|
||||
@ -2638,6 +2710,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CONTENT_INFO_LAST_PLAYED,
|
||||
"Dernière partie"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CONTENT_INFO_CHEEVOS_HASH,
|
||||
"Empreinte RetroSuccès"
|
||||
)
|
||||
#ifdef HAVE_LAKKA_SWITCH
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_REBOOT,
|
||||
@ -4727,6 +4803,10 @@ MSG_HASH(
|
||||
MSG_APPENDED_DISK,
|
||||
"Disque ajouté"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_FAILED_TO_APPEND_DISK,
|
||||
"Échec de l'ajout du disque"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_APPLICATION_DIR,
|
||||
"Dossier de l'application"
|
||||
@ -5539,6 +5619,14 @@ MSG_HASH(
|
||||
MSG_VIRTUAL_DISK_TRAY,
|
||||
"Lecteur de disque virtuel."
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_VIRTUAL_DISK_TRAY_EJECT,
|
||||
"éjecter"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_VIRTUAL_DISK_TRAY_CLOSE,
|
||||
"fermer"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_AUDIO_LATENCY,
|
||||
"Latence audio désirée en millisecondes. Peut être ignorée si le pilote audio ne peut fournir une telle valeur."
|
||||
@ -5611,6 +5699,14 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_INPUT_DUTY_CYCLE,
|
||||
"Décrit la durée après laquelle une touche en mode turbo se répète. Les nombres sont décrits en images."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_INPUT_TURBO_MODE,
|
||||
"Sélectionne le comportement général du mode turbo."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_INPUT_TURBO_DEFAULT_BUTTON,
|
||||
"Touche active par défaut pour le mode turbo 'Touche unique'."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_VIDEO_VSYNC,
|
||||
"Synchronise la sortie vidéo de la carte graphique avec la fréquence de rafraîchissement de l'écran. Recommandé."
|
||||
@ -7630,10 +7726,6 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_RGUI_PARTICLE_EFFECT_SPEED,
|
||||
"Vitesse de l'animation en arrière-plan"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MENU_RGUI_PARTICLE_EFFECT_SPEED,
|
||||
"Adjust speed of background particle animation effects."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_RGUI_EXTENDED_ASCII,
|
||||
"Prise en charge de l'ASCII étendu"
|
||||
@ -8173,10 +8265,6 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CHEAT_BROWSE_MEMORY,
|
||||
"Parcourir l'adresse : %08X"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CHEAT_DESC,
|
||||
"Description"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CHEAT_STATE,
|
||||
"Activé"
|
||||
@ -8377,70 +8465,6 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_CHEAT_MEMORY_SIZE_32,
|
||||
"32-bit, valeur max = 0xFFFFFFFF"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_0,
|
||||
"1"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_1,
|
||||
"2"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_2,
|
||||
"3"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_3,
|
||||
"4"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_4,
|
||||
"5"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_5,
|
||||
"6"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_6,
|
||||
"7"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_7,
|
||||
"8"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_8,
|
||||
"9"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_9,
|
||||
"10"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_10,
|
||||
"11"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_11,
|
||||
"12"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_12,
|
||||
"13"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_13,
|
||||
"14"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_14,
|
||||
"15"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_15,
|
||||
"16"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_RUMBLE_PORT_16,
|
||||
"Tous"
|
||||
@ -8677,10 +8701,6 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_QT_CONFIRM_DELETE_PLAYLIST,
|
||||
"Êtes-vous sûr de vouloir supprimer la liste de lecture \"%1\"?"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_QT_QUESTION,
|
||||
"Question"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_DELETE_FILE,
|
||||
"Impossible de supprimer le fichier."
|
||||
@ -8899,7 +8919,11 @@ MSG_HASH(
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_FAILED_TO_SET_DISK,
|
||||
"Impossible de paramétrer le disque"
|
||||
"Impossible de sélectionner le disque"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_FAILED_TO_SET_INITIAL_DISK,
|
||||
"Impossible de sélectionner le dernier disque utilisé..."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_QT_CORE_OPTIONS,
|
||||
@ -10026,6 +10050,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DELETE_PLAYLIST,
|
||||
"Supprimer la liste de lecture"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_DELETE_PLAYLIST,
|
||||
"Supprime la liste de lecture du système de fichiers."
|
||||
)
|
||||
#ifdef HAVE_LAKKA
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LOCALAP_ENABLE,
|
||||
|
@ -3810,34 +3810,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_AZERBAIJANI,
|
||||
"Azerbaijani"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_ALBANIAN,
|
||||
"Albanese"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_AFRIKAANS,
|
||||
"Afrikaans"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_ESTONIAN,
|
||||
"Estone"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_FILIPINO,
|
||||
"Filippino"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_FINNISH,
|
||||
"Finnish"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_GALICIAN,
|
||||
"Galician"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_GEORGIAN,
|
||||
"Georgian"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_GUJARATI,
|
||||
"Gujarati"
|
||||
@ -3858,18 +3834,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_HUNGARIAN,
|
||||
"Ungherese"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_ICELANDIC,
|
||||
"Icelandic"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_INDONESIAN,
|
||||
"Indonesiano"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_IRISH,
|
||||
"Irish"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_KANNADA,
|
||||
"Kannada"
|
||||
@ -3946,14 +3914,6 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_URDU,
|
||||
"Urdu"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_WELSH,
|
||||
"Welsh"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_LANG_YIDDISH,
|
||||
"Yiddish"
|
||||
)
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_LOAD_DISC,
|
||||
"Carica un disco fisico multimediale. Dovresti prima selezionare il core (Carica Core) che intendi utilizzare con il disco.")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_DUMP_DISC,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -502,6 +502,10 @@ MSG_HASH(MENU_ENUM_LABEL_CONTENT_DIR,
|
||||
"content_directory")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MENU_SCALE_FACTOR,
|
||||
"menu_scale_factor")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MENU_WIDGET_SCALE_AUTO,
|
||||
"menu_widget_scale_auto")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MENU_WIDGET_SCALE_FACTOR,
|
||||
"menu_widget_scale_factor")
|
||||
MSG_HASH(MENU_ENUM_LABEL_DRIVER_SETTINGS,
|
||||
"driver_settings")
|
||||
MSG_HASH(MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE,
|
||||
|
@ -814,7 +814,7 @@ MSG_HASH(
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_DISK_TRAY_EJECT,
|
||||
"Opens virtual disk try and removes currently loaded disk. NOTE: If RetroArch is configured to pause while menu is active, some cores may not register changes unless content is resumed for a few seconds after each disk control action."
|
||||
"Opens virtual disk tray and removes currently loaded disk. NOTE: If RetroArch is configured to pause while menu is active, some cores may not register changes unless content is resumed for a few seconds after each disk control action."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DISK_TRAY_INSERT,
|
||||
@ -924,6 +924,22 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MENU_SCALE_FACTOR,
|
||||
"Applies a global scaling factor when drawing the menu. Can be used to increase or decrease the size of the user interface."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_WIDGET_SCALE_AUTO,
|
||||
"Auto Scale Menu Widgets"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MENU_WIDGET_SCALE_AUTO,
|
||||
"Automatically resize decorated notifications, indicators and controls based on current menu scale."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_WIDGET_SCALE_FACTOR,
|
||||
"Menu Widget Scale Override"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_MENU_WIDGET_SCALE_FACTOR,
|
||||
"Applies a manual scaling factor override when drawing menu widgets. Only applies when 'Auto Scale Menu Widgets' is disabled. Can be used to increase or decrease the size of decorated notifications, indicators and controls independently from the menu itself."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS,
|
||||
"Drivers"
|
||||
|
@ -320,10 +320,6 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CLOSE_CONTENT,
|
||||
"Đóng nội dung"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CONFIG,
|
||||
"Config"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CONFIGURATIONS,
|
||||
"Tải cấu hình"
|
||||
@ -437,8 +433,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS,
|
||||
"Trình điều khiển")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DUMMY_ON_CORE_SHUTDOWN,
|
||||
"Tải Core giả khi tắt máy")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CHECK_FOR_MISSING_FIRMWARE,
|
||||
"Check for Missing Firmware Before Loading")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPER,
|
||||
"Nền năng động")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY,
|
||||
@ -556,8 +550,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_APPLY_CHANGES,
|
||||
"Áp dụng Changes")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SHOW_ADVANCED_SETTINGS,
|
||||
"Show Advanced thiết lập")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SHOW_HIDDEN_FILES,
|
||||
"Show Hidden Files and Folders")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_SHUTDOWN,
|
||||
"Tắt Máy")
|
||||
#ifdef HAVE_LAKKA
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "led_driver.h"
|
||||
#include "../configuration.h"
|
||||
#include "../verbosity.h"
|
||||
|
||||
static const led_driver_t *current_led_driver = NULL;
|
||||
@ -32,43 +31,40 @@ static const led_driver_t null_led_driver = {
|
||||
"null"
|
||||
};
|
||||
|
||||
bool led_driver_init(void)
|
||||
void led_driver_init(const char *led_driver)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
char *drivername = settings ? settings->arrays.led_driver : NULL;
|
||||
const char *drivername = led_driver;
|
||||
|
||||
if(!drivername)
|
||||
drivername = (char*)"null";
|
||||
if (!drivername)
|
||||
drivername = (const char*)"null";
|
||||
|
||||
current_led_driver = &null_led_driver;
|
||||
current_led_driver = &null_led_driver;
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
if(string_is_equal("overlay", drivername))
|
||||
current_led_driver = &overlay_led_driver;
|
||||
if (string_is_equal("overlay", drivername))
|
||||
current_led_driver = &overlay_led_driver;
|
||||
#endif
|
||||
|
||||
#if HAVE_RPILED
|
||||
if(string_is_equal("rpi", drivername))
|
||||
current_led_driver = &rpi_led_driver;
|
||||
if (string_is_equal("rpi", drivername))
|
||||
current_led_driver = &rpi_led_driver;
|
||||
#endif
|
||||
|
||||
RARCH_LOG("[LED]: LED driver = '%s' %p\n",
|
||||
drivername, current_led_driver);
|
||||
|
||||
if(current_led_driver)
|
||||
if (current_led_driver)
|
||||
(*current_led_driver->init)();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_driver_free(void)
|
||||
{
|
||||
if(current_led_driver)
|
||||
if (current_led_driver)
|
||||
(*current_led_driver->free)();
|
||||
}
|
||||
|
||||
void led_driver_set_led(int led, int value)
|
||||
{
|
||||
if(current_led_driver)
|
||||
if (current_led_driver)
|
||||
(*current_led_driver->set_led)(led, value);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ typedef struct led_driver
|
||||
const char *ident;
|
||||
} led_driver_t;
|
||||
|
||||
bool led_driver_init(void);
|
||||
void led_driver_init(const char *led_driver);
|
||||
|
||||
void led_driver_free(void);
|
||||
|
||||
|
@ -59,7 +59,8 @@ enum string_list_type
|
||||
};
|
||||
|
||||
struct string_list *dir_list_new_special(const char *input_dir,
|
||||
enum dir_list_type type, const char *filter);
|
||||
enum dir_list_type type, const char *filter,
|
||||
bool show_hidden_files);
|
||||
|
||||
struct string_list *string_list_new_special(enum string_list_type type,
|
||||
void *data, unsigned *len, size_t *list_size);
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "../dynamic.h"
|
||||
#include "../core.h"
|
||||
#include "../verbosity.h"
|
||||
#include "../configuration.h"
|
||||
|
||||
cheat_manager_t cheat_manager_state;
|
||||
|
||||
@ -579,19 +578,16 @@ void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx)
|
||||
RARCH_LOG("%s\n", msg);
|
||||
}
|
||||
|
||||
void cheat_manager_toggle_index(unsigned i)
|
||||
void cheat_manager_toggle_index(bool apply_cheats_after_toggle,
|
||||
unsigned i)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!cheat_manager_state.cheats || cheat_manager_state.size == 0)
|
||||
return;
|
||||
|
||||
cheat_manager_state.cheats[i].state = !cheat_manager_state.cheats[i].state;
|
||||
cheat_manager_update(&cheat_manager_state, i);
|
||||
|
||||
if (!settings)
|
||||
return;
|
||||
|
||||
if (settings->bools.apply_cheats_after_toggle)
|
||||
if (apply_cheats_after_toggle)
|
||||
cheat_manager_apply_cheats();
|
||||
}
|
||||
|
||||
@ -650,27 +646,24 @@ bool cheat_manager_get_code_state(unsigned i)
|
||||
|
||||
static bool cheat_manager_get_game_specific_filename(
|
||||
char *s, size_t len,
|
||||
const char *path_cheat_database,
|
||||
bool saving)
|
||||
{
|
||||
char s1[PATH_MAX_LENGTH];
|
||||
struct retro_system_info system_info;
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
const char *core_name = NULL;
|
||||
const char *game_name = NULL;
|
||||
|
||||
s1[0] = '\0';
|
||||
|
||||
if (!settings || !global)
|
||||
return false;
|
||||
|
||||
if (!core_get_system_info(&system_info))
|
||||
if (!global || !core_get_system_info(&system_info))
|
||||
return false;
|
||||
|
||||
core_name = system_info.library_name;
|
||||
game_name = path_basename(global->name.cheatfile);
|
||||
|
||||
if (string_is_empty(settings->paths.path_cheat_database) ||
|
||||
if (string_is_empty(path_cheat_database) ||
|
||||
string_is_empty(core_name) ||
|
||||
string_is_empty(game_name))
|
||||
return false;
|
||||
@ -678,7 +671,7 @@ static bool cheat_manager_get_game_specific_filename(
|
||||
s[0] = '\0';
|
||||
|
||||
fill_pathname_join(s1,
|
||||
settings->paths.path_cheat_database, core_name,
|
||||
path_cheat_database, core_name,
|
||||
sizeof(s1));
|
||||
|
||||
if (saving)
|
||||
@ -693,24 +686,28 @@ static bool cheat_manager_get_game_specific_filename(
|
||||
return true;
|
||||
}
|
||||
|
||||
void cheat_manager_load_game_specific_cheats(void)
|
||||
void cheat_manager_load_game_specific_cheats(const char *path_cheat_database)
|
||||
{
|
||||
char cheat_file[PATH_MAX_LENGTH];
|
||||
|
||||
if (cheat_manager_get_game_specific_filename(
|
||||
cheat_file, sizeof(cheat_file), false))
|
||||
cheat_file, sizeof(cheat_file),
|
||||
path_cheat_database,
|
||||
false))
|
||||
{
|
||||
RARCH_LOG("[Cheats]: Load game-specific cheatfile: %s\n", cheat_file);
|
||||
cheat_manager_load(cheat_file, true);
|
||||
}
|
||||
}
|
||||
|
||||
void cheat_manager_save_game_specific_cheats(void)
|
||||
void cheat_manager_save_game_specific_cheats(const char *path_cheat_database)
|
||||
{
|
||||
char cheat_file[PATH_MAX_LENGTH];
|
||||
|
||||
if (cheat_manager_get_game_specific_filename(
|
||||
cheat_file, sizeof(cheat_file), true))
|
||||
cheat_file, sizeof(cheat_file),
|
||||
path_cheat_database,
|
||||
true))
|
||||
{
|
||||
RARCH_LOG("[Cheats]: Save game-specific cheatfile: %s\n", cheat_file);
|
||||
cheat_manager_save(cheat_file, NULL, true);
|
||||
|
@ -217,7 +217,8 @@ void cheat_manager_apply_cheats(void);
|
||||
|
||||
void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx);
|
||||
|
||||
void cheat_manager_toggle_index(unsigned i);
|
||||
void cheat_manager_toggle_index(bool apply_cheats_after_toggle,
|
||||
unsigned i);
|
||||
|
||||
unsigned cheat_manager_get_buf_size(void);
|
||||
|
||||
@ -235,9 +236,9 @@ bool cheat_manager_copy_idx_to_working(unsigned idx);
|
||||
|
||||
bool cheat_manager_copy_working_to_idx(unsigned idx);
|
||||
|
||||
void cheat_manager_load_game_specific_cheats(void);
|
||||
void cheat_manager_load_game_specific_cheats(const char *path_cheat_database);
|
||||
|
||||
void cheat_manager_save_game_specific_cheats(void);
|
||||
void cheat_manager_save_game_specific_cheats(const char *path_cheat_database);
|
||||
|
||||
int cheat_manager_initialize_memory(rarch_setting_t *setting, bool wraparound);
|
||||
|
||||
|
@ -548,7 +548,7 @@ bool manual_content_scan_get_menu_core_name(const char **core_name)
|
||||
* > Returns NULL in the event of failure
|
||||
* > Returned string list must be free()'d */
|
||||
struct string_list *manual_content_scan_get_menu_system_name_list(
|
||||
const char *path_content_database)
|
||||
const char *path_content_database, bool show_hidden_files)
|
||||
{
|
||||
union string_list_elem_attr attr;
|
||||
struct string_list *name_list = string_list_new();
|
||||
@ -579,7 +579,7 @@ struct string_list *manual_content_scan_get_menu_system_name_list(
|
||||
* or verify file extensions) */
|
||||
struct string_list *rdb_list = dir_list_new_special(
|
||||
path_content_database,
|
||||
DIR_LIST_DATABASES, NULL);
|
||||
DIR_LIST_DATABASES, NULL, show_hidden_files);
|
||||
|
||||
if (rdb_list && rdb_list->size)
|
||||
{
|
||||
|
@ -195,7 +195,7 @@ bool manual_content_scan_get_menu_core_name(const char **core_name);
|
||||
* > Returns NULL in the event of failure
|
||||
* > Returned string list must be free()'d */
|
||||
struct string_list *manual_content_scan_get_menu_system_name_list(
|
||||
const char *path_content_database);
|
||||
const char *path_content_database, bool show_hidden_files);
|
||||
|
||||
/* Creates a list of all possible 'core name' menu
|
||||
* strings, for use in 'menu_displaylist' drop-down
|
||||
|
@ -524,13 +524,13 @@ static int playlist_left_thumbnail_mode_left(unsigned type, const char *label,
|
||||
static int manual_content_scan_system_name_left(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
settings_t *settings = config_get_ptr();
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database);
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database, settings->bools.show_hidden_files);
|
||||
#else
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(NULL);
|
||||
manual_content_scan_get_menu_system_name_list(NULL, settings->bools.show_hidden_files);
|
||||
#endif
|
||||
const char *current_system_name = NULL;
|
||||
enum manual_content_scan_system_name_type next_system_name_type =
|
||||
|
@ -2731,6 +2731,7 @@ static void menu_input_st_string_cb_save_preset(void *userdata,
|
||||
if (!string_is_empty(str))
|
||||
{
|
||||
rarch_setting_t *setting = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool ret = false;
|
||||
const char *label = menu_input_dialog_get_label_buffer();
|
||||
|
||||
@ -2744,7 +2745,10 @@ static void menu_input_st_string_cb_save_preset(void *userdata,
|
||||
}
|
||||
else if (!string_is_empty(label))
|
||||
ret = menu_shader_manager_save_preset(menu_shader_get(),
|
||||
str, true);
|
||||
str,
|
||||
settings->paths.directory_video_shader,
|
||||
settings->paths.directory_menu_config,
|
||||
true);
|
||||
|
||||
if (ret)
|
||||
runloop_msg_queue_push(
|
||||
@ -2849,6 +2853,8 @@ static int generic_action_ok_shader_preset_remove(const char *path,
|
||||
unsigned action_type)
|
||||
{
|
||||
enum auto_shader_type preset_type;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
switch (action_type)
|
||||
{
|
||||
case ACTION_OK_SHADER_PRESET_REMOVE_GLOBAL:
|
||||
@ -2867,7 +2873,9 @@ static int generic_action_ok_shader_preset_remove(const char *path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (menu_shader_manager_remove_auto_preset(preset_type))
|
||||
if (menu_shader_manager_remove_auto_preset(preset_type,
|
||||
settings->paths.directory_video_shader,
|
||||
settings->paths.directory_menu_config))
|
||||
{
|
||||
bool refresh = false;
|
||||
|
||||
@ -2892,6 +2900,8 @@ static int generic_action_ok_shader_preset_save(const char *path,
|
||||
unsigned action_type)
|
||||
{
|
||||
enum auto_shader_type preset_type;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
switch (action_type)
|
||||
{
|
||||
case ACTION_OK_SHADER_PRESET_SAVE_GLOBAL:
|
||||
@ -2910,7 +2920,10 @@ static int generic_action_ok_shader_preset_save(const char *path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (menu_shader_manager_save_auto_preset(menu_shader_get(), preset_type, true))
|
||||
if (menu_shader_manager_save_auto_preset(menu_shader_get(), preset_type,
|
||||
settings->paths.directory_video_shader,
|
||||
settings->paths.directory_menu_config,
|
||||
true))
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY),
|
||||
1, 100, true,
|
||||
@ -3061,7 +3074,9 @@ static int generic_action_ok_remap_file_operation(const char *path,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (input_remapping_remove_file(file))
|
||||
if (input_remapping_remove_file(file,
|
||||
settings->paths.directory_input_remapping
|
||||
))
|
||||
{
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
switch (action_type)
|
||||
@ -3276,18 +3291,18 @@ static int action_ok_deferred_list_stub(const char *path,
|
||||
static int action_ok_set_switch_cpu_profile(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
char* profile_name = SWITCH_CPU_PROFILES[entry_idx];
|
||||
char command[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
#ifdef HAVE_LAKKA_SWITCH
|
||||
char* profile_name = SWITCH_CPU_PROFILES[entry_idx];
|
||||
|
||||
snprintf(command, sizeof(command), "cpu-profile set '%s'", profile_name);
|
||||
|
||||
system(command);
|
||||
snprintf(command, sizeof(command), "Current profile set to %s", profile_name);
|
||||
#else
|
||||
unsigned profile_clock = SWITCH_CPU_SPEEDS_VALUES[entry_idx];
|
||||
config_get_ptr()->uints.libnx_overclock = entry_idx;
|
||||
|
||||
unsigned profile_clock = SWITCH_CPU_SPEEDS_VALUES[entry_idx];
|
||||
if (hosversionBefore(8, 0, 0))
|
||||
pcvSetClockRate(PcvModule_CpuBus, (u32)profile_clock);
|
||||
else
|
||||
@ -3454,9 +3469,14 @@ int action_ok_core_option_dropdown_list(const char *path,
|
||||
static int action_ok_cheat_reload_cheats(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
bool refresh = false ;
|
||||
bool refresh = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
cheat_manager_realloc(0, CHEAT_HANDLER_TYPE_EMU);
|
||||
cheat_manager_load_game_specific_cheats();
|
||||
|
||||
cheat_manager_load_game_specific_cheats(
|
||||
settings->paths.path_cheat_database);
|
||||
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||
return 0 ;
|
||||
|
@ -104,7 +104,10 @@ int shader_action_preset_parameter_right(unsigned type, const char *label, bool
|
||||
int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
cheat_manager_toggle_index((unsigned)idx);
|
||||
settings_t *settings = config_get_ptr();
|
||||
cheat_manager_toggle_index(
|
||||
settings->bools.apply_cheats_after_toggle,
|
||||
(unsigned)idx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -611,13 +614,16 @@ static int playlist_left_thumbnail_mode_right(unsigned type, const char *label,
|
||||
static int manual_content_scan_system_name_right(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
settings_t *settings = config_get_ptr();
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database);
|
||||
manual_content_scan_get_menu_system_name_list(
|
||||
settings->paths.path_content_database,
|
||||
settings->bools.show_hidden_files);
|
||||
#else
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(NULL);
|
||||
manual_content_scan_get_menu_system_name_list(NULL,
|
||||
settings->bools.show_hidden_files);
|
||||
#endif
|
||||
const char *current_system_name = NULL;
|
||||
enum manual_content_scan_system_name_type next_system_name_type =
|
||||
|
@ -113,7 +113,7 @@ int action_switch_thumbnail(const char *path,
|
||||
* changing thumbnail view mode.
|
||||
* For other menu drivers, we cycle through available thumbnail
|
||||
* types. */
|
||||
if(!string_is_equal(settings->arrays.menu_driver, "rgui") &&
|
||||
if (!string_is_equal(settings->arrays.menu_driver, "rgui") &&
|
||||
!string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
settings->uints.menu_left_thumbnails++;
|
||||
@ -131,7 +131,7 @@ int action_switch_thumbnail(const char *path,
|
||||
* changing thumbnail view mode.
|
||||
* For other menu drivers, we cycle through available thumbnail
|
||||
* types. */
|
||||
if(!string_is_equal(settings->arrays.menu_driver, "rgui") &&
|
||||
if (!string_is_equal(settings->arrays.menu_driver, "rgui") &&
|
||||
!string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
settings->uints.menu_thumbnails++;
|
||||
|
@ -244,7 +244,9 @@ static int action_start_netplay_mitm_server(
|
||||
unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
strlcpy(settings->arrays.netplay_mitm_server, netplay_mitm_server, sizeof(settings->arrays.netplay_mitm_server));
|
||||
strlcpy(settings->arrays.netplay_mitm_server,
|
||||
DEFAULT_NETPLAY_MITM_SERVER,
|
||||
sizeof(settings->arrays.netplay_mitm_server));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -213,11 +213,13 @@ default_sublabel_macro(action_bind_sublabel_statistics_show, MENU_
|
||||
default_sublabel_macro(action_bind_sublabel_netplay_settings, MENU_ENUM_SUBLABEL_NETPLAY)
|
||||
default_sublabel_macro(action_bind_sublabel_user_bind_settings, MENU_ENUM_SUBLABEL_INPUT_USER_BINDS)
|
||||
default_sublabel_macro(action_bind_sublabel_input_hotkey_settings, MENU_ENUM_SUBLABEL_INPUT_HOTKEY_BINDS)
|
||||
#ifdef HAVE_MATERIALUI
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_icons_enable, MENU_ENUM_SUBLABEL_MATERIALUI_ICONS_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_landscape_layout_optimization, MENU_ENUM_SUBLABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_auto_rotate_nav_bar, MENU_ENUM_SUBLABEL_MATERIALUI_AUTO_ROTATE_NAV_BAR)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_dual_thumbnail_list_view_enable, MENU_ENUM_SUBLABEL_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_thumbnail_background_enable, MENU_ENUM_SUBLABEL_MATERIALUI_THUMBNAIL_BACKGROUND_ENABLE)
|
||||
#endif
|
||||
default_sublabel_macro(action_bind_sublabel_add_content_list, MENU_ENUM_SUBLABEL_ADD_CONTENT_LIST)
|
||||
default_sublabel_macro(action_bind_sublabel_video_frame_delay, MENU_ENUM_SUBLABEL_VIDEO_FRAME_DELAY)
|
||||
default_sublabel_macro(action_bind_sublabel_video_shader_delay, MENU_ENUM_SUBLABEL_VIDEO_SHADER_DELAY)
|
||||
@ -426,11 +428,13 @@ default_sublabel_macro(action_bind_sublabel_mouse_enable, MENU_
|
||||
default_sublabel_macro(action_bind_sublabel_pointer_enable, MENU_ENUM_SUBLABEL_POINTER_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_thumbnails, MENU_ENUM_SUBLABEL_THUMBNAILS)
|
||||
default_sublabel_macro(action_bind_sublabel_thumbnails_rgui, MENU_ENUM_SUBLABEL_THUMBNAILS_RGUI)
|
||||
#ifdef HAVE_MATERIALUI
|
||||
default_sublabel_macro(action_bind_sublabel_thumbnails_materialui, MENU_ENUM_SUBLABEL_THUMBNAILS_MATERIALUI)
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails_materialui, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS_MATERIALUI)
|
||||
#endif
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS)
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails_rgui, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS_RGUI)
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails_ozone, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS_OZONE)
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails_materialui, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS_MATERIALUI)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_thumbnail_upscale_threshold, MENU_ENUM_SUBLABEL_MENU_THUMBNAIL_UPSCALE_THRESHOLD)
|
||||
default_sublabel_macro(action_bind_sublabel_timedate_enable, MENU_ENUM_SUBLABEL_TIMEDATE_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_timedate_style, MENU_ENUM_SUBLABEL_TIMEDATE_STYLE)
|
||||
@ -518,15 +522,19 @@ default_sublabel_macro(action_bind_sublabel_xmb_shadows_enable,
|
||||
default_sublabel_macro(action_bind_sublabel_xmb_vertical_thumbnails, MENU_ENUM_SUBLABEL_XMB_VERTICAL_THUMBNAILS)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_xmb_thumbnail_scale_factor, MENU_ENUM_SUBLABEL_MENU_XMB_THUMBNAIL_SCALE_FACTOR)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_color_theme, MENU_ENUM_SUBLABEL_MATERIALUI_MENU_COLOR_THEME)
|
||||
#ifdef HAVE_MATERIALUI
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_menu_transition_animation, MENU_ENUM_SUBLABEL_MATERIALUI_MENU_TRANSITION_ANIMATION)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_menu_thumbnail_view_portrait, MENU_ENUM_SUBLABEL_MATERIALUI_MENU_THUMBNAIL_VIEW_PORTRAIT)
|
||||
default_sublabel_macro(action_bind_sublabel_materialui_menu_thumbnail_view_landscape, MENU_ENUM_SUBLABEL_MATERIALUI_MENU_THUMBNAIL_VIEW_LANDSCAPE)
|
||||
#endif
|
||||
default_sublabel_macro(action_bind_sublabel_ozone_menu_color_theme, MENU_ENUM_SUBLABEL_OZONE_MENU_COLOR_THEME)
|
||||
default_sublabel_macro(action_bind_sublabel_ozone_collapse_sidebar, MENU_ENUM_SUBLABEL_OZONE_COLLAPSE_SIDEBAR)
|
||||
default_sublabel_macro(action_bind_sublabel_ozone_truncate_playlist_name, MENU_ENUM_SUBLABEL_OZONE_TRUNCATE_PLAYLIST_NAME)
|
||||
default_sublabel_macro(action_bind_sublabel_ozone_scroll_content_metadata, MENU_ENUM_SUBLABEL_OZONE_SCROLL_CONTENT_METADATA)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_use_preferred_system_color_theme, MENU_ENUM_SUBLABEL_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_scale_factor, MENU_ENUM_SUBLABEL_MENU_SCALE_FACTOR)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_widget_scale_auto, MENU_ENUM_SUBLABEL_MENU_WIDGET_SCALE_AUTO)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_widget_scale_factor, MENU_ENUM_SUBLABEL_MENU_WIDGET_SCALE_FACTOR)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_wallpaper_opacity, MENU_ENUM_SUBLABEL_MENU_WALLPAPER_OPACITY)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_framebuffer_opacity, MENU_ENUM_SUBLABEL_MENU_FRAMEBUFFER_OPACITY)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_horizontal_animation, MENU_ENUM_SUBLABEL_MENU_HORIZONTAL_ANIMATION)
|
||||
@ -1294,19 +1302,29 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_audio_resampler_quality);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE:
|
||||
#ifdef HAVE_MATERIALUI
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_icons_enable);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION:
|
||||
#ifdef HAVE_MATERIALUI
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_landscape_layout_optimization);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_AUTO_ROTATE_NAV_BAR:
|
||||
#ifdef HAVE_MATERIALUI
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_auto_rotate_nav_bar);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_DUAL_THUMBNAIL_LIST_VIEW_ENABLE:
|
||||
#ifdef HAVE_MATERIALUI
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_dual_thumbnail_list_view_enable);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_THUMBNAIL_BACKGROUND_ENABLE:
|
||||
#ifdef HAVE_MATERIALUI
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_thumbnail_background_enable);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_VIEWPORT_CUSTOM_HEIGHT:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_viewport_custom_height);
|
||||
@ -1746,6 +1764,12 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_MENU_SCALE_FACTOR:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_scale_factor);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MENU_WIDGET_SCALE_AUTO:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_widget_scale_auto);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MENU_WIDGET_SCALE_FACTOR:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_widget_scale_factor);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MENU_WALLPAPER_OPACITY:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_wallpaper_opacity);
|
||||
break;
|
||||
@ -1769,13 +1793,19 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_color_theme);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_MENU_TRANSITION_ANIMATION:
|
||||
#ifdef HAVE_MATERIALUI
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_menu_transition_animation);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_MENU_THUMBNAIL_VIEW_PORTRAIT:
|
||||
#ifdef HAVE_MATERIALUI
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_menu_thumbnail_view_portrait);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_MENU_THUMBNAIL_VIEW_LANDSCAPE:
|
||||
#ifdef HAVE_MATERIALUI
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_menu_thumbnail_view_landscape);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_XMB_SHADOWS_ENABLE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_xmb_shadows_enable);
|
||||
@ -2022,34 +2052,47 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
break;
|
||||
case MENU_ENUM_LABEL_THUMBNAILS:
|
||||
settings = config_get_ptr();
|
||||
#ifdef HAVE_RGUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
else
|
||||
#endif
|
||||
#ifdef HAVE_MATERIALUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
|
||||
}
|
||||
break;
|
||||
case MENU_ENUM_LABEL_LEFT_THUMBNAILS:
|
||||
settings = config_get_ptr();
|
||||
#ifdef HAVE_RGUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
else
|
||||
#endif
|
||||
#ifdef HAVE_OZONE
|
||||
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
else
|
||||
#endif
|
||||
#ifdef HAVE_MATERIALUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
|
||||
}
|
||||
@ -2802,15 +2845,20 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_RIGHT_THUMBNAIL_MODE:
|
||||
settings = config_get_ptr();
|
||||
/* Uses same sublabels as MENU_ENUM_LABEL_THUMBNAILS */
|
||||
#ifdef HAVE_RGUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
else
|
||||
#endif
|
||||
#ifdef HAVE_MATERIALUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
|
||||
}
|
||||
@ -2818,19 +2866,27 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE:
|
||||
settings = config_get_ptr();
|
||||
/* Uses same sublabels as MENU_ENUM_LABEL_LEFT_THUMBNAILS */
|
||||
#ifdef HAVE_RGUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
else
|
||||
#endif
|
||||
#ifdef HAVE_OZONE
|
||||
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
|
||||
}
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
else
|
||||
#endif
|
||||
#ifdef HAVE_MATERIALUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
|
||||
}
|
||||
|
@ -89,17 +89,23 @@ static int action_get_title_remap_port(const char *path, const char *label,
|
||||
}
|
||||
|
||||
static int action_get_title_thumbnails(
|
||||
const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
||||
const char *path, const char *label, unsigned menu_type,
|
||||
char *s, size_t len)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *title = NULL;
|
||||
enum msg_hash_enums label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS;
|
||||
|
||||
#if defined(HAVE_RGUI) || defined(HAVE_MATERIALUI)
|
||||
settings_t *settings = config_get_ptr();
|
||||
/* Get label value */
|
||||
#ifdef HAVE_RGUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_RGUI;
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
#endif
|
||||
#ifdef HAVE_MATERIALUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_MATERIALUI;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
title = msg_hash_to_str(label_value);
|
||||
|
||||
@ -113,19 +119,27 @@ static int action_get_title_thumbnails(
|
||||
}
|
||||
|
||||
static int action_get_title_left_thumbnails(
|
||||
const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
||||
const char *path, const char *label, unsigned menu_type,
|
||||
char *s, size_t len)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *title = NULL;
|
||||
enum msg_hash_enums label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS;
|
||||
|
||||
#if defined(HAVE_RGUI) || defined(HAVE_OZONE) || defined(HAVE_MATERIALUI)
|
||||
settings_t *settings = config_get_ptr();
|
||||
/* Get label value */
|
||||
#ifdef HAVE_RGUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_RGUI;
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
#endif
|
||||
#ifdef HAVE_OZONE
|
||||
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_OZONE;
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
#endif
|
||||
#ifdef HAVE_MATERIALUI
|
||||
if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_MATERIALUI;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
title = msg_hash_to_str(label_value);
|
||||
|
||||
@ -138,7 +152,9 @@ static int action_get_title_left_thumbnails(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_get_title_dropdown_item(const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
||||
static int action_get_title_dropdown_item(
|
||||
const char *path, const char *label, unsigned menu_type,
|
||||
char *s, size_t len)
|
||||
{
|
||||
/* Sanity check */
|
||||
if (string_is_empty(path))
|
||||
@ -158,15 +174,16 @@ static int action_get_title_dropdown_item(const char *path, const char *label, u
|
||||
|
||||
if (coreopts)
|
||||
{
|
||||
unsigned i;
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned menu_index = string_to_unsigned(tmp_str_list->elems[(unsigned)tmp_str_list->size - 1].data);
|
||||
unsigned visible_index = 0;
|
||||
unsigned option_index = 0;
|
||||
bool option_found = false;
|
||||
unsigned i;
|
||||
bool game_specific_options = settings->bools.game_specific_options;
|
||||
|
||||
/* Convert menu index to option index */
|
||||
if (settings->bools.game_specific_options)
|
||||
if (game_specific_options)
|
||||
menu_index--;
|
||||
|
||||
for (i = 0; i < coreopts->size; i++)
|
||||
@ -186,7 +203,8 @@ static int action_get_title_dropdown_item(const char *path, const char *label, u
|
||||
/* If option was found, title == option description */
|
||||
if (option_found)
|
||||
{
|
||||
const char *title = core_option_manager_get_desc(coreopts, option_index);
|
||||
const char *title = core_option_manager_get_desc(
|
||||
coreopts, option_index);
|
||||
|
||||
if (s && !string_is_empty(title))
|
||||
{
|
||||
@ -215,7 +233,8 @@ static int action_get_title_dropdown_item(const char *path, const char *label, u
|
||||
* MENU_ENUM_LABEL_VALUE_##STR
|
||||
* to get 'MENU_ENUM_LABEL_VALUE_' from a
|
||||
* 'MENU_ENUM_LABEL_', we therefore add 2... */
|
||||
enum msg_hash_enums enum_idx = (enum msg_hash_enums)(string_to_unsigned(path) + 2);
|
||||
enum msg_hash_enums enum_idx = (enum msg_hash_enums)
|
||||
(string_to_unsigned(path) + 2);
|
||||
|
||||
/* Check if enum index is valid
|
||||
* Note: This is a very crude check, but better than nothing */
|
||||
@ -225,19 +244,25 @@ static int action_get_title_dropdown_item(const char *path, const char *label, u
|
||||
* MENU_ENUM_LABEL_LEFT_THUMBNAILS require special
|
||||
* treatment, since their titles depend upon the
|
||||
* current menu driver... */
|
||||
if (enum_idx == MENU_ENUM_LABEL_VALUE_THUMBNAILS)
|
||||
return action_get_title_thumbnails(path, label, menu_type, s, len);
|
||||
else if (enum_idx == MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS)
|
||||
return action_get_title_left_thumbnails(path, label, menu_type, s, len);
|
||||
else
|
||||
switch (enum_idx)
|
||||
{
|
||||
const char *title = msg_hash_to_str(enum_idx);
|
||||
case MENU_ENUM_LABEL_VALUE_THUMBNAILS:
|
||||
return action_get_title_thumbnails(
|
||||
path, label, menu_type, s, len);
|
||||
case MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS:
|
||||
return action_get_title_left_thumbnails(
|
||||
path, label, menu_type, s, len);
|
||||
default:
|
||||
{
|
||||
const char *title = msg_hash_to_str(enum_idx);
|
||||
|
||||
if (s && !string_is_empty(title))
|
||||
{
|
||||
sanitize_to_string(s, title, len);
|
||||
return 1;
|
||||
}
|
||||
if (s && !string_is_empty(title))
|
||||
{
|
||||
sanitize_to_string(s, title, len);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -297,18 +322,6 @@ static int action_get_title_deferred_playlist_list(const char *path, const char
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_get_title_dropdown_playlist_right_thumbnail_mode_item(
|
||||
const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
||||
{
|
||||
return action_get_title_thumbnails(path, label, menu_type, s, len);
|
||||
}
|
||||
|
||||
static int action_get_title_dropdown_playlist_left_thumbnail_mode_item(
|
||||
const char *path, const char *label, unsigned menu_type, char *s, size_t len)
|
||||
{
|
||||
return action_get_title_left_thumbnails(path, label, menu_type, s, len);
|
||||
}
|
||||
|
||||
default_title_macro(action_get_quick_menu_override_options, MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS)
|
||||
default_title_macro(action_get_user_accounts_cheevos_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_RETRO_ACHIEVEMENTS)
|
||||
default_title_macro(action_get_user_accounts_youtube_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_YOUTUBE)
|
||||
@ -1474,8 +1487,8 @@ int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_VIDEO_SHADER_NUM_PASSES, action_get_title_dropdown_video_shader_num_pass_item },
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_DEFAULT_CORE, action_get_title_dropdown_playlist_default_core_item},
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LABEL_DISPLAY_MODE, action_get_title_dropdown_playlist_label_display_mode_item},
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE, action_get_title_dropdown_playlist_right_thumbnail_mode_item},
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE, action_get_title_dropdown_playlist_left_thumbnail_mode_item},
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_RIGHT_THUMBNAIL_MODE, action_get_title_thumbnails},
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_PLAYLIST_LEFT_THUMBNAIL_MODE, action_get_title_left_thumbnails},
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME, action_get_title_dropdown_manual_content_scan_system_name_item},
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_MANUAL_CONTENT_SCAN_CORE_NAME, action_get_title_dropdown_manual_content_scan_core_name_item},
|
||||
{MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_DISK_INDEX, action_get_title_dropdown_disk_index},
|
||||
|
@ -2271,6 +2271,9 @@ static void materialui_render(void *data,
|
||||
unsigned width, unsigned height,
|
||||
bool is_idle)
|
||||
{
|
||||
size_t i;
|
||||
float bottom;
|
||||
float scale_factor;
|
||||
settings_t *settings = config_get_ptr();
|
||||
materialui_handle_t *mui = (materialui_handle_t*)data;
|
||||
unsigned header_height = menu_display_get_header_height();
|
||||
@ -2278,9 +2281,6 @@ static void materialui_render(void *data,
|
||||
file_list_t *list = menu_entries_get_selection_buf_ptr(0);
|
||||
bool first_entry_found = false;
|
||||
bool last_entry_found = false;
|
||||
size_t i;
|
||||
float bottom;
|
||||
float scale_factor;
|
||||
|
||||
if (!settings || !mui || !list)
|
||||
return;
|
||||
@ -2499,21 +2499,26 @@ static void materialui_render(void *data,
|
||||
if ((mui->list_view_type != MUI_LIST_VIEW_DEFAULT) &&
|
||||
(mui->list_view_type != MUI_LIST_VIEW_PLAYLIST))
|
||||
{
|
||||
bool on_screen = first_entry_found && !last_entry_found;
|
||||
bool on_screen =
|
||||
first_entry_found && !last_entry_found;
|
||||
unsigned thumbnail_upscale_threshold =
|
||||
settings->uints.menu_thumbnail_upscale_threshold;
|
||||
bool network_on_demand_thumbnails =
|
||||
settings->bools.network_on_demand_thumbnails;
|
||||
|
||||
if (mui->secondary_thumbnail_enabled)
|
||||
menu_thumbnail_process_streams(
|
||||
mui->thumbnail_path_data, mui->playlist, i,
|
||||
&node->thumbnails.primary, &node->thumbnails.secondary,
|
||||
on_screen,
|
||||
settings->uints.menu_thumbnail_upscale_threshold,
|
||||
settings->bools.network_on_demand_thumbnails);
|
||||
thumbnail_upscale_threshold,
|
||||
network_on_demand_thumbnails);
|
||||
else
|
||||
menu_thumbnail_process_stream(
|
||||
mui->thumbnail_path_data, MENU_THUMBNAIL_RIGHT,
|
||||
mui->playlist, i, &node->thumbnails.primary, on_screen,
|
||||
settings->uints.menu_thumbnail_upscale_threshold,
|
||||
settings->bools.network_on_demand_thumbnails);
|
||||
thumbnail_upscale_threshold,
|
||||
network_on_demand_thumbnails);
|
||||
}
|
||||
else if (last_entry_found)
|
||||
break;
|
||||
@ -5874,7 +5879,7 @@ static void materialui_populate_nav_bar(
|
||||
mui->nav_bar.menu_tabs[menu_tab_index].active =
|
||||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU));
|
||||
|
||||
if(mui->nav_bar.menu_tabs[menu_tab_index].active)
|
||||
if (mui->nav_bar.menu_tabs[menu_tab_index].active)
|
||||
mui->nav_bar.active_menu_tab_index = menu_tab_index;
|
||||
|
||||
menu_tab_index++;
|
||||
@ -5889,7 +5894,7 @@ static void materialui_populate_nav_bar(
|
||||
mui->nav_bar.menu_tabs[menu_tab_index].active =
|
||||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB));
|
||||
|
||||
if(mui->nav_bar.menu_tabs[menu_tab_index].active)
|
||||
if (mui->nav_bar.menu_tabs[menu_tab_index].active)
|
||||
mui->nav_bar.active_menu_tab_index = menu_tab_index;
|
||||
|
||||
menu_tab_index++;
|
||||
@ -5903,7 +5908,7 @@ static void materialui_populate_nav_bar(
|
||||
mui->nav_bar.menu_tabs[menu_tab_index].active =
|
||||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS_TAB));
|
||||
|
||||
if(mui->nav_bar.menu_tabs[menu_tab_index].active)
|
||||
if (mui->nav_bar.menu_tabs[menu_tab_index].active)
|
||||
mui->nav_bar.active_menu_tab_index = menu_tab_index;
|
||||
|
||||
menu_tab_index++;
|
||||
@ -5915,16 +5920,16 @@ static void materialui_populate_nav_bar(
|
||||
static void materialui_init_transition_animation(
|
||||
materialui_handle_t *mui, settings_t *settings)
|
||||
{
|
||||
menu_animation_ctx_entry_t alpha_entry;
|
||||
menu_animation_ctx_entry_t x_offset_entry;
|
||||
size_t stack_size = materialui_list_get_size(mui, MENU_LIST_PLAIN);
|
||||
menu_animation_ctx_tag alpha_tag = (uintptr_t)&mui->transition_alpha;
|
||||
menu_animation_ctx_tag x_offset_tag = (uintptr_t)&mui->transition_x_offset;
|
||||
menu_animation_ctx_entry_t alpha_entry;
|
||||
menu_animation_ctx_entry_t x_offset_entry;
|
||||
unsigned transition_animation = settings->uints.menu_materialui_transition_animation;
|
||||
|
||||
/* If animations are disabled, reset alpha/x offset
|
||||
* values and return immediately */
|
||||
if (settings->uints.menu_materialui_transition_animation ==
|
||||
MATERIALUI_TRANSITION_ANIM_NONE)
|
||||
if (transition_animation == MATERIALUI_TRANSITION_ANIM_NONE)
|
||||
{
|
||||
mui->transition_alpha = 1.0f;
|
||||
mui->transition_x_offset = 0.0f;
|
||||
@ -5966,29 +5971,25 @@ static void materialui_init_transition_animation(
|
||||
* - We apply a standard 'back' animation here */
|
||||
if (mui->menu_stack_flushed)
|
||||
{
|
||||
if (settings->uints.menu_materialui_transition_animation !=
|
||||
MATERIALUI_TRANSITION_ANIM_FADE)
|
||||
if (transition_animation != MATERIALUI_TRANSITION_ANIM_FADE)
|
||||
mui->transition_x_offset = -1.0f;
|
||||
}
|
||||
/* >> Menu 'forward' action */
|
||||
else if (stack_size > mui->last_stack_size)
|
||||
{
|
||||
if (settings->uints.menu_materialui_transition_animation ==
|
||||
MATERIALUI_TRANSITION_ANIM_SLIDE)
|
||||
if (transition_animation == MATERIALUI_TRANSITION_ANIM_SLIDE)
|
||||
mui->transition_x_offset = 1.0f;
|
||||
}
|
||||
/* >> Menu 'back' action */
|
||||
else if (stack_size < mui->last_stack_size)
|
||||
{
|
||||
if (settings->uints.menu_materialui_transition_animation ==
|
||||
MATERIALUI_TRANSITION_ANIM_SLIDE)
|
||||
if (transition_animation == MATERIALUI_TRANSITION_ANIM_SLIDE)
|
||||
mui->transition_x_offset = -1.0f;
|
||||
}
|
||||
/* >> Menu tab 'switch' action - using navigation
|
||||
* bar to switch between top level menus */
|
||||
else if ((stack_size == 1) &&
|
||||
(settings->uints.menu_materialui_transition_animation !=
|
||||
MATERIALUI_TRANSITION_ANIM_FADE))
|
||||
(transition_animation != MATERIALUI_TRANSITION_ANIM_FADE))
|
||||
{
|
||||
/* We're not changing menu levels here, so set
|
||||
* slide to match horizontal list 'movement'
|
||||
|
@ -150,6 +150,10 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
|
||||
*userdata = ozone;
|
||||
|
||||
ozone->last_width = width;
|
||||
ozone->last_height = height;
|
||||
ozone->last_scale_factor = menu_display_get_dpi_scale(width, height);
|
||||
|
||||
ozone->selection_buf_old = (file_list_t*)calloc(1, sizeof(file_list_t));
|
||||
|
||||
ozone->draw_sidebar = true;
|
||||
@ -444,101 +448,195 @@ static void ozone_refresh_thumbnail_image(void *data, unsigned i)
|
||||
ozone_update_thumbnail_image(ozone);
|
||||
}
|
||||
|
||||
/* TODO: Scale text */
|
||||
static void ozone_context_reset(void *data, bool is_threaded)
|
||||
/* Determines the size of all menu elements */
|
||||
static void ozone_set_layout(ozone_handle_t *ozone, bool is_threaded)
|
||||
{
|
||||
/* Fonts init */
|
||||
unsigned i;
|
||||
unsigned size;
|
||||
int font_size;
|
||||
float scale_factor;
|
||||
char font_path[PATH_MAX_LENGTH];
|
||||
|
||||
float scale = 1; /*TODO: compute that from screen resolution and dpi */
|
||||
font_path[0] = '\0';
|
||||
|
||||
if (!ozone)
|
||||
return;
|
||||
|
||||
scale_factor = ozone->last_scale_factor;
|
||||
|
||||
/* Calculate dimensions */
|
||||
ozone->dimensions.header_height = HEADER_HEIGHT * scale_factor;
|
||||
ozone->dimensions.footer_height = FOOTER_HEIGHT * scale_factor;
|
||||
|
||||
ozone->dimensions.entry_padding_horizontal_half = ENTRY_PADDING_HORIZONTAL_HALF * scale_factor;
|
||||
ozone->dimensions.entry_padding_horizontal_full = ENTRY_PADDING_HORIZONTAL_FULL * scale_factor;
|
||||
ozone->dimensions.entry_padding_vertical = ENTRY_PADDING_VERTICAL * scale_factor;
|
||||
ozone->dimensions.entry_height = ENTRY_HEIGHT * scale_factor;
|
||||
ozone->dimensions.entry_spacing = ENTRY_SPACING * scale_factor;
|
||||
ozone->dimensions.entry_icon_size = ENTRY_ICON_SIZE * scale_factor;
|
||||
ozone->dimensions.entry_icon_padding = ENTRY_ICON_PADDING * scale_factor;
|
||||
|
||||
ozone->dimensions.sidebar_entry_height = SIDEBAR_ENTRY_HEIGHT * scale_factor;
|
||||
ozone->dimensions.sidebar_padding_horizontal = SIDEBAR_X_PADDING * scale_factor;
|
||||
ozone->dimensions.sidebar_padding_vertical = SIDEBAR_Y_PADDING * scale_factor;
|
||||
ozone->dimensions.sidebar_entry_padding_vertical = SIDEBAR_ENTRY_Y_PADDING * scale_factor;
|
||||
ozone->dimensions.sidebar_entry_icon_size = SIDEBAR_ENTRY_ICON_SIZE * scale_factor;
|
||||
ozone->dimensions.sidebar_entry_icon_padding = SIDEBAR_ENTRY_ICON_PADDING * scale_factor;
|
||||
ozone->dimensions.sidebar_gradient_height = SIDEBAR_GRADIENT_HEIGHT * scale_factor;
|
||||
|
||||
ozone->dimensions.sidebar_width_normal = SIDEBAR_WIDTH * scale_factor;
|
||||
ozone->dimensions.sidebar_width_collapsed =
|
||||
ozone->dimensions.sidebar_entry_icon_size +
|
||||
ozone->dimensions.sidebar_entry_icon_padding * 2 +
|
||||
ozone->dimensions.sidebar_padding_horizontal * 2;
|
||||
|
||||
if (ozone->dimensions.sidebar_width == 0)
|
||||
ozone->dimensions.sidebar_width = (float)ozone->dimensions.sidebar_width_normal;
|
||||
|
||||
ozone->dimensions.thumbnail_bar_width =
|
||||
ozone->dimensions.sidebar_width_normal -
|
||||
ozone->dimensions.sidebar_entry_icon_size -
|
||||
ozone->dimensions.sidebar_entry_icon_padding;
|
||||
|
||||
ozone->dimensions.cursor_size = CURSOR_SIZE * scale_factor;
|
||||
|
||||
ozone->dimensions.fullscreen_thumbnail_padding = FULLSCREEN_THUMBNAIL_PADDING * scale_factor;
|
||||
|
||||
ozone->dimensions.spacer_1px = (scale_factor > 1.0f) ? (unsigned)(scale_factor + 0.5f) : 1;
|
||||
ozone->dimensions.spacer_2px = ozone->dimensions.spacer_1px * 2;
|
||||
ozone->dimensions.spacer_3px = (unsigned)((scale_factor * 3.0f) + 0.5f);
|
||||
ozone->dimensions.spacer_5px = (unsigned)((scale_factor * 5.0f) + 0.5f);
|
||||
|
||||
/* Initialise fonts */
|
||||
|
||||
/* > Free existing */
|
||||
if (ozone->fonts.footer)
|
||||
{
|
||||
menu_display_font_free(ozone->fonts.footer);
|
||||
ozone->fonts.footer = NULL;
|
||||
}
|
||||
if (ozone->fonts.entries_label)
|
||||
{
|
||||
menu_display_font_free(ozone->fonts.entries_label);
|
||||
ozone->fonts.entries_label = NULL;
|
||||
}
|
||||
if (ozone->fonts.entries_sublabel)
|
||||
{
|
||||
menu_display_font_free(ozone->fonts.entries_sublabel);
|
||||
ozone->fonts.entries_sublabel = NULL;
|
||||
}
|
||||
if (ozone->fonts.time)
|
||||
{
|
||||
menu_display_font_free(ozone->fonts.time);
|
||||
ozone->fonts.time = NULL;
|
||||
}
|
||||
if (ozone->fonts.sidebar)
|
||||
{
|
||||
menu_display_font_free(ozone->fonts.sidebar);
|
||||
ozone->fonts.sidebar = NULL;
|
||||
}
|
||||
if (ozone->fonts.title)
|
||||
{
|
||||
menu_display_font_free(ozone->fonts.title);
|
||||
ozone->fonts.title = NULL;
|
||||
}
|
||||
|
||||
/* > Cache 'naive' font heights */
|
||||
ozone->title_font_glyph_height = FONT_SIZE_TITLE * scale_factor;
|
||||
ozone->entry_font_glyph_height = FONT_SIZE_ENTRIES_LABEL * scale_factor;
|
||||
ozone->sublabel_font_glyph_height = FONT_SIZE_ENTRIES_SUBLABEL * scale_factor;
|
||||
ozone->footer_font_glyph_height = FONT_SIZE_FOOTER * scale_factor;
|
||||
ozone->sidebar_font_glyph_height = FONT_SIZE_SIDEBAR * scale_factor;
|
||||
ozone->time_font_glyph_height = FONT_SIZE_TIME * scale_factor;
|
||||
|
||||
/* > Create 'bold' font objects */
|
||||
fill_pathname_join(font_path, ozone->assets_path, "bold.ttf", sizeof(font_path));
|
||||
ozone->fonts.title = menu_display_font_file(font_path, ozone->title_font_glyph_height, is_threaded);
|
||||
|
||||
/* > Create 'regular' font objects */
|
||||
fill_pathname_join(font_path, ozone->assets_path, "regular.ttf", sizeof(font_path));
|
||||
ozone->fonts.entries_label = menu_display_font_file(font_path, ozone->entry_font_glyph_height, is_threaded);
|
||||
ozone->fonts.entries_sublabel = menu_display_font_file(font_path, ozone->sublabel_font_glyph_height, is_threaded);
|
||||
ozone->fonts.footer = menu_display_font_file(font_path, ozone->footer_font_glyph_height, is_threaded);
|
||||
ozone->fonts.sidebar = menu_display_font_file(font_path, ozone->sidebar_font_glyph_height, is_threaded);
|
||||
ozone->fonts.time = menu_display_font_file(font_path, ozone->time_font_glyph_height, is_threaded);
|
||||
|
||||
/* > Check for missing assets */
|
||||
if (!ozone->fonts.title ||
|
||||
!ozone->fonts.entries_label ||
|
||||
!ozone->fonts.entries_sublabel ||
|
||||
!ozone->fonts.footer ||
|
||||
!ozone->fonts.sidebar ||
|
||||
!ozone->fonts.time)
|
||||
ozone->has_all_assets = false;
|
||||
|
||||
/* > Cache 'naive' font widths */
|
||||
ozone->title_font_glyph_width = ozone->title_font_glyph_height * 3.0f/4.0f;
|
||||
ozone->entry_font_glyph_width = ozone->entry_font_glyph_height * 3.0f/4.0f;
|
||||
ozone->sublabel_font_glyph_width = ozone->sublabel_font_glyph_height * 3.0f/4.0f;
|
||||
ozone->footer_font_glyph_width = ozone->footer_font_glyph_height * 3.0f/4.0f;
|
||||
ozone->sidebar_font_glyph_width = ozone->sidebar_font_glyph_height * 3.0f/4.0f;
|
||||
ozone->time_font_glyph_width = ozone->time_font_glyph_height * 3.0f/4.0f;
|
||||
|
||||
/* > Determine more realistic font widths */
|
||||
font_size = font_driver_get_message_width(ozone->fonts.title, "a", 1, 1);
|
||||
if (font_size > 0)
|
||||
ozone->title_font_glyph_width = (unsigned)font_size;
|
||||
font_size = font_driver_get_message_width(ozone->fonts.entries_label, "a", 1, 1);
|
||||
if (font_size > 0)
|
||||
ozone->entry_font_glyph_width = (unsigned)font_size;
|
||||
font_size = font_driver_get_message_width(ozone->fonts.entries_sublabel, "a", 1, 1);
|
||||
if (font_size > 0)
|
||||
ozone->sublabel_font_glyph_width = (unsigned)font_size;
|
||||
font_size = font_driver_get_message_width(ozone->fonts.footer, "a", 1, 1);
|
||||
if (font_size > 0)
|
||||
ozone->footer_font_glyph_width = (unsigned)font_size;
|
||||
font_size = font_driver_get_message_width(ozone->fonts.sidebar, "a", 1, 1);
|
||||
if (font_size > 0)
|
||||
ozone->sidebar_font_glyph_width = (unsigned)font_size;
|
||||
font_size = font_driver_get_message_width(ozone->fonts.time, "a", 1, 1);
|
||||
if (font_size > 0)
|
||||
ozone->time_font_glyph_width = (unsigned)font_size;
|
||||
|
||||
/* > Get actual font heights */
|
||||
font_size = font_driver_get_line_height(ozone->fonts.title, 1.0f);
|
||||
if (font_size > 0)
|
||||
ozone->title_font_glyph_height = (unsigned)font_size;
|
||||
font_size = font_driver_get_line_height(ozone->fonts.entries_label, 1.0f);
|
||||
if (font_size > 0)
|
||||
ozone->entry_font_glyph_height = (unsigned)font_size;
|
||||
font_size = font_driver_get_line_height(ozone->fonts.entries_sublabel, 1.0f);
|
||||
if (font_size > 0)
|
||||
ozone->sublabel_font_glyph_height = (unsigned)font_size;
|
||||
font_size = font_driver_get_line_height(ozone->fonts.footer, 1.0f);
|
||||
if (font_size > 0)
|
||||
ozone->footer_font_glyph_height = (unsigned)font_size;
|
||||
font_size = font_driver_get_line_height(ozone->fonts.sidebar, 1.0f);
|
||||
if (font_size > 0)
|
||||
ozone->sidebar_font_glyph_height = (unsigned)font_size;
|
||||
font_size = font_driver_get_line_height(ozone->fonts.time, 1.0f);
|
||||
if (font_size > 0)
|
||||
ozone->time_font_glyph_height = (unsigned)font_size;
|
||||
|
||||
/* Multiple sidebar parameters are set via animations
|
||||
* > ozone_refresh_sidebars() cancels any existing
|
||||
* animations and 'force updates' the affected
|
||||
* variables with newly scaled values */
|
||||
ozone_refresh_sidebars(ozone, ozone->last_height);
|
||||
|
||||
/* Entry dimensions must be recalculated after
|
||||
* updating menu layout */
|
||||
ozone->need_compute = true;
|
||||
}
|
||||
|
||||
static void ozone_context_reset(void *data, bool is_threaded)
|
||||
{
|
||||
unsigned i;
|
||||
ozone_handle_t *ozone = (ozone_handle_t*) data;
|
||||
|
||||
if (ozone)
|
||||
{
|
||||
ozone->has_all_assets = true;
|
||||
|
||||
fill_pathname_join(font_path, ozone->assets_path, "regular.ttf", sizeof(font_path));
|
||||
ozone->fonts.footer = menu_display_font_file(font_path, FONT_SIZE_FOOTER, is_threaded);
|
||||
ozone->fonts.entries_label = menu_display_font_file(font_path, FONT_SIZE_ENTRIES_LABEL, is_threaded);
|
||||
ozone->fonts.entries_sublabel = menu_display_font_file(font_path, FONT_SIZE_ENTRIES_SUBLABEL, is_threaded);
|
||||
ozone->fonts.time = menu_display_font_file(font_path, FONT_SIZE_TIME, is_threaded);
|
||||
ozone->fonts.sidebar = menu_display_font_file(font_path, FONT_SIZE_SIDEBAR, is_threaded);
|
||||
|
||||
fill_pathname_join(font_path, ozone->assets_path, "bold.ttf", sizeof(font_path));
|
||||
ozone->fonts.title = menu_display_font_file(font_path, FONT_SIZE_TITLE, is_threaded);
|
||||
|
||||
if (
|
||||
!ozone->fonts.footer ||
|
||||
!ozone->fonts.entries_label ||
|
||||
!ozone->fonts.entries_sublabel ||
|
||||
!ozone->fonts.time ||
|
||||
!ozone->fonts.sidebar ||
|
||||
!ozone->fonts.title
|
||||
)
|
||||
{
|
||||
ozone->has_all_assets = false;
|
||||
}
|
||||
|
||||
/* Dimensions */
|
||||
ozone->dimensions.header_height = HEADER_HEIGHT * scale;
|
||||
ozone->dimensions.footer_height = FOOTER_HEIGHT * scale;
|
||||
|
||||
ozone->dimensions.entry_padding_horizontal_half = ENTRY_PADDING_HORIZONTAL_HALF * scale;
|
||||
ozone->dimensions.entry_padding_horizontal_full = ENTRY_PADDING_HORIZONTAL_FULL * scale;
|
||||
ozone->dimensions.entry_padding_vertical = ENTRY_PADDING_VERTICAL * scale;
|
||||
ozone->dimensions.entry_height = ENTRY_HEIGHT * scale;
|
||||
ozone->dimensions.entry_spacing = ENTRY_SPACING * scale;
|
||||
ozone->dimensions.entry_icon_size = ENTRY_ICON_SIZE * scale;
|
||||
ozone->dimensions.entry_icon_padding = ENTRY_ICON_PADDING * scale;
|
||||
|
||||
ozone->dimensions.sidebar_entry_height = SIDEBAR_ENTRY_HEIGHT * scale;
|
||||
ozone->dimensions.sidebar_padding_horizontal = SIDEBAR_X_PADDING * scale;
|
||||
ozone->dimensions.sidebar_padding_vertical = SIDEBAR_Y_PADDING * scale;
|
||||
ozone->dimensions.sidebar_entry_padding_vertical = SIDEBAR_ENTRY_Y_PADDING * scale;
|
||||
ozone->dimensions.sidebar_entry_icon_size = SIDEBAR_ENTRY_ICON_SIZE * scale;
|
||||
ozone->dimensions.sidebar_entry_icon_padding = SIDEBAR_ENTRY_ICON_PADDING * scale;
|
||||
|
||||
ozone->dimensions.sidebar_width_normal = SIDEBAR_WIDTH * scale;
|
||||
ozone->dimensions.sidebar_width_collapsed = ozone->dimensions.sidebar_entry_icon_size
|
||||
+ ozone->dimensions.sidebar_entry_icon_padding * 2
|
||||
+ ozone->dimensions.sidebar_padding_horizontal * 2;
|
||||
|
||||
if (ozone->dimensions.sidebar_width == 0)
|
||||
ozone->dimensions.sidebar_width = (float) ozone->dimensions.sidebar_width_normal;
|
||||
|
||||
ozone->dimensions.thumbnail_bar_width = ozone->dimensions.sidebar_width_normal
|
||||
- ozone->dimensions.sidebar_entry_icon_size
|
||||
- ozone->dimensions.sidebar_entry_icon_padding;
|
||||
ozone->dimensions.cursor_size = CURSOR_SIZE * scale;
|
||||
|
||||
ozone->dimensions.fullscreen_thumbnail_padding = FULLSCREEN_THUMBNAIL_PADDING * scale;
|
||||
|
||||
/* Naive font size */
|
||||
ozone->title_font_glyph_width = FONT_SIZE_TITLE * 3/4;
|
||||
ozone->entry_font_glyph_width = FONT_SIZE_ENTRIES_LABEL * 3/4;
|
||||
ozone->sublabel_font_glyph_width = FONT_SIZE_ENTRIES_SUBLABEL * 3/4;
|
||||
ozone->sidebar_font_glyph_width = FONT_SIZE_SIDEBAR * 3/4;
|
||||
ozone->footer_font_glyph_width = FONT_SIZE_FOOTER * 3/4;
|
||||
|
||||
/* More realistic font size */
|
||||
size = font_driver_get_message_width(ozone->fonts.title, "a", 1, 1);
|
||||
if (size)
|
||||
ozone->title_font_glyph_width = size;
|
||||
size = font_driver_get_message_width(ozone->fonts.entries_label, "a", 1, 1);
|
||||
if (size)
|
||||
ozone->entry_font_glyph_width = size;
|
||||
size = font_driver_get_message_width(ozone->fonts.entries_sublabel, "a", 1, 1);
|
||||
if (size)
|
||||
ozone->sublabel_font_glyph_width = size;
|
||||
size = font_driver_get_message_width(ozone->fonts.sidebar, "a", 1, 1);
|
||||
if (size)
|
||||
ozone->sidebar_font_glyph_width = size;
|
||||
size = font_driver_get_message_width(ozone->fonts.footer, "a", 1, 1);
|
||||
if (size)
|
||||
ozone->footer_font_glyph_width = size;
|
||||
ozone_set_layout(ozone, is_threaded);
|
||||
|
||||
/* Textures init */
|
||||
for (i = 0; i < OZONE_TEXTURE_LAST; i++)
|
||||
@ -984,11 +1082,30 @@ static void ozone_render(void *data,
|
||||
bool is_idle)
|
||||
{
|
||||
size_t i;
|
||||
float scale_factor;
|
||||
unsigned end = (unsigned)menu_entries_get_size();
|
||||
ozone_handle_t *ozone = (ozone_handle_t*)data;
|
||||
if (!data)
|
||||
if (!ozone)
|
||||
return;
|
||||
|
||||
/* Check whether screen dimensions or menu scale
|
||||
* factor have changed */
|
||||
scale_factor = menu_display_get_dpi_scale(width, height);
|
||||
|
||||
if ((scale_factor != ozone->last_scale_factor) ||
|
||||
(width != ozone->last_width) ||
|
||||
(height != ozone->last_height))
|
||||
{
|
||||
ozone->last_scale_factor = scale_factor;
|
||||
ozone->last_width = width;
|
||||
ozone->last_height = height;
|
||||
|
||||
/* Note: We don't need a full context reset here
|
||||
* > Just rescale layout, and reset frame time counter */
|
||||
ozone_set_layout(ozone, video_driver_is_threaded());
|
||||
video_driver_monitor_reset();
|
||||
}
|
||||
|
||||
if (ozone->need_compute)
|
||||
{
|
||||
ozone_compute_entries_position(ozone);
|
||||
@ -1016,10 +1133,14 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
menu_animation_ctx_ticker_t ticker;
|
||||
menu_animation_ctx_ticker_smooth_t ticker_smooth;
|
||||
static const char* const ticker_spacer = OZONE_TICKER_SPACER;
|
||||
unsigned ticker_x_offset = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned timedate_offset = 0;
|
||||
bool use_smooth_ticker = settings->bools.menu_ticker_smooth;
|
||||
unsigned ticker_x_offset = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned timedate_offset = 0;
|
||||
bool use_smooth_ticker = settings->bools.menu_ticker_smooth;
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
unsigned logo_icon_size = 60 * scale_factor;
|
||||
unsigned status_icon_size = 92 * scale_factor;
|
||||
unsigned seperator_margin = 30 * scale_factor;
|
||||
|
||||
/* Initial ticker configuration */
|
||||
if (use_smooth_ticker)
|
||||
@ -1039,14 +1160,14 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
}
|
||||
|
||||
/* Separator */
|
||||
menu_display_draw_quad(video_info, 30, ozone->dimensions.header_height, video_info->width - 60, 1, video_info->width, video_info->height, ozone->theme->header_footer_separator);
|
||||
menu_display_draw_quad(video_info, seperator_margin, ozone->dimensions.header_height, video_info->width - seperator_margin * 2, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->header_footer_separator);
|
||||
|
||||
/* Title */
|
||||
if (use_smooth_ticker)
|
||||
{
|
||||
ticker_smooth.font = ozone->fonts.title;
|
||||
ticker_smooth.selected = true;
|
||||
ticker_smooth.field_width = (video_info->width - 128 - 47 - 180);
|
||||
ticker_smooth.field_width = (video_info->width - (128 + 47 + 180) * scale_factor);
|
||||
ticker_smooth.src_str = ozone->show_fullscreen_thumbnails ? ozone->fullscreen_thumbnail_label : ozone->title;
|
||||
ticker_smooth.dst_str = title;
|
||||
ticker_smooth.dst_str_len = sizeof(title);
|
||||
@ -1056,23 +1177,41 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
else
|
||||
{
|
||||
ticker.s = title;
|
||||
ticker.len = (video_info->width - 128 - 47 - 180) / ozone->title_font_glyph_width;
|
||||
ticker.len = (video_info->width - (128 + 47 + 180) * scale_factor) / ozone->title_font_glyph_width;
|
||||
ticker.str = ozone->show_fullscreen_thumbnails ? ozone->fullscreen_thumbnail_label : ozone->title;
|
||||
ticker.selected = true;
|
||||
|
||||
menu_animation_ticker(&ticker);
|
||||
}
|
||||
|
||||
ozone_draw_text(video_info, ozone, title, ticker_x_offset + 128, ozone->dimensions.header_height / 2 + FONT_SIZE_TITLE * 3/8, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.title, ozone->theme->text_rgba, false);
|
||||
ozone_draw_text(video_info, ozone, title, ticker_x_offset + 128 * scale_factor, ozone->dimensions.header_height / 2 + ozone->title_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.title, ozone->theme->text_rgba, false);
|
||||
|
||||
/* Icon */
|
||||
menu_display_blend_begin(video_info);
|
||||
#if 0
|
||||
if (discord_avatar_is_ready())
|
||||
ozone_draw_icon(video_info, 60, 60, ozone->textures[OZONE_TEXTURE_DISCORD_OWN_AVATAR], 47, 14, video_info->width, video_info->height, 0, 1, ozone->theme->entries_icon);
|
||||
ozone_draw_icon(
|
||||
video_info,
|
||||
logo_icon_size,
|
||||
logo_icon_size,
|
||||
ozone->textures[OZONE_TEXTURE_DISCORD_OWN_AVATAR],
|
||||
47 * scale_factor,
|
||||
14 * scale_factor, /* Where does this come from...? */
|
||||
video_info->width,
|
||||
video_info->height,
|
||||
0, 1, ozone->theme->entries_icon);
|
||||
else
|
||||
#endif
|
||||
ozone_draw_icon(video_info, 60, 60, ozone->textures[OZONE_TEXTURE_RETROARCH], 47, (ozone->dimensions.header_height - 60) / 2, video_info->width, video_info->height, 0, 1, ozone->theme->entries_icon);
|
||||
ozone_draw_icon(
|
||||
video_info,
|
||||
logo_icon_size,
|
||||
logo_icon_size,
|
||||
ozone->textures[OZONE_TEXTURE_RETROARCH],
|
||||
47 * scale_factor,
|
||||
(ozone->dimensions.header_height - logo_icon_size) / 2,
|
||||
video_info->width,
|
||||
video_info->height,
|
||||
0, 1, ozone->theme->entries_icon);
|
||||
menu_display_blend_end(video_info);
|
||||
|
||||
/* Battery */
|
||||
@ -1090,12 +1229,21 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
|
||||
if (powerstate.battery_enabled)
|
||||
{
|
||||
timedate_offset = 95;
|
||||
timedate_offset = 95 * scale_factor;
|
||||
|
||||
ozone_draw_text(video_info, ozone, msg, video_info->width - 85, ozone->dimensions.header_height / 2 + FONT_SIZE_TIME * 3/8, TEXT_ALIGN_RIGHT, video_info->width, video_info->height, ozone->fonts.time, ozone->theme->text_rgba, false);
|
||||
ozone_draw_text(video_info, ozone, msg, video_info->width - 85 * scale_factor, ozone->dimensions.header_height / 2 + ozone->time_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_RIGHT, video_info->width, video_info->height, ozone->fonts.time, ozone->theme->text_rgba, false);
|
||||
|
||||
menu_display_blend_begin(video_info);
|
||||
ozone_draw_icon(video_info, 92, 92, ozone->icons_textures[powerstate.charging? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_CHARGING : (powerstate.percent > 80)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_FULL : (powerstate.percent > 60)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_80 : (powerstate.percent > 40)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_60 : (powerstate.percent > 20)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_40 : OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_20], video_info->width - 60 - 56, ozone->dimensions.header_height / 2 - 42, video_info->width, video_info->height, 0, 1, ozone->theme->entries_icon);
|
||||
ozone_draw_icon(
|
||||
video_info,
|
||||
status_icon_size,
|
||||
status_icon_size,
|
||||
ozone->icons_textures[powerstate.charging? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_CHARGING : (powerstate.percent > 80)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_FULL : (powerstate.percent > 60)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_80 : (powerstate.percent > 40)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_60 : (powerstate.percent > 20)? OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_40 : OZONE_ENTRIES_ICONS_TEXTURE_BATTERY_20],
|
||||
video_info->width - (60 + 56) * scale_factor,
|
||||
0,
|
||||
video_info->width,
|
||||
video_info->height,
|
||||
0, 1, ozone->theme->entries_icon);
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
}
|
||||
@ -1114,43 +1262,55 @@ static void ozone_draw_header(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
|
||||
menu_display_timedate(&datetime);
|
||||
|
||||
ozone_draw_text(video_info, ozone, timedate, video_info->width - 85 - timedate_offset, ozone->dimensions.header_height / 2 + FONT_SIZE_TIME * 3/8, TEXT_ALIGN_RIGHT, video_info->width, video_info->height, ozone->fonts.time, ozone->theme->text_rgba, false);
|
||||
ozone_draw_text(video_info, ozone, timedate, video_info->width - (85 * scale_factor) - timedate_offset, ozone->dimensions.header_height / 2 + ozone->time_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_RIGHT, video_info->width, video_info->height, ozone->fonts.time, ozone->theme->text_rgba, false);
|
||||
|
||||
menu_display_blend_begin(video_info);
|
||||
ozone_draw_icon(video_info, 92, 92, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CLOCK], video_info->width - 60 - 56 - timedate_offset, ozone->dimensions.header_height / 2 - 42, video_info->width, video_info->height, 0, 1, ozone->theme->entries_icon);
|
||||
ozone_draw_icon(
|
||||
video_info,
|
||||
status_icon_size,
|
||||
status_icon_size,
|
||||
ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CLOCK],
|
||||
video_info->width - (60 + 56) * scale_factor - timedate_offset,
|
||||
0,
|
||||
video_info->width,
|
||||
video_info->height,
|
||||
0, 1, ozone->theme->entries_icon);
|
||||
menu_display_blend_end(video_info);
|
||||
}
|
||||
}
|
||||
|
||||
static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_info, settings_t *settings)
|
||||
{
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
unsigned seperator_margin = 30 * scale_factor;
|
||||
|
||||
/* Separator */
|
||||
menu_display_draw_quad(video_info, 30, video_info->height - ozone->dimensions.footer_height, video_info->width - 60, 1, video_info->width, video_info->height, ozone->theme->header_footer_separator);
|
||||
menu_display_draw_quad(video_info, seperator_margin, video_info->height - ozone->dimensions.footer_height, video_info->width - seperator_margin * 2, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->header_footer_separator);
|
||||
|
||||
/* Core title or Switch icon */
|
||||
if (settings->bools.menu_core_enable)
|
||||
{
|
||||
char core_title[255];
|
||||
menu_entries_get_core_title(core_title, sizeof(core_title));
|
||||
ozone_draw_text(video_info, ozone, core_title, 59, video_info->height - ozone->dimensions.footer_height / 2 + FONT_SIZE_FOOTER * 3/8, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
ozone_draw_text(video_info, ozone, core_title, 59 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
}
|
||||
else
|
||||
ozone_draw_icon(video_info, 69, 30, ozone->theme->textures[OZONE_THEME_TEXTURE_SWITCH], 59, video_info->height - ozone->dimensions.footer_height / 2 - 15, video_info->width,video_info->height, 0, 1, NULL);
|
||||
ozone_draw_icon(video_info, 69 * scale_factor, 30 * scale_factor, ozone->theme->textures[OZONE_THEME_TEXTURE_SWITCH], 59 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - 15 * scale_factor, video_info->width,video_info->height, 0, 1, NULL);
|
||||
|
||||
/* Buttons */
|
||||
{
|
||||
unsigned back_width = 215;
|
||||
unsigned ok_width = 96;
|
||||
unsigned search_width = 343;
|
||||
unsigned thumb_width = 343 + 188 + 80;
|
||||
unsigned icon_size = 35;
|
||||
unsigned back_width = 215 * scale_factor;
|
||||
unsigned ok_width = 96 * scale_factor;
|
||||
unsigned search_width = 343 * scale_factor;
|
||||
unsigned thumb_width = (343 + 188 + 80) * scale_factor;
|
||||
unsigned icon_size = 35 * scale_factor;
|
||||
unsigned icon_offset = icon_size / 2;
|
||||
bool do_swap = video_info->input_menu_swap_ok_cancel_buttons;
|
||||
|
||||
if (do_swap)
|
||||
{
|
||||
back_width = 96;
|
||||
ok_width = 215;
|
||||
back_width = 96 * scale_factor;
|
||||
ok_width = 215 * scale_factor;
|
||||
}
|
||||
|
||||
menu_display_blend_begin(video_info);
|
||||
@ -1159,19 +1319,19 @@ static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
|
||||
if (do_swap)
|
||||
{
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D], video_info->width - 138, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R], video_info->width - 256, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D], video_info->width - 138 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R], video_info->width - 256 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
}
|
||||
else
|
||||
{
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D], video_info->width - 256, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R], video_info->width - 138, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D], video_info->width - 256 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R], video_info->width - 138 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
}
|
||||
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_U], video_info->width - 384, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_U], video_info->width - 384 * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
|
||||
if (ozone->is_playlist && !ozone->cursor_in_sidebar)
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_L], video_info->width - 384 - 118 - 100 - 50, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
ozone_draw_icon(video_info, icon_size, icon_size, ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_L], video_info->width - (384 + 118 + 100 + 50) * scale_factor, video_info->height - ozone->dimensions.footer_height / 2 - icon_offset, video_info->width,video_info->height, 0, 1, ozone->theme_dynamic.entries_icon);
|
||||
|
||||
menu_display_blend_end(video_info);
|
||||
|
||||
@ -1179,21 +1339,21 @@ static void ozone_draw_footer(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
do_swap ?
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_OK) :
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_BACK),
|
||||
video_info->width - back_width, video_info->height - ozone->dimensions.footer_height / 2 + FONT_SIZE_FOOTER * 3/8, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
video_info->width - back_width, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
ozone_draw_text(video_info, ozone,
|
||||
do_swap ?
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_BACK) :
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_OK),
|
||||
video_info->width - ok_width, video_info->height - ozone->dimensions.footer_height / 2 + FONT_SIZE_FOOTER * 3/8, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
video_info->width - ok_width, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
|
||||
ozone_draw_text(video_info, ozone,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SEARCH),
|
||||
video_info->width - search_width, video_info->height - ozone->dimensions.footer_height / 2 + FONT_SIZE_FOOTER * 3/8, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
video_info->width - search_width, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
|
||||
if (ozone->is_playlist && !ozone->cursor_in_sidebar)
|
||||
ozone_draw_text(video_info, ozone,
|
||||
msg_hash_to_str(MSG_CHANGE_THUMBNAIL_TYPE),
|
||||
video_info->width - thumb_width, video_info->height - ozone->dimensions.footer_height / 2 + FONT_SIZE_FOOTER * 3/8, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
video_info->width - thumb_width, video_info->height - ozone->dimensions.footer_height / 2 + ozone->footer_font_glyph_height * 3.0f/10.0f, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.footer, ozone->theme->text_rgba, false);
|
||||
|
||||
}
|
||||
|
||||
@ -1581,7 +1741,7 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
|
||||
ozone_draw_sidebar(ozone, video_info);
|
||||
|
||||
/* Menu entries */
|
||||
menu_display_scissor_begin(video_info, ozone->sidebar_offset + (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.header_height + 1, video_info->width - (unsigned) ozone->dimensions.sidebar_width + (-ozone->sidebar_offset), video_info->height - ozone->dimensions.header_height - ozone->dimensions.footer_height - 1);
|
||||
menu_display_scissor_begin(video_info, ozone->sidebar_offset + (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, video_info->width - (unsigned) ozone->dimensions.sidebar_width + (-ozone->sidebar_offset), video_info->height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px);
|
||||
|
||||
/* Current list */
|
||||
ozone_draw_entries(ozone,
|
||||
@ -1733,6 +1893,7 @@ static void ozone_animation_end(void *userdata)
|
||||
|
||||
static void ozone_list_open(ozone_handle_t *ozone)
|
||||
{
|
||||
menu_animation_ctx_tag sidebar_tag = (uintptr_t)&ozone->sidebar_offset;
|
||||
struct menu_animation_ctx_entry entry;
|
||||
|
||||
ozone->draw_old_list = true;
|
||||
@ -1761,7 +1922,7 @@ static void ozone_list_open(ozone_handle_t *ozone)
|
||||
entry.duration = ANIMATION_PUSH_ENTRY_DURATION;
|
||||
entry.easing_enum = EASING_OUT_QUAD;
|
||||
entry.subject = &ozone->sidebar_offset;
|
||||
entry.tag = (uintptr_t) NULL;
|
||||
entry.tag = sidebar_tag;
|
||||
entry.target_value = 0.0f;
|
||||
entry.userdata = NULL;
|
||||
|
||||
@ -1775,7 +1936,7 @@ static void ozone_list_open(ozone_handle_t *ozone)
|
||||
entry.duration = ANIMATION_PUSH_ENTRY_DURATION;
|
||||
entry.easing_enum = EASING_OUT_QUAD;
|
||||
entry.subject = &ozone->sidebar_offset;
|
||||
entry.tag = (uintptr_t) NULL;
|
||||
entry.tag = sidebar_tag;
|
||||
entry.target_value = -ozone->dimensions.sidebar_width;
|
||||
entry.userdata = (void*) ozone;
|
||||
|
||||
@ -2017,6 +2178,7 @@ static void ozone_list_cache(void *data,
|
||||
unsigned video_info_height;
|
||||
float bottom_boundary;
|
||||
ozone_node_t *first_node;
|
||||
float scale_factor;
|
||||
unsigned first = 0;
|
||||
unsigned last = 0;
|
||||
file_list_t *selection_buf = NULL;
|
||||
@ -2025,6 +2187,7 @@ static void ozone_list_cache(void *data,
|
||||
if (!ozone)
|
||||
return;
|
||||
|
||||
scale_factor = ozone->last_scale_factor;
|
||||
ozone->need_compute = true;
|
||||
ozone->selection_old_list = ozone->selection;
|
||||
ozone->scroll_old = ozone->animations.scroll_y;
|
||||
@ -2044,12 +2207,12 @@ static void ozone_list_cache(void *data,
|
||||
if (!node)
|
||||
continue;
|
||||
|
||||
if (y + ozone->animations.scroll_y + node->height + 20 < ozone->dimensions.header_height + ozone->dimensions.entry_padding_vertical)
|
||||
if (y + ozone->animations.scroll_y + node->height + 20 * scale_factor < ozone->dimensions.header_height + ozone->dimensions.entry_padding_vertical)
|
||||
{
|
||||
first++;
|
||||
goto text_iterate;
|
||||
}
|
||||
else if (y + ozone->animations.scroll_y - node->height - 20 > bottom_boundary)
|
||||
else if (y + ozone->animations.scroll_y - node->height - 20 * scale_factor > bottom_boundary)
|
||||
goto text_iterate;
|
||||
|
||||
last++;
|
||||
@ -2405,7 +2568,6 @@ static enum menu_action ozone_parse_menu_entry_action(
|
||||
if (!ozone->cursor_in_sidebar)
|
||||
break;
|
||||
|
||||
tag = (uintptr_t)ozone;
|
||||
new_selection = (int)(ozone->categories_selection_ptr + 1);
|
||||
|
||||
if (new_selection >= (int)(ozone->system_tab_end + horizontal_list_size + 1))
|
||||
@ -2420,7 +2582,6 @@ static enum menu_action ozone_parse_menu_entry_action(
|
||||
if (!ozone->cursor_in_sidebar)
|
||||
break;
|
||||
|
||||
tag = (uintptr_t)ozone;
|
||||
new_selection = (int)ozone->categories_selection_ptr - 1;
|
||||
|
||||
if (new_selection < 0)
|
||||
|
@ -52,6 +52,8 @@ typedef struct ozone_handle ozone_handle_t;
|
||||
#define ENTRY_ICON_SIZE 46
|
||||
#define ENTRY_ICON_PADDING 15
|
||||
|
||||
/* > 'SIDEBAR_WIDTH' must be kept in sync with
|
||||
* menu driver metrics */
|
||||
#define SIDEBAR_WIDTH 408
|
||||
#define SIDEBAR_X_PADDING 40
|
||||
#define SIDEBAR_Y_PADDING 20
|
||||
@ -59,6 +61,7 @@ typedef struct ozone_handle ozone_handle_t;
|
||||
#define SIDEBAR_ENTRY_Y_PADDING 10
|
||||
#define SIDEBAR_ENTRY_ICON_SIZE 46
|
||||
#define SIDEBAR_ENTRY_ICON_PADDING 15
|
||||
#define SIDEBAR_GRADIENT_HEIGHT 28
|
||||
|
||||
#define FULLSCREEN_THUMBNAIL_PADDING 48
|
||||
|
||||
@ -151,6 +154,14 @@ struct ozone_handle
|
||||
unsigned sublabel_font_glyph_width;
|
||||
unsigned footer_font_glyph_width;
|
||||
unsigned sidebar_font_glyph_width;
|
||||
unsigned time_font_glyph_width;
|
||||
|
||||
unsigned title_font_glyph_height;
|
||||
unsigned entry_font_glyph_height;
|
||||
unsigned sublabel_font_glyph_height;
|
||||
unsigned footer_font_glyph_height;
|
||||
unsigned sidebar_font_glyph_height;
|
||||
unsigned time_font_glyph_height;
|
||||
|
||||
ozone_theme_t *theme;
|
||||
|
||||
@ -167,6 +178,10 @@ struct ozone_handle
|
||||
float message_background[16];
|
||||
} theme_dynamic;
|
||||
|
||||
unsigned last_width;
|
||||
unsigned last_height;
|
||||
float last_scale_factor;
|
||||
|
||||
bool need_compute;
|
||||
|
||||
file_list_t *selection_buf_old;
|
||||
@ -213,11 +228,17 @@ struct ozone_handle
|
||||
int sidebar_entry_height;
|
||||
int sidebar_entry_icon_size;
|
||||
int sidebar_entry_icon_padding;
|
||||
int sidebar_gradient_height;
|
||||
|
||||
int cursor_size;
|
||||
|
||||
int thumbnail_bar_width;
|
||||
int fullscreen_thumbnail_padding;
|
||||
|
||||
int spacer_1px;
|
||||
int spacer_2px;
|
||||
int spacer_3px;
|
||||
int spacer_5px;
|
||||
} dimensions;
|
||||
|
||||
bool show_cursor;
|
||||
@ -316,6 +337,8 @@ void ozone_update_scroll(ozone_handle_t *ozone, bool allow_animation, ozone_node
|
||||
|
||||
void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation);
|
||||
|
||||
void ozone_refresh_sidebars(ozone_handle_t *ozone, unsigned video_height);
|
||||
|
||||
void ozone_entries_update_thumbnail_bar(ozone_handle_t *ozone, bool is_playlist, bool allow_animation);
|
||||
|
||||
void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_info);
|
||||
|
@ -118,6 +118,12 @@ static void ozone_draw_cursor_slice(ozone_handle_t *ozone,
|
||||
unsigned width, unsigned height,
|
||||
size_t y, float alpha)
|
||||
{
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
int slice_x = x_offset - 14 * scale_factor;
|
||||
int slice_y = (int)y + 8 * scale_factor;
|
||||
unsigned slice_new_w = width + (3 + 28 - 4) * scale_factor;
|
||||
unsigned slice_new_h = height + 20 * scale_factor;
|
||||
|
||||
menu_display_set_alpha(ozone->theme_dynamic.cursor_alpha, alpha);
|
||||
menu_display_set_alpha(ozone->theme_dynamic.cursor_border, alpha);
|
||||
|
||||
@ -126,28 +132,28 @@ static void ozone_draw_cursor_slice(ozone_handle_t *ozone,
|
||||
/* Cursor without border */
|
||||
menu_display_draw_texture_slice(
|
||||
video_info,
|
||||
x_offset - 14,
|
||||
(int)(y + 8),
|
||||
slice_x,
|
||||
slice_y,
|
||||
80, 80,
|
||||
width + 3 + 28 - 4,
|
||||
height + 20,
|
||||
slice_new_w,
|
||||
slice_new_h,
|
||||
video_info->width, video_info->height,
|
||||
ozone->theme_dynamic.cursor_alpha,
|
||||
20, 1.0,
|
||||
20, scale_factor,
|
||||
ozone->theme->textures[OZONE_THEME_TEXTURE_CURSOR_NO_BORDER]
|
||||
);
|
||||
|
||||
/* Tainted border */
|
||||
menu_display_draw_texture_slice(
|
||||
video_info,
|
||||
x_offset - 14,
|
||||
(int)(y + 8),
|
||||
slice_x,
|
||||
slice_y,
|
||||
80, 80,
|
||||
width + 3 + 28 - 4,
|
||||
height + 20,
|
||||
slice_new_w,
|
||||
slice_new_h,
|
||||
video_info->width, video_info->height,
|
||||
ozone->theme_dynamic.cursor_border,
|
||||
20, 1.0,
|
||||
20, scale_factor,
|
||||
ozone->textures[OZONE_TEXTURE_CURSOR_BORDER]
|
||||
);
|
||||
|
||||
@ -164,21 +170,21 @@ static void ozone_draw_cursor_fallback(ozone_handle_t *ozone,
|
||||
menu_display_set_alpha(ozone->theme_dynamic.selection, alpha);
|
||||
|
||||
/* Fill */
|
||||
menu_display_draw_quad(video_info, x_offset, (int)y, width, height - 5, video_info->width, video_info->height, ozone->theme_dynamic.selection);
|
||||
menu_display_draw_quad(video_info, x_offset, (int)y, width, height - ozone->dimensions.spacer_5px, video_info->width, video_info->height, ozone->theme_dynamic.selection);
|
||||
|
||||
/* Borders (can't do one single quad because of alpha) */
|
||||
|
||||
/* Top */
|
||||
menu_display_draw_quad(video_info, x_offset - 3, (int)(y - 3), width + 6, 3, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
|
||||
menu_display_draw_quad(video_info, x_offset - ozone->dimensions.spacer_3px, (int)(y - ozone->dimensions.spacer_3px), width + ozone->dimensions.spacer_3px * 2, ozone->dimensions.spacer_3px, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
|
||||
|
||||
/* Bottom */
|
||||
menu_display_draw_quad(video_info, x_offset - 3, (int)(y + height - 5), width + 6, 3, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
|
||||
menu_display_draw_quad(video_info, x_offset - ozone->dimensions.spacer_3px, (int)(y + height - ozone->dimensions.spacer_5px), width + ozone->dimensions.spacer_3px * 2, ozone->dimensions.spacer_3px, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
|
||||
|
||||
/* Left */
|
||||
menu_display_draw_quad(video_info, (int)(x_offset - 3), (int)y, 3, height - 5, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
|
||||
menu_display_draw_quad(video_info, (int)(x_offset - ozone->dimensions.spacer_3px), (int)y, ozone->dimensions.spacer_3px, height - ozone->dimensions.spacer_5px, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
|
||||
|
||||
/* Right */
|
||||
menu_display_draw_quad(video_info, x_offset + width, (int)y, 3, height - 5, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
|
||||
menu_display_draw_quad(video_info, x_offset + width, (int)y, ozone->dimensions.spacer_3px, height - ozone->dimensions.spacer_5px, video_info->width, video_info->height, ozone->theme_dynamic.selection_border);
|
||||
}
|
||||
|
||||
void ozone_draw_cursor(ozone_handle_t *ozone,
|
||||
@ -255,8 +261,9 @@ void ozone_draw_osk(ozone_handle_t *ozone,
|
||||
unsigned text_color;
|
||||
struct string_list *list;
|
||||
|
||||
unsigned margin = 75;
|
||||
unsigned padding = 10;
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
unsigned margin = 75 * scale_factor;
|
||||
unsigned padding = 10 * scale_factor;
|
||||
unsigned bottom_end = video_info->height/2;
|
||||
unsigned y_offset = 0;
|
||||
bool draw_placeholder = string_is_empty(str);
|
||||
@ -272,20 +279,20 @@ void ozone_draw_osk(ozone_handle_t *ozone,
|
||||
|
||||
/* Border */
|
||||
/* Top */
|
||||
menu_display_draw_quad(video_info, margin, margin, video_info->width - margin*2, 1, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
menu_display_draw_quad(video_info, margin, margin, video_info->width - margin*2, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
|
||||
/* Bottom */
|
||||
menu_display_draw_quad(video_info, margin, bottom_end - margin, video_info->width - margin*2, 1, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
menu_display_draw_quad(video_info, margin, bottom_end - margin, video_info->width - margin*2, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
|
||||
/* Left */
|
||||
menu_display_draw_quad(video_info, margin, margin, 1, bottom_end - margin*2, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
menu_display_draw_quad(video_info, margin, margin, ozone->dimensions.spacer_1px, bottom_end - margin*2, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
|
||||
/* Right */
|
||||
menu_display_draw_quad(video_info, video_info->width - margin, margin, 1, bottom_end - margin*2, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
menu_display_draw_quad(video_info, video_info->width - margin, margin, ozone->dimensions.spacer_1px, bottom_end - margin*2, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
|
||||
/* Backdrop */
|
||||
/* TODO: Remove the backdrop if blur shader is available */
|
||||
menu_display_draw_quad(video_info, margin + 1, margin + 1, video_info->width - margin*2 - 2, bottom_end - margin*2 - 2, video_info->width, video_info->height, ozone_osk_backdrop);
|
||||
menu_display_draw_quad(video_info, margin + ozone->dimensions.spacer_1px, margin + ozone->dimensions.spacer_1px, video_info->width - margin*2 - ozone->dimensions.spacer_2px, bottom_end - margin*2 - ozone->dimensions.spacer_2px, video_info->width, video_info->height, ozone_osk_backdrop);
|
||||
|
||||
/* Placeholder & text*/
|
||||
if (!draw_placeholder)
|
||||
@ -307,7 +314,7 @@ void ozone_draw_osk(ozone_handle_t *ozone,
|
||||
{
|
||||
const char *msg = list->elems[i].data;
|
||||
|
||||
ozone_draw_text(video_info, ozone, msg, margin + padding * 2, margin + padding + FONT_SIZE_ENTRIES_LABEL + y_offset, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_label, text_color, false);
|
||||
ozone_draw_text(video_info, ozone, msg, margin + padding * 2, margin + padding + ozone->sublabel_font_glyph_height + y_offset, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_label, text_color, false);
|
||||
|
||||
/* Cursor */
|
||||
if (i == list->size - 1)
|
||||
@ -315,12 +322,12 @@ void ozone_draw_osk(ozone_handle_t *ozone,
|
||||
if (ozone->osk_cursor)
|
||||
{
|
||||
unsigned cursor_x = draw_placeholder ? 0 : font_driver_get_message_width(ozone->fonts.entries_label, msg, (unsigned)strlen(msg), 1);
|
||||
menu_display_draw_quad(video_info, margin + padding*2 + cursor_x, margin + padding + y_offset + 3, 1, 25, video_info->width, video_info->height, ozone_pure_white);
|
||||
menu_display_draw_quad(video_info, margin + padding*2 + cursor_x, margin + padding + y_offset + ozone->dimensions.spacer_3px, ozone->dimensions.spacer_1px, 25 * scale_factor, video_info->width, video_info->height, ozone_pure_white);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
y_offset += 25;
|
||||
y_offset += 25 * scale_factor;
|
||||
}
|
||||
}
|
||||
|
||||
@ -342,11 +349,11 @@ void ozone_draw_messagebox(ozone_handle_t *ozone,
|
||||
{
|
||||
unsigned i, y_position;
|
||||
int x, y, longest = 0, longest_width = 0;
|
||||
float line_height = 0;
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
struct string_list *list = !string_is_empty(message)
|
||||
? string_split(message, "\n") : NULL;
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
|
||||
if (!list || !ozone || !ozone->fonts.footer)
|
||||
{
|
||||
@ -358,14 +365,12 @@ void ozone_draw_messagebox(ozone_handle_t *ozone,
|
||||
if (list->elems == 0)
|
||||
goto end;
|
||||
|
||||
line_height = 25;
|
||||
|
||||
y_position = height / 2;
|
||||
if (menu_input_dialog_get_display_kb())
|
||||
y_position = height / 4;
|
||||
|
||||
x = width / 2;
|
||||
y = y_position - (list->size-1) * line_height / 2;
|
||||
y = y_position - (list->size * ozone->footer_font_glyph_height) / 2;
|
||||
|
||||
/* find the longest line width */
|
||||
for (i = 0; i < list->size; i++)
|
||||
@ -386,18 +391,24 @@ void ozone_draw_messagebox(ozone_handle_t *ozone,
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
if (ozone->has_all_assets) /* avoid drawing a black box if there's no assets */
|
||||
{
|
||||
int slice_x = x - longest_width/2 - 48 * scale_factor;
|
||||
unsigned slice_new_w = longest_width + 48 * 2 * scale_factor;
|
||||
unsigned slice_new_h = ozone->footer_font_glyph_height * (list->size + 2);
|
||||
|
||||
menu_display_draw_texture_slice(
|
||||
video_info,
|
||||
x - longest_width/2 - 48,
|
||||
y + 16 - 48,
|
||||
slice_x,
|
||||
y,
|
||||
256, 256,
|
||||
longest_width + 48 * 2,
|
||||
line_height * list->size + 48 * 2,
|
||||
slice_new_w,
|
||||
slice_new_h,
|
||||
width, height,
|
||||
ozone->theme_dynamic.message_background,
|
||||
16, 1.0,
|
||||
16, scale_factor,
|
||||
ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_DIALOG_SLICE]
|
||||
);
|
||||
}
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
@ -407,7 +418,7 @@ void ozone_draw_messagebox(ozone_handle_t *ozone,
|
||||
ozone_draw_text(video_info, ozone,
|
||||
msg,
|
||||
x - longest_width/2.0,
|
||||
y + (i+0.75) * line_height,
|
||||
y + (i + 1) * ozone->footer_font_glyph_height,
|
||||
TEXT_ALIGN_LEFT,
|
||||
width, height,
|
||||
ozone->fonts.footer,
|
||||
@ -434,7 +445,7 @@ void ozone_draw_fullscreen_thumbnails(
|
||||
unsigned width = video_info->width;
|
||||
unsigned height = video_info->height;
|
||||
int view_width = (int)width;
|
||||
int view_height = (int)height - ozone->dimensions.header_height - ozone->dimensions.footer_height - 1;
|
||||
int view_height = (int)height - ozone->dimensions.header_height - ozone->dimensions.footer_height - ozone->dimensions.spacer_1px;
|
||||
int thumbnail_margin = ozone->dimensions.fullscreen_thumbnail_padding;
|
||||
bool show_right_thumbnail = false;
|
||||
bool show_left_thumbnail = false;
|
||||
@ -506,7 +517,7 @@ void ozone_draw_fullscreen_thumbnails(
|
||||
/* > Thumbnail bounding box height + y position
|
||||
* are fixed */
|
||||
thumbnail_box_height = view_height - (thumbnail_margin * 2);
|
||||
thumbnail_y = ozone->dimensions.header_height + thumbnail_margin + 1;
|
||||
thumbnail_y = ozone->dimensions.header_height + thumbnail_margin + ozone->dimensions.spacer_1px;
|
||||
|
||||
/* Thumbnail bounding box width and x position
|
||||
* depend upon number of active thumbnails */
|
||||
@ -597,7 +608,7 @@ void ozone_draw_fullscreen_thumbnails(
|
||||
menu_display_draw_quad(
|
||||
video_info,
|
||||
0,
|
||||
ozone->dimensions.header_height + 1,
|
||||
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
|
||||
width,
|
||||
(unsigned)view_height,
|
||||
width,
|
||||
@ -610,7 +621,7 @@ void ozone_draw_fullscreen_thumbnails(
|
||||
0,
|
||||
ozone->dimensions.header_height,
|
||||
width,
|
||||
1,
|
||||
ozone->dimensions.spacer_1px,
|
||||
width,
|
||||
height,
|
||||
separator_color);
|
||||
@ -620,7 +631,7 @@ void ozone_draw_fullscreen_thumbnails(
|
||||
0,
|
||||
height - ozone->dimensions.footer_height,
|
||||
width,
|
||||
1,
|
||||
ozone->dimensions.spacer_1px,
|
||||
width,
|
||||
height,
|
||||
separator_color);
|
||||
|
@ -53,8 +53,9 @@ static void ozone_draw_entry_value(ozone_handle_t *ozone,
|
||||
uint32_t alpha_uint32,
|
||||
menu_entry_t *entry)
|
||||
{
|
||||
bool switch_is_on = true;
|
||||
bool do_draw_text = false;
|
||||
bool switch_is_on = true;
|
||||
bool do_draw_text = false;
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
|
||||
if (!entry->checked && string_is_empty(value))
|
||||
return;
|
||||
@ -63,7 +64,7 @@ static void ozone_draw_entry_value(ozone_handle_t *ozone,
|
||||
if (entry->checked)
|
||||
{
|
||||
menu_display_blend_begin(video_info);
|
||||
ozone_draw_icon(video_info, 30, 30, ozone->theme->textures[OZONE_THEME_TEXTURE_CHECK], x - 20, y - 22, video_info->width, video_info->height, 0, 1, ozone->theme_dynamic.entries_checkmark);
|
||||
ozone_draw_icon(video_info, 30 * scale_factor, 30 * scale_factor, ozone->theme->textures[OZONE_THEME_TEXTURE_CHECK], x - 20 * scale_factor, y - 22 * scale_factor, video_info->width, video_info->height, 0, 1, ozone->theme_dynamic.entries_checkmark);
|
||||
menu_display_blend_end(video_info);
|
||||
return;
|
||||
}
|
||||
@ -145,7 +146,7 @@ void ozone_update_scroll(ozone_handle_t *ozone, bool allow_animation, ozone_node
|
||||
node->position_y +
|
||||
node->height / 2;
|
||||
|
||||
bottom_boundary = video_info_height - ozone->dimensions.header_height - 1 - ozone->dimensions.footer_height;
|
||||
bottom_boundary = video_info_height - ozone->dimensions.header_height - ozone->dimensions.spacer_1px - ozone->dimensions.footer_height;
|
||||
entries_middle = video_info_height/2;
|
||||
|
||||
new_scroll = ozone->animations.scroll_y - (current_selection_middle_onscreen - entries_middle);
|
||||
@ -199,7 +200,7 @@ void ozone_compute_entries_position(ozone_handle_t *ozone)
|
||||
|
||||
file_list_t *selection_buf = NULL;
|
||||
int entry_padding = ozone_get_entries_padding(ozone, false);
|
||||
unsigned sublabel_line_height = font_driver_get_line_height(ozone->fonts.entries_sublabel, 1.0f);
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
|
||||
|
||||
@ -254,7 +255,7 @@ void ozone_compute_entries_position(ozone_handle_t *ozone)
|
||||
char wrapped_sublabel_str[MENU_SUBLABEL_MAX_LENGTH];
|
||||
wrapped_sublabel_str[0] = '\0';
|
||||
|
||||
node->height += ozone->dimensions.entry_spacing + 40;
|
||||
node->height += ozone->dimensions.entry_spacing + 40 * scale_factor;
|
||||
|
||||
sublabel_max_width = video_info_width -
|
||||
entry_padding * 2 - ozone->dimensions.entry_icon_padding * 2;
|
||||
@ -271,7 +272,7 @@ void ozone_compute_entries_position(ozone_handle_t *ozone)
|
||||
|
||||
if (lines > 1)
|
||||
{
|
||||
node->height += (lines - 1) * sublabel_line_height;
|
||||
node->height += (lines - 1) * ozone->sublabel_font_glyph_height;
|
||||
node->wrap = true;
|
||||
}
|
||||
}
|
||||
@ -363,6 +364,8 @@ void ozone_draw_entries(ozone_handle_t *ozone, video_frame_info_t *video_info,
|
||||
int16_t cursor_x = 0;
|
||||
int16_t cursor_y = 0;
|
||||
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
|
||||
menu_input_get_pointer_state(&pointer);
|
||||
|
||||
if (pointer.type != MENU_POINTER_DISABLED)
|
||||
@ -385,7 +388,7 @@ void ozone_draw_entries(ozone_handle_t *ozone, video_frame_info_t *video_info,
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
|
||||
|
||||
entries_end = file_list_get_size(selection_buf);
|
||||
y = ozone->dimensions.header_height + 1 + ozone->dimensions.entry_padding_vertical;
|
||||
y = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.entry_padding_vertical;
|
||||
sidebar_offset = ozone->sidebar_offset;
|
||||
entry_width = video_info->width - (unsigned) ozone->dimensions.sidebar_width - ozone->sidebar_offset - entry_padding * 2 - ozone->animations.thumbnail_bar_position;
|
||||
button_height = ozone->dimensions.entry_height; /* height of the button (entry minus sublabel) */
|
||||
@ -402,9 +405,9 @@ void ozone_draw_entries(ozone_handle_t *ozone, video_frame_info_t *video_info,
|
||||
if (alpha != 1.0f)
|
||||
{
|
||||
if (old_list)
|
||||
x_offset += invert * -(alpha_anim * 120); /* left */
|
||||
x_offset += invert * -(alpha_anim * 120 * scale_factor); /* left */
|
||||
else
|
||||
x_offset += invert * (alpha_anim * 120); /* right */
|
||||
x_offset += invert * (alpha_anim * 120 * scale_factor); /* right */
|
||||
}
|
||||
|
||||
x_offset += (int) sidebar_offset;
|
||||
@ -431,9 +434,9 @@ void ozone_draw_entries(ozone_handle_t *ozone, video_frame_info_t *video_info,
|
||||
if (!node || ozone->empty_playlist)
|
||||
goto border_iterate;
|
||||
|
||||
if (y + scroll_y + node->height + 20 < ozone->dimensions.header_height + ozone->dimensions.entry_padding_vertical)
|
||||
if (y + scroll_y + node->height + 20 * scale_factor < ozone->dimensions.header_height + ozone->dimensions.entry_padding_vertical)
|
||||
goto border_iterate;
|
||||
else if (y + scroll_y - node->height - 20 > bottom_boundary)
|
||||
else if (y + scroll_y - node->height - 20 * scale_factor > bottom_boundary)
|
||||
goto border_iterate;
|
||||
|
||||
border_start_x = (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding;
|
||||
@ -444,9 +447,9 @@ void ozone_draw_entries(ozone_handle_t *ozone, video_frame_info_t *video_info,
|
||||
|
||||
/* Borders */
|
||||
menu_display_draw_quad(video_info, border_start_x,
|
||||
border_start_y, entry_width, 1, video_info->width, video_info->height, ozone->theme_dynamic.entries_border);
|
||||
border_start_y, entry_width, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme_dynamic.entries_border);
|
||||
menu_display_draw_quad(video_info, border_start_x,
|
||||
border_start_y + button_height, entry_width, 1, video_info->width, video_info->height, ozone->theme_dynamic.entries_border);
|
||||
border_start_y + button_height, entry_width, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme_dynamic.entries_border);
|
||||
|
||||
/* Cursor */
|
||||
if (!old_list && ozone->cursor_mode)
|
||||
@ -461,16 +464,16 @@ border_iterate:
|
||||
|
||||
/* Cursor(s) layer - current */
|
||||
if (!ozone->cursor_in_sidebar)
|
||||
ozone_draw_cursor(ozone, video_info, (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + 3,
|
||||
entry_width - 5, button_height + 2, selection_y + scroll_y + 1, ozone->animations.cursor_alpha * alpha);
|
||||
ozone_draw_cursor(ozone, video_info, (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.spacer_3px,
|
||||
entry_width - ozone->dimensions.spacer_5px, button_height + ozone->dimensions.spacer_2px, selection_y + scroll_y + ozone->dimensions.spacer_1px, ozone->animations.cursor_alpha * alpha);
|
||||
|
||||
/* Old*/
|
||||
if (!ozone->cursor_in_sidebar_old)
|
||||
ozone_draw_cursor(ozone, video_info, (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + 3,
|
||||
entry_width - 5, button_height + 2, old_selection_y + scroll_y + 1, (1-ozone->animations.cursor_alpha) * alpha);
|
||||
ozone_draw_cursor(ozone, video_info, (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.spacer_3px,
|
||||
entry_width - ozone->dimensions.spacer_5px, button_height + ozone->dimensions.spacer_2px, old_selection_y + scroll_y + ozone->dimensions.spacer_1px, (1-ozone->animations.cursor_alpha) * alpha);
|
||||
|
||||
/* Icons + text */
|
||||
y = ozone->dimensions.header_height + 1 + ozone->dimensions.entry_padding_vertical;
|
||||
y = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.entry_padding_vertical;
|
||||
|
||||
if (old_list)
|
||||
y += ozone->old_list_offset_y;
|
||||
@ -527,9 +530,9 @@ border_iterate:
|
||||
if (!node)
|
||||
continue;
|
||||
|
||||
if (y + scroll_y + node->height + 20 < ozone->dimensions.header_height + ozone->dimensions.entry_padding_vertical)
|
||||
if (y + scroll_y + node->height + 20 * scale_factor < ozone->dimensions.header_height + ozone->dimensions.entry_padding_vertical)
|
||||
goto icons_iterate;
|
||||
else if (y + scroll_y - node->height - 20 > bottom_boundary)
|
||||
else if (y + scroll_y - node->height - 20 * scale_factor > bottom_boundary)
|
||||
goto icons_iterate;
|
||||
|
||||
/* Prepare text */
|
||||
@ -538,7 +541,7 @@ border_iterate:
|
||||
if (use_smooth_ticker)
|
||||
{
|
||||
ticker_smooth.selected = entry_selected && !ozone->cursor_in_sidebar;
|
||||
ticker_smooth.field_width = entry_width - entry_padding - 10 - ozone->dimensions.entry_icon_padding;
|
||||
ticker_smooth.field_width = entry_width - entry_padding - (10 * scale_factor) - ozone->dimensions.entry_icon_padding;
|
||||
ticker_smooth.src_str = entry_rich_label;
|
||||
ticker_smooth.dst_str = rich_label;
|
||||
ticker_smooth.dst_str_len = sizeof(rich_label);
|
||||
@ -550,7 +553,7 @@ border_iterate:
|
||||
ticker.s = rich_label;
|
||||
ticker.str = entry_rich_label;
|
||||
ticker.selected = entry_selected && !ozone->cursor_in_sidebar;
|
||||
ticker.len = (entry_width - entry_padding - 10 - ozone->dimensions.entry_icon_padding) / ozone->entry_font_glyph_width;
|
||||
ticker.len = (entry_width - entry_padding - (10 * scale_factor) - ozone->dimensions.entry_icon_padding) / ozone->entry_font_glyph_width;
|
||||
|
||||
menu_animation_ticker(&ticker);
|
||||
}
|
||||
@ -560,8 +563,8 @@ border_iterate:
|
||||
/* Note: This entry can never be selected, so ticker_x_offset
|
||||
* is irrelevant here (i.e. this text will never scroll) */
|
||||
unsigned text_width = font_driver_get_message_width(ozone->fonts.entries_label, rich_label, (unsigned)strlen(rich_label), 1);
|
||||
x_offset = (video_info_width - (unsigned) ozone->dimensions.sidebar_width - entry_padding * 2) / 2 - text_width / 2 - 60;
|
||||
y = video_info_height / 2 - 60;
|
||||
x_offset = (video_info_width - (unsigned) ozone->dimensions.sidebar_width - entry_padding * 2) / 2 - text_width / 2 - 60 * scale_factor;
|
||||
y = video_info_height / 2 - 60 * scale_factor;
|
||||
}
|
||||
|
||||
menu_entry_get_sublabel(&entry, &sublabel_str);
|
||||
@ -628,10 +631,10 @@ border_iterate:
|
||||
|
||||
/* Draw text */
|
||||
ozone_draw_text(video_info, ozone, rich_label, ticker_x_offset + text_offset + (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.entry_icon_size + ozone->dimensions.entry_icon_padding * 2,
|
||||
y + ozone->dimensions.entry_height / 2 + FONT_SIZE_ENTRIES_LABEL * 3/8 + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_label, COLOR_TEXT_ALPHA(ozone->theme->text_rgba, alpha_uint32), false);
|
||||
y + ozone->dimensions.entry_height / 2 + ozone->entry_font_glyph_height * 3.0f/10.0f + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_label, COLOR_TEXT_ALPHA(ozone->theme->text_rgba, alpha_uint32), false);
|
||||
if (!string_is_empty(sublabel_str))
|
||||
ozone_draw_text(video_info, ozone, sublabel_str, (unsigned) ozone->dimensions.sidebar_width + x_offset + entry_padding + ozone->dimensions.entry_icon_padding,
|
||||
y + ozone->dimensions.entry_height + 1 + 5 + FONT_SIZE_ENTRIES_SUBLABEL + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
|
||||
y + ozone->dimensions.entry_height + ozone->dimensions.spacer_1px + ozone->dimensions.spacer_5px + ozone->sublabel_font_glyph_height + scroll_y, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.entries_sublabel, COLOR_TEXT_ALPHA(ozone->theme->text_sublabel_rgba, alpha_uint32), false);
|
||||
|
||||
/* Value */
|
||||
if (use_smooth_ticker)
|
||||
@ -661,7 +664,7 @@ border_iterate:
|
||||
|
||||
ozone_draw_entry_value(ozone, video_info, entry_value_ticker,
|
||||
value_x_offset + (unsigned) ozone->dimensions.sidebar_width + entry_padding + x_offset + entry_width - ozone->dimensions.entry_icon_padding,
|
||||
y + ozone->dimensions.entry_height / 2 + FONT_SIZE_ENTRIES_LABEL * 3/8 + scroll_y, alpha_uint32, &entry);
|
||||
y + ozone->dimensions.entry_height / 2 + ozone->entry_font_glyph_height * 3.0f/10.0f + scroll_y, alpha_uint32, &entry);
|
||||
|
||||
icons_iterate:
|
||||
y += node->height;
|
||||
@ -680,7 +683,6 @@ static void ozone_draw_no_thumbnail_available(ozone_handle_t *ozone,
|
||||
{
|
||||
unsigned icon = OZONE_ENTRIES_ICONS_TEXTURE_CORE_INFO;
|
||||
unsigned icon_size = (unsigned)((float)ozone->dimensions.sidebar_entry_icon_size * 1.5f);
|
||||
unsigned text_height = font_driver_get_line_height(ozone->fonts.footer, 1.0f);
|
||||
|
||||
menu_display_blend_begin(video_info);
|
||||
ozone_draw_icon(video_info,
|
||||
@ -698,7 +700,7 @@ static void ozone_draw_no_thumbnail_available(ozone_handle_t *ozone,
|
||||
ozone,
|
||||
msg_hash_to_str(MSG_NO_THUMBNAIL_AVAILABLE),
|
||||
x_position + sidebar_width/2,
|
||||
video_info->height / 2 - icon_size/2 + text_height * 3 + FONT_SIZE_FOOTER - y_offset,
|
||||
video_info->height / 2 - icon_size/2 + ozone->footer_font_glyph_height * 4 - y_offset,
|
||||
TEXT_ALIGN_CENTER,
|
||||
video_info->width, video_info->height,
|
||||
ozone->fonts.footer,
|
||||
@ -710,12 +712,10 @@ static void ozone_draw_no_thumbnail_available(ozone_handle_t *ozone,
|
||||
static void ozone_content_metadata_line(video_frame_info_t *video_info, ozone_handle_t *ozone,
|
||||
unsigned *y, unsigned column_x, const char *text, unsigned lines_count)
|
||||
{
|
||||
int line_height = font_driver_get_line_height(ozone->fonts.footer, 1);
|
||||
|
||||
ozone_draw_text(video_info, ozone,
|
||||
text,
|
||||
column_x,
|
||||
*y + FONT_SIZE_FOOTER,
|
||||
*y + ozone->footer_font_glyph_height,
|
||||
TEXT_ALIGN_LEFT,
|
||||
video_info->width, video_info->height,
|
||||
ozone->fonts.footer,
|
||||
@ -724,16 +724,16 @@ static void ozone_content_metadata_line(video_frame_info_t *video_info, ozone_ha
|
||||
);
|
||||
|
||||
if (lines_count > 0)
|
||||
*y += (unsigned)(line_height * (lines_count - 1)) + (unsigned)((float)line_height * 1.5f);
|
||||
*y += (unsigned)(ozone->footer_font_glyph_height * (lines_count - 1)) + (unsigned)((float)ozone->footer_font_glyph_height * 1.5f);
|
||||
}
|
||||
|
||||
void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
{
|
||||
unsigned sidebar_height = video_info->height - ozone->dimensions.header_height - 55 - ozone->dimensions.footer_height;
|
||||
unsigned sidebar_height = video_info->height - ozone->dimensions.header_height - ozone->dimensions.sidebar_gradient_height * 2 - ozone->dimensions.footer_height;
|
||||
unsigned sidebar_width = ozone->dimensions.thumbnail_bar_width;
|
||||
unsigned x_position = video_info->width - (unsigned) ozone->animations.thumbnail_bar_position;
|
||||
unsigned thumbnail_width = sidebar_width - (ozone->dimensions.sidebar_entry_icon_padding * 2);
|
||||
unsigned thumbnail_height = (video_info->height - ozone->dimensions.header_height - 2 - ozone->dimensions.footer_height - (ozone->dimensions.sidebar_entry_icon_padding * 3)) / 2;
|
||||
unsigned thumbnail_height = (video_info->height - ozone->dimensions.header_height - ozone->dimensions.spacer_2px - ozone->dimensions.footer_height - (ozone->dimensions.sidebar_entry_icon_padding * 3)) / 2;
|
||||
int thumbnail_x_position = x_position + ozone->dimensions.sidebar_entry_icon_padding;
|
||||
int right_thumbnail_y_position = 0;
|
||||
int left_thumbnail_y_position = 0;
|
||||
@ -744,9 +744,9 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
/* Background */
|
||||
if (!video_info->libretro_running)
|
||||
{
|
||||
menu_display_draw_quad(video_info, x_position, ozone->dimensions.header_height + 1, (unsigned) ozone->animations.thumbnail_bar_position, 55/2, video_info->width, video_info->height, ozone->theme->sidebar_top_gradient);
|
||||
menu_display_draw_quad(video_info, x_position, ozone->dimensions.header_height + 1 + 55/2, (unsigned) ozone->animations.thumbnail_bar_position, sidebar_height, video_info->width, video_info->height, ozone->theme->sidebar_background);
|
||||
menu_display_draw_quad(video_info, x_position, video_info->height - ozone->dimensions.footer_height - 55/2 - 1, (unsigned) ozone->animations.thumbnail_bar_position, 55/2 + 1, video_info->width, video_info->height, ozone->theme->sidebar_bottom_gradient);
|
||||
menu_display_draw_quad(video_info, x_position, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->animations.thumbnail_bar_position, ozone->dimensions.sidebar_gradient_height, video_info->width, video_info->height, ozone->theme->sidebar_top_gradient);
|
||||
menu_display_draw_quad(video_info, x_position, ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_gradient_height, (unsigned) ozone->animations.thumbnail_bar_position, sidebar_height, video_info->width, video_info->height, ozone->theme->sidebar_background);
|
||||
menu_display_draw_quad(video_info, x_position, video_info->height - ozone->dimensions.footer_height - ozone->dimensions.sidebar_gradient_height - ozone->dimensions.spacer_1px, (unsigned) ozone->animations.thumbnail_bar_position, ozone->dimensions.sidebar_gradient_height + ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->sidebar_bottom_gradient);
|
||||
}
|
||||
|
||||
/* Thumbnails */
|
||||
@ -787,7 +787,7 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
}
|
||||
else
|
||||
right_thumbnail_y_position =
|
||||
ozone->dimensions.header_height + 1 +
|
||||
ozone->dimensions.header_height + ozone->dimensions.spacer_1px +
|
||||
ozone->dimensions.sidebar_entry_icon_padding;
|
||||
|
||||
menu_thumbnail_draw(
|
||||
@ -812,7 +812,7 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
|
||||
/* Bottom row : "left" thumbnail or content metadata */
|
||||
left_thumbnail_y_position =
|
||||
ozone->dimensions.header_height + 1 +
|
||||
ozone->dimensions.header_height + ozone->dimensions.spacer_1px +
|
||||
thumbnail_height +
|
||||
(ozone->dimensions.sidebar_entry_icon_padding * 2);
|
||||
|
||||
@ -877,7 +877,7 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i
|
||||
/* Separator */
|
||||
menu_display_draw_quad(video_info,
|
||||
x_position + separator_padding, y,
|
||||
sidebar_width - separator_padding*2, 1,
|
||||
sidebar_width - separator_padding*2, ozone->dimensions.spacer_1px,
|
||||
video_info->width, video_info->height,
|
||||
ozone->theme_dynamic.entries_border);
|
||||
|
||||
|
@ -116,6 +116,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
settings_t *settings = config_get_ptr();
|
||||
uint32_t text_alpha = ozone->animations.sidebar_text_alpha * 255.0f;
|
||||
bool use_smooth_ticker = settings->bools.menu_ticker_smooth;
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
|
||||
/* Initial ticker configuration */
|
||||
if (use_smooth_ticker)
|
||||
@ -148,32 +149,32 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
menu_display_scissor_begin(video_info, 0, ozone->dimensions.header_height, (unsigned) ozone->dimensions.sidebar_width, video_info->height - ozone->dimensions.header_height - ozone->dimensions.footer_height);
|
||||
|
||||
/* Background */
|
||||
sidebar_height = video_info->height - ozone->dimensions.header_height - 55 - ozone->dimensions.footer_height;
|
||||
sidebar_height = video_info->height - ozone->dimensions.header_height - ozone->dimensions.sidebar_gradient_height * 2 - ozone->dimensions.footer_height;
|
||||
|
||||
if (!video_info->libretro_running)
|
||||
{
|
||||
menu_display_draw_quad(video_info, ozone->sidebar_offset, ozone->dimensions.header_height + 1, (unsigned) ozone->dimensions.sidebar_width, 55/2, video_info->width, video_info->height, ozone->theme->sidebar_top_gradient);
|
||||
menu_display_draw_quad(video_info, ozone->sidebar_offset, ozone->dimensions.header_height + 1 + 55/2, (unsigned) ozone->dimensions.sidebar_width, sidebar_height, video_info->width, video_info->height, ozone->theme->sidebar_background);
|
||||
menu_display_draw_quad(video_info, ozone->sidebar_offset, video_info->height - ozone->dimensions.footer_height - 55/2 - 1, (unsigned) ozone->dimensions.sidebar_width, 55/2 + 1, video_info->width, video_info->height, ozone->theme->sidebar_bottom_gradient);
|
||||
menu_display_draw_quad(video_info, ozone->sidebar_offset, ozone->dimensions.header_height + ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.sidebar_gradient_height, video_info->width, video_info->height, ozone->theme->sidebar_top_gradient);
|
||||
menu_display_draw_quad(video_info, ozone->sidebar_offset, ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_gradient_height, (unsigned) ozone->dimensions.sidebar_width, sidebar_height, video_info->width, video_info->height, ozone->theme->sidebar_background);
|
||||
menu_display_draw_quad(video_info, ozone->sidebar_offset, video_info->height - ozone->dimensions.footer_height - ozone->dimensions.sidebar_gradient_height - ozone->dimensions.spacer_1px, (unsigned) ozone->dimensions.sidebar_width, ozone->dimensions.sidebar_gradient_height + ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->sidebar_bottom_gradient);
|
||||
}
|
||||
|
||||
/* Tabs */
|
||||
/* y offset computation */
|
||||
y = ozone->dimensions.header_height + 1 + ozone->dimensions.sidebar_padding_vertical;
|
||||
y = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_padding_vertical;
|
||||
for (i = 0; i < ozone->system_tab_end + horizontal_list_size + 1; i++)
|
||||
{
|
||||
if (i == ozone->categories_selection_ptr)
|
||||
{
|
||||
selection_y = (unsigned)y;
|
||||
if (ozone->categories_selection_ptr > ozone->system_tab_end)
|
||||
selection_y += ozone->dimensions.sidebar_entry_padding_vertical + 1;
|
||||
selection_y += ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px;
|
||||
}
|
||||
|
||||
if (i == ozone->categories_active_idx_old)
|
||||
{
|
||||
selection_old_y = (unsigned)y;
|
||||
if (ozone->categories_active_idx_old > ozone->system_tab_end)
|
||||
selection_old_y += ozone->dimensions.sidebar_entry_padding_vertical + 1;
|
||||
selection_old_y += ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px;
|
||||
}
|
||||
|
||||
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
|
||||
@ -183,15 +184,15 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
|
||||
/* Cursor */
|
||||
if (ozone->cursor_in_sidebar)
|
||||
ozone_draw_cursor(ozone, video_info, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + 3,
|
||||
entry_width - 5, ozone->dimensions.sidebar_entry_height + 2, selection_y + 1 + ozone->animations.scroll_y_sidebar, ozone->animations.cursor_alpha);
|
||||
ozone_draw_cursor(ozone, video_info, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.spacer_3px,
|
||||
entry_width - ozone->dimensions.spacer_5px, ozone->dimensions.sidebar_entry_height + ozone->dimensions.spacer_2px, selection_y + ozone->dimensions.spacer_2px + ozone->animations.scroll_y_sidebar, ozone->animations.cursor_alpha);
|
||||
|
||||
if (ozone->cursor_in_sidebar_old)
|
||||
ozone_draw_cursor(ozone, video_info, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + 3,
|
||||
entry_width - 5, ozone->dimensions.sidebar_entry_height + 2, selection_old_y + 1 + ozone->animations.scroll_y_sidebar, 1-ozone->animations.cursor_alpha);
|
||||
ozone_draw_cursor(ozone, video_info, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.spacer_3px,
|
||||
entry_width - ozone->dimensions.spacer_5px, ozone->dimensions.sidebar_entry_height + ozone->dimensions.spacer_2px, selection_old_y + ozone->dimensions.spacer_2px + ozone->animations.scroll_y_sidebar, 1-ozone->animations.cursor_alpha);
|
||||
|
||||
/* Menu tabs */
|
||||
y = ozone->dimensions.header_height + 1 + ozone->dimensions.sidebar_padding_vertical;
|
||||
y = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_padding_vertical;
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
for (i = 0; i < (unsigned)(ozone->system_tab_end+1); i++)
|
||||
@ -214,7 +215,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
/* Text */
|
||||
if (!ozone->sidebar_collapsed)
|
||||
ozone_draw_text(video_info, ozone, title, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.sidebar_entry_icon_padding * 2 + ozone->dimensions.sidebar_entry_icon_size,
|
||||
y + ozone->dimensions.sidebar_entry_height / 2 + FONT_SIZE_SIDEBAR * 3/8 + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.sidebar, text_color, true);
|
||||
y + ozone->dimensions.sidebar_entry_height / 2 + ozone->sidebar_font_glyph_height * 3.0f/10.0f + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.sidebar, text_color, true);
|
||||
|
||||
y += ozone->dimensions.sidebar_entry_height + ozone->dimensions.sidebar_entry_padding_vertical;
|
||||
}
|
||||
@ -224,9 +225,9 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
/* Console tabs */
|
||||
if (horizontal_list_size > 0)
|
||||
{
|
||||
menu_display_draw_quad(video_info, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal, y + ozone->animations.scroll_y_sidebar, entry_width, 1, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
menu_display_draw_quad(video_info, ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal, y + ozone->animations.scroll_y_sidebar, entry_width, ozone->dimensions.spacer_1px, video_info->width, video_info->height, ozone->theme->entries_border);
|
||||
|
||||
y += ozone->dimensions.sidebar_entry_padding_vertical + 1;
|
||||
y += ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px;
|
||||
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
@ -253,7 +254,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
if (use_smooth_ticker)
|
||||
{
|
||||
ticker_smooth.selected = selected;
|
||||
ticker_smooth.field_width = (entry_width - ozone->dimensions.sidebar_entry_icon_size - 40);
|
||||
ticker_smooth.field_width = (entry_width - ozone->dimensions.sidebar_entry_icon_size - 40 * scale_factor);
|
||||
ticker_smooth.src_str = node->console_name;
|
||||
ticker_smooth.dst_str = console_title;
|
||||
ticker_smooth.dst_str_len = sizeof(console_title);
|
||||
@ -262,7 +263,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
}
|
||||
else
|
||||
{
|
||||
ticker.len = (entry_width - ozone->dimensions.sidebar_entry_icon_size - 40) / ozone->sidebar_font_glyph_width;
|
||||
ticker.len = (entry_width - ozone->dimensions.sidebar_entry_icon_size - 40 * scale_factor) / ozone->sidebar_font_glyph_width;
|
||||
ticker.s = console_title;
|
||||
ticker.selected = selected;
|
||||
ticker.str = node->console_name;
|
||||
@ -271,7 +272,7 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
}
|
||||
|
||||
ozone_draw_text(video_info, ozone, console_title, ticker_x_offset + ozone->sidebar_offset + ozone->dimensions.sidebar_padding_horizontal + ozone->dimensions.sidebar_entry_icon_padding * 2 + ozone->dimensions.sidebar_entry_icon_size,
|
||||
y + ozone->dimensions.sidebar_entry_height / 2 + FONT_SIZE_SIDEBAR * 3/8 + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT,
|
||||
y + ozone->dimensions.sidebar_entry_height / 2 + ozone->sidebar_font_glyph_height * 3.0f/10.0f + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT,
|
||||
video_info->width, video_info->height, ozone->fonts.sidebar, text_color, true);
|
||||
|
||||
console_iterate:
|
||||
@ -344,14 +345,14 @@ unsigned ozone_get_selected_sidebar_y_position(ozone_handle_t *ozone)
|
||||
{
|
||||
return ozone->categories_selection_ptr * ozone->dimensions.sidebar_entry_height +
|
||||
(ozone->categories_selection_ptr - 1) * ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.sidebar_padding_vertical +
|
||||
(ozone->categories_selection_ptr > ozone->system_tab_end ? ozone->dimensions.sidebar_entry_padding_vertical + 1 : 0);
|
||||
(ozone->categories_selection_ptr > ozone->system_tab_end ? ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px : 0);
|
||||
}
|
||||
|
||||
unsigned ozone_get_sidebar_height(ozone_handle_t *ozone)
|
||||
{
|
||||
int entries = (int)(ozone->system_tab_end + 1 + (ozone->horizontal_list ? ozone->horizontal_list->size : 0));
|
||||
return entries * ozone->dimensions.sidebar_entry_height + (entries - 1) * ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.sidebar_padding_vertical +
|
||||
(ozone->horizontal_list && ozone->horizontal_list->size > 0 ? ozone->dimensions.sidebar_entry_padding_vertical + 1 : 0);
|
||||
(ozone->horizontal_list && ozone->horizontal_list->size > 0 ? ozone->dimensions.sidebar_entry_padding_vertical + ozone->dimensions.spacer_1px : 0);
|
||||
}
|
||||
|
||||
static void ozone_sidebar_collapse_end(void *userdata)
|
||||
@ -435,6 +436,33 @@ void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
|
||||
ozone_entries_update_thumbnail_bar(ozone, is_playlist, allow_animation);
|
||||
}
|
||||
|
||||
static float ozone_sidebar_get_scroll_y(ozone_handle_t *ozone, unsigned video_height)
|
||||
{
|
||||
float scroll_y = ozone->animations.scroll_y_sidebar;
|
||||
float selected_position_y;
|
||||
float current_selection_middle_onscreen;
|
||||
float bottom_boundary;
|
||||
float entries_middle;
|
||||
float entries_height;
|
||||
|
||||
selected_position_y = ozone_get_selected_sidebar_y_position(ozone);
|
||||
current_selection_middle_onscreen = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->animations.scroll_y_sidebar + selected_position_y + ozone->dimensions.sidebar_entry_height / 2.0f;
|
||||
bottom_boundary = (float)video_height - (ozone->dimensions.header_height + ozone->dimensions.spacer_1px) - ozone->dimensions.footer_height;
|
||||
entries_middle = (float)video_height / 2.0f;
|
||||
entries_height = ozone_get_sidebar_height(ozone);
|
||||
|
||||
if (current_selection_middle_onscreen != entries_middle)
|
||||
scroll_y = ozone->animations.scroll_y_sidebar - (current_selection_middle_onscreen - entries_middle);
|
||||
|
||||
if (scroll_y + entries_height < bottom_boundary)
|
||||
scroll_y = bottom_boundary - entries_height - ozone->dimensions.sidebar_padding_vertical;
|
||||
|
||||
if (scroll_y > 0.0f)
|
||||
scroll_y = 0.0f;
|
||||
|
||||
return scroll_y;
|
||||
}
|
||||
|
||||
void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
|
||||
{
|
||||
unsigned video_info_height;
|
||||
@ -443,13 +471,6 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
|
||||
|
||||
menu_animation_ctx_tag tag;
|
||||
|
||||
float new_scroll;
|
||||
float selected_position_y;
|
||||
float current_selection_middle_onscreen;
|
||||
float bottom_boundary;
|
||||
float entries_middle;
|
||||
float entries_height;
|
||||
|
||||
video_driver_get_size(NULL, &video_info_height);
|
||||
|
||||
tag = (uintptr_t)ozone;
|
||||
@ -478,29 +499,13 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
|
||||
menu_animation_push(&entry);
|
||||
|
||||
/* Scroll animation */
|
||||
new_scroll = 0;
|
||||
selected_position_y = ozone_get_selected_sidebar_y_position(ozone);
|
||||
current_selection_middle_onscreen = ozone->dimensions.header_height + 1 + ozone->animations.scroll_y_sidebar + selected_position_y + ozone->dimensions.sidebar_entry_height / 2;
|
||||
bottom_boundary = video_info_height - (ozone->dimensions.header_height + 1) - ozone->dimensions.footer_height;
|
||||
entries_middle = video_info_height/2;
|
||||
entries_height = ozone_get_sidebar_height(ozone);
|
||||
|
||||
if (current_selection_middle_onscreen != entries_middle)
|
||||
new_scroll = ozone->animations.scroll_y_sidebar - (current_selection_middle_onscreen - entries_middle);
|
||||
|
||||
if (new_scroll + entries_height < bottom_boundary)
|
||||
new_scroll = bottom_boundary - entries_height - ozone->dimensions.sidebar_padding_vertical;
|
||||
|
||||
if (new_scroll > 0)
|
||||
new_scroll = 0;
|
||||
|
||||
entry.cb = NULL;
|
||||
entry.duration = ANIMATION_CURSOR_DURATION;
|
||||
entry.easing_enum = EASING_OUT_QUAD;
|
||||
entry.subject = &ozone->animations.scroll_y_sidebar;
|
||||
entry.tag = tag;
|
||||
entry.target_value = new_scroll;
|
||||
entry.userdata = NULL;
|
||||
entry.cb = NULL;
|
||||
entry.duration = ANIMATION_CURSOR_DURATION;
|
||||
entry.easing_enum = EASING_OUT_QUAD;
|
||||
entry.subject = &ozone->animations.scroll_y_sidebar;
|
||||
entry.tag = tag;
|
||||
entry.target_value = ozone_sidebar_get_scroll_y(ozone, video_info_height);
|
||||
entry.userdata = NULL;
|
||||
|
||||
menu_animation_push(&entry);
|
||||
|
||||
@ -514,6 +519,68 @@ void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
|
||||
}
|
||||
}
|
||||
|
||||
void ozone_refresh_sidebars(ozone_handle_t *ozone, unsigned video_height)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_animation_ctx_tag collapsed_tag = (uintptr_t)&ozone->sidebar_collapsed;
|
||||
menu_animation_ctx_tag offset_tag = (uintptr_t)&ozone->sidebar_offset;
|
||||
menu_animation_ctx_tag thumbnail_tag = (uintptr_t)&ozone->show_thumbnail_bar;
|
||||
menu_animation_ctx_tag scroll_tag = (uintptr_t)ozone;
|
||||
bool is_playlist = ozone_is_playlist(ozone, false);
|
||||
|
||||
/* Kill any existing animations */
|
||||
menu_animation_kill_by_tag(&collapsed_tag);
|
||||
menu_animation_kill_by_tag(&offset_tag);
|
||||
menu_animation_kill_by_tag(&thumbnail_tag);
|
||||
if (ozone->depth == 1)
|
||||
menu_animation_kill_by_tag(&scroll_tag);
|
||||
|
||||
/* Set sidebar width */
|
||||
if (settings->bools.ozone_collapse_sidebar || (is_playlist && !ozone->cursor_in_sidebar))
|
||||
{
|
||||
ozone->animations.sidebar_text_alpha = 0.0f;
|
||||
ozone->dimensions.sidebar_width = ozone->dimensions.sidebar_width_collapsed;
|
||||
ozone->sidebar_collapsed = true;
|
||||
}
|
||||
else if (ozone->cursor_in_sidebar || (!is_playlist && !settings->bools.ozone_collapse_sidebar))
|
||||
{
|
||||
ozone->animations.sidebar_text_alpha = 1.0f;
|
||||
ozone->dimensions.sidebar_width = ozone->dimensions.sidebar_width_normal;
|
||||
ozone->sidebar_collapsed = false;
|
||||
}
|
||||
|
||||
/* Set sidebar offset */
|
||||
if (ozone->depth == 1)
|
||||
{
|
||||
ozone->sidebar_offset = 0.0f;
|
||||
ozone->draw_sidebar = true;
|
||||
}
|
||||
else if (ozone->depth > 1)
|
||||
{
|
||||
ozone->sidebar_offset = -ozone->dimensions.sidebar_width;
|
||||
ozone->draw_sidebar = false;
|
||||
}
|
||||
|
||||
/* Set thumbnail bar position */
|
||||
if (is_playlist && !ozone->cursor_in_sidebar && ozone->depth == 1)
|
||||
{
|
||||
ozone->animations.thumbnail_bar_position = ozone->dimensions.thumbnail_bar_width;
|
||||
ozone->show_thumbnail_bar = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ozone->animations.thumbnail_bar_position = 0.0f;
|
||||
ozone->show_thumbnail_bar = false;
|
||||
}
|
||||
|
||||
/* If sidebar is on-screen, update scroll position */
|
||||
if (ozone->depth == 1)
|
||||
{
|
||||
ozone->animations.cursor_alpha = 1.0f;
|
||||
ozone->animations.scroll_y_sidebar = ozone_sidebar_get_scroll_y(ozone, video_height);
|
||||
}
|
||||
}
|
||||
|
||||
void ozone_change_tab(ozone_handle_t *ozone,
|
||||
enum msg_hash_enums tab,
|
||||
enum menu_settings_type type)
|
||||
@ -661,7 +728,7 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||
|
||||
if (image_texture_load(&ti, texturepath))
|
||||
{
|
||||
if(ti.pixels)
|
||||
if (ti.pixels)
|
||||
{
|
||||
video_driver_texture_unload(&node->icon);
|
||||
video_driver_texture_load(&ti,
|
||||
@ -691,7 +758,7 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
|
||||
|
||||
if (image_texture_load(&ti, content_texturepath))
|
||||
{
|
||||
if(ti.pixels)
|
||||
if (ti.pixels)
|
||||
{
|
||||
video_driver_texture_unload(&node->content_icon);
|
||||
video_driver_texture_load(&ti,
|
||||
|
@ -1676,7 +1676,7 @@ static bool request_thumbnail(
|
||||
{
|
||||
/* Would like to cancel any existing image load tasks
|
||||
* here, but can't see how to do it... */
|
||||
if(task_push_image_load(thumbnail->path,
|
||||
if (task_push_image_load(thumbnail->path,
|
||||
video_driver_supports_rgba(), 0,
|
||||
(thumbnail_id == MENU_THUMBNAIL_LEFT) ?
|
||||
menu_display_handle_left_thumbnail_upload : menu_display_handle_thumbnail_upload, NULL))
|
||||
@ -1768,7 +1768,7 @@ static bool downscale_thumbnail(rgui_t *rgui, unsigned max_width, unsigned max_h
|
||||
* calls it - but do it anyway in case the
|
||||
* scaler_ctx_gen_filter() internals ever change... */
|
||||
scaler_ctx_gen_reset(&rgui->image_scaler);
|
||||
if(!scaler_ctx_gen_filter(&rgui->image_scaler))
|
||||
if (!scaler_ctx_gen_filter(&rgui->image_scaler))
|
||||
{
|
||||
/* Could be leftovers if scaler_ctx_gen_filter()
|
||||
* fails, so reset just in case... */
|
||||
@ -2218,36 +2218,36 @@ static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const ch
|
||||
goto end;
|
||||
|
||||
/* Parse config file */
|
||||
if(!config_get_hex(conf, "rgui_entry_normal_color", &normal_color))
|
||||
if (!config_get_hex(conf, "rgui_entry_normal_color", &normal_color))
|
||||
goto end;
|
||||
|
||||
if(!config_get_hex(conf, "rgui_entry_hover_color", &hover_color))
|
||||
if (!config_get_hex(conf, "rgui_entry_hover_color", &hover_color))
|
||||
goto end;
|
||||
|
||||
if(!config_get_hex(conf, "rgui_title_color", &title_color))
|
||||
if (!config_get_hex(conf, "rgui_title_color", &title_color))
|
||||
goto end;
|
||||
|
||||
if(!config_get_hex(conf, "rgui_bg_dark_color", &bg_dark_color))
|
||||
if (!config_get_hex(conf, "rgui_bg_dark_color", &bg_dark_color))
|
||||
goto end;
|
||||
|
||||
if(!config_get_hex(conf, "rgui_bg_light_color", &bg_light_color))
|
||||
if (!config_get_hex(conf, "rgui_bg_light_color", &bg_light_color))
|
||||
goto end;
|
||||
|
||||
if(!config_get_hex(conf, "rgui_border_dark_color", &border_dark_color))
|
||||
if (!config_get_hex(conf, "rgui_border_dark_color", &border_dark_color))
|
||||
goto end;
|
||||
|
||||
if(!config_get_hex(conf, "rgui_border_light_color", &border_light_color))
|
||||
if (!config_get_hex(conf, "rgui_border_light_color", &border_light_color))
|
||||
goto end;
|
||||
|
||||
/* Make shadow colour optional (fallback to fully opaque black)
|
||||
* - i.e. if user has no intention of enabling shadows, they
|
||||
* should not have to include this entry */
|
||||
if(!config_get_hex(conf, "rgui_shadow_color", &shadow_color))
|
||||
if (!config_get_hex(conf, "rgui_shadow_color", &shadow_color))
|
||||
shadow_color = 0xFF000000;
|
||||
|
||||
/* Make particle colour optional too (fallback to normal
|
||||
* rgb with bg_light alpha) */
|
||||
if(!config_get_hex(conf, "rgui_particle_color", &particle_color))
|
||||
if (!config_get_hex(conf, "rgui_particle_color", &particle_color))
|
||||
particle_color = (normal_color & 0x00FFFFFF) |
|
||||
(bg_light_color & 0xFF000000);
|
||||
|
||||
@ -3643,7 +3643,7 @@ static void rgui_render(void *data,
|
||||
* standard layout (even though it always will...),
|
||||
* so have to check whether there are an odd or even
|
||||
* number of entries... */
|
||||
if((rgui_term_layout.height & 1) == 0)
|
||||
if ((rgui_term_layout.height & 1) == 0)
|
||||
{
|
||||
/* Even number of entries */
|
||||
if ((show_thumbnail && (term_offset <= term_mid_point)) ||
|
||||
|
@ -219,7 +219,7 @@ HRESULT XuiTextureLoader(IXuiDevice *pDevice, LPCWSTR szFileName,
|
||||
|
||||
/* Cast our d3d device into our IDirect3DDevice9* interface */
|
||||
d3dDevice = (IDirect3DDevice9*)pDevice->GetD3DDevice();
|
||||
if(!d3dDevice)
|
||||
if (!d3dDevice)
|
||||
goto cleanup;
|
||||
|
||||
/* Create our texture based on our conditions */
|
||||
@ -241,7 +241,7 @@ HRESULT XuiTextureLoader(IXuiDevice *pDevice, LPCWSTR szFileName,
|
||||
ppTex
|
||||
);
|
||||
|
||||
if(hr != D3DXERR_INVALIDDATA )
|
||||
if (hr != D3DXERR_INVALIDDATA )
|
||||
{
|
||||
pImageInfo->Depth = pSrc.Depth;
|
||||
pImageInfo->Format = pSrc.Format;
|
||||
@ -477,7 +477,7 @@ static void xui_set_list_text(int index, const wchar_t* leftText,
|
||||
if (XuiHandleIsValid(hControl))
|
||||
XuiControlGetVisual(hControl, &hVisual);
|
||||
|
||||
if(!XuiHandleIsValid(hVisual))
|
||||
if (!XuiHandleIsValid(hVisual))
|
||||
return;
|
||||
|
||||
XuiElementGetChildById(hVisual, L"LeftText", &hTextLeft);
|
||||
@ -497,7 +497,7 @@ static void xui_set_list_text(int index, const wchar_t* leftText,
|
||||
XuiTextElementSetText(hTextLeft, leftText);
|
||||
XuiElementGetChildById(hVisual, L"RightText", &hTextRight);
|
||||
|
||||
if(XuiHandleIsValid(hTextRight))
|
||||
if (XuiHandleIsValid(hTextRight))
|
||||
{
|
||||
currText = XuiTextElementGetText(hTextRight);
|
||||
XuiElementGetBounds(hTextRight, &width, &height);
|
||||
|
@ -128,7 +128,7 @@ static void menu_display_d3d8_draw(menu_display_ctx_draw_t *draw,
|
||||
|
||||
if (!d3d || !draw || draw->pipeline.id)
|
||||
return;
|
||||
if((d3d->menu_display.offset + draw->coords->vertices )
|
||||
if ((d3d->menu_display.offset + draw->coords->vertices )
|
||||
> (unsigned)d3d->menu_display.size)
|
||||
return;
|
||||
|
||||
@ -185,7 +185,7 @@ static void menu_display_d3d8_draw(menu_display_ctx_draw_t *draw,
|
||||
}
|
||||
d3d8_vertex_buffer_unlock(d3d->menu_display.buffer);
|
||||
|
||||
if(!draw->matrix_data)
|
||||
if (!draw->matrix_data)
|
||||
draw->matrix_data = menu_display_d3d8_get_default_mvp(video_info);
|
||||
|
||||
/* ugh */
|
||||
|
@ -133,7 +133,7 @@ static void menu_display_d3d9_draw(menu_display_ctx_draw_t *draw,
|
||||
|
||||
dev = d3d->dev;
|
||||
|
||||
if((d3d->menu_display.offset + draw->coords->vertices )
|
||||
if ((d3d->menu_display.offset + draw->coords->vertices )
|
||||
> (unsigned)d3d->menu_display.size)
|
||||
return;
|
||||
|
||||
@ -180,7 +180,7 @@ static void menu_display_d3d9_draw(menu_display_ctx_draw_t *draw,
|
||||
d3d9_vertex_buffer_unlock((LPDIRECT3DVERTEXBUFFER9)
|
||||
d3d->menu_display.buffer);
|
||||
|
||||
if(!draw->matrix_data)
|
||||
if (!draw->matrix_data)
|
||||
draw->matrix_data = menu_display_d3d9_get_default_mvp(video_info);
|
||||
|
||||
/* ugh */
|
||||
|
@ -67,7 +67,7 @@ static void menu_display_wiiu_draw(menu_display_ctx_draw_t *draw,
|
||||
if (!wiiu || !draw)
|
||||
return;
|
||||
|
||||
if(draw->pipeline.id)
|
||||
if (draw->pipeline.id)
|
||||
{
|
||||
GX2SetShaderMode(GX2_SHADER_MODE_UNIFORM_BLOCK);
|
||||
|
||||
@ -113,7 +113,7 @@ static void menu_display_wiiu_draw(menu_display_ctx_draw_t *draw,
|
||||
}
|
||||
|
||||
}
|
||||
else if(draw->coords->vertex || draw->coords->color[0] != draw->coords->color[12])
|
||||
else if (draw->coords->vertex || draw->coords->color[0] != draw->coords->color[12])
|
||||
{
|
||||
if (wiiu->vertex_cache_tex.current + 4 > wiiu->vertex_cache_tex.size)
|
||||
return;
|
||||
@ -128,7 +128,7 @@ static void menu_display_wiiu_draw(menu_display_ctx_draw_t *draw,
|
||||
GX2SetAttribBuffer(0, wiiu->vertex_cache_tex.size * sizeof(*wiiu->vertex_cache_tex.v),
|
||||
sizeof(*wiiu->vertex_cache_tex.v), wiiu->vertex_cache_tex.v);
|
||||
|
||||
if(!draw->coords->vertex)
|
||||
if (!draw->coords->vertex)
|
||||
{
|
||||
v[0].pos.x = 0.0f;
|
||||
v[0].pos.y = 1.0f;
|
||||
@ -151,7 +151,7 @@ static void menu_display_wiiu_draw(menu_display_ctx_draw_t *draw,
|
||||
v[3].pos.y = 1.0 - draw->coords->vertex[7];
|
||||
}
|
||||
|
||||
if(!draw->coords->tex_coord)
|
||||
if (!draw->coords->tex_coord)
|
||||
{
|
||||
v[0].coord.u = 0.0f;
|
||||
v[0].coord.v = 1.0f;
|
||||
@ -182,7 +182,7 @@ static void menu_display_wiiu_draw(menu_display_ctx_draw_t *draw,
|
||||
v[i].color.a = draw->coords->color[(i << 2) + 3];
|
||||
}
|
||||
|
||||
if(draw->texture)
|
||||
if (draw->texture)
|
||||
GX2SetPixelTexture((GX2Texture*)draw->texture, tex_shader.ps.samplerVars[0].location);
|
||||
|
||||
GX2DrawEx(GX2_PRIMITIVE_MODE_TRIANGLE_STRIP, 4, wiiu->vertex_cache_tex.current, 1);
|
||||
@ -206,7 +206,7 @@ static void menu_display_wiiu_draw(menu_display_ctx_draw_t *draw,
|
||||
v->color = COLOR_RGBA(0xFF * draw->coords->color[0], 0xFF * draw->coords->color[1],
|
||||
0xFF * draw->coords->color[2], 0xFF * draw->coords->color[3]);
|
||||
|
||||
if(draw->texture)
|
||||
if (draw->texture)
|
||||
GX2SetPixelTexture((GX2Texture*)draw->texture, sprite_shader.ps.samplerVars[0].location);
|
||||
|
||||
GX2DrawEx(GX2_PRIMITIVE_MODE_POINTS, 1, wiiu->vertex_cache.current, 1);
|
||||
@ -242,7 +242,7 @@ static void menu_display_wiiu_draw_pipeline(menu_display_ctx_draw_t *draw,
|
||||
case VIDEO_SHADER_MENU:
|
||||
case VIDEO_SHADER_MENU_2:
|
||||
ca = menu_display_get_coords_array();
|
||||
if(!wiiu->menu_shader_vbo)
|
||||
if (!wiiu->menu_shader_vbo)
|
||||
{
|
||||
wiiu->menu_shader_vbo = MEM2_alloc(ca->coords.vertices * 2 * sizeof(float), GX2_VERTEX_BUFFER_ALIGNMENT);
|
||||
memcpy(wiiu->menu_shader_vbo, ca->coords.vertex, ca->coords.vertices * 2 * sizeof(float));
|
||||
@ -266,7 +266,7 @@ static void menu_display_wiiu_draw_pipeline(menu_display_ctx_draw_t *draw,
|
||||
return;
|
||||
}
|
||||
|
||||
if(!wiiu->menu_shader_ubo)
|
||||
if (!wiiu->menu_shader_ubo)
|
||||
{
|
||||
wiiu->menu_shader_ubo = MEM2_alloc(sizeof(*wiiu->menu_shader_ubo), GX2_UNIFORM_BLOCK_ALIGNMENT);
|
||||
matrix_4x4_ortho(wiiu->menu_shader_ubo->mvp, 0, 1, 1, 0, -1, 1);
|
||||
|
@ -34,7 +34,6 @@
|
||||
|
||||
#include "menu_animation.h"
|
||||
#include "menu_driver.h"
|
||||
#include "../configuration.h"
|
||||
#include "../performance_counters.h"
|
||||
|
||||
struct tween
|
||||
@ -1186,7 +1185,10 @@ bool menu_animation_push(menu_animation_ctx_entry_t *entry)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void menu_animation_update_time(bool timedate_enable, unsigned video_width, unsigned video_height)
|
||||
static void menu_animation_update_time(
|
||||
bool timedate_enable,
|
||||
unsigned video_width, unsigned video_height,
|
||||
float menu_ticker_speed)
|
||||
{
|
||||
static retro_time_t
|
||||
last_clock_update = 0;
|
||||
@ -1198,12 +1200,13 @@ static void menu_animation_update_time(bool timedate_enable, unsigned video_widt
|
||||
static float ticker_pixel_accumulator = 0.0f;
|
||||
unsigned ticker_pixel_accumulator_uint = 0;
|
||||
float ticker_pixel_increment = 0.0f;
|
||||
|
||||
/* Adjust ticker speed */
|
||||
settings_t *settings = config_get_ptr();
|
||||
float speed_factor = settings->floats.menu_ticker_speed > 0.0001f ? settings->floats.menu_ticker_speed : 1.0f;
|
||||
unsigned ticker_speed = (unsigned)(((float)TICKER_SPEED / speed_factor) + 0.5);
|
||||
unsigned ticker_slow_speed = (unsigned)(((float)TICKER_SLOW_SPEED / speed_factor) + 0.5);
|
||||
float speed_factor = (menu_ticker_speed > 0.0001f)
|
||||
? menu_ticker_speed : 1.0f;
|
||||
unsigned ticker_speed =
|
||||
(unsigned)(((float)TICKER_SPEED / speed_factor) + 0.5);
|
||||
unsigned ticker_slow_speed =
|
||||
(unsigned)(((float)TICKER_SLOW_SPEED / speed_factor) + 0.5);
|
||||
|
||||
/* Note: cur_time & old_time are in us, delta_time is in ms */
|
||||
cur_time = cpu_features_get_time_usec();
|
||||
@ -1251,27 +1254,32 @@ static void menu_animation_update_time(bool timedate_enable, unsigned video_widt
|
||||
* every 2 frames is optimal, but may be too fast
|
||||
* for some users - so play it safe. Users can always
|
||||
* set ticker speed to 2x if they prefer)
|
||||
* Note 2: It turns out that resolution adjustment
|
||||
* also fails for Ozone, because it doesn't implement
|
||||
* any kind of DPI scaling - i.e. text gets smaller
|
||||
* as resolution increases. This is annoying. It
|
||||
* means we have to use a fixed multiplier for
|
||||
* Ozone as well...
|
||||
* Note 3: GLUI uses the new DPI scaling system,
|
||||
* Note 2: GLUI uses the new DPI scaling system,
|
||||
* so scaling multiplier is menu_display_get_dpi_scale()
|
||||
* multiplied by a small correction factor (since the
|
||||
* default 1.0x speed is just a little faster than the
|
||||
* non-smooth ticker) */
|
||||
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
|
||||
ticker_pixel_increment *= 0.25f;
|
||||
/* TODO/FIXME: Remove this Ozone special case if/when
|
||||
* Ozone gets proper DPI scaling */
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
ticker_pixel_increment *= 0.5f;
|
||||
else if (string_is_equal(settings->arrays.menu_driver, "glui"))
|
||||
ticker_pixel_increment *= (menu_display_get_dpi_scale(video_width, video_height) * 0.8f);
|
||||
else if (video_width > 0)
|
||||
ticker_pixel_increment *= ((float)video_width / 1920.0f);
|
||||
* non-smooth ticker)
|
||||
* Note 3: Ozone now also uses the new DPI scaling
|
||||
* system. We therefore take the same approach as GLUI,
|
||||
* but with a different correction factor (expected
|
||||
* scroll speed is somewhat lower for Ozone) */
|
||||
switch (menu_driver_ident_id())
|
||||
{
|
||||
case MENU_DRIVER_ID_RGUI:
|
||||
ticker_pixel_increment *= 0.25f;
|
||||
break;
|
||||
case MENU_DRIVER_ID_OZONE:
|
||||
ticker_pixel_increment *= (menu_display_get_dpi_scale(video_width, video_height) * 0.5f);
|
||||
break;
|
||||
case MENU_DRIVER_ID_GLUI:
|
||||
ticker_pixel_increment *= (menu_display_get_dpi_scale(video_width, video_height) * 0.8f);
|
||||
break;
|
||||
case MENU_DRIVER_ID_XMB:
|
||||
default:
|
||||
if (video_width > 0)
|
||||
ticker_pixel_increment *= ((float)video_width / 1920.0f);
|
||||
break;
|
||||
}
|
||||
|
||||
/* > Update accumulator */
|
||||
ticker_pixel_accumulator += ticker_pixel_increment;
|
||||
@ -1286,12 +1294,18 @@ static void menu_animation_update_time(bool timedate_enable, unsigned video_widt
|
||||
}
|
||||
}
|
||||
|
||||
bool menu_animation_update(unsigned video_width, unsigned video_height)
|
||||
bool menu_animation_update(
|
||||
bool menu_timedate_enable,
|
||||
float menu_ticker_speed,
|
||||
unsigned video_width,
|
||||
unsigned video_height)
|
||||
{
|
||||
unsigned i;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
menu_animation_update_time(settings->bools.menu_timedate_enable, video_width, video_height);
|
||||
menu_animation_update_time(
|
||||
menu_timedate_enable,
|
||||
video_width, video_height,
|
||||
menu_ticker_speed);
|
||||
|
||||
anim.in_update = true;
|
||||
anim.pending_deletes = false;
|
||||
@ -1305,7 +1319,7 @@ bool menu_animation_update(unsigned video_width, unsigned video_height)
|
||||
|
||||
tween->running_since += delta_time;
|
||||
|
||||
*tween->subject = tween->easing(
|
||||
*tween->subject = tween->easing(
|
||||
tween->running_since,
|
||||
tween->initial_value,
|
||||
tween->target_value - tween->initial_value,
|
||||
@ -1365,11 +1379,9 @@ static void build_ticker_loop_string(
|
||||
|
||||
/* Copy 'trailing' chunk of source string, if required */
|
||||
if (num_chars1 > 0)
|
||||
{
|
||||
utf8cpy(
|
||||
dest_str, dest_str_len,
|
||||
utf8skip(src_str, char_offset1), num_chars1);
|
||||
}
|
||||
|
||||
/* Copy chunk of spacer string, if required */
|
||||
if (num_chars2 > 0)
|
||||
@ -1472,7 +1484,6 @@ bool menu_animation_ticker(menu_animation_ctx_ticker_t *ticker)
|
||||
/* 'Fixed width' font version of menu_animation_ticker_smooth() */
|
||||
bool menu_animation_ticker_smooth_fw(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
{
|
||||
size_t src_str_len = 0;
|
||||
size_t spacer_len = 0;
|
||||
unsigned glyph_width = ticker->glyph_width;
|
||||
unsigned src_str_width = 0;
|
||||
@ -1485,7 +1496,7 @@ bool menu_animation_ticker_smooth_fw(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
* repeat */
|
||||
|
||||
/* Get length + width of src string */
|
||||
src_str_len = utf8len(ticker->src_str);
|
||||
size_t src_str_len = utf8len(ticker->src_str);
|
||||
if (src_str_len < 1)
|
||||
goto end;
|
||||
|
||||
@ -1495,8 +1506,8 @@ bool menu_animation_ticker_smooth_fw(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
* can just copy the entire string */
|
||||
if (src_str_width <= ticker->field_width)
|
||||
{
|
||||
utf8cpy(ticker->dst_str, ticker->dst_str_len, ticker->src_str, src_str_len);
|
||||
|
||||
utf8cpy(ticker->dst_str, ticker->dst_str_len,
|
||||
ticker->src_str, src_str_len);
|
||||
if (ticker->dst_str_width)
|
||||
*ticker->dst_str_width = src_str_width;
|
||||
*ticker->x_offset = 0;
|
||||
@ -1592,11 +1603,9 @@ bool menu_animation_ticker_smooth_fw(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
|
||||
/* Copy required substring */
|
||||
if (num_chars > 0)
|
||||
{
|
||||
utf8cpy(
|
||||
ticker->dst_str, ticker->dst_str_len,
|
||||
utf8skip(ticker->src_str, char_offset), num_chars);
|
||||
}
|
||||
|
||||
if (ticker->dst_str_width)
|
||||
*ticker->dst_str_width = num_chars * glyph_width;
|
||||
@ -1666,17 +1675,18 @@ bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
if (glyph_width < 0)
|
||||
goto end;
|
||||
|
||||
src_char_widths[i] = (unsigned)glyph_width;
|
||||
src_str_width += (unsigned)glyph_width;
|
||||
src_char_widths[i] = (unsigned)glyph_width;
|
||||
src_str_width += (unsigned)glyph_width;
|
||||
|
||||
str_ptr = utf8skip(str_ptr, 1);
|
||||
str_ptr = utf8skip(str_ptr, 1);
|
||||
}
|
||||
|
||||
/* If total src string width is <= text field width, we
|
||||
* can just copy the entire string */
|
||||
if (src_str_width <= ticker->field_width)
|
||||
{
|
||||
utf8cpy(ticker->dst_str, ticker->dst_str_len, ticker->src_str, src_str_len);
|
||||
utf8cpy(ticker->dst_str, ticker->dst_str_len,
|
||||
ticker->src_str, src_str_len);
|
||||
|
||||
if (ticker->dst_str_width)
|
||||
*ticker->dst_str_width = src_str_width;
|
||||
@ -1693,7 +1703,8 @@ bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
unsigned current_width = 0;
|
||||
unsigned num_chars = 0;
|
||||
int period_width =
|
||||
font_driver_get_message_width(ticker->font, ".", 1, ticker->font_scale);
|
||||
font_driver_get_message_width(ticker->font,
|
||||
".", 1, ticker->font_scale);
|
||||
|
||||
/* Sanity check */
|
||||
if (period_width < 0)
|
||||
@ -1721,7 +1732,8 @@ bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
}
|
||||
|
||||
/* Copy string segment + add suffix */
|
||||
utf8cpy(ticker->dst_str, ticker->dst_str_len, ticker->src_str, num_chars);
|
||||
utf8cpy(ticker->dst_str, ticker->dst_str_len,
|
||||
ticker->src_str, num_chars);
|
||||
strlcat(ticker->dst_str, "...", ticker->dst_str_len);
|
||||
|
||||
if (ticker->dst_str_width)
|
||||
@ -1804,16 +1816,16 @@ bool menu_animation_ticker_smooth(menu_animation_ctx_ticker_smooth_t *ticker)
|
||||
|
||||
menu_animation_ticker_smooth_generic(
|
||||
ticker->idx,
|
||||
src_char_widths, src_str_len, src_str_width, ticker->field_width,
|
||||
&char_offset, &num_chars, ticker->x_offset, ticker->dst_str_width);
|
||||
src_char_widths, src_str_len,
|
||||
src_str_width, ticker->field_width,
|
||||
&char_offset, &num_chars,
|
||||
ticker->x_offset, ticker->dst_str_width);
|
||||
|
||||
/* Copy required substring */
|
||||
if (num_chars > 0)
|
||||
{
|
||||
utf8cpy(
|
||||
ticker->dst_str, ticker->dst_str_len,
|
||||
utf8skip(ticker->src_str, char_offset), num_chars);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@ -1849,7 +1861,8 @@ end:
|
||||
}
|
||||
|
||||
static void build_line_ticker_string(
|
||||
size_t num_display_lines, size_t line_offset, struct string_list *lines,
|
||||
size_t num_display_lines, size_t line_offset,
|
||||
struct string_list *lines,
|
||||
char *dest_str, size_t dest_str_len)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -198,7 +198,11 @@ void menu_timer_start(menu_timer_t *timer, menu_timer_ctx_entry_t *timer_entry);
|
||||
|
||||
void menu_timer_kill(menu_timer_t *timer);
|
||||
|
||||
bool menu_animation_update(unsigned video_width, unsigned video_height);
|
||||
bool menu_animation_update(
|
||||
bool menu_timedate_enable,
|
||||
float menu_ticker_speed,
|
||||
unsigned video_width,
|
||||
unsigned video_height);
|
||||
|
||||
bool menu_animation_ticker(menu_animation_ctx_ticker_t *ticker);
|
||||
|
||||
|
@ -2739,7 +2739,8 @@ static unsigned menu_displaylist_parse_playlist_manager_list(
|
||||
/* Add collection playlists */
|
||||
str_list = dir_list_new_special(
|
||||
settings->paths.directory_playlist,
|
||||
DIR_LIST_COLLECTIONS, NULL);
|
||||
DIR_LIST_COLLECTIONS, NULL,
|
||||
settings->bools.show_hidden_files);
|
||||
|
||||
if (str_list && str_list->size)
|
||||
{
|
||||
@ -2942,7 +2943,8 @@ static unsigned menu_displaylist_parse_pl_thumbnail_download_list(
|
||||
|
||||
str_list = dir_list_new_special(
|
||||
settings->paths.directory_playlist,
|
||||
DIR_LIST_COLLECTIONS, NULL);
|
||||
DIR_LIST_COLLECTIONS, NULL,
|
||||
settings->bools.show_hidden_files);
|
||||
|
||||
if (str_list && str_list->size)
|
||||
{
|
||||
@ -4239,7 +4241,11 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
case DISPLAYLIST_SHADER_PRESET_REMOVE:
|
||||
{
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||
if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_GLOBAL))
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_GLOBAL,
|
||||
settings->paths.directory_video_shader,
|
||||
settings->paths.directory_menu_config
|
||||
))
|
||||
if (menu_entries_append_enum(list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_GLOBAL),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GLOBAL),
|
||||
@ -4247,7 +4253,10 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
|
||||
if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_CORE))
|
||||
if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_CORE,
|
||||
settings->paths.directory_video_shader,
|
||||
settings->paths.directory_menu_config
|
||||
))
|
||||
if (menu_entries_append_enum(list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_CORE),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_CORE),
|
||||
@ -4255,7 +4264,10 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
|
||||
if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_PARENT))
|
||||
if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_PARENT,
|
||||
settings->paths.directory_video_shader,
|
||||
settings->paths.directory_menu_config
|
||||
))
|
||||
if (menu_entries_append_enum(list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_PARENT),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_PARENT),
|
||||
@ -4263,7 +4275,10 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
MENU_SETTING_ACTION, 0, 0))
|
||||
count++;
|
||||
|
||||
if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_GAME))
|
||||
if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_GAME,
|
||||
settings->paths.directory_video_shader,
|
||||
settings->paths.directory_menu_config
|
||||
))
|
||||
if (menu_entries_append_enum(list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_GAME),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GAME),
|
||||
@ -5274,15 +5289,18 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
count = populate_playlist_thumbnail_mode_dropdown_list(list, PLAYLIST_THUMBNAIL_LEFT);
|
||||
break;
|
||||
case DISPLAYLIST_DROPDOWN_LIST_MANUAL_CONTENT_SCAN_SYSTEM_NAME:
|
||||
/* Get system name list */
|
||||
{
|
||||
/* Get system name list */
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
settings_t *settings = config_get_ptr();
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database);
|
||||
manual_content_scan_get_menu_system_name_list(
|
||||
settings->paths.path_content_database,
|
||||
settings->bools.show_hidden_files);
|
||||
#else
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(NULL);
|
||||
manual_content_scan_get_menu_system_name_list(NULL,
|
||||
settings->bools.show_hidden_files);
|
||||
#endif
|
||||
|
||||
if (system_name_list)
|
||||
@ -6473,6 +6491,8 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_displaylist_build_info_selective_t build_list[] = {
|
||||
{MENU_ENUM_LABEL_MENU_WIDGET_SCALE_AUTO, PARSE_ONLY_BOOL, false },
|
||||
{MENU_ENUM_LABEL_MENU_WIDGET_SCALE_FACTOR, PARSE_ONLY_FLOAT, false },
|
||||
{MENU_ENUM_LABEL_VIDEO_FONT_ENABLE, PARSE_ONLY_BOOL, true },
|
||||
{MENU_ENUM_LABEL_FPS_SHOW, PARSE_ONLY_BOOL, false },
|
||||
{MENU_ENUM_LABEL_FPS_UPDATE_INTERVAL, PARSE_ONLY_UINT, false },
|
||||
@ -6510,6 +6530,15 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
|
||||
if (settings->bools.video_msg_bgcolor_enable)
|
||||
build_list[i].checked = true;
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MENU_WIDGET_SCALE_AUTO:
|
||||
if (menu_widgets_ready())
|
||||
build_list[i].checked = true;
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MENU_WIDGET_SCALE_FACTOR:
|
||||
if (menu_widgets_ready())
|
||||
if (!settings->bools.menu_widget_scale_auto)
|
||||
build_list[i].checked = true;
|
||||
break;
|
||||
default:
|
||||
if (settings->bools.video_font_enable)
|
||||
build_list[i].checked = true;
|
||||
@ -7944,7 +7973,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
|
||||
unsigned i;
|
||||
char text[PATH_MAX_LENGTH];
|
||||
char current_profile[PATH_MAX_LENGTH];
|
||||
#ifdef HAVE_LAKKA_SWITCH
|
||||
FILE *profile = NULL;
|
||||
#endif
|
||||
const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)/sizeof(SWITCH_CPU_PROFILES[1]);
|
||||
|
||||
runloop_msg_queue_push("Warning : extended overclocking can damage the Switch", 1, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
@ -7959,7 +7990,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
|
||||
snprintf(text, sizeof(text), "Current profile : %s", current_profile);
|
||||
#else
|
||||
u32 currentClock = 0;
|
||||
if(hosversionBefore(8, 0, 0))
|
||||
if (hosversionBefore(8, 0, 0))
|
||||
pcvGetClockRate(PcvModule_CpuBus, ¤tClock);
|
||||
else
|
||||
{
|
||||
|
@ -88,6 +88,10 @@
|
||||
* DPI-aware menu scaling factors */
|
||||
#define REFERENCE_DPI 96.0f
|
||||
|
||||
/* 'OZONE_SIDEBAR_WIDTH' must be kept in sync
|
||||
* with ozone menu driver metrics */
|
||||
#define OZONE_SIDEBAR_WIDTH 408
|
||||
|
||||
typedef struct menu_ctx_load_image
|
||||
{
|
||||
void *data;
|
||||
@ -204,11 +208,12 @@ static bool menu_display_null_font_init_first(
|
||||
bool is_threaded)
|
||||
{
|
||||
font_data_t **handle = (font_data_t**)font_handle;
|
||||
*handle = font_driver_init_first(video_data,
|
||||
if ((*handle = font_driver_init_first(video_data,
|
||||
font_path, font_size, true,
|
||||
is_threaded,
|
||||
FONT_DRIVER_RENDER_DONT_CARE);
|
||||
return *handle;
|
||||
FONT_DRIVER_RENDER_DONT_CARE)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static const float *menu_display_null_get_default_vertices(void)
|
||||
@ -322,6 +327,8 @@ static menu_handle_t *menu_driver_data = NULL;
|
||||
static const menu_ctx_driver_t *menu_driver_ctx = NULL;
|
||||
static void *menu_userdata = NULL;
|
||||
|
||||
static enum menu_driver_id_type menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
|
||||
|
||||
/* Quick jumping indices with L/R.
|
||||
* Rebuilt when parsing directory. */
|
||||
static size_t scroll_index_list[SCROLL_INDEX_SIZE];
|
||||
@ -1339,6 +1346,8 @@ bool menu_entries_append_enum(file_list_t *list, const char *path,
|
||||
size_t idx;
|
||||
const char *menu_path = NULL;
|
||||
menu_file_list_cbs_t *cbs = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!list || !label)
|
||||
return false;
|
||||
|
||||
@ -1376,7 +1385,8 @@ bool menu_entries_append_enum(file_list_t *list, const char *path,
|
||||
&& enum_idx != MENU_ENUM_LABEL_RDB_ENTRY)
|
||||
cbs->setting = menu_setting_find_enum(enum_idx);
|
||||
|
||||
menu_cbs_init(list, cbs, path, label, type, idx);
|
||||
if (!string_is_equal(settings->arrays.menu_driver, "null"))
|
||||
menu_cbs_init(list, cbs, path, label, type, idx);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -2044,17 +2054,292 @@ void menu_display_unset_framebuffer_dirty_flag(void)
|
||||
menu_display_framebuf_dirty = false;
|
||||
}
|
||||
|
||||
float menu_display_get_dpi_scale(unsigned width, unsigned height)
|
||||
static float menu_display_get_adjusted_scale_internal(float base_scale, float scale_factor, unsigned width)
|
||||
{
|
||||
/* Apply user-set scaling factor */
|
||||
float adjusted_scale = base_scale * scale_factor;
|
||||
|
||||
/* Ozone has a capped scale factor */
|
||||
adjusted_scale = (menu_driver_id == MENU_DRIVER_ID_OZONE) ?
|
||||
(((float)OZONE_SIDEBAR_WIDTH * adjusted_scale) > ((float)width * 0.3333333f) ?
|
||||
((float)width * 0.3333333f / (float)OZONE_SIDEBAR_WIDTH) : adjusted_scale) :
|
||||
adjusted_scale;
|
||||
|
||||
/* Ensure final scale is 'sane' */
|
||||
return (adjusted_scale > 0.0001f) ? adjusted_scale : 1.0f;
|
||||
}
|
||||
|
||||
/* Ugh... Since we must now have independent scale
|
||||
* factors for menus and widgets, and most of the internal
|
||||
* scaling variables are cached/static, a huge amount of
|
||||
* code duplication is required for the pixel_scale and
|
||||
* dpi_scale functions. A necessary evil, I suppose... */
|
||||
|
||||
float menu_display_get_pixel_scale(unsigned width, unsigned height)
|
||||
{
|
||||
static unsigned last_width = 0;
|
||||
static unsigned last_height = 0;
|
||||
static float scale = 0.0f;
|
||||
static bool scale_cached = false;
|
||||
bool scale_updated = false;
|
||||
static float last_menu_scale_factor = 0.0f;
|
||||
float menu_scale_factor = 1.0f;
|
||||
static enum menu_driver_id_type last_menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
|
||||
static float adjusted_scale = 1.0f;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (settings)
|
||||
menu_scale_factor = settings->floats.menu_scale_factor;
|
||||
|
||||
/* We need to perform a square root here, which
|
||||
* can be slow on some platforms (not *slow*, but
|
||||
* it involves enough work that it's worth trying
|
||||
* to optimise). We therefore cache the pixel scale,
|
||||
* and only update on first run or when the video
|
||||
* size changes */
|
||||
if (!scale_cached ||
|
||||
(width != last_width) ||
|
||||
(height != last_height))
|
||||
{
|
||||
/* Baseline reference is a 1080p display */
|
||||
scale = (float)(
|
||||
sqrt((double)((width * width) + (height * height))) /
|
||||
DIAGONAL_PIXELS_1080P);
|
||||
|
||||
scale_cached = true;
|
||||
scale_updated = true;
|
||||
last_width = width;
|
||||
last_height = height;
|
||||
}
|
||||
|
||||
/* Adjusted scale calculation may also be slow, so
|
||||
* only update if something changes */
|
||||
if (scale_updated ||
|
||||
(menu_scale_factor != last_menu_scale_factor) ||
|
||||
(menu_driver_id != last_menu_driver_id))
|
||||
{
|
||||
adjusted_scale = menu_display_get_adjusted_scale_internal(scale, menu_scale_factor, width);
|
||||
last_menu_scale_factor = menu_scale_factor;
|
||||
last_menu_driver_id = menu_driver_id;
|
||||
}
|
||||
|
||||
return adjusted_scale;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
float menu_display_get_widget_pixel_scale(unsigned width, unsigned height)
|
||||
{
|
||||
static unsigned last_width = 0;
|
||||
static unsigned last_height = 0;
|
||||
static float scale = 0.0f;
|
||||
static bool scale_cached = false;
|
||||
bool scale_updated = false;
|
||||
static float last_menu_scale_factor = 0.0f;
|
||||
float menu_scale_factor = 1.0f;
|
||||
static enum menu_driver_id_type last_menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
|
||||
static float adjusted_scale = 1.0f;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
/* When using RGUI, settings->floats.menu_scale_factor
|
||||
* is ignored
|
||||
* > If we are not using a widget scale factor override,
|
||||
* just set menu_scale_factor to 1.0 */
|
||||
if (settings)
|
||||
menu_scale_factor = settings->bools.menu_widget_scale_auto ?
|
||||
((menu_driver_id == MENU_DRIVER_ID_RGUI) ?
|
||||
1.0f : settings->floats.menu_scale_factor) :
|
||||
settings->floats.menu_widget_scale_factor;
|
||||
|
||||
/* We need to perform a square root here, which
|
||||
* can be slow on some platforms (not *slow*, but
|
||||
* it involves enough work that it's worth trying
|
||||
* to optimise). We therefore cache the pixel scale,
|
||||
* and only update on first run or when the video
|
||||
* size changes */
|
||||
if (!scale_cached ||
|
||||
(width != last_width) ||
|
||||
(height != last_height))
|
||||
{
|
||||
/* Baseline reference is a 1080p display */
|
||||
scale = (float)(
|
||||
sqrt((double)((width * width) + (height * height))) /
|
||||
DIAGONAL_PIXELS_1080P);
|
||||
|
||||
scale_cached = true;
|
||||
scale_updated = true;
|
||||
last_width = width;
|
||||
last_height = height;
|
||||
}
|
||||
|
||||
/* Adjusted scale calculation may also be slow, so
|
||||
* only update if something changes */
|
||||
if (scale_updated ||
|
||||
(menu_scale_factor != last_menu_scale_factor) ||
|
||||
(menu_driver_id != last_menu_driver_id))
|
||||
{
|
||||
adjusted_scale = menu_display_get_adjusted_scale_internal(scale, menu_scale_factor, width);
|
||||
last_menu_scale_factor = menu_scale_factor;
|
||||
last_menu_driver_id = menu_driver_id;
|
||||
}
|
||||
|
||||
return adjusted_scale;
|
||||
}
|
||||
#endif
|
||||
|
||||
float menu_display_get_dpi_scale_internal(unsigned width, unsigned height)
|
||||
{
|
||||
static unsigned last_width = 0;
|
||||
static unsigned last_height = 0;
|
||||
static float scale = 0.0f;
|
||||
static bool scale_cached = false;
|
||||
float menu_scale_factor = 0.0f;
|
||||
settings_t *settings = config_get_ptr();
|
||||
float diagonal_pixels;
|
||||
float pixel_scale;
|
||||
float dpi;
|
||||
gfx_ctx_metrics_t metrics;
|
||||
|
||||
if (scale_cached &&
|
||||
(width == last_width) &&
|
||||
(height == last_height))
|
||||
return scale;
|
||||
|
||||
/* Determine the diagonal 'size' of the display
|
||||
* (or window) in terms of pixels */
|
||||
diagonal_pixels = (float)sqrt(
|
||||
(double)((width * width) + (height * height)));
|
||||
|
||||
/* TODO/FIXME: On Mac, calling video_context_driver_get_metrics()
|
||||
* here causes RetroArch to crash (EXC_BAD_ACCESS). This is
|
||||
* unfortunate, and needs to be fixed at the gfx context driver
|
||||
* level. Until this is done, all we can do is fallback to using
|
||||
* the old legacy 'magic number' scaling on Mac platforms. */
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
|
||||
if (true)
|
||||
{
|
||||
scale = (diagonal_pixels / 6.5f) / 212.0f;
|
||||
scale_cached = true;
|
||||
last_width = width;
|
||||
last_height = height;
|
||||
return scale;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Get pixel scale relative to baseline 1080p display */
|
||||
pixel_scale = diagonal_pixels / DIAGONAL_PIXELS_1080P;
|
||||
|
||||
/* Attempt to get display DPI */
|
||||
metrics.type = DISPLAY_METRIC_DPI;
|
||||
metrics.value = &dpi;
|
||||
|
||||
if (video_context_driver_get_metrics(&metrics) && (dpi > 0.0f))
|
||||
{
|
||||
float display_size;
|
||||
float dpi_scale;
|
||||
|
||||
#if defined(ANDROID) || defined(HAVE_COCOATOUCH)
|
||||
/* Android/iOS devices tell complete lies when
|
||||
* reporting DPI values. From the Android devices
|
||||
* I've had access to, the DPI is generally
|
||||
* overestimated by 17%. All we can do is apply
|
||||
* a blind correction factor... */
|
||||
dpi = dpi * 0.83f;
|
||||
#endif
|
||||
|
||||
/* Note: If we are running in windowed mode, this
|
||||
* 'display size' is actually the window size - which
|
||||
* kinda makes a mess of everything. Since we cannot
|
||||
* get fullscreen resolution when running in windowed
|
||||
* mode, there is nothing we can do about this. So just
|
||||
* treat the window as a display, and hope for the best... */
|
||||
display_size = diagonal_pixels / dpi;
|
||||
dpi_scale = dpi / REFERENCE_DPI;
|
||||
|
||||
/* Note: We have tried leveraging every possible metric
|
||||
* (and numerous studies on TV/monitor/mobile device
|
||||
* usage habits) to determine an appropriate auto scaling
|
||||
* factor. *None of these 'smart'/technical methods work
|
||||
* consistently in the real world* - there is simply too
|
||||
* much variance.
|
||||
* So instead we have implemented a very fuzzy/loose
|
||||
* method which is crude as can be, but actually has
|
||||
* some semblance of usability... */
|
||||
|
||||
if (display_size > 24.0f)
|
||||
{
|
||||
/* DPI scaling fails miserably when using large
|
||||
* displays. Having a UI element that's 1 inch high
|
||||
* on all screens might seem like a good idea - until
|
||||
* you realise that a HTPC user is probably sitting
|
||||
* several metres from their TV, which makes something
|
||||
* 1 inch high virtually invisible.
|
||||
* So we make some assumptions:
|
||||
* - Normal size displays <= 24 inches are probably
|
||||
* PC monitors, with an eye-to-screen distance of
|
||||
* 1 arm length. Under these conditions, fixed size
|
||||
* (DPI scaled) UI elements should be visible for most
|
||||
* users
|
||||
* - Large displays > 24 inches start to encroach on
|
||||
* TV territory. Once we start working with TVs, we
|
||||
* have to consider users sitting on a couch - and
|
||||
* in this situation, we fall back to the age-old
|
||||
* standard of UI elements occupying a fixed fraction
|
||||
* of the display size (i.e. just look at the menu of
|
||||
* any console system for the past decade)
|
||||
* - 24 -> 32 inches is a grey area, where the display
|
||||
* might be a monitor or a TV. Above 32 inches, a TV
|
||||
* is almost a certainty. So we simply lerp between
|
||||
* dpi scaling and pixel scaling as the display size
|
||||
* increases from 24 to 32 */
|
||||
float fraction = (display_size > 32.0f) ? 32.0f : display_size;
|
||||
fraction = fraction - 24.0f;
|
||||
fraction = fraction / (32.0f - 24.0f);
|
||||
|
||||
scale = ((1.0f - fraction) * dpi_scale) + (fraction * pixel_scale);
|
||||
}
|
||||
else if (display_size < 12.0f)
|
||||
{
|
||||
/* DPI scaling also fails when using very small
|
||||
* displays - i.e. mobile devices (tablets/phones).
|
||||
* That 1 inch UI element is going to look pretty
|
||||
* dumb on a 5 inch screen in landscape orientation...
|
||||
* We're essentially in the opposite situation to the
|
||||
* TV case above, and it turns out that a similar
|
||||
* solution provides relief: as screen size reduces
|
||||
* from 12 inches to zero, we lerp from dpi scaling
|
||||
* to pixel scaling */
|
||||
float fraction = display_size / 12.0f;
|
||||
|
||||
scale = ((1.0f - fraction) * pixel_scale) + (fraction * dpi_scale);
|
||||
}
|
||||
else
|
||||
scale = dpi_scale;
|
||||
}
|
||||
/* If DPI retrieval is unsupported, all we can do
|
||||
* is use the raw pixel scale */
|
||||
else
|
||||
scale = pixel_scale;
|
||||
|
||||
scale_cached = true;
|
||||
last_width = width;
|
||||
last_height = height;
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
||||
float menu_display_get_dpi_scale(unsigned width, unsigned height)
|
||||
{
|
||||
static unsigned last_width = 0;
|
||||
static unsigned last_height = 0;
|
||||
static float scale = 0.0f;
|
||||
static bool scale_cached = false;
|
||||
bool scale_updated = false;
|
||||
static float last_menu_scale_factor = 0.0f;
|
||||
float menu_scale_factor = 1.0f;
|
||||
static enum menu_driver_id_type last_menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
|
||||
static float adjusted_scale = 1.0f;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (settings)
|
||||
menu_scale_factor = settings->floats.menu_scale_factor;
|
||||
menu_scale_factor = settings->floats.menu_scale_factor;
|
||||
|
||||
/* Scale is based on display metrics - these are a fixed
|
||||
* hardware property. To minimise performance overheads
|
||||
@ -2064,148 +2349,81 @@ float menu_display_get_dpi_scale(unsigned width, unsigned height)
|
||||
(width != last_width) ||
|
||||
(height != last_height))
|
||||
{
|
||||
float diagonal_pixels;
|
||||
float pixel_scale;
|
||||
float dpi;
|
||||
gfx_ctx_metrics_t metrics;
|
||||
|
||||
/* Determine the diagonal 'size' of the display
|
||||
* (or window) in terms of pixels */
|
||||
diagonal_pixels = (float)sqrt(
|
||||
(double)((width * width) + (height * height)));
|
||||
|
||||
/* TODO/FIXME: On Mac, calling video_context_driver_get_metrics()
|
||||
* here causes RetroArch to crash (EXC_BAD_ACCESS). This is
|
||||
* unfortunate, and needs to be fixed at the gfx context driver
|
||||
* level. Until this is done, all we can do is fallback to using
|
||||
* the old legacy 'magic number' scaling on Mac platforms.
|
||||
* Note: We use a rather ugly construct here so the 'Mac hack'
|
||||
* can be added in one place, without polluting the rest of
|
||||
* the code. */
|
||||
#if defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
|
||||
if (true)
|
||||
{
|
||||
scale = (diagonal_pixels / 6.5f) / 212.0f;
|
||||
scale_cached = true;
|
||||
last_width = width;
|
||||
last_height = height;
|
||||
|
||||
if (settings)
|
||||
return scale * ((menu_scale_factor > 0.0001f) ?
|
||||
menu_scale_factor : 1.0f);
|
||||
|
||||
return scale;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Get pixel scale relative to baseline 1080p display */
|
||||
pixel_scale = diagonal_pixels / DIAGONAL_PIXELS_1080P;
|
||||
|
||||
/* Attempt to get display DPI */
|
||||
metrics.type = DISPLAY_METRIC_DPI;
|
||||
metrics.value = &dpi;
|
||||
|
||||
if (video_context_driver_get_metrics(&metrics) && (dpi > 0.0f))
|
||||
{
|
||||
float display_size;
|
||||
float dpi_scale;
|
||||
|
||||
#if defined(ANDROID) || defined(HAVE_COCOATOUCH)
|
||||
/* Android/iOS devices tell complete lies when
|
||||
* reporting DPI values. From the Android devices
|
||||
* I've had access to, the DPI is generally
|
||||
* overestimated by 17%. All we can do is apply
|
||||
* a blind correction factor... */
|
||||
dpi = dpi * 0.83f;
|
||||
#endif
|
||||
|
||||
/* Note: If we are running in windowed mode, this
|
||||
* 'display size' is actually the window size - which
|
||||
* kinda makes a mess of everything. Since we cannot
|
||||
* get fullscreen resolution when running in windowed
|
||||
* mode, there is nothing we can do about this. So just
|
||||
* treat the window as a display, and hope for the best... */
|
||||
display_size = diagonal_pixels / dpi;
|
||||
dpi_scale = dpi / REFERENCE_DPI;
|
||||
|
||||
/* Note: We have tried leveraging every possible metric
|
||||
* (and numerous studies on TV/monitor/mobile device
|
||||
* usage habits) to determine an appropriate auto scaling
|
||||
* factor. *None of these 'smart'/technical methods work
|
||||
* consistently in the real world* - there is simply too
|
||||
* much variance.
|
||||
* So instead we have implemented a very fuzzy/loose
|
||||
* method which is crude as can be, but actually has
|
||||
* some semblance of usability... */
|
||||
|
||||
if (display_size > 24.0f)
|
||||
{
|
||||
/* DPI scaling fails miserably when using large
|
||||
* displays. Having a UI element that's 1 inch high
|
||||
* on all screens might seem like a good idea - until
|
||||
* you realise that a HTPC user is probably sitting
|
||||
* several metres from their TV, which makes something
|
||||
* 1 inch high virtually invisible.
|
||||
* So we make some assumptions:
|
||||
* - Normal size displays <= 24 inches are probably
|
||||
* PC monitors, with an eye-to-screen distance of
|
||||
* 1 arm length. Under these conditions, fixed size
|
||||
* (DPI scaled) UI elements should be visible for most
|
||||
* users
|
||||
* - Large displays > 24 inches start to encroach on
|
||||
* TV territory. Once we start working with TVs, we
|
||||
* have to consider users sitting on a couch - and
|
||||
* in this situation, we fall back to the age-old
|
||||
* standard of UI elements occupying a fixed fraction
|
||||
* of the display size (i.e. just look at the menu of
|
||||
* any console system for the past decade)
|
||||
* - 24 -> 32 inches is a grey area, where the display
|
||||
* might be a monitor or a TV. Above 32 inches, a TV
|
||||
* is almost a certainty. So we simply lerp between
|
||||
* dpi scaling and pixel scaling as the display size
|
||||
* increases from 24 to 32 */
|
||||
float fraction = (display_size > 32.0f) ? 32.0f : display_size;
|
||||
fraction = fraction - 24.0f;
|
||||
fraction = fraction / (32.0f - 24.0f);
|
||||
|
||||
scale = ((1.0f - fraction) * dpi_scale) + (fraction * pixel_scale);
|
||||
}
|
||||
else if (display_size < 12.0f)
|
||||
{
|
||||
/* DPI scaling also fails when using very small
|
||||
* displays - i.e. mobile devices (tablets/phones).
|
||||
* That 1 inch UI element is going to look pretty
|
||||
* dumb on a 5 inch screen in landscape orientation...
|
||||
* We're essentially in the opposite situation to the
|
||||
* TV case above, and it turns out that a similar
|
||||
* solution provides relief: as screen size reduces
|
||||
* from 12 inches to zero, we lerp from dpi scaling
|
||||
* to pixel scaling */
|
||||
float fraction = display_size / 12.0f;
|
||||
|
||||
scale = ((1.0f - fraction) * pixel_scale) + (fraction * dpi_scale);
|
||||
}
|
||||
else
|
||||
scale = dpi_scale;
|
||||
}
|
||||
/* If DPI retrieval is unsupported, all we can do
|
||||
* is use the raw pixel scale */
|
||||
else
|
||||
scale = pixel_scale;
|
||||
|
||||
scale_cached = true;
|
||||
last_width = width;
|
||||
last_height = height;
|
||||
scale = menu_display_get_dpi_scale_internal(width, height);
|
||||
scale_cached = true;
|
||||
scale_updated = true;
|
||||
last_width = width;
|
||||
last_height = height;
|
||||
}
|
||||
|
||||
/* Apply user scaling factor */
|
||||
if (settings)
|
||||
return scale * ((menu_scale_factor > 0.0001f) ?
|
||||
menu_scale_factor : 1.0f);
|
||||
/* Adjusted scale calculation may also be slow, so
|
||||
* only update if something changes */
|
||||
if (scale_updated ||
|
||||
(menu_scale_factor != last_menu_scale_factor) ||
|
||||
(menu_driver_id != last_menu_driver_id))
|
||||
{
|
||||
adjusted_scale = menu_display_get_adjusted_scale_internal(scale, menu_scale_factor, width);
|
||||
last_menu_scale_factor = menu_scale_factor;
|
||||
last_menu_driver_id = menu_driver_id;
|
||||
}
|
||||
|
||||
return scale;
|
||||
return adjusted_scale;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
float menu_display_get_widget_dpi_scale(unsigned width, unsigned height)
|
||||
{
|
||||
static unsigned last_width = 0;
|
||||
static unsigned last_height = 0;
|
||||
static float scale = 0.0f;
|
||||
static bool scale_cached = false;
|
||||
bool scale_updated = false;
|
||||
static float last_menu_scale_factor = 0.0f;
|
||||
float menu_scale_factor = 1.0f;
|
||||
static enum menu_driver_id_type last_menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
|
||||
static float adjusted_scale = 1.0f;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
/* When using RGUI, settings->floats.menu_scale_factor
|
||||
* is ignored
|
||||
* > If we are not using a widget scale factor override,
|
||||
* just set menu_scale_factor to 1.0 */
|
||||
if (settings)
|
||||
menu_scale_factor = settings->bools.menu_widget_scale_auto ?
|
||||
((menu_driver_id == MENU_DRIVER_ID_RGUI) ?
|
||||
1.0f : settings->floats.menu_scale_factor) :
|
||||
settings->floats.menu_widget_scale_factor;
|
||||
|
||||
/* Scale is based on display metrics - these are a fixed
|
||||
* hardware property. To minimise performance overheads
|
||||
* we therefore only call video_context_driver_get_metrics()
|
||||
* on first run, or when the current video resolution changes */
|
||||
if (!scale_cached ||
|
||||
(width != last_width) ||
|
||||
(height != last_height))
|
||||
{
|
||||
scale = menu_display_get_dpi_scale_internal(width, height);
|
||||
scale_cached = true;
|
||||
scale_updated = true;
|
||||
last_width = width;
|
||||
last_height = height;
|
||||
}
|
||||
|
||||
/* Adjusted scale calculation may also be slow, so
|
||||
* only update if something changes */
|
||||
if (scale_updated ||
|
||||
(menu_scale_factor != last_menu_scale_factor) ||
|
||||
(menu_driver_id != last_menu_driver_id))
|
||||
{
|
||||
adjusted_scale = menu_display_get_adjusted_scale_internal(scale, menu_scale_factor, width);
|
||||
last_menu_scale_factor = menu_scale_factor;
|
||||
last_menu_driver_id = menu_driver_id;
|
||||
}
|
||||
|
||||
return adjusted_scale;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool menu_display_driver_exists(const char *s)
|
||||
{
|
||||
unsigned i;
|
||||
@ -3361,6 +3579,11 @@ const char *menu_driver_ident(void)
|
||||
return menu_driver_ctx->ident;
|
||||
}
|
||||
|
||||
enum menu_driver_id_type menu_driver_ident_id(void)
|
||||
{
|
||||
return menu_driver_id;
|
||||
}
|
||||
|
||||
void menu_driver_frame(video_frame_info_t *video_info)
|
||||
{
|
||||
if (video_info->menu_is_alive && menu_driver_ctx->frame)
|
||||
@ -3451,8 +3674,38 @@ bool menu_driver_list_set_selection(file_list_t *list)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void menu_driver_set_id(void)
|
||||
{
|
||||
const char *driver_name = NULL;
|
||||
|
||||
menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
|
||||
|
||||
if (!menu_driver_ctx || !menu_driver_ctx->ident)
|
||||
return;
|
||||
|
||||
driver_name = menu_driver_ctx->ident;
|
||||
|
||||
if (string_is_empty(driver_name))
|
||||
return;
|
||||
|
||||
if (string_is_equal(driver_name, "rgui"))
|
||||
menu_driver_id = MENU_DRIVER_ID_RGUI;
|
||||
else if (string_is_equal(driver_name, "ozone"))
|
||||
menu_driver_id = MENU_DRIVER_ID_OZONE;
|
||||
else if (string_is_equal(driver_name, "glui"))
|
||||
menu_driver_id = MENU_DRIVER_ID_GLUI;
|
||||
else if (string_is_equal(driver_name, "xmb"))
|
||||
menu_driver_id = MENU_DRIVER_ID_XMB;
|
||||
else if (string_is_equal(driver_name, "xui"))
|
||||
menu_driver_id = MENU_DRIVER_ID_XUI;
|
||||
else if (string_is_equal(driver_name, "stripes"))
|
||||
menu_driver_id = MENU_DRIVER_ID_STRIPES;
|
||||
}
|
||||
|
||||
static bool menu_driver_init_internal(bool video_is_threaded)
|
||||
{
|
||||
menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
|
||||
|
||||
if (menu_driver_ctx->init)
|
||||
{
|
||||
menu_driver_data = (menu_handle_t*)
|
||||
@ -3474,6 +3727,8 @@ static bool menu_driver_init_internal(bool video_is_threaded)
|
||||
if (!menu_driver_ctx->lists_init(menu_driver_data))
|
||||
return false;
|
||||
|
||||
menu_driver_set_id();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3680,6 +3935,8 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
free(menu_userdata);
|
||||
menu_userdata = NULL;
|
||||
|
||||
menu_driver_id = MENU_DRIVER_ID_UNKNOWN;
|
||||
|
||||
#ifndef HAVE_DYNAMIC
|
||||
if (frontend_driver_has_fork())
|
||||
#endif
|
||||
|
@ -224,6 +224,17 @@ enum menu_settings_type
|
||||
MENU_SETTINGS_LAST
|
||||
};
|
||||
|
||||
enum menu_driver_id_type
|
||||
{
|
||||
MENU_DRIVER_ID_UNKNOWN = 0,
|
||||
MENU_DRIVER_ID_RGUI,
|
||||
MENU_DRIVER_ID_OZONE,
|
||||
MENU_DRIVER_ID_GLUI,
|
||||
MENU_DRIVER_ID_XMB,
|
||||
MENU_DRIVER_ID_XUI,
|
||||
MENU_DRIVER_ID_STRIPES
|
||||
};
|
||||
|
||||
typedef struct menu_display_ctx_driver
|
||||
{
|
||||
/* Draw graphics to the screen. */
|
||||
@ -526,6 +537,8 @@ const char* config_get_menu_driver_options(void);
|
||||
|
||||
const char *menu_driver_ident(void);
|
||||
|
||||
enum menu_driver_id_type menu_driver_ident_id(void);
|
||||
|
||||
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data);
|
||||
|
||||
void menu_driver_frame(video_frame_info_t *video_info);
|
||||
@ -594,7 +607,12 @@ void menu_display_unset_viewport(unsigned width, unsigned height);
|
||||
bool menu_display_get_framebuffer_dirty_flag(void);
|
||||
void menu_display_set_framebuffer_dirty_flag(void);
|
||||
void menu_display_unset_framebuffer_dirty_flag(void);
|
||||
float menu_display_get_pixel_scale(unsigned width, unsigned height);
|
||||
float menu_display_get_dpi_scale(unsigned width, unsigned height);
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
float menu_display_get_widget_pixel_scale(unsigned width, unsigned height);
|
||||
float menu_display_get_widget_dpi_scale(unsigned width, unsigned height);
|
||||
#endif
|
||||
bool menu_display_init_first_driver(bool video_is_threaded);
|
||||
bool menu_display_restore_clear_color(void);
|
||||
void menu_display_clear_color(menu_display_ctx_clearcolor_t *color,
|
||||
|
@ -2567,7 +2567,8 @@ static int setting_action_ok_bind_all_save_autoconfig(rarch_setting_t *setting,
|
||||
index_offset = setting->index_offset;
|
||||
name = input_config_get_device_name(index_offset);
|
||||
|
||||
if(!string_is_empty(name) && config_save_autoconf_profile(name, index_offset))
|
||||
if (!string_is_empty(name) &&
|
||||
config_save_autoconf_profile(name, index_offset))
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_AUTOCONFIG_FILE_SAVED_SUCCESSFULLY), 1, 100, true,
|
||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
@ -6861,7 +6862,7 @@ static void overlay_auto_rotate_toggle_change_handler(rarch_setting_t *setting)
|
||||
#ifdef HAVE_VIDEO_LAYOUT
|
||||
static void change_handler_video_layout_enable(rarch_setting_t *setting)
|
||||
{
|
||||
if(*setting->value.target.boolean)
|
||||
if (*setting->value.target.boolean)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
void *driver = video_driver_get_ptr(false);
|
||||
@ -11780,6 +11781,48 @@ static bool setting_append_list(
|
||||
&subgroup_info,
|
||||
parent_group);
|
||||
|
||||
/* This is the SETTINGS_LIST_FONT category, but the
|
||||
* parent group is ONSCREEN_DISPLAY_SETTINGS.
|
||||
* Menu widget settings don't belong in the SETTINGS_LIST_FONT
|
||||
* category, but they *do* belong in the ONSCREEN_DISPLAY_SETTINGS
|
||||
* group. I don't want to refactor these names, so we'll assume
|
||||
* group trumps category, and just place the widget settings here */
|
||||
#ifdef HAVE_MENU_WIDGETS
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.menu_widget_scale_auto,
|
||||
MENU_ENUM_LABEL_MENU_WIDGET_SCALE_AUTO,
|
||||
MENU_ENUM_LABEL_VALUE_MENU_WIDGET_SCALE_AUTO,
|
||||
DEFAULT_MENU_WIDGET_SCALE_AUTO,
|
||||
MENU_ENUM_LABEL_VALUE_OFF,
|
||||
MENU_ENUM_LABEL_VALUE_ON,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler,
|
||||
SD_FLAG_NONE
|
||||
);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_bool_action_left_with_refresh;
|
||||
(*list)[list_info->index - 1].action_left = &setting_bool_action_left_with_refresh;
|
||||
(*list)[list_info->index - 1].action_right = &setting_bool_action_right_with_refresh;
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.menu_widget_scale_factor,
|
||||
MENU_ENUM_LABEL_MENU_WIDGET_SCALE_FACTOR,
|
||||
MENU_ENUM_LABEL_VALUE_MENU_WIDGET_SCALE_FACTOR,
|
||||
DEFAULT_MENU_WIDGET_SCALE_FACTOR,
|
||||
"%.2fx",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
menu_settings_list_current_add_range(list, list_info, 0.2, 5.0, 0.01, true, true);
|
||||
#endif
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.video_font_enable,
|
||||
@ -12863,9 +12906,11 @@ static bool setting_append_list(
|
||||
|
||||
START_SUB_GROUP(list, list_info, "Display", &group_info, &subgroup_info, parent_group);
|
||||
|
||||
/* Only implemented for GLUI and XMB at present */
|
||||
/* > MaterialUI, XMB and Ozone all support menu scaling */
|
||||
if (string_is_equal(settings->arrays.menu_driver, "glui") ||
|
||||
string_is_equal(settings->arrays.menu_driver, "xmb"))
|
||||
string_is_equal(settings->arrays.menu_driver, "xmb") ||
|
||||
string_is_equal(settings->arrays.menu_driver, "ozone"))
|
||||
{
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.menu_scale_factor,
|
||||
@ -12880,6 +12925,7 @@ static bool setting_append_list(
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
menu_settings_list_current_add_range(list, list_info, 0.2, 5.0, 0.01, true, true);
|
||||
}
|
||||
|
||||
#ifdef HAVE_XMB
|
||||
if (string_is_equal(settings->arrays.menu_driver, "xmb"))
|
||||
@ -15488,7 +15534,7 @@ static bool setting_append_list(
|
||||
sizeof(settings->paths.network_buildbot_url),
|
||||
MENU_ENUM_LABEL_CORE_UPDATER_BUILDBOT_URL,
|
||||
MENU_ENUM_LABEL_VALUE_CORE_UPDATER_BUILDBOT_URL,
|
||||
buildbot_server_url,
|
||||
DEFAULT_BUILDBOT_SERVER_URL,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
@ -15585,7 +15631,7 @@ static bool setting_append_list(
|
||||
sizeof(settings->arrays.netplay_mitm_server),
|
||||
MENU_ENUM_LABEL_NETPLAY_MITM_SERVER,
|
||||
MENU_ENUM_LABEL_VALUE_NETPLAY_MITM_SERVER,
|
||||
netplay_mitm_server,
|
||||
DEFAULT_NETPLAY_MITM_SERVER,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
@ -16806,7 +16852,7 @@ static bool setting_append_list(
|
||||
sizeof(settings->arrays.midi_input),
|
||||
MENU_ENUM_LABEL_MIDI_INPUT,
|
||||
MENU_ENUM_LABEL_VALUE_MIDI_INPUT,
|
||||
midi_input,
|
||||
DEFAULT_MIDI_INPUT,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
@ -16822,7 +16868,7 @@ static bool setting_append_list(
|
||||
sizeof(settings->arrays.midi_output),
|
||||
MENU_ENUM_LABEL_MIDI_OUTPUT,
|
||||
MENU_ENUM_LABEL_VALUE_MIDI_OUTPUT,
|
||||
midi_output,
|
||||
DEFAULT_MIDI_OUTPUT,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "menu_driver.h"
|
||||
#include "menu_shader.h"
|
||||
#include "../file_path_special.h"
|
||||
#include "../configuration.h"
|
||||
#include "../paths.h"
|
||||
#include "../retroarch.h"
|
||||
#include "../verbosity.h"
|
||||
@ -169,24 +168,12 @@ bool menu_shader_manager_set_preset(struct video_shader *shader,
|
||||
bool ret = false;
|
||||
|
||||
if (apply && !retroarch_apply_shader(type, preset_path, true))
|
||||
{
|
||||
/* We don't want to disable shaders entirely here,
|
||||
* just reset number of passes
|
||||
* > Note: Disabling shaders at this point would in
|
||||
* fact be dangerous, since it changes the number of
|
||||
* entries in the shader options menu which can in
|
||||
* turn lead to the menu selection pointer going out
|
||||
* of bounds. This causes undefined behaviour/segfaults */
|
||||
menu_shader_manager_clear_num_passes(shader);
|
||||
command_event(CMD_EVENT_SHADER_PRESET_LOADED, NULL);
|
||||
return false;
|
||||
}
|
||||
goto clear;
|
||||
|
||||
if (string_is_empty(preset_path))
|
||||
{
|
||||
menu_shader_manager_clear_num_passes(shader);
|
||||
command_event(CMD_EVENT_SHADER_PRESET_LOADED, NULL);
|
||||
return true;
|
||||
ret = true;
|
||||
goto clear;
|
||||
}
|
||||
|
||||
if (!shader)
|
||||
@ -216,15 +203,29 @@ bool menu_shader_manager_set_preset(struct video_shader *shader,
|
||||
ret = true;
|
||||
|
||||
end:
|
||||
command_event(CMD_EVENT_SHADER_PRESET_LOADED, NULL);
|
||||
#ifdef HAVE_MENU
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
||||
#endif
|
||||
command_event(CMD_EVENT_SHADER_PRESET_LOADED, NULL);
|
||||
return ret;
|
||||
|
||||
clear:
|
||||
/* We don't want to disable shaders entirely here,
|
||||
* just reset number of passes
|
||||
* > Note: Disabling shaders at this point would in
|
||||
* fact be dangerous, since it changes the number of
|
||||
* entries in the shader options menu which can in
|
||||
* turn lead to the menu selection pointer going out
|
||||
* of bounds. This causes undefined behaviour/segfaults */
|
||||
menu_shader_manager_clear_num_passes(shader);
|
||||
command_event(CMD_EVENT_SHADER_PRESET_LOADED, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool menu_shader_manager_save_preset_internal(
|
||||
const struct video_shader *shader, const char *basename,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config,
|
||||
bool apply, bool save_reference)
|
||||
{
|
||||
bool ret = false;
|
||||
@ -271,7 +272,9 @@ static bool menu_shader_manager_save_preset_internal(
|
||||
{
|
||||
preset_path = fullname;
|
||||
|
||||
ret = video_shader_write_preset(preset_path, shader, save_reference);
|
||||
ret = video_shader_write_preset(preset_path,
|
||||
dir_video_shader,
|
||||
shader, save_reference);
|
||||
|
||||
if (ret)
|
||||
RARCH_LOG("Saved shader preset to %s.\n", preset_path);
|
||||
@ -281,7 +284,6 @@ static bool menu_shader_manager_save_preset_internal(
|
||||
else
|
||||
{
|
||||
const char *dirs[3] = {0};
|
||||
settings_t *settings = config_get_ptr();
|
||||
char config_directory[PATH_MAX_LENGTH];
|
||||
|
||||
config_directory[0] = '\0';
|
||||
@ -292,8 +294,8 @@ static bool menu_shader_manager_save_preset_internal(
|
||||
path_get(RARCH_PATH_CONFIG),
|
||||
sizeof(config_directory));
|
||||
|
||||
dirs[0] = settings->paths.directory_video_shader;
|
||||
dirs[1] = settings->paths.directory_menu_config;
|
||||
dirs[0] = dir_video_shader;
|
||||
dirs[1] = dir_menu_config;
|
||||
dirs[2] = config_directory;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dirs); i++)
|
||||
@ -306,7 +308,9 @@ static bool menu_shader_manager_save_preset_internal(
|
||||
|
||||
preset_path = buffer;
|
||||
|
||||
ret = video_shader_write_preset(preset_path, shader, save_reference);
|
||||
ret = video_shader_write_preset(preset_path,
|
||||
dir_video_shader,
|
||||
shader, save_reference);
|
||||
|
||||
if (ret)
|
||||
{
|
||||
@ -328,24 +332,26 @@ static bool menu_shader_manager_save_preset_internal(
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool menu_shader_manager_operate_auto_preset(enum auto_shader_operation op,
|
||||
const struct video_shader *shader, enum auto_shader_type type, bool apply)
|
||||
static bool menu_shader_manager_operate_auto_preset(
|
||||
enum auto_shader_operation op,
|
||||
const struct video_shader *shader,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config,
|
||||
enum auto_shader_type type, bool apply)
|
||||
{
|
||||
char tmp[PATH_MAX_LENGTH];
|
||||
char directory[PATH_MAX_LENGTH];
|
||||
char file[PATH_MAX_LENGTH];
|
||||
bool success = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct retro_system_info *system = runloop_get_libretro_system_info();
|
||||
const char *core_name = system ? system->library_name : NULL;
|
||||
const char *path_dir_video_shader = settings->paths.directory_video_shader;
|
||||
|
||||
tmp[0] = directory[0] = file[0] = '\0';
|
||||
|
||||
if (type == SHADER_PRESET_GLOBAL)
|
||||
fill_pathname_join(
|
||||
directory,
|
||||
path_dir_video_shader,
|
||||
dir_video_shader,
|
||||
"presets",
|
||||
sizeof(directory));
|
||||
else if (string_is_empty(core_name))
|
||||
@ -354,7 +360,7 @@ static bool menu_shader_manager_operate_auto_preset(enum auto_shader_operation o
|
||||
{
|
||||
fill_pathname_join(
|
||||
tmp,
|
||||
path_dir_video_shader,
|
||||
dir_video_shader,
|
||||
"presets",
|
||||
sizeof(tmp));
|
||||
fill_pathname_join(
|
||||
@ -397,7 +403,10 @@ static bool menu_shader_manager_operate_auto_preset(enum auto_shader_operation o
|
||||
path_mkdir(directory);
|
||||
|
||||
return menu_shader_manager_save_preset_internal(
|
||||
shader, file, apply, true);
|
||||
shader, file,
|
||||
dir_video_shader,
|
||||
dir_menu_config,
|
||||
apply, true);
|
||||
case AUTO_SHADER_OP_REMOVE:
|
||||
{
|
||||
/* remove all supported auto-shaders of given type */
|
||||
@ -458,11 +467,18 @@ static bool menu_shader_manager_operate_auto_preset(enum auto_shader_operation o
|
||||
* Needs to be consistent with retroarch_load_shader_preset()
|
||||
* Auto-shaders will be saved as a reference if possible
|
||||
**/
|
||||
bool menu_shader_manager_save_auto_preset(const struct video_shader *shader,
|
||||
enum auto_shader_type type, bool apply)
|
||||
bool menu_shader_manager_save_auto_preset(
|
||||
const struct video_shader *shader,
|
||||
enum auto_shader_type type,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config,
|
||||
bool apply)
|
||||
{
|
||||
return menu_shader_manager_operate_auto_preset(
|
||||
AUTO_SHADER_OP_SAVE, shader, type, apply);
|
||||
AUTO_SHADER_OP_SAVE, shader,
|
||||
dir_video_shader,
|
||||
dir_menu_config,
|
||||
type, apply);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -475,10 +491,16 @@ bool menu_shader_manager_save_auto_preset(const struct video_shader *shader,
|
||||
* Save a shader preset to disk.
|
||||
**/
|
||||
bool menu_shader_manager_save_preset(const struct video_shader *shader,
|
||||
const char *basename, bool apply)
|
||||
const char *basename,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config,
|
||||
bool apply)
|
||||
{
|
||||
return menu_shader_manager_save_preset_internal(
|
||||
shader, basename, apply, false);
|
||||
shader, basename,
|
||||
dir_video_shader,
|
||||
dir_menu_config,
|
||||
apply, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -487,10 +509,16 @@ bool menu_shader_manager_save_preset(const struct video_shader *shader,
|
||||
*
|
||||
* Deletes an auto-shader.
|
||||
**/
|
||||
bool menu_shader_manager_remove_auto_preset(enum auto_shader_type type)
|
||||
bool menu_shader_manager_remove_auto_preset(
|
||||
enum auto_shader_type type,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config)
|
||||
{
|
||||
return menu_shader_manager_operate_auto_preset(
|
||||
AUTO_SHADER_OP_REMOVE, NULL, type, false);
|
||||
AUTO_SHADER_OP_REMOVE, NULL,
|
||||
dir_video_shader,
|
||||
dir_menu_config,
|
||||
type, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -499,10 +527,16 @@ bool menu_shader_manager_remove_auto_preset(enum auto_shader_type type)
|
||||
*
|
||||
* Tests if an auto-shader of the given type exists.
|
||||
**/
|
||||
bool menu_shader_manager_auto_preset_exists(enum auto_shader_type type)
|
||||
bool menu_shader_manager_auto_preset_exists(
|
||||
enum auto_shader_type type,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config)
|
||||
{
|
||||
return menu_shader_manager_operate_auto_preset(
|
||||
AUTO_SHADER_OP_EXISTS, NULL, type, false);
|
||||
AUTO_SHADER_OP_EXISTS, NULL,
|
||||
dir_video_shader,
|
||||
dir_menu_config,
|
||||
type, false);
|
||||
}
|
||||
|
||||
int menu_shader_manager_clear_num_passes(struct video_shader *shader)
|
||||
@ -613,7 +647,7 @@ enum rarch_shader_type menu_shader_manager_get_type(
|
||||
if (type == RARCH_SHADER_NONE)
|
||||
{
|
||||
type = video_shader_parse_type(shader->pass[0].source.path);
|
||||
i = 1;
|
||||
i = 1;
|
||||
}
|
||||
|
||||
for (; i < shader->passes; i++)
|
||||
@ -642,7 +676,10 @@ enum rarch_shader_type menu_shader_manager_get_type(
|
||||
*
|
||||
* Apply shader state changes.
|
||||
**/
|
||||
void menu_shader_manager_apply_changes(struct video_shader *shader)
|
||||
void menu_shader_manager_apply_changes(
|
||||
struct video_shader *shader,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config)
|
||||
{
|
||||
enum rarch_shader_type type = RARCH_SHADER_NONE;
|
||||
|
||||
@ -653,7 +690,8 @@ void menu_shader_manager_apply_changes(struct video_shader *shader)
|
||||
|
||||
if (shader->passes && type != RARCH_SHADER_NONE)
|
||||
{
|
||||
menu_shader_manager_save_preset(shader, NULL, true);
|
||||
menu_shader_manager_save_preset(shader, NULL,
|
||||
dir_video_shader, dir_menu_config, true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -70,8 +70,12 @@ bool menu_shader_manager_set_preset(
|
||||
* Needs to be consistent with retroarch_load_shader_preset()
|
||||
* Auto-shaders will be saved as a reference if possible
|
||||
**/
|
||||
bool menu_shader_manager_save_auto_preset(const struct video_shader *shader,
|
||||
enum auto_shader_type type, bool apply);
|
||||
bool menu_shader_manager_save_auto_preset(
|
||||
const struct video_shader *shader,
|
||||
enum auto_shader_type type,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config,
|
||||
bool apply);
|
||||
|
||||
/**
|
||||
* menu_shader_manager_save_preset:
|
||||
@ -82,7 +86,10 @@ bool menu_shader_manager_save_auto_preset(const struct video_shader *shader,
|
||||
* Save a shader preset to disk.
|
||||
**/
|
||||
bool menu_shader_manager_save_preset(const struct video_shader *shader,
|
||||
const char *basename, bool apply);
|
||||
const char *basename,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config,
|
||||
bool apply);
|
||||
|
||||
/**
|
||||
* menu_shader_manager_get_type:
|
||||
@ -100,7 +107,10 @@ enum rarch_shader_type menu_shader_manager_get_type(
|
||||
*
|
||||
* Apply shader state changes.
|
||||
**/
|
||||
void menu_shader_manager_apply_changes(struct video_shader *shader);
|
||||
void menu_shader_manager_apply_changes(
|
||||
struct video_shader *shader,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config);
|
||||
|
||||
int menu_shader_manager_clear_num_passes(struct video_shader *shader);
|
||||
|
||||
@ -122,9 +132,15 @@ void menu_shader_manager_clear_pass_path(struct video_shader *shader,
|
||||
*
|
||||
* Deletes an auto-shader.
|
||||
**/
|
||||
bool menu_shader_manager_remove_auto_preset(enum auto_shader_type type);
|
||||
bool menu_shader_manager_remove_auto_preset(
|
||||
enum auto_shader_type type,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config);
|
||||
|
||||
bool menu_shader_manager_auto_preset_exists(enum auto_shader_type type);
|
||||
bool menu_shader_manager_auto_preset_exists(
|
||||
enum auto_shader_type type,
|
||||
const char *dir_video_shader,
|
||||
const char *dir_menu_config);
|
||||
|
||||
void menu_shader_set_modified(bool modified);
|
||||
|
||||
|
@ -250,7 +250,7 @@ void menu_thumbnail_request(
|
||||
|
||||
/* Would like to cancel any existing image load tasks
|
||||
* here, but can't see how to do it... */
|
||||
if(task_push_image_load(
|
||||
if (task_push_image_load(
|
||||
thumbnail_path, video_driver_supports_rgba(),
|
||||
menu_thumbnail_upscale_threshold,
|
||||
menu_thumbnail_handle_upload, thumbnail_tag))
|
||||
@ -343,7 +343,7 @@ void menu_thumbnail_request_file(
|
||||
|
||||
/* Would like to cancel any existing image load tasks
|
||||
* here, but can't see how to do it... */
|
||||
if(task_push_image_load(
|
||||
if (task_push_image_load(
|
||||
file_path, video_driver_supports_rgba(),
|
||||
menu_thumbnail_upscale_threshold,
|
||||
menu_thumbnail_handle_upload, thumbnail_tag))
|
||||
|
@ -102,20 +102,22 @@ void filebrowser_parse(menu_displaylist_info_t *info, unsigned type_data)
|
||||
}
|
||||
else if (!string_is_empty(path))
|
||||
{
|
||||
bool show_hidden_files = settings->bools.show_hidden_files;
|
||||
|
||||
if (filebrowser_types == FILEBROWSER_SELECT_FILE_SUBSYSTEM)
|
||||
{
|
||||
if (subsystem && subsystem_current_count > 0 && content_get_subsystem_rom_id() < subsystem->num_roms)
|
||||
str_list = dir_list_new(path,
|
||||
(filter_ext && info) ? subsystem->roms[content_get_subsystem_rom_id()].valid_extensions : NULL,
|
||||
true, settings->bools.show_hidden_files, true, false);
|
||||
true, show_hidden_files, true, false);
|
||||
}
|
||||
else if (info && ((info->type_default == FILE_TYPE_MANUAL_SCAN_DAT) || (info->type_default == FILE_TYPE_SIDELOAD_CORE)))
|
||||
str_list = dir_list_new(path,
|
||||
info->exts, true, settings->bools.show_hidden_files, false, false);
|
||||
info->exts, true, show_hidden_files, false, false);
|
||||
else
|
||||
str_list = dir_list_new(path,
|
||||
(filter_ext && info) ? info->exts : NULL,
|
||||
true, settings->bools.show_hidden_files, true, false);
|
||||
true, show_hidden_files, true, false);
|
||||
}
|
||||
|
||||
switch (filebrowser_types)
|
||||
|
@ -628,7 +628,7 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
|
||||
/*keep resetting bind during the hold period, or we'll potentially bind joystick and mouse, etc.*/
|
||||
binds.buffer = *( binds.output );
|
||||
|
||||
if ( menu_input_key_bind_poll_find_hold( &binds, &binds.buffer ) )
|
||||
if (menu_input_key_bind_poll_find_hold(&binds, &binds.buffer))
|
||||
{
|
||||
/*inhibit timeout*/
|
||||
rarch_timer_begin_new_time( &binds.timer_timeout, settings->uints.input_bind_timeout );
|
||||
@ -642,10 +642,8 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
|
||||
menu_input_binds.begin - MENU_SETTINGS_BIND_BEGIN ) );
|
||||
|
||||
/*hold complete?*/
|
||||
if ( rarch_timer_has_expired( &binds.timer_hold ) )
|
||||
{
|
||||
if (rarch_timer_has_expired(&binds.timer_hold))
|
||||
complete = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -655,7 +653,7 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
|
||||
|
||||
#else
|
||||
|
||||
if ( ( binds.skip && !menu_input_binds.skip ) ||
|
||||
if ((binds.skip && !menu_input_binds.skip) ||
|
||||
menu_input_key_bind_poll_find_trigger( &menu_input_binds, &binds, &( binds.buffer ) ) )
|
||||
{
|
||||
complete = true;
|
||||
@ -663,7 +661,7 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
|
||||
|
||||
#endif
|
||||
|
||||
if ( complete )
|
||||
if (complete)
|
||||
{
|
||||
input_driver_t *input_drv = input_get_ptr();
|
||||
|
||||
@ -678,7 +676,7 @@ bool menu_input_key_bind_iterate(menu_input_ctx_bind_t *bind)
|
||||
|
||||
binds.begin++;
|
||||
|
||||
if ( binds.begin > binds.last )
|
||||
if (binds.begin > binds.last)
|
||||
{
|
||||
input_keyboard_ctl( RARCH_INPUT_KEYBOARD_CTL_CANCEL_WAIT_KEYS, NULL );
|
||||
return true;
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "menu_osk.h"
|
||||
|
||||
#include "../../input/input_driver.h"
|
||||
#include "../../configuration.h"
|
||||
|
||||
static char *osk_grid[45] = {NULL};
|
||||
|
||||
@ -82,16 +81,8 @@ void menu_event_set_osk_ptr(int i)
|
||||
osk_ptr = i;
|
||||
}
|
||||
|
||||
void menu_event_osk_append(int ptr)
|
||||
void menu_event_osk_append(int ptr, bool is_rgui)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool is_rgui;
|
||||
|
||||
if (ptr < 0 || !settings)
|
||||
return;
|
||||
|
||||
is_rgui = string_is_equal(settings->arrays.menu_driver, "rgui");
|
||||
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
if (string_is_equal(osk_grid[ptr],"\xe2\x87\xa6")) /* backspace character */
|
||||
input_keyboard_event(true, '\x7f', '\x7f', 0, RETRO_DEVICE_KEYBOARD);
|
||||
@ -99,9 +90,9 @@ void menu_event_osk_append(int ptr)
|
||||
input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD);
|
||||
else
|
||||
if (string_is_equal(osk_grid[ptr],"\xe2\x87\xa7")) /* up arrow */
|
||||
menu_event_set_osk_idx(OSK_UPPERCASE_LATIN);
|
||||
osk_idx = OSK_UPPERCASE_LATIN;
|
||||
else if (string_is_equal(osk_grid[ptr],"\xe2\x87\xa9")) /* down arrow */
|
||||
menu_event_set_osk_idx(OSK_LOWERCASE_LATIN);
|
||||
osk_idx = OSK_LOWERCASE_LATIN;
|
||||
else if (string_is_equal(osk_grid[ptr],"\xe2\x8a\x95")) /* plus sign (next button) */
|
||||
#else
|
||||
if (string_is_equal(osk_grid[ptr], "Bksp"))
|
||||
@ -110,22 +101,22 @@ void menu_event_osk_append(int ptr)
|
||||
input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD);
|
||||
else
|
||||
if (string_is_equal(osk_grid[ptr], "Upper"))
|
||||
menu_event_set_osk_idx(OSK_UPPERCASE_LATIN);
|
||||
osk_idx = OSK_UPPERCASE_LATIN;
|
||||
else if (string_is_equal(osk_grid[ptr], "Lower"))
|
||||
menu_event_set_osk_idx(OSK_LOWERCASE_LATIN);
|
||||
osk_idx = OSK_LOWERCASE_LATIN;
|
||||
else if (string_is_equal(osk_grid[ptr], "Next"))
|
||||
#endif
|
||||
if (menu_event_get_osk_idx() < (is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1))
|
||||
menu_event_set_osk_idx((enum osk_type)(menu_event_get_osk_idx() + 1));
|
||||
if (osk_idx < (is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1))
|
||||
osk_idx = (enum osk_type)(osk_idx + 1);
|
||||
else
|
||||
menu_event_set_osk_idx((enum osk_type)(OSK_TYPE_UNKNOWN + 1));
|
||||
osk_idx = ((enum osk_type)(OSK_TYPE_UNKNOWN + 1));
|
||||
else
|
||||
input_keyboard_line_append(osk_grid[ptr]);
|
||||
}
|
||||
|
||||
void menu_event_osk_iterate(void)
|
||||
{
|
||||
switch (menu_event_get_osk_idx())
|
||||
switch (osk_idx)
|
||||
{
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
case OSK_HIRAGANA_PAGE1:
|
||||
|
@ -55,7 +55,7 @@ int menu_event_get_osk_ptr(void);
|
||||
|
||||
void menu_event_set_osk_ptr(int a);
|
||||
|
||||
void menu_event_osk_append(int a);
|
||||
void menu_event_osk_append(int a, bool is_rgui);
|
||||
|
||||
void menu_event_osk_iterate(void);
|
||||
|
||||
|
@ -289,10 +289,12 @@ static unsigned libretro_message_width = 0;
|
||||
static char libretro_message[LIBRETRO_MESSAGE_SIZE] = {'\0'};
|
||||
|
||||
/* Metrics */
|
||||
#define BASE_FONT_SIZE 32.0f
|
||||
|
||||
static float widget_font_size;
|
||||
static unsigned simple_widget_padding = 0;
|
||||
static unsigned simple_widget_height;
|
||||
static unsigned glyph_width;
|
||||
static unsigned line_height;
|
||||
|
||||
static unsigned msg_queue_height;
|
||||
static unsigned msg_queue_icon_size_x;
|
||||
@ -316,6 +318,15 @@ static unsigned msg_queue_task_hourglass_x;
|
||||
|
||||
static unsigned generic_message_height; /* used for both generic and libretro messages */
|
||||
|
||||
static unsigned load_content_animation_icon_size_initial;
|
||||
static unsigned load_content_animation_icon_size_target;
|
||||
|
||||
static unsigned divider_width_1px;
|
||||
|
||||
static unsigned last_video_width;
|
||||
static unsigned last_video_height;
|
||||
static float last_scale_factor;
|
||||
|
||||
static void msg_widget_msg_transition_animation_done(void *userdata)
|
||||
{
|
||||
menu_widget_msg_t *msg = (menu_widget_msg_t*) userdata;
|
||||
@ -423,9 +434,8 @@ void menu_widgets_msg_queue_push(
|
||||
unsigned width = menu_driver_is_alive() ?
|
||||
msg_queue_default_rect_width_menu_alive : msg_queue_default_rect_width;
|
||||
unsigned text_width = font_driver_get_message_width(font_regular, title, title_length, msg_queue_text_scale_factor);
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
msg_widget->text_height = msg_queue_text_scale_factor * settings->floats.video_font_size;
|
||||
msg_widget->text_height = msg_queue_text_scale_factor * widget_font_size;
|
||||
|
||||
/* Text is too wide, split it into two lines */
|
||||
if (text_width > width)
|
||||
@ -863,10 +873,38 @@ static void menu_widgets_hourglass_tick(void *userdata)
|
||||
menu_animation_push(&entry);
|
||||
}
|
||||
|
||||
void menu_widgets_iterate(unsigned width, unsigned height)
|
||||
/* Forward declaration */
|
||||
static void menu_widgets_layout(
|
||||
bool is_threaded, const char *dir_assets, char *font_path);
|
||||
|
||||
void menu_widgets_iterate(
|
||||
unsigned width, unsigned height,
|
||||
const char *dir_assets, char *font_path)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
/* Check whether screen dimensions or menu scale
|
||||
* factor have changed */
|
||||
float scale_factor = (menu_driver_ident_id() == MENU_DRIVER_ID_XMB) ?
|
||||
menu_display_get_widget_pixel_scale(width, height) :
|
||||
menu_display_get_widget_dpi_scale(width, height);
|
||||
|
||||
if ((scale_factor != last_scale_factor) ||
|
||||
(width != last_video_width) ||
|
||||
(height != last_video_height))
|
||||
{
|
||||
last_scale_factor = scale_factor;
|
||||
last_video_width = width;
|
||||
last_video_height = height;
|
||||
|
||||
/* Note: We don't need a full context reset here
|
||||
* > Just rescale layout, and reset frame time counter */
|
||||
menu_widgets_layout(
|
||||
video_driver_is_threaded(),
|
||||
dir_assets, font_path);
|
||||
video_driver_monitor_reset();
|
||||
}
|
||||
|
||||
/* Messages queue */
|
||||
|
||||
/* Consume one message if available */
|
||||
@ -944,8 +982,6 @@ void menu_widgets_iterate(unsigned width, unsigned height)
|
||||
if (screenshot_filename[0] != '\0')
|
||||
{
|
||||
menu_timer_ctx_entry_t timer;
|
||||
settings_t *settings = config_get_ptr();
|
||||
float video_font_size = settings->floats.video_font_size;
|
||||
|
||||
video_driver_texture_unload(&screenshot_texture);
|
||||
|
||||
@ -953,7 +989,7 @@ void menu_widgets_iterate(unsigned width, unsigned height)
|
||||
"", &screenshot_texture, TEXTURE_FILTER_MIPMAP_LINEAR,
|
||||
&screenshot_texture_width, &screenshot_texture_height);
|
||||
|
||||
screenshot_height = video_font_size * 4;
|
||||
screenshot_height = widget_font_size * 4;
|
||||
screenshot_width = width;
|
||||
|
||||
screenshot_scale_factor = menu_widgets_get_thumbnail_scale_factor(
|
||||
@ -1013,8 +1049,6 @@ static int menu_widgets_draw_indicator(video_frame_info_t *video_info,
|
||||
{
|
||||
unsigned height = simple_widget_height;
|
||||
const char *txt = msg_hash_to_str(msg);
|
||||
settings_t *settings = config_get_ptr();
|
||||
float video_font_size = settings->floats.video_font_size;
|
||||
|
||||
width = font_driver_get_message_width(font_regular, txt, (unsigned)strlen(txt), 1) + simple_widget_padding*2;
|
||||
|
||||
@ -1027,7 +1061,7 @@ static int menu_widgets_draw_indicator(video_frame_info_t *video_info,
|
||||
|
||||
menu_display_draw_text(font_regular,
|
||||
txt,
|
||||
top_right_x_advance - width + simple_widget_padding, video_font_size + simple_widget_padding/4,
|
||||
top_right_x_advance - width + simple_widget_padding, widget_font_size + simple_widget_padding/4,
|
||||
video_info->width, video_info->height,
|
||||
0xFFFFFFFF, TEXT_ALIGN_LEFT,
|
||||
1.0f,
|
||||
@ -1054,8 +1088,6 @@ static void menu_widgets_draw_task_msg(menu_widget_msg_t *msg, video_frame_info_
|
||||
bool draw_msg_new = false;
|
||||
unsigned task_percentage_offset = 0;
|
||||
char task_percentage[256] = {0};
|
||||
settings_t *settings = config_get_ptr();
|
||||
float video_font_size = settings->floats.video_font_size;
|
||||
|
||||
if (msg->msg_new)
|
||||
draw_msg_new = !string_is_equal(msg->msg_new, msg->msg);
|
||||
@ -1143,7 +1175,7 @@ static void menu_widgets_draw_task_msg(menu_widget_msg_t *msg, video_frame_info_
|
||||
menu_display_draw_text(font_regular,
|
||||
msg->msg_new,
|
||||
msg_queue_task_text_start_x,
|
||||
video_info->height - msg->offset_y + msg_queue_text_scale_factor * video_font_size + msg_queue_height/4 - video_font_size/2.25f - msg_queue_height/2 + msg->msg_transition_animation,
|
||||
video_info->height - msg->offset_y + msg_queue_text_scale_factor * widget_font_size + msg_queue_height/4 - widget_font_size/2.25f - msg_queue_height/2 + msg->msg_transition_animation,
|
||||
video_info->width, video_info->height,
|
||||
text_color,
|
||||
TEXT_ALIGN_LEFT,
|
||||
@ -1157,7 +1189,7 @@ static void menu_widgets_draw_task_msg(menu_widget_msg_t *msg, video_frame_info_
|
||||
menu_display_draw_text(font_regular,
|
||||
msg->msg,
|
||||
msg_queue_task_text_start_x,
|
||||
video_info->height - msg->offset_y + msg_queue_text_scale_factor * video_font_size + msg_queue_height/4 - video_font_size/2.25f + msg->msg_transition_animation,
|
||||
video_info->height - msg->offset_y + msg_queue_text_scale_factor * widget_font_size + msg_queue_height/4 - widget_font_size/2.25f + msg->msg_transition_animation,
|
||||
video_info->width, video_info->height,
|
||||
text_color,
|
||||
TEXT_ALIGN_LEFT,
|
||||
@ -1180,7 +1212,7 @@ static void menu_widgets_draw_task_msg(menu_widget_msg_t *msg, video_frame_info_
|
||||
menu_display_draw_text(font_regular,
|
||||
task_percentage,
|
||||
msg_queue_rect_start_x - msg_queue_icon_size_x + rect_width - msg_queue_glyph_width,
|
||||
video_info->height - msg->offset_y + msg_queue_text_scale_factor * video_font_size + msg_queue_height/4 - video_font_size/2.25f,
|
||||
video_info->height - msg->offset_y + msg_queue_text_scale_factor * widget_font_size + msg_queue_height/4 - widget_font_size/2.25f,
|
||||
video_info->width, video_info->height,
|
||||
text_color,
|
||||
TEXT_ALIGN_RIGHT,
|
||||
@ -1300,12 +1332,11 @@ static void menu_widgets_draw_backdrop(video_frame_info_t *video_info, float alp
|
||||
|
||||
static void menu_widgets_draw_load_content_animation(video_frame_info_t *video_info)
|
||||
{
|
||||
/* TODO: scale this right ? (change metrics) */
|
||||
|
||||
/* TODO: change metrics? */
|
||||
int icon_size = (int) load_content_animation_icon_size;
|
||||
uint32_t text_alpha = load_content_animation_fade_alpha * 255.0f;
|
||||
uint32_t text_color = COLOR_TEXT_ALPHA(0xB8B8B800, text_alpha);
|
||||
unsigned text_offset = -25 * load_content_animation_fade_alpha;
|
||||
unsigned text_offset = -25 * last_scale_factor * load_content_animation_fade_alpha;
|
||||
float *icon_color = load_content_animation_icon_color;
|
||||
|
||||
/* Fade out */
|
||||
@ -1328,7 +1359,7 @@ static void menu_widgets_draw_load_content_animation(video_frame_info_t *video_i
|
||||
menu_display_draw_text(font_bold,
|
||||
load_content_animation_content_name,
|
||||
video_info->width/2,
|
||||
video_info->height/2 + 175 + 25 + text_offset,
|
||||
video_info->height/2 + (175 + 25) * last_scale_factor + text_offset,
|
||||
video_info->width,
|
||||
video_info->height,
|
||||
text_color,
|
||||
@ -1356,8 +1387,6 @@ void menu_widgets_frame(void *data)
|
||||
video_frame_info_t *video_info = (video_frame_info_t*)data;
|
||||
int top_right_x_advance = video_info->width;
|
||||
int scissor_me_timbers = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
float video_font_size = settings->floats.video_font_size;
|
||||
|
||||
menu_widgets_frame_count++;
|
||||
|
||||
@ -1391,28 +1420,28 @@ void menu_widgets_frame(void *data)
|
||||
/* top line */
|
||||
menu_display_draw_quad(video_info,
|
||||
0, 0,
|
||||
video_info->width, 1,
|
||||
video_info->width, divider_width_1px,
|
||||
video_info->width, video_info->height,
|
||||
outline_color
|
||||
);
|
||||
/* bottom line */
|
||||
menu_display_draw_quad(video_info,
|
||||
0, video_info->height-1,
|
||||
video_info->width, 1,
|
||||
0, video_info->height-divider_width_1px,
|
||||
video_info->width, divider_width_1px,
|
||||
video_info->width, video_info->height,
|
||||
outline_color
|
||||
);
|
||||
/* left line */
|
||||
menu_display_draw_quad(video_info,
|
||||
0, 0,
|
||||
1, video_info->height,
|
||||
divider_width_1px, video_info->height,
|
||||
video_info->width, video_info->height,
|
||||
outline_color
|
||||
);
|
||||
/* right line */
|
||||
menu_display_draw_quad(video_info,
|
||||
video_info->width-1, 0,
|
||||
1, video_info->height,
|
||||
video_info->width-divider_width_1px, 0,
|
||||
divider_width_1px, video_info->height,
|
||||
video_info->width, video_info->height,
|
||||
outline_color
|
||||
);
|
||||
@ -1436,7 +1465,7 @@ void menu_widgets_frame(void *data)
|
||||
|
||||
menu_display_draw_text(font_regular, libretro_message,
|
||||
simple_widget_padding,
|
||||
video_info->height - generic_message_height/2 + line_height/4,
|
||||
video_info->height - generic_message_height/2 + widget_font_size/4,
|
||||
video_info->width, video_info->height,
|
||||
text_color, TEXT_ALIGN_LEFT,
|
||||
1, false, 0, false);
|
||||
@ -1456,7 +1485,7 @@ void menu_widgets_frame(void *data)
|
||||
|
||||
menu_display_draw_text(font_regular, generic_message,
|
||||
video_info->width/2,
|
||||
video_info->height - generic_message_height/2 + line_height/4,
|
||||
video_info->height - generic_message_height/2 + widget_font_size/4,
|
||||
video_info->width, video_info->height,
|
||||
text_color, TEXT_ALIGN_CENTER,
|
||||
1, false, 0, false);
|
||||
@ -1488,7 +1517,7 @@ void menu_widgets_frame(void *data)
|
||||
|
||||
menu_display_draw_text(font_regular,
|
||||
msg_hash_to_str(MSG_SCREENSHOT_SAVED),
|
||||
screenshot_thumbnail_width + simple_widget_padding, video_font_size * 1.9f + screenshot_y,
|
||||
screenshot_thumbnail_width + simple_widget_padding, widget_font_size * 1.9f + screenshot_y,
|
||||
video_info->width, video_info->height,
|
||||
text_color_faint,
|
||||
TEXT_ALIGN_LEFT,
|
||||
@ -1505,7 +1534,7 @@ void menu_widgets_frame(void *data)
|
||||
|
||||
menu_display_draw_text(font_regular,
|
||||
shotname,
|
||||
screenshot_thumbnail_width + simple_widget_padding, video_font_size * 2.9f + screenshot_y,
|
||||
screenshot_thumbnail_width + simple_widget_padding, widget_font_size * 2.9f + screenshot_y,
|
||||
video_info->width, video_info->height,
|
||||
text_color_info,
|
||||
TEXT_ALIGN_LEFT,
|
||||
@ -1569,7 +1598,7 @@ void menu_widgets_frame(void *data)
|
||||
/* Title */
|
||||
menu_display_draw_text(font_regular,
|
||||
msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED),
|
||||
cheevo_height + simple_widget_padding - unfold_offet, video_font_size * 1.9f + cheevo_y,
|
||||
cheevo_height + simple_widget_padding - unfold_offet, widget_font_size * 1.9f + cheevo_y,
|
||||
video_info->width, video_info->height,
|
||||
text_color_faint,
|
||||
TEXT_ALIGN_LEFT,
|
||||
@ -1582,7 +1611,7 @@ void menu_widgets_frame(void *data)
|
||||
|
||||
menu_display_draw_text(font_regular,
|
||||
cheevo_title,
|
||||
cheevo_height + simple_widget_padding - unfold_offet, video_font_size * 2.9f + cheevo_y,
|
||||
cheevo_height + simple_widget_padding - unfold_offet, widget_font_size * 2.9f + cheevo_y,
|
||||
video_info->width, video_info->height,
|
||||
text_color_info,
|
||||
TEXT_ALIGN_LEFT,
|
||||
@ -1606,13 +1635,13 @@ void menu_widgets_frame(void *data)
|
||||
menu_texture_item volume_icon = 0;
|
||||
|
||||
unsigned volume_width = video_info->width / 3;
|
||||
unsigned volume_height = video_font_size * 4;
|
||||
unsigned volume_height = widget_font_size * 4;
|
||||
unsigned icon_size = menu_widgets_icons_textures[MENU_WIDGETS_ICON_VOLUME_MED] ? volume_height : simple_widget_padding;
|
||||
unsigned text_color = COLOR_TEXT_ALPHA(0xffffffff, (unsigned)(volume_text_alpha*255.0f));
|
||||
unsigned text_color_db = COLOR_TEXT_ALPHA(text_color_faint, (unsigned)(volume_text_alpha*255.0f));
|
||||
|
||||
unsigned bar_x = icon_size;
|
||||
unsigned bar_height = video_font_size / 2;
|
||||
unsigned bar_height = widget_font_size / 2;
|
||||
unsigned bar_width = volume_width - bar_x - simple_widget_padding;
|
||||
unsigned bar_y = volume_height / 2 + bar_height/2;
|
||||
|
||||
@ -1688,7 +1717,7 @@ void menu_widgets_frame(void *data)
|
||||
const char *text = msg_hash_to_str(MSG_AUDIO_MUTED);
|
||||
menu_display_draw_text(font_regular,
|
||||
text,
|
||||
volume_width/2, volume_height/2 + video_font_size / 3,
|
||||
volume_width/2, volume_height/2 + widget_font_size / 3,
|
||||
video_info->width, video_info->height,
|
||||
text_color, TEXT_ALIGN_CENTER,
|
||||
1, false, 0, false
|
||||
@ -1724,7 +1753,7 @@ void menu_widgets_frame(void *data)
|
||||
|
||||
menu_display_draw_text(font_regular,
|
||||
msg,
|
||||
volume_width - simple_widget_padding, video_font_size * 2,
|
||||
volume_width - simple_widget_padding, widget_font_size * 2,
|
||||
video_info->width, video_info->height,
|
||||
text_color_db,
|
||||
TEXT_ALIGN_RIGHT,
|
||||
@ -1733,7 +1762,7 @@ void menu_widgets_frame(void *data)
|
||||
|
||||
menu_display_draw_text(font_regular,
|
||||
percentage_msg,
|
||||
icon_size, video_font_size * 2,
|
||||
icon_size, widget_font_size * 2,
|
||||
video_info->width, video_info->height,
|
||||
text_color,
|
||||
TEXT_ALIGN_LEFT,
|
||||
@ -1768,6 +1797,11 @@ void menu_widgets_frame(void *data)
|
||||
int text_width = font_driver_get_message_width(font_regular, text, (unsigned)strlen(text), 1.0f);
|
||||
int total_width = text_width + simple_widget_padding * 2;
|
||||
|
||||
int fps_text_x = top_right_x_advance - simple_widget_padding - text_width;
|
||||
/* Ensure that left hand side of text does
|
||||
* not bleed off the edge of the screen */
|
||||
fps_text_x = (fps_text_x < 0) ? 0 : fps_text_x;
|
||||
|
||||
menu_display_set_alpha(menu_widgets_backdrop_orig, DEFAULT_BACKDROP);
|
||||
|
||||
menu_display_draw_quad(video_info,
|
||||
@ -1779,7 +1813,7 @@ void menu_widgets_frame(void *data)
|
||||
|
||||
menu_display_draw_text(font_regular,
|
||||
text,
|
||||
top_right_x_advance - simple_widget_padding - text_width, video_font_size + simple_widget_padding/4,
|
||||
fps_text_x, widget_font_size + simple_widget_padding/4,
|
||||
video_info->width, video_info->height,
|
||||
0xFFFFFFFF,
|
||||
TEXT_ALIGN_LEFT,
|
||||
@ -1855,6 +1889,16 @@ bool menu_widgets_init(bool video_is_threaded)
|
||||
if (!file_list_reserve(current_msgs, MSG_QUEUE_ONSCREEN_MAX))
|
||||
goto error;
|
||||
|
||||
/* Initialise scaling parameters
|
||||
* NOTE - special cases:
|
||||
* > Ozone has a capped scale factor
|
||||
* > XMB uses pixel based scaling - all other drivers
|
||||
* use DPI based scaling */
|
||||
video_driver_get_size(&last_video_width, &last_video_height);
|
||||
last_scale_factor = (menu_driver_ident_id() == MENU_DRIVER_ID_XMB) ?
|
||||
menu_display_get_widget_pixel_scale(last_video_width, last_video_height) :
|
||||
menu_display_get_widget_dpi_scale(last_video_width, last_video_height);
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
@ -1863,93 +1907,66 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
void menu_widgets_context_reset(bool is_threaded,
|
||||
unsigned width, unsigned height)
|
||||
static void menu_widgets_layout(
|
||||
bool is_threaded, const char *dir_assets, char *font_path)
|
||||
{
|
||||
int i;
|
||||
char xmb_path[PATH_MAX_LENGTH];
|
||||
char monochrome_png_path[PATH_MAX_LENGTH];
|
||||
char menu_widgets_path[PATH_MAX_LENGTH];
|
||||
char theme_path[PATH_MAX_LENGTH];
|
||||
char ozone_path[PATH_MAX_LENGTH];
|
||||
char font_path[PATH_MAX_LENGTH];
|
||||
settings_t *settings = config_get_ptr();
|
||||
float video_font_size = settings->floats.video_font_size;
|
||||
int font_height = 0;
|
||||
|
||||
/* Textures paths */
|
||||
fill_pathname_join(
|
||||
menu_widgets_path,
|
||||
settings->paths.directory_assets,
|
||||
"menu_widgets",
|
||||
sizeof(menu_widgets_path)
|
||||
);
|
||||
/* Base font size must be determined first */
|
||||
widget_font_size = BASE_FONT_SIZE * last_scale_factor;
|
||||
|
||||
fill_pathname_join(
|
||||
xmb_path,
|
||||
settings->paths.directory_assets,
|
||||
"xmb",
|
||||
sizeof(xmb_path)
|
||||
);
|
||||
/* Initialise fonts */
|
||||
|
||||
/* Monochrome */
|
||||
fill_pathname_join(
|
||||
theme_path,
|
||||
xmb_path,
|
||||
"monochrome",
|
||||
sizeof(theme_path)
|
||||
);
|
||||
|
||||
fill_pathname_join(
|
||||
monochrome_png_path,
|
||||
theme_path,
|
||||
"png",
|
||||
sizeof(monochrome_png_path)
|
||||
);
|
||||
|
||||
/* Load textures */
|
||||
/* Icons */
|
||||
for (i = 0; i < MENU_WIDGETS_ICON_LAST; i++)
|
||||
/* > Free existing */
|
||||
if (font_regular)
|
||||
{
|
||||
menu_display_reset_textures_list(menu_widgets_icons_names[i], monochrome_png_path, &menu_widgets_icons_textures[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL);
|
||||
menu_display_font_free(font_regular);
|
||||
font_regular = NULL;
|
||||
}
|
||||
if (font_bold)
|
||||
{
|
||||
menu_display_font_free(font_bold);
|
||||
font_bold = NULL;
|
||||
}
|
||||
|
||||
/* Message queue */
|
||||
menu_display_reset_textures_list("msg_queue_icon.png", menu_widgets_path, &msg_queue_icon, TEXTURE_FILTER_LINEAR, NULL, NULL);
|
||||
menu_display_reset_textures_list("msg_queue_icon_outline.png", menu_widgets_path, &msg_queue_icon_outline, TEXTURE_FILTER_LINEAR, NULL, NULL);
|
||||
menu_display_reset_textures_list("msg_queue_icon_rect.png", menu_widgets_path, &msg_queue_icon_rect, TEXTURE_FILTER_NEAREST, NULL, NULL);
|
||||
|
||||
msg_queue_has_icons = msg_queue_icon && msg_queue_icon_outline && msg_queue_icon_rect;
|
||||
|
||||
/* Fonts paths */
|
||||
fill_pathname_join(
|
||||
ozone_path,
|
||||
settings->paths.directory_assets,
|
||||
"ozone",
|
||||
sizeof(ozone_path)
|
||||
);
|
||||
|
||||
/* Fonts */
|
||||
if (settings->paths.path_font[0] == '\0')
|
||||
/* > Create new */
|
||||
if (string_is_empty(font_path))
|
||||
{
|
||||
fill_pathname_join(font_path, ozone_path, "regular.ttf", sizeof(font_path));
|
||||
font_regular = menu_display_font_file(font_path, video_font_size, is_threaded);
|
||||
char ozone_path[PATH_MAX_LENGTH];
|
||||
char font_path[PATH_MAX_LENGTH];
|
||||
|
||||
ozone_path[0] = '\0';
|
||||
font_path[0] = '\0';
|
||||
|
||||
/* Base path */
|
||||
fill_pathname_join(ozone_path, dir_assets, "ozone", sizeof(ozone_path));
|
||||
|
||||
/* Create regular font */
|
||||
fill_pathname_join(font_path, ozone_path, "regular.ttf", sizeof(font_path));
|
||||
font_regular = menu_display_font_file(font_path, widget_font_size, is_threaded);
|
||||
|
||||
/* Create bold font */
|
||||
fill_pathname_join(font_path, ozone_path, "bold.ttf", sizeof(font_path));
|
||||
font_bold = menu_display_font_file(font_path, video_font_size, is_threaded);
|
||||
font_bold = menu_display_font_file(font_path, widget_font_size, is_threaded);
|
||||
}
|
||||
else
|
||||
{
|
||||
font_regular = menu_display_font_file(settings->paths.path_font, video_font_size, is_threaded);
|
||||
font_bold = menu_display_font_file(settings->paths.path_font, video_font_size, is_threaded);
|
||||
/* Load fonts from user-supplied path */
|
||||
font_regular = menu_display_font_file(font_path, widget_font_size, is_threaded);
|
||||
font_bold = menu_display_font_file(font_path, widget_font_size, is_threaded);
|
||||
}
|
||||
|
||||
/* Metrics */
|
||||
simple_widget_padding = video_font_size * 2/3;
|
||||
simple_widget_height = video_font_size + simple_widget_padding;
|
||||
glyph_width = font_driver_get_message_width(font_regular, "a", 1, 1);
|
||||
line_height = font_driver_get_line_height(font_regular, 1);
|
||||
/* > Get actual font size */
|
||||
font_height = font_driver_get_line_height(font_regular, 1.0f);
|
||||
if (font_height > 0)
|
||||
widget_font_size = (float)font_height;
|
||||
|
||||
msg_queue_height = video_font_size * 2.5f;
|
||||
/* Calculate dimensions */
|
||||
simple_widget_padding = widget_font_size * 2.0f/3.0f;
|
||||
simple_widget_height = widget_font_size + simple_widget_padding;
|
||||
glyph_width = font_driver_get_message_width(font_regular, "a", 1, 1);
|
||||
|
||||
msg_queue_height = widget_font_size * 2.5f;
|
||||
|
||||
if (msg_queue_has_icons)
|
||||
{
|
||||
@ -1984,14 +2001,89 @@ void menu_widgets_context_reset(bool is_threaded,
|
||||
msg_queue_task_text_start_x -= msg_queue_glyph_width*2;
|
||||
|
||||
msg_queue_regular_text_start = msg_queue_rect_start_x + msg_queue_regular_padding_x;
|
||||
msg_queue_regular_text_base_y = video_font_size * msg_queue_text_scale_factor + msg_queue_height/2;
|
||||
msg_queue_regular_text_base_y = widget_font_size * msg_queue_text_scale_factor + msg_queue_height/2;
|
||||
|
||||
msg_queue_task_hourglass_x = msg_queue_rect_start_x - msg_queue_icon_size_x;
|
||||
|
||||
generic_message_height = video_font_size * 2;
|
||||
generic_message_height = widget_font_size * 2;
|
||||
|
||||
msg_queue_default_rect_width_menu_alive = msg_queue_glyph_width * 40;
|
||||
msg_queue_default_rect_width = width - msg_queue_regular_text_start - (2 * simple_widget_padding);
|
||||
msg_queue_default_rect_width = last_video_width - msg_queue_regular_text_start - (2 * simple_widget_padding);
|
||||
|
||||
load_content_animation_icon_size_initial = LOAD_CONTENT_ANIMATION_INITIAL_ICON_SIZE * last_scale_factor;
|
||||
load_content_animation_icon_size_target = LOAD_CONTENT_ANIMATION_TARGET_ICON_SIZE * last_scale_factor;
|
||||
|
||||
divider_width_1px = (last_scale_factor > 1.0f) ? (unsigned)(last_scale_factor + 0.5f) : 1;
|
||||
}
|
||||
|
||||
void menu_widgets_context_reset(bool is_threaded,
|
||||
unsigned width, unsigned height,
|
||||
const char *dir_assets, char *font_path)
|
||||
{
|
||||
int i;
|
||||
char xmb_path[PATH_MAX_LENGTH];
|
||||
char monochrome_png_path[PATH_MAX_LENGTH];
|
||||
char menu_widgets_path[PATH_MAX_LENGTH];
|
||||
char theme_path[PATH_MAX_LENGTH];
|
||||
|
||||
xmb_path[0] = '\0';
|
||||
monochrome_png_path[0] = '\0';
|
||||
menu_widgets_path[0] = '\0';
|
||||
theme_path[0] = '\0';
|
||||
|
||||
/* Textures paths */
|
||||
fill_pathname_join(
|
||||
menu_widgets_path,
|
||||
dir_assets,
|
||||
"menu_widgets",
|
||||
sizeof(menu_widgets_path)
|
||||
);
|
||||
|
||||
fill_pathname_join(
|
||||
xmb_path,
|
||||
dir_assets,
|
||||
"xmb",
|
||||
sizeof(xmb_path)
|
||||
);
|
||||
|
||||
/* Monochrome */
|
||||
fill_pathname_join(
|
||||
theme_path,
|
||||
xmb_path,
|
||||
"monochrome",
|
||||
sizeof(theme_path)
|
||||
);
|
||||
|
||||
fill_pathname_join(
|
||||
monochrome_png_path,
|
||||
theme_path,
|
||||
"png",
|
||||
sizeof(monochrome_png_path)
|
||||
);
|
||||
|
||||
/* Load textures */
|
||||
/* Icons */
|
||||
for (i = 0; i < MENU_WIDGETS_ICON_LAST; i++)
|
||||
{
|
||||
menu_display_reset_textures_list(menu_widgets_icons_names[i], monochrome_png_path, &menu_widgets_icons_textures[i], TEXTURE_FILTER_MIPMAP_LINEAR, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Message queue */
|
||||
menu_display_reset_textures_list("msg_queue_icon.png", menu_widgets_path, &msg_queue_icon, TEXTURE_FILTER_LINEAR, NULL, NULL);
|
||||
menu_display_reset_textures_list("msg_queue_icon_outline.png", menu_widgets_path, &msg_queue_icon_outline, TEXTURE_FILTER_LINEAR, NULL, NULL);
|
||||
menu_display_reset_textures_list("msg_queue_icon_rect.png", menu_widgets_path, &msg_queue_icon_rect, TEXTURE_FILTER_NEAREST, NULL, NULL);
|
||||
|
||||
msg_queue_has_icons = msg_queue_icon && msg_queue_icon_outline && msg_queue_icon_rect;
|
||||
|
||||
/* Update scaling/dimensions */
|
||||
last_video_width = width;
|
||||
last_video_height = height;
|
||||
last_scale_factor = (menu_driver_ident_id() == MENU_DRIVER_ID_XMB) ?
|
||||
menu_display_get_widget_pixel_scale(last_video_width, last_video_height) :
|
||||
menu_display_get_widget_dpi_scale(last_video_width, last_video_height);
|
||||
menu_widgets_layout(is_threaded, dir_assets, font_path);
|
||||
|
||||
video_driver_monitor_reset();
|
||||
}
|
||||
|
||||
void menu_widgets_context_destroy(void)
|
||||
@ -2009,8 +2101,10 @@ void menu_widgets_context_destroy(void)
|
||||
video_driver_texture_unload(&msg_queue_icon_rect);
|
||||
|
||||
/* Fonts */
|
||||
menu_display_font_free(font_regular);
|
||||
menu_display_font_free(font_bold);
|
||||
if (font_regular)
|
||||
menu_display_font_free(font_regular);
|
||||
if (font_bold)
|
||||
menu_display_font_free(font_bold);
|
||||
|
||||
font_regular = NULL;
|
||||
font_bold = NULL;
|
||||
@ -2122,12 +2216,10 @@ static void menu_widgets_volume_timer_end(void *userdata)
|
||||
menu_animation_push(&entry);
|
||||
}
|
||||
|
||||
void menu_widgets_volume_update_and_show(void)
|
||||
void menu_widgets_volume_update_and_show(float new_volume)
|
||||
{
|
||||
menu_timer_ctx_entry_t entry;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool mute = *(audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE));
|
||||
float new_volume = settings->floats.audio_volume;
|
||||
bool mute = *(audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE));
|
||||
|
||||
menu_animation_kill_by_tag(&volume_tag);
|
||||
|
||||
@ -2245,7 +2337,6 @@ void menu_widgets_cleanup_load_content_animation(void)
|
||||
void menu_widgets_start_load_content_animation(const char *content_name, bool remove_extension)
|
||||
{
|
||||
/* TODO: finish the animation based on design, correct all timings */
|
||||
/* TODO: scale the icon correctly */
|
||||
menu_animation_ctx_entry_t entry;
|
||||
menu_timer_ctx_entry_t timer_entry;
|
||||
int i;
|
||||
@ -2270,7 +2361,7 @@ void menu_widgets_start_load_content_animation(const char *content_name, bool re
|
||||
path_remove_extension(load_content_animation_content_name);
|
||||
|
||||
/* Reset animation state */
|
||||
load_content_animation_icon_size = LOAD_CONTENT_ANIMATION_INITIAL_ICON_SIZE;
|
||||
load_content_animation_icon_size = load_content_animation_icon_size_initial;
|
||||
load_content_animation_icon_alpha = 0.0f;
|
||||
load_content_animation_fade_alpha = 0.0f;
|
||||
load_content_animation_final_fade_alpha = 0.0f;
|
||||
@ -2287,7 +2378,7 @@ void menu_widgets_start_load_content_animation(const char *content_name, bool re
|
||||
/* Position */
|
||||
entry.duration = ANIMATION_LOAD_CONTENT_DURATION;
|
||||
entry.subject = &load_content_animation_icon_size;
|
||||
entry.target_value = LOAD_CONTENT_ANIMATION_TARGET_ICON_SIZE;
|
||||
entry.target_value = load_content_animation_icon_size_target;
|
||||
|
||||
menu_animation_push(&entry);
|
||||
|
||||
@ -2404,8 +2495,7 @@ static void menu_widgets_achievement_unfold(void *userdata)
|
||||
static void menu_widgets_start_achievement_notification(void)
|
||||
{
|
||||
menu_animation_ctx_entry_t entry;
|
||||
settings_t *settings = config_get_ptr();
|
||||
cheevo_height = settings->floats.video_font_size * 4;
|
||||
cheevo_height = widget_font_size * 4;
|
||||
cheevo_width = MAX(
|
||||
font_driver_get_message_width(font_regular, msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED), 0, 1),
|
||||
font_driver_get_message_width(font_regular, cheevo_title, 0, 1)
|
||||
|
@ -48,9 +48,11 @@ void menu_widgets_msg_queue_push(
|
||||
enum message_queue_category category,
|
||||
unsigned prio, bool flush);
|
||||
|
||||
void menu_widgets_volume_update_and_show(void);
|
||||
void menu_widgets_volume_update_and_show(float new_volume);
|
||||
|
||||
void menu_widgets_iterate(unsigned width, unsigned height);
|
||||
void menu_widgets_iterate(
|
||||
unsigned width, unsigned height,
|
||||
const char *dir_assets, char *font_path);
|
||||
|
||||
void menu_widgets_screenshot_taken(const char *shotname, const char *filename);
|
||||
|
||||
@ -70,7 +72,8 @@ void menu_widgets_start_load_content_animation(
|
||||
void menu_widgets_cleanup_load_content_animation(void);
|
||||
|
||||
void menu_widgets_context_reset(bool is_threaded,
|
||||
unsigned width, unsigned height);
|
||||
unsigned width, unsigned height,
|
||||
const char *dir_assets, char *font_path);
|
||||
|
||||
void menu_widgets_context_destroy(void);
|
||||
|
||||
|
@ -405,7 +405,8 @@ static bool alsa_midi_write(void *p, const midi_event_t *event)
|
||||
ev.time.time.tv_sec = d->out_ev_time.tv_sec + event->delta_time / 1000000;
|
||||
ev.time.time.tv_nsec = d->out_ev_time.tv_nsec +
|
||||
(event->delta_time % 1000000) * 1000;
|
||||
if(ev.time.time.tv_nsec >= 1000000000)
|
||||
|
||||
if (ev.time.time.tv_nsec >= 1000000000)
|
||||
{
|
||||
ev.time.time.tv_sec += 1;
|
||||
ev.time.time.tv_nsec -= 1000000000;
|
||||
|
@ -168,7 +168,7 @@ static void CALLBACK winmm_midi_input_callback(HMIDIIN dev, UINT msg,
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if(msg == MIM_LONGDATA)
|
||||
else if (msg == MIM_LONGDATA)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
RARCH_WARN("[MIDI]: SysEx input not implemented, event dropped.\n");
|
||||
|
@ -517,6 +517,8 @@ enum msg_hash_enums
|
||||
MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_END = MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN + RARCH_BIND_LIST_END,
|
||||
|
||||
MENU_LABEL(MENU_SCALE_FACTOR),
|
||||
MENU_LABEL(MENU_WIDGET_SCALE_AUTO),
|
||||
MENU_LABEL(MENU_WIDGET_SCALE_FACTOR),
|
||||
MENU_LABEL(MENU_WALLPAPER_OPACITY),
|
||||
MENU_LABEL(MENU_FRAMEBUFFER_OPACITY),
|
||||
MENU_LABEL(MENU_USE_PREFERRED_SYSTEM_COLOR_THEME),
|
||||
|
@ -856,7 +856,7 @@ static void netplay_announce(void)
|
||||
frontend_drv->ident, frontend_architecture_tmp);
|
||||
|
||||
#ifdef HAVE_DISCORD
|
||||
if(discord_is_ready())
|
||||
if (discord_is_ready())
|
||||
net_http_urlencode(&username, discord_get_own_username());
|
||||
else
|
||||
#endif
|
||||
@ -990,7 +990,7 @@ static void netplay_frontend_paused(netplay_t *netplay, bool paused)
|
||||
* Returns: true (1) if the frontend is cleared to emulate the frame, false (0)
|
||||
* if we're stalled or paused
|
||||
**/
|
||||
bool netplay_pre_frame(netplay_t *netplay)
|
||||
static bool netplay_pre_frame(netplay_t *netplay)
|
||||
{
|
||||
bool sync_stalled = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -1039,7 +1039,10 @@ bool netplay_pre_frame(netplay_t *netplay)
|
||||
}
|
||||
}
|
||||
|
||||
sync_stalled = !netplay_sync_pre_frame(netplay);
|
||||
sync_stalled = !netplay_sync_pre_frame(netplay,
|
||||
settings->paths.netplay_password,
|
||||
settings->paths.netplay_spectate_password
|
||||
);
|
||||
|
||||
/* If we're disconnected, deinitialize */
|
||||
if (!netplay->is_server && !netplay->connections[0].active)
|
||||
@ -1068,7 +1071,7 @@ bool netplay_pre_frame(netplay_t *netplay)
|
||||
* We check if we have new input and replay from recorded input.
|
||||
* Call this after running retro_run().
|
||||
**/
|
||||
void netplay_post_frame(netplay_t *netplay)
|
||||
static void netplay_post_frame(netplay_t *netplay)
|
||||
{
|
||||
size_t i;
|
||||
retro_assert(netplay);
|
||||
@ -1144,7 +1147,7 @@ static void netplay_force_future(netplay_t *netplay)
|
||||
* Send a loaded savestate to those connected peers using the given compression
|
||||
* scheme.
|
||||
*/
|
||||
void netplay_send_savestate(netplay_t *netplay,
|
||||
static void netplay_send_savestate(netplay_t *netplay,
|
||||
retro_ctx_serialize_info_t *serial_info, uint32_t cx,
|
||||
struct compression_transcoder *z)
|
||||
{
|
||||
@ -1285,7 +1288,8 @@ static void netplay_core_reset(netplay_t *netplay)
|
||||
*
|
||||
* Get the preferred share mode
|
||||
*/
|
||||
uint8_t netplay_settings_share_mode(unsigned share_digital, unsigned share_analog)
|
||||
uint8_t netplay_settings_share_mode(unsigned share_digital,
|
||||
unsigned share_analog)
|
||||
{
|
||||
if (share_digital || share_analog)
|
||||
{
|
||||
@ -1466,6 +1470,8 @@ bool init_netplay(void *direct_host, const char *server, unsigned port)
|
||||
discord_get_own_username() ? discord_get_own_username() :
|
||||
#endif
|
||||
settings->paths.username,
|
||||
settings->paths.netplay_password,
|
||||
settings->paths.netplay_spectate_password,
|
||||
quirks);
|
||||
|
||||
if (netplay_data)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user