Merge pull request #2 from RobLoach/undo

Fix the Merge conflict
This commit is contained in:
rz5 2016-06-16 03:42:53 +01:00 committed by GitHub
commit 362f50caf2
54 changed files with 3858 additions and 397 deletions

View File

@ -14,7 +14,7 @@ A libretro core written in portable C or C++ can run seamlessly on many platform
While RetroArch is the reference frontend for libretro, several other projects have used the libretro
interface to include support for emulators and/or game engines. libretro is completely open and free for anyone to use.
[libretro API header](https://github.com/libretro/RetroArch/blob/master/libretro.h)
[libretro API header](https://github.com/libretro/RetroArch/blob/master/libretro-common/include/libretro.h)
## Binaries

View File

@ -2149,9 +2149,7 @@ bool cheevos_load(const void *data)
if (game_id)
goto found;
}
runloop_msg_queue_push("This game doesn't feature achievements",
0, 5 * 60, false);
RARCH_LOG("CHEEVOS this game doesn't feature achievements\n");
return false;

View File

@ -1971,18 +1971,8 @@ bool config_load_override(void)
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;
/* Config directory: config_directory.
* Try config directory setting first,
* fallback to the location of the current configuration file. */
if (!string_is_empty(settings->directory.menu_config))
strlcpy(config_directory,
settings->directory.menu_config,
sizeof(config_directory));
else if (!string_is_empty(global->path.config))
fill_pathname_basedir(config_directory,
global->path.config, sizeof(config_directory));
else
return false;
fill_pathname_application_special(config_directory, sizeof(config_directory),
APPLICATION_SPECIAL_DIRECTORY_CONFIG);
/* Concatenate strings into full paths for core_path, game_path */
fill_pathname_join(game_path,

View File

@ -34,12 +34,17 @@
#endif
#include <file/file_path.h>
#include <string/stdstring.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include "configuration.h"
#include "file_path_special.h"
#include "runloop.h"
#include "verbosity.h"
void fill_pathname_expand_special(char *out_path,
@ -257,3 +262,166 @@ void fill_pathname_application_path(char *s, size_t len)
#endif
}
#endif
#ifdef HAVE_XMB
const char *xmb_theme_ident(void);
#endif
void fill_pathname_application_special(char *s, size_t len, enum application_special_type type)
{
switch (type)
{
case APPLICATION_SPECIAL_DIRECTORY_AUTOCONFIG:
{
settings_t *settings = config_get_ptr();
fill_pathname_join(s,
settings->directory.autoconfig,
settings->input.joypad_driver,
len);
}
break;
case APPLICATION_SPECIAL_DIRECTORY_CONFIG:
{
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
/* Try config directory setting first,
* fallback to the location of the current configuration file. */
if (!string_is_empty(settings->directory.menu_config))
strlcpy(s, settings->directory.menu_config, len);
else if (!string_is_empty(global->path.config))
fill_pathname_basedir(s, global->path.config, len);
}
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_ICONS:
#ifdef HAVE_ZARCH
{
}
#endif
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT:
#ifdef HAVE_ZARCH
{
char s1[PATH_MAX_LENGTH] = {0};
fill_pathname_application_special(s1, sizeof(s1),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH);
fill_pathname_join(s,
s1, "Roboto-Condensed.ttf", len);
}
#endif
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH:
#ifdef HAVE_ZARCH
{
settings_t *settings = config_get_ptr();
fill_pathname_join(s,
settings->directory.assets,
"zarch",
len);
}
#endif
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS:
#ifdef HAVE_XMB
{
char s1[PATH_MAX_LENGTH] = {0};
char s2[PATH_MAX_LENGTH] = {0};
fill_pathname_application_special(s1, sizeof(s1),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB);
fill_pathname_join(s2, s1, "png",
sizeof(s2));
fill_pathname_slash(s2, sizeof(s2));
strlcpy(s, s2, len);
}
#endif
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG:
#ifdef HAVE_XMB
{
settings_t *settings = config_get_ptr();
if (!string_is_empty(settings->path.menu_wallpaper))
strlcpy(s, settings->path.menu_wallpaper, len);
else
{
char s1[PATH_MAX_LENGTH] = {0};
fill_pathname_application_special(s1, sizeof(s1),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
fill_pathname_join(s, s1, "bg.png", len);
}
}
#endif
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB:
#ifdef HAVE_XMB
{
char s1[PATH_MAX_LENGTH] = {0};
char s2[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr();
fill_pathname_join(
s1,
settings->directory.assets,
"xmb",
sizeof(s1));
fill_pathname_join(s2,
s1, xmb_theme_ident(), sizeof(s2));
strlcpy(s, s2, len);
}
#endif
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI:
#ifdef HAVE_MATERIALUI
{
settings_t *settings = config_get_ptr();
fill_pathname_join(
s,
settings->directory.assets,
"glui",
len);
}
#endif
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS:
#ifdef HAVE_MATERIALUI
{
char s1[PATH_MAX_LENGTH] = {0};
fill_pathname_application_special(s1,
sizeof(s1), APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI);
fill_pathname_slash(s1, sizeof(s1));
strlcpy(s, s1, len);
}
#endif
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT:
#ifdef HAVE_MATERIALUI
{
char s1[PATH_MAX_LENGTH] = {0};
fill_pathname_application_special(s1, sizeof(s1),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI);
fill_pathname_join(s, s1, "Roboto-Regular.ttf", len);
}
#endif
break;
case APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT:
#ifdef HAVE_XMB
{
settings_t *settings = config_get_ptr();
if (!string_is_empty(settings->menu.xmb_font))
strlcpy(s, settings->menu.xmb_font, len);
else
{
char s1[PATH_MAX_LENGTH] = {0};
fill_pathname_application_special(s1, sizeof(s1),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB);
fill_pathname_join(s, s1, "font.ttf", len);
}
}
#endif
break;
case APPLICATION_SPECIAL_NONE:
default:
break;
}
}

View File

@ -22,6 +22,25 @@
#include <boolean.h>
enum application_special_type
{
APPLICATION_SPECIAL_NONE = 0,
APPLICATION_SPECIAL_DIRECTORY_AUTOCONFIG,
APPLICATION_SPECIAL_DIRECTORY_CONFIG,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT,
APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_ICONS
};
bool fill_pathname_application_data(char *s, size_t len);
void fill_pathname_application_special(char *s, size_t len, enum application_special_type type);
#endif

View File

@ -278,5 +278,7 @@ frontend_ctx_driver_t frontend_ctx_ctr = {
frontend_ctr_get_architecture,
NULL, /* get_powerstate */
frontend_ctr_parse_drive_list,
NULL, /* get_mem_total */
NULL, /* get_mem_free */
"ctr",
};

View File

@ -665,6 +665,44 @@ static int frontend_darwin_parse_drive_list(void *data)
return ret;
}
static uint64_t frontend_darwin_get_mem_total(void)
{
#if defined(OSX)
uint64_t size;
int mib[2] = { CTL_HW, HW_MEMSIZE };
u_int namelen = sizeof(mib) / sizeof(mib[0]);
size_t len = sizeof(size);
if (sysctl(mib, namelen, &size, &len, NULL, 0) < 0)
return 0;
return size;
#else
return 0;
#endif
}
static uint64_t frontend_darwin_get_mem_used(void)
{
#if defined(OSX) && !defined(OSX_PPC)
vm_size_t page_size;
vm_statistics64_data_t vm_stats;
mach_port_t mach_port = mach_host_self();
mach_msg_type_number_t count = sizeof(vm_stats) / sizeof(natural_t);
if (KERN_SUCCESS == host_page_size(mach_port, &page_size) &&
KERN_SUCCESS == host_statistics64(mach_port, HOST_VM_INFO,
(host_info64_t)&vm_stats, &count))
{
long long used_memory = ((int64_t)vm_stats.active_count +
(int64_t)vm_stats.inactive_count +
(int64_t)vm_stats.wire_count) * (int64_t)page_size;
return used_memory;
}
#endif
return 0;
}
frontend_ctx_driver_t frontend_ctx_darwin = {
frontend_darwin_get_environment_settings,
NULL, /* init */
@ -681,5 +719,7 @@ frontend_ctx_driver_t frontend_ctx_darwin = {
frontend_darwin_get_architecture,
frontend_darwin_get_powerstate,
frontend_darwin_parse_drive_list,
frontend_darwin_get_mem_total,
frontend_darwin_get_mem_used,
"darwin",
};

View File

@ -21,12 +21,17 @@
#include <stdio.h>
#include <string.h>
#include <gccore.h>
#include <ogcsys.h>
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
#include <ogc/mutex.h>
#include <ogc/cond.h>
#include "../../memory/wii/mem2_manager.h"
#endif
#include "../../defines/gx_defines.h"
#include <boolean.h>
#include <file/file_path.h>
@ -481,6 +486,24 @@ static void frontend_gx_shutdown(bool unused)
#endif
}
static uint64_t frontend_gx_get_mem_total(void)
{
uint64_t total = SYSMEM1_SIZE;
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
total += gx_mem2_total();
#endif
return total;
}
static uint64_t frontend_gx_get_mem_used(void)
{
uint64_t total = SYSMEM1_SIZE - SYS_GetArena1Size();
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
total += gx_mem2_used();
#endif
return total;
}
frontend_ctx_driver_t frontend_ctx_gx = {
frontend_gx_get_environment_settings,
frontend_gx_init,
@ -501,5 +524,7 @@ frontend_ctx_driver_t frontend_ctx_gx = {
frontend_gx_get_architecture,
NULL, /* get_powerstate */
frontend_gx_parse_drive_list,
frontend_gx_get_mem_total,
frontend_gx_get_mem_used,
"gx",
};

View File

@ -1173,7 +1173,7 @@ static void frontend_linux_get_os(char *s,
static void frontend_linux_get_env(int *argc,
char *argv[], void *data, void *params_data)
{
RARCH_LOG("Configuring platform driver ...\n");
char base_path[PATH_MAX] = {0};
#ifdef ANDROID
int32_t major, minor, rel;
char device_model[PROP_VALUE_MAX] = {0};
@ -1632,7 +1632,6 @@ static void frontend_linux_get_env(int *argc,
snprintf(g_defaults.settings.menu, sizeof(g_defaults.settings.menu), "xmb");
#else
char base_path[PATH_MAX] = {0};
const char *xdg = getenv("XDG_CONFIG_HOME");
const char *home = getenv("HOME");
@ -1881,6 +1880,20 @@ static void frontend_linux_exitspawn(char *core_path, size_t core_path_size)
}
#endif
static uint64_t frontend_linux_get_mem_total(void)
{
long pages = sysconf(_SC_PHYS_PAGES);
long page_size = sysconf(_SC_PAGE_SIZE);
return pages * page_size;
}
static uint64_t frontend_linux_get_mem_used(void)
{
long pages = sysconf(_SC_AVPHYS_PAGES);
long page_size = sysconf(_SC_PAGE_SIZE);
return pages * page_size;
}
frontend_ctx_driver_t frontend_ctx_linux = {
frontend_linux_get_env, /* environment_get */
frontend_linux_init, /* init */
@ -1912,9 +1925,14 @@ frontend_ctx_driver_t frontend_ctx_linux = {
frontend_linux_get_powerstate,
#ifdef ANDROID
frontend_android_parse_drive_list, /* parse_drive_list */
"android",
#else
NULL, /* parse_drive_list */
"linux",
#endif
frontend_linux_get_mem_total,
frontend_linux_get_mem_used,
#ifdef ANDROID
"android"
#else
"linux"
#endif
};

View File

@ -35,5 +35,7 @@ frontend_ctx_driver_t frontend_ctx_null = {
NULL, /* get_architecture */
NULL, /* get_powerstate */
NULL, /* parse_drive_list */
NULL, /* get_mem_total */
NULL, /* get_mem_free */
"null",
};

View File

@ -539,5 +539,7 @@ frontend_ctx_driver_t frontend_ctx_ps3 = {
frontend_ps3_get_architecture,
NULL, /* get_powerstate */
frontend_ps3_parse_drive_list,
NULL, /* get_mem_total */
NULL, /* get_mem_free */
"ps3",
};

View File

@ -404,6 +404,8 @@ frontend_ctx_driver_t frontend_ctx_psp = {
frontend_psp_get_architecture,
frontend_psp_get_powerstate,
frontend_psp_parse_drive_list,
NULL, /* get_mem_total */
NULL, /* get_mem_free */
#ifdef VITA
"vita",
#else

View File

@ -84,5 +84,7 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
frontend_qnx_get_architecture,
NULL, /* get_powerstate */
NULL, /* parse_drive_list */
NULL, /* get_mem_total */
NULL, /* get_mem_free */
"qnx",
};

View File

@ -297,7 +297,22 @@ static void frontend_win32_environment_get(int *argc, char *argv[],
snprintf(g_defaults.settings.menu, sizeof(g_defaults.settings.menu), "xmb");
#endif
#endif
}
static uint64_t frontend_win32_get_mem_total(void)
{
MEMORYSTATUSEX mem_info;
mem_info.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&mem_info);
return mem_info.ullTotalPhys;
}
static uint64_t frontend_win32_get_mem_used(void)
{
MEMORYSTATUSEX mem_info;
mem_info.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&mem_info);
return ((frontend_win32_get_mem_total() - mem_info.ullAvailPhys));
}
frontend_ctx_driver_t frontend_ctx_win32 = {
@ -316,5 +331,7 @@ frontend_ctx_driver_t frontend_ctx_win32 = {
frontend_win32_get_architecture,
frontend_win32_get_powerstate,
frontend_win32_parse_drive_list,
"win32",
frontend_win32_get_mem_total,
frontend_win32_get_mem_used,
"win32"
};

View File

@ -1406,5 +1406,7 @@ frontend_ctx_driver_t frontend_ctx_xdk = {
frontend_xdk_get_architecture,
NULL, /* get_powerstate */
frontend_xdk_parse_drive_list,
NULL, /* get_mem_total */
NULL, /* get_mem_free */
"xdk",
};

View File

@ -84,5 +84,6 @@ frontend_ctx_driver_t frontend_ctx_qnx = {
frontend_xenon_get_architecture,
NULL, /* get_powerstate */
NULL, /* parse_drive_list */
NULL, /* get_mem_total */
"xenon",
};

View File

@ -308,4 +308,20 @@ enum frontend_architecture frontend_driver_get_cpu_architecture(void)
return FRONTEND_ARCH_NONE;
return frontend->get_architecture();
}
uint64_t frontend_driver_get_total_memory(void)
{
frontend_ctx_driver_t *frontend = frontend_get_ptr();
if (!frontend || !frontend->get_total_mem)
return 0;
return frontend->get_total_mem();
}
uint64_t frontend_driver_get_used_memory(void)
{
frontend_ctx_driver_t *frontend = frontend_get_ptr();
if (!frontend || !frontend->get_used_mem)
return 0;
return frontend->get_used_mem();
}
#endif

View File

@ -17,6 +17,7 @@
#ifndef __FRONTEND_DRIVER_H
#define __FRONTEND_DRIVER_H
#include <stdint.h>
#include <stddef.h>
#include <boolean.h>
@ -79,6 +80,8 @@ typedef struct frontend_ctx_driver
enum frontend_architecture (*get_architecture)(void);
enum frontend_powerstate (*get_powerstate)(int *seconds, int *percent);
int (*parse_drive_list)(void*);
uint64_t (*get_total_mem)(void);
uint64_t (*get_used_mem)(void);
const char *ident;
@ -152,6 +155,10 @@ bool frontend_driver_get_core_extension(char *s, size_t len);
bool frontend_driver_get_salamander_basename(char *s, size_t len);
uint64_t frontend_driver_get_total_memory(void);
uint64_t frontend_driver_get_used_memory(void);
RETRO_END_DECLS
#endif

View File

@ -82,6 +82,9 @@ typedef struct vulkan_context_fp
PFN_vkCreateInstance vkCreateInstance;
PFN_vkDestroyInstance vkDestroyInstance;
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties;
PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties;
/* Device */
PFN_vkCreateDevice vkCreateDevice;
PFN_vkDestroyDevice vkDestroyDevice;

View File

@ -1045,6 +1045,7 @@ void vulkan_buffer_chain_free(
static bool vulkan_load_instance_symbols(gfx_ctx_vulkan_data_t *vk)
{
VK_GET_INSTANCE_PROC_ADDR(EnumerateDeviceExtensionProperties);
VK_GET_INSTANCE_PROC_ADDR(GetDeviceProcAddr);
VK_GET_INSTANCE_PROC_ADDR(DestroyInstance);
VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceFormatProperties);
@ -1207,6 +1208,98 @@ static bool vulkan_load_device_symbols(gfx_ctx_vulkan_data_t *vk)
return true;
}
static bool vulkan_find_extensions(const char **exts, unsigned num_exts,
const VkExtensionProperties *properties, unsigned property_count)
{
unsigned i, ext;
bool found;
for (ext = 0; ext < num_exts; ext++)
{
found = false;
for (i = 0; i < property_count; i++)
{
if (!strcmp(exts[ext], properties[i].extensionName))
{
found = true;
break;
}
}
if (!found)
return false;
}
return true;
}
static bool vulkan_find_instance_extensions(const char **exts, unsigned num_exts)
{
bool ret = true;
VkExtensionProperties *properties = NULL;
uint32_t property_count;
if (VKFUNC(vkEnumerateInstanceExtensionProperties(NULL, &property_count, NULL)) != VK_SUCCESS)
return false;
properties = (VkExtensionProperties*)malloc(property_count * sizeof(*properties));
if (!properties)
{
ret = false;
goto end;
}
if (VKFUNC(vkEnumerateInstanceExtensionProperties(NULL, &property_count, properties)) != VK_SUCCESS)
{
ret = false;
goto end;
}
if (!vulkan_find_extensions(exts, num_exts, properties, property_count))
{
RARCH_ERR("[Vulkan]: Could not find instance extensions. Will attempt without them.\n");
ret = false;
goto end;
}
end:
free(properties);
return ret;
}
static bool vulkan_find_device_extensions(VkPhysicalDevice gpu, const char **exts, unsigned num_exts)
{
bool ret = true;
VkExtensionProperties *properties = NULL;
uint32_t property_count;
if (VKFUNC(vkEnumerateDeviceExtensionProperties(gpu, NULL, &property_count, NULL)) != VK_SUCCESS)
return false;
properties = (VkExtensionProperties*)malloc(property_count * sizeof(*properties));
if (!properties)
{
ret = false;
goto end;
}
if (VKFUNC(vkEnumerateDeviceExtensionProperties(gpu, NULL, &property_count, properties)) != VK_SUCCESS)
{
ret = false;
goto end;
}
if (!vulkan_find_extensions(exts, num_exts, properties, property_count))
{
RARCH_ERR("[Vulkan]: Could not find device extensions. Will attempt without them.\n");
ret = false;
goto end;
}
end:
free(properties);
return ret;
}
bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
enum vulkan_wsi_type type)
{
@ -1227,6 +1320,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
"VK_KHR_swapchain",
};
static const char *instance_extensions[2];
bool use_instance_ext, use_device_ext;
instance_extensions[0] = "VK_KHR_surface";
@ -1271,6 +1365,9 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
RARCH_LOG("Vulkan dynamic library loaded.\n");
VKSYM(vk, GetInstanceProcAddr);
VK_GET_INSTANCE_PROC_ADDR(EnumerateInstanceExtensionProperties);
use_instance_ext = vulkan_find_instance_extensions(instance_extensions, ARRAY_SIZE(instance_extensions));
app.pApplicationName = "RetroArch";
app.applicationVersion = 0;
@ -1279,8 +1376,8 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
app.apiVersion = VK_MAKE_VERSION(1, 0, 6);
info.pApplicationInfo = &app;
info.enabledExtensionCount = ARRAY_SIZE(instance_extensions);
info.ppEnabledExtensionNames = instance_extensions;
info.enabledExtensionCount = use_instance_ext ? ARRAY_SIZE(instance_extensions) : 0;
info.ppEnabledExtensionNames = use_instance_ext ? instance_extensions : NULL;
if (cached_instance)
{
@ -1382,14 +1479,16 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
return false;
}
use_device_ext = vulkan_find_device_extensions(vk->context.gpu, device_extensions, ARRAY_SIZE(device_extensions));
queue_info.queueFamilyIndex = vk->context.graphics_queue_index;
queue_info.queueCount = 1;
queue_info.pQueuePriorities = &one;
device_info.queueCreateInfoCount = 1;
device_info.pQueueCreateInfos = &queue_info;
device_info.enabledExtensionCount = ARRAY_SIZE(device_extensions);
device_info.ppEnabledExtensionNames = device_extensions;
device_info.enabledExtensionCount = use_device_ext ? ARRAY_SIZE(device_extensions) : 0;
device_info.ppEnabledExtensionNames = use_device_ext ? device_extensions : NULL;
device_info.pEnabledFeatures = &features;
if (cached_device)
@ -1756,6 +1855,12 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
vk->context.gpu, vk->vk_surface,
&present_mode_count, present_modes);
for (i = 0; i < present_mode_count; i++)
{
RARCH_LOG("[Vulkan]: Swapchain supports present mode: %u.\n",
present_modes[i]);
}
for (i = 0; i < present_mode_count; i++)
{
if (!swap_interval && present_modes[i] == VK_PRESENT_MODE_MAILBOX_KHR)

View File

@ -167,16 +167,6 @@ static void *android_gfx_ctx_init(void *video_driver)
if (!egl_create_surface(&and->egl, android_app->window))
goto unlock_error;
#endif
break;
case GFX_CTX_VULKAN_API:
#ifdef HAVE_VULKAN
and->width = ANativeWindow_getWidth(android_app->window);
and->height = ANativeWindow_getHeight(android_app->window);
if (!vulkan_surface_create(&and->vk, VULKAN_WSI_ANDROID,
NULL, android_app->window,
and->width, and->height, and->swap_interval))
goto error;
#endif
break;
case GFX_CTX_NONE:
@ -243,6 +233,8 @@ static void android_gfx_ctx_check_window(void *data, bool *quit,
/* Swapchains are recreated in set_resize as a
* central place, so use that to trigger swapchain reinit. */
*resize = and->vk.need_new_swapchain;
new_width = and->width;
new_height = and->height;
#endif
break;
case GFX_CTX_NONE:
@ -252,6 +244,9 @@ static void android_gfx_ctx_check_window(void *data, bool *quit,
if (new_width != *width || new_height != *height)
{
RARCH_LOG("[Android]: Resizing (%u x %u) -> (%u x %u).\n",
*width, *height, new_width, new_height);
*width = new_width;
*height = new_height;
*resize = true;
@ -265,10 +260,37 @@ static void android_gfx_ctx_check_window(void *data, bool *quit,
static bool android_gfx_ctx_set_resize(void *data,
unsigned width, unsigned height)
{
#ifdef HAVE_VULKAN
android_ctx_data_t *and = (android_ctx_data_t*)data;
struct android_app *android_app = (struct android_app*)g_android;
#endif
(void)data;
(void)width;
(void)height;
switch (android_api)
{
case GFX_CTX_VULKAN_API:
#ifdef HAVE_VULKAN
and->width = ANativeWindow_getWidth(android_app->window);
and->height = ANativeWindow_getHeight(android_app->window);
RARCH_LOG("[Android]: Native window size: %u x %u.\n", and->width, and->height);
if (!vulkan_create_swapchain(&and->vk, and->width, and->height, and->swap_interval))
{
RARCH_ERR("[Android]: Failed to update swapchain.\n");
return false;
}
and->vk.context.invalid_swapchain = true;
and->vk.need_new_swapchain = false;
#endif
break;
case GFX_CTX_NONE:
default:
break;
}
return false;
}
@ -289,7 +311,8 @@ static bool android_gfx_ctx_set_video_mode(void *data,
bool fullscreen)
{
#ifdef HAVE_VULKAN
android_ctx_data_t *and = (android_ctx_data_t*)data;
struct android_app *android_app = (struct android_app*)g_android;
android_ctx_data_t *and = (android_ctx_data_t*)data;
#endif
(void)width;
@ -300,10 +323,18 @@ static bool android_gfx_ctx_set_video_mode(void *data,
{
case GFX_CTX_VULKAN_API:
#ifdef HAVE_VULKAN
and->width = width;
and->height = height;
and->width = ANativeWindow_getWidth(android_app->window);
and->height = ANativeWindow_getHeight(android_app->window);
RARCH_LOG("[Android]: Native window size: %u x %u.\n", and->width, and->height);
if (!vulkan_surface_create(&and->vk, VULKAN_WSI_ANDROID, NULL, android_app->window,
and->width, and->height, and->swap_interval))
{
RARCH_ERR("[Android]: Failed to create surface.\n");
return false;
}
#endif
break;
case GFX_CTX_NONE:
default:
break;
@ -479,6 +510,7 @@ static void android_gfx_ctx_set_swap_interval(void *data, unsigned swap_interval
#ifdef HAVE_VULKAN
if (and->swap_interval != swap_interval)
{
RARCH_LOG("[Vulkan]: Setting swap interval: %u.\n", swap_interval);
and->swap_interval = swap_interval;
if (and->vk.swapchain)
and->vk.need_new_swapchain = true;

View File

@ -26,6 +26,7 @@
#include "input_autodetect.h"
#include "../configuration.h"
#include "../file_path_special.h"
#include "../list_special.h"
#include "../runloop.h"
#include "../verbosity.h"
@ -213,19 +214,15 @@ static bool input_autoconfigure_joypad_from_conf_dir(
int current_best = 0;
config_file_t *conf = NULL;
struct string_list *list = NULL;
settings_t *settings = config_get_ptr();
if (!settings)
return false;
fill_pathname_application_special(path, sizeof(path),
APPLICATION_SPECIAL_DIRECTORY_AUTOCONFIG);
fill_pathname_join(path,
settings->directory.autoconfig,
settings->input.joypad_driver,
sizeof(path));
list = dir_list_new_special(path, DIR_LIST_AUTOCONFIG, "cfg");
if (!list || !list->size)
{
settings_t *settings = config_get_ptr();
if (list)
string_list_free(list);
list = dir_list_new_special(settings->directory.autoconfig,

82
intl/french.h Normal file
View File

@ -0,0 +1,82 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __INTL_FRENCH_H
#define __INTL_FRENCH_H
#define RETRO_LBL_JOYPAD_B "Bouton RetroPad B"
#define RETRO_LBL_JOYPAD_Y "Bouton RetroPad Y"
#define RETRO_LBL_JOYPAD_SELECT "Bouton RetroPad Select"
#define RETRO_LBL_JOYPAD_START "Bouton RetroPad Start"
#define RETRO_LBL_JOYPAD_UP "RetroPad D-Pad Up"
#define RETRO_LBL_JOYPAD_DOWN "Croix directionnelle RetroPad Haut"
#define RETRO_LBL_JOYPAD_LEFT "Croix directionnelle RetroPad Gauche"
#define RETRO_LBL_JOYPAD_RIGHT "Croix directionnelle RetroPad Droite"
#define RETRO_LBL_JOYPAD_A "Bouton RetroPad A"
#define RETRO_LBL_JOYPAD_X "Bouton RetroPad X"
#define RETRO_LBL_JOYPAD_L "Bouton RetroPad L"
#define RETRO_LBL_JOYPAD_R "Bouton RetroPad R"
#define RETRO_LBL_JOYPAD_L2 "Bouton RetroPad L2"
#define RETRO_LBL_JOYPAD_R2 "Bouton RetroPad R2"
#define RETRO_LBL_JOYPAD_L3 "Bouton RetroPad L3"
#define RETRO_LBL_JOYPAD_R3 "Bouton RetroPad R3"
#define RETRO_LBL_TURBO_ENABLE "Turbo Activé"
#define RETRO_LBL_ANALOG_LEFT_X "Analogue Gauche X"
#define RETRO_LBL_ANALOG_LEFT_Y "Analogue Gauche Y"
#define RETRO_LBL_ANALOG_RIGHT_X "Analogue Droite X"
#define RETRO_LBL_ANALOG_RIGHT_Y "Analogue Droite Y"
#define RETRO_LBL_ANALOG_LEFT_X_PLUS "Analogue Gauche X +"
#define RETRO_LBL_ANALOG_LEFT_X_MINUS "Analogue Gauche X -"
#define RETRO_LBL_ANALOG_LEFT_Y_PLUS "Analogue Gauche Y +"
#define RETRO_LBL_ANALOG_LEFT_Y_MINUS "Analogue Gauche Y -"
#define RETRO_LBL_ANALOG_RIGHT_X_PLUS "Analogue Droite X +"
#define RETRO_LBL_ANALOG_RIGHT_X_MINUS "Analogue Droite X -"
#define RETRO_LBL_ANALOG_RIGHT_Y_PLUS "Analogue Droite Y +"
#define RETRO_LBL_ANALOG_RIGHT_Y_MINUS "Analogue Droite Y -"
#define RETRO_LBL_FAST_FORWARD_KEY "Avance Rapide"
#define RETRO_LBL_FAST_FORWARD_HOLD_KEY "Avance Rapide Appui Maintenu"
#define RETRO_LBL_LOAD_STATE_KEY "Charger une savestate"
#define RETRO_LBL_SAVE_STATE_KEY "Sauvegarder une savestate"
#define RETRO_LBL_FULLSCREEN_TOGGLE_KEY "Mode plein écran"
#define RETRO_LBL_QUIT_KEY "Quitter"
#define RETRO_LBL_STATE_SLOT_PLUS "État Slot Suivant"
#define RETRO_LBL_STATE_SLOT_MINUS "État Slot Antérieur"
#define RETRO_LBL_REWIND "Rembobinage"
#define RETRO_LBL_MOVIE_RECORD_TOGGLE "Commutateur enregistrement vidéo"
#define RETRO_LBL_PAUSE_TOGGLE "Pause"
#define RETRO_LBL_FRAMEADVANCE "Défiler image"
#define RETRO_LBL_RESET "Reset"
#define RETRO_LBL_SHADER_NEXT "Prochain Shader"
#define RETRO_LBL_SHADER_PREV "Précédent Shader"
#define RETRO_LBL_CHEAT_INDEX_PLUS "Index Cheat Suivant"
#define RETRO_LBL_CHEAT_INDEX_MINUS "Index Cheat Antérieur"
#define RETRO_LBL_CHEAT_TOGGLE "Commutateur Mode Triche"
#define RETRO_LBL_SCREENSHOT "Capture d'écran"
#define RETRO_LBL_MUTE "Couper le son"
#define RETRO_LBL_OSK "Active le clavier visuel"
#define RETRO_LBL_NETPLAY_FLIP "Inversement des joueurs Netplay"
#define RETRO_LBL_SLOWMOTION "Ralenti"
#define RETRO_LBL_ENABLE_HOTKEY "Active raccourci clavier"
#define RETRO_LBL_VOLUME_UP "Augmenter le volume"
#define RETRO_LBL_VOLUME_DOWN "Diminuer le volume"
#define RETRO_LBL_OVERLAY_NEXT "Prochain Overlay"
#define RETRO_LBL_DISK_EJECT_TOGGLE "Commutateur éjecter le disque"
#define RETRO_LBL_DISK_NEXT "Prochain Changement Disque"
#define RETRO_LBL_DISK_PREV "Précédent Changement Disque"
#define RETRO_LBL_GRAB_MOUSE_TOGGLE "Commutateur capturer la souris"
#define RETRO_LBL_MENU_TOGGLE "Commutateur Menu"
#endif

View File

@ -15,9 +15,9 @@
#include "../msg_hash.h"
const char *msg_hash_to_str_de(uint32_t hash)
const char *msg_hash_to_str_de(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case 0:
default:

View File

@ -15,9 +15,9 @@
#include "../msg_hash.h"
const char *msg_hash_to_str_eo(uint32_t hash)
const char *msg_hash_to_str_eo(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case 0:
default:

View File

@ -28,9 +28,9 @@
/* DO NOT REMOVE THIS. If it causes build failure, it's because you saved the file as UTF-8. Read the above comment. */
extern const char force_iso_8859_1[sizeof("äÄöÖßüÜ")==7+1 ? 1 : -1];
const char *msg_hash_to_str_es(uint32_t hash)
const char *msg_hash_to_str_es(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case MSG_PROGRAM:
return "RetroArch";

View File

@ -15,11 +15,197 @@
#include "../msg_hash.h"
const char *msg_hash_to_str_fr(uint32_t hash)
#ifdef __clang__
#pragma clang diagnostic ignored "-Winvalid-source-encoding"
#endif
/* IMPORTANT:
* For non-english characters to work without proper unicode support,
* we need this file to be encoded in ISO 8859-1 (Latin1), not UTF-8.
* If you save this file as UTF-8, you'll break non-english characters
* (e.g. German "Umlauts" and Portugese diacritics).
*/
/* DO NOT REMOVE THIS. If it causes build failure, it's because you saved the file as UTF-8. Read the above comment. */
extern const char force_iso_8859_1[sizeof("äÄöÖßüÜ")==7+1 ? 1 : -1];
const char *msg_hash_to_str_fr(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case 0:
case MSG_PROGRAM:
return "RetroArch";
case MSG_MOVIE_RECORD_STOPPED:
return "Arrêt de l'enregistrement vidéo.";
case MSG_MOVIE_PLAYBACK_ENDED:
return "Fin de la lecture vidéo";
case MSG_AUTOSAVE_FAILED:
return "Impossible d'activer l'enregistrement automatique.";
case MSG_NETPLAY_FAILED_MOVIE_PLAYBACK_HAS_STARTED:
return "Lecture en cours. Impossible d'activer le jeu en réseau.";
case MSG_NETPLAY_FAILED:
return "Échec de l'initialisation du jeu en réseau";
case MSG_LIBRETRO_ABI_BREAK:
return "est compilé avec une version différente de la bibliothèque libretro actuelle.";
case MSG_REWIND_INIT_FAILED_NO_SAVESTATES:
return "L'implémentation ne supporte pas la sauvegarde d'état. Impossible d'activer le retour rapide.";
case MSG_REWIND_INIT_FAILED_THREADED_AUDIO:
return "L'implémentation utilise audio thread. Impossible d'activer le retour rapide.";
case MSG_REWIND_INIT_FAILED:
return "Échec de l'initialisation du tampon pour le retour rapide. Cette fonctionnalité sera désactivée.";
case MSG_REWIND_INIT:
return "Initialisation du tampon pour le retour rapide avec une taille";
case MSG_CUSTOM_TIMING_GIVEN:
return "Temps personnalisé attribué";
case MSG_VIEWPORT_SIZE_CALCULATION_FAILED:
return "Échec du calcul de la taille du visuel ! Utilisation des données brutes. Cela ne fonctionnera probablement pas bien ...";
case MSG_HW_RENDERED_MUST_USE_POSTSHADED_RECORDING:
return "Le core Libretro utilise le rendu matériel. Obligation d'utiliser également l'enregistrement post-shaded.";
case MSG_RECORDING_TO:
return "Enregistrement vers";
case MSG_DETECTED_VIEWPORT_OF:
return "Détection du visuel";
case MSG_TAKING_SCREENSHOT:
return "Réalisation d'une copie d'écran.";
case MSG_FAILED_TO_TAKE_SCREENSHOT:
return "Échec de la copie d'écran.";
case MSG_FAILED_TO_START_RECORDING:
return "Échec de l'activation de l'enregistrement.";
case MSG_RECORDING_TERMINATED_DUE_TO_RESIZE:
return "Enregistrement interrompu à cause du redimensionnement.";
case MSG_USING_LIBRETRO_DUMMY_CORE_RECORDING_SKIPPED:
return "Utilisation d'un core libretro simple. Ignore l'enregistrement.";
case MSG_UNKNOWN:
return "Inconnu";
case MSG_LOADING_CONTENT_FILE:
return "Chargement du contenu";
case MSG_RECEIVED:
return "Reçu";
case MSG_UNRECOGNIZED_COMMAND:
return "Commande non reconnue";
case MSG_SENDING_COMMAND:
return "Envoi commande";
case MSG_GOT_INVALID_DISK_INDEX:
return "Index du disque invalide.";
case MSG_FAILED_TO_REMOVE_DISK_FROM_TRAY:
return "Impossible d'éjecter le disque du lecteur.";
case MSG_REMOVED_DISK_FROM_TRAY:
return "Éjection du disque du lecteur.";
case MSG_VIRTUAL_DISK_TRAY:
return "Lecteur de disque virtuel.";
case MSG_FAILED_TO:
return "Échec de";
case MSG_TO:
return "de";
case MSG_SAVING_RAM_TYPE:
return "Sauvegarde du type de RAM";
case MSG_SAVING_STATE:
return "Sauvegarde savestate";
case MSG_LOADING_STATE:
return "Chargement savestate";
case MSG_FAILED_TO_LOAD_MOVIE_FILE:
return "Échec du chargement du fichier vidéo";
case MSG_FAILED_TO_LOAD_CONTENT:
return "Échec du chargement du fichier";
case MSG_COULD_NOT_READ_CONTENT_FILE:
return "Impossible de lire le contenu du fichier";
case MSG_GRAB_MOUSE_STATE:
return "Capture la souris";
case MSG_PAUSED:
return "Pause.";
case MSG_UNPAUSED:
return "Relancé.";
case MSG_FAILED_TO_LOAD_OVERLAY:
return "Impossible de charger l'overlay.";
case MSG_FAILED_TO_UNMUTE_AUDIO:
return "Impossible de remettre le son.";
case MSG_AUDIO_MUTED:
return "Son coupé.";
case MSG_AUDIO_UNMUTED:
return "Remise du son.";
case MSG_RESET:
return "Reset";
case MSG_FAILED_TO_LOAD_STATE:
return "Impossible de charger la savestate à partir de";
case MSG_FAILED_TO_SAVE_STATE_TO:
return "Impossible de sauvegarder la savestate vers";
case MSG_FAILED_TO_UNDO_LOAD_STATE:
return "Aucun savestate de retour arrière trouvé";
case MSG_FAILED_TO_UNDO_SAVE_STATE:
return "Impossible de sauvegarder les informations de savestate de retour arrière";
case MSG_FAILED_TO_SAVE_SRAM:
return "Impossible de sauvegarder la SRAM";
case MSG_STATE_SIZE:
return "Taille savestate";
case MSG_FOUND_SHADER:
return "Shader trouvé";
case MSG_SRAM_WILL_NOT_BE_SAVED:
return "SRAM ne sera pas sauvegardée.";
case MSG_BLOCKING_SRAM_OVERWRITE:
return "Bloque l'écrasement de la SRAM";
case MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES:
return "Le core ne supporte pas les savestates.";
case MSG_SAVED_STATE_TO_SLOT:
return "Savestate vers slot";
case MSG_SAVED_SUCCESSFULLY_TO:
return "Sauvegarde réussie vers";
case MSG_BYTES:
return "octets";
case MSG_CONFIG_DIRECTORY_NOT_SET:
return "Répertoire de configuration non défini. Impossible de sauvegarder le nouveau fichier.";
case MSG_SKIPPING_SRAM_LOAD:
return "Ignore le chargement de la SRAM.";
case MSG_APPENDED_DISK:
return "Disque fusionné";
case MSG_STARTING_MOVIE_PLAYBACK:
return "Démarrage de la lecture vidéo.";
case MSG_FAILED_TO_REMOVE_TEMPORARY_FILE:
return "Impossible de supprimer le fichier temporaire";
case MSG_REMOVING_TEMPORARY_CONTENT_FILE:
return "Suppression du fichier temporaire";
case MSG_LOADED_STATE_FROM_SLOT:
return "Chargement du savestate à partir du slot";
case MSG_COULD_NOT_PROCESS_ZIP_FILE:
return "Impossible de traiter le fichier ZIP.";
case MSG_SCANNING_OF_DIRECTORY_FINISHED:
return "Analyse des dossiers terminée";
case MSG_SCANNING:
return "Analyse";
case MSG_REDIRECTING_CHEATFILE_TO:
return "Redirection du fichier triche vers";
case MSG_REDIRECTING_SAVEFILE_TO:
return "Redirection de la sauvegarde vers";
case MSG_REDIRECTING_SAVESTATE_TO:
return "Redirection de la savestate vers";
case MSG_SHADER:
return "Shader";
case MSG_APPLYING_SHADER:
return "Application du shader";
case MSG_FAILED_TO_APPLY_SHADER:
return "Impossible d'appliquer le shader.";
case MSG_STARTING_MOVIE_RECORD_TO:
return "Démarrage de l'enregistrement vidéo vers";
case MSG_FAILED_TO_START_MOVIE_RECORD:
return "Impossible de démarrer l'enregistrement vidéo.";
case MSG_STATE_SLOT:
return "State slot";
case MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT:
return "Redémarrage de l'enregistrement à cause de la réinitialisation du pilote.";
case MSG_SLOW_MOTION:
return "Ralenti.";
case MSG_SLOW_MOTION_REWIND:
return "Rembobinage ralenti.";
case MSG_REWINDING:
return "Rembobinage.";
case MSG_REWIND_REACHED_END:
return "Atteinte de la fin du tampon de rembobinage.";
case MSG_CHEEVOS_HARDCORE_MODE_ENABLE:
return "Mode matériel activé : savestate et rembobinage sont désactivés.";
case MSG_TASK_FAILED:
return "Échec";
case MSG_DOWNLOADING:
return "Téléchargement";
case MSG_EXTRACTING:
return "Extraction";
default:
break;
}

View File

@ -15,9 +15,9 @@
#include "../msg_hash.h"
const char *msg_hash_to_str_it(uint32_t hash)
const char *msg_hash_to_str_it(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case 0:
default:

View File

@ -15,9 +15,9 @@
#include "../msg_hash.h"
const char *msg_hash_to_str_nl(uint32_t hash)
const char *msg_hash_to_str_nl(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case 0:
default:

View File

@ -15,9 +15,9 @@
#include "../msg_hash.h"
const char *msg_hash_to_str_pl(uint32_t hash)
const char *msg_hash_to_str_pl(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case MSG_PROGRAM:
return "RetroArch";

View File

@ -15,9 +15,9 @@
#include "../msg_hash.h"
const char *msg_hash_to_str_pt(uint32_t hash)
const char *msg_hash_to_str_pt(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case MSG_UNKNOWN:
return "Desconhecido";

View File

@ -16,9 +16,9 @@
#include "../msg_hash.h"
const char *msg_hash_to_str_ru(uint32_t hash)
const char *msg_hash_to_str_ru(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case MSG_PROGRAM:
return "RetroArch";

View File

@ -15,9 +15,9 @@
#include "../msg_hash.h"
const char *msg_hash_to_str_us(uint32_t hash)
const char *msg_hash_to_str_us(enum msg_hash_enums msg)
{
switch (hash)
switch (msg)
{
case MSG_PROGRAM:
return "RetroArch";

View File

@ -55,7 +55,7 @@ static INLINE unsigned compat_clz_u16(uint16_t val)
}
/* Count Trailing Zero */
#if defined(__GNUC__)
#if defined(__GNUC__) && !defined(RARCH_CONSOLE)
static INLINE int compat_ctz(unsigned x)
{
return __builtin_ctz(x);

2782
menu-refactor.diff Normal file

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,8 @@
#include "../../verbosity.h"
#include "../../tasks/tasks_internal.h"
#include "../../file_path_special.h"
enum
{
MUI_TEXTURE_POINTER = 0,
@ -142,10 +144,13 @@ static const char *mui_texture_path(unsigned id)
return NULL;
}
static void mui_context_reset_textures(mui_handle_t *mui,
const char *iconpath)
static void mui_context_reset_textures(mui_handle_t *mui)
{
unsigned i;
char iconpath[PATH_MAX_LENGTH] = {0};
fill_pathname_application_special(iconpath, sizeof(iconpath),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS);
for (i = 0; i < MUI_TEXTURE_LAST; i++)
{
@ -997,26 +1002,6 @@ static void mui_frame(void *data)
menu_display_unset_viewport();
}
static void mui_font(void)
{
menu_display_ctx_font_t font_info;
char mediapath[PATH_MAX_LENGTH] = {0};
char fontpath[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr();
int font_size = menu_display_get_font_size();
fill_pathname_join(mediapath, settings->directory.assets,
"glui", sizeof(mediapath));
fill_pathname_join(fontpath, mediapath,
"Roboto-Regular.ttf", sizeof(fontpath));
font_info.path = fontpath;
font_info.size = font_size;
if (!menu_display_font_main_init(&font_info))
RARCH_WARN("Failed to load font.");
}
static void mui_layout(mui_handle_t *mui)
{
void *fb_buf;
@ -1050,7 +1035,7 @@ static void mui_layout(mui_handle_t *mui)
/* we assume the average glyph aspect ratio is close to 3:4 */
mui->glyph_width = new_font_size * 3/4;
mui_font();
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT);
fb_buf = menu_display_get_font_buffer();
@ -1232,24 +1217,17 @@ static void mui_populate_entries(
static void mui_context_reset(void *data)
{
char iconpath[PATH_MAX_LENGTH] = {0};
mui_handle_t *mui = (mui_handle_t*)data;
settings_t *settings = config_get_ptr();
if (!mui || !settings)
return;
fill_pathname_join(
iconpath,
settings->directory.assets,
"glui",
sizeof(iconpath));
fill_pathname_slash(iconpath, sizeof(iconpath));
mui_layout(mui);
mui_context_bg_destroy(mui);
menu_display_allocate_white_texture();
mui_context_reset_textures(mui, iconpath);
mui_context_reset_textures(mui);
task_push_image_load(settings->path.menu_wallpaper, "cb_menu_wallpaper",
menu_display_handle_wallpaper_upload, NULL);

View File

@ -45,6 +45,7 @@
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../system.h"
#include "../../file_path_special.h"
#include "../../tasks/tasks_internal.h"
@ -193,7 +194,6 @@ typedef struct xmb_handle
float vertical;
} spacing;
char dir[4];
int size;
} icon;
@ -310,7 +310,7 @@ float gradient_dark[16] = {
0.0, 0.0, 0.0, 1.00,
};
static const char *xmb_theme_ident(void)
const char *xmb_theme_ident(void)
{
settings_t *settings = config_get_ptr();
switch (settings->menu.xmb_theme)
@ -383,28 +383,6 @@ static float *xmb_gradient_ident(void)
}
#endif
static void xmb_fill_default_background_path(xmb_handle_t *xmb,
char *path, size_t size)
{
char mediapath[PATH_MAX_LENGTH] = {0};
char themepath[PATH_MAX_LENGTH] = {0};
char iconpath[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr();
strlcpy(xmb->icon.dir, "png", sizeof(xmb->icon.dir));
fill_pathname_join(mediapath, settings->directory.assets,
"xmb", sizeof(mediapath));
fill_pathname_join(themepath, mediapath, xmb_theme_ident(), sizeof(themepath));
fill_pathname_join(iconpath, themepath, xmb->icon.dir, sizeof(iconpath));
fill_pathname_slash(iconpath, sizeof(iconpath));
fill_pathname_join(path, iconpath, "bg.png", size);
if (*settings->path.menu_wallpaper)
strlcpy(path, settings->path.menu_wallpaper, size);
}
static size_t xmb_list_get_selection(void *data)
{
xmb_handle_t *xmb = (xmb_handle_t*)data;
@ -1067,7 +1045,8 @@ static void xmb_list_switch_new(xmb_handle_t *xmb,
strlcat(path, ".png", sizeof(path));
if (!path_file_exists(path))
xmb_fill_default_background_path(xmb, path, sizeof(path));
fill_pathname_application_special(path, sizeof(path),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG);
if(!string_is_equal(path, xmb->background_file_path))
{
@ -1334,11 +1313,15 @@ static void xmb_toggle_horizontal_list(xmb_handle_t *xmb)
}
static void xmb_context_reset_horizontal_list(
xmb_handle_t *xmb, const char *themepath)
xmb_handle_t *xmb)
{
unsigned i;
int depth; /* keep this integer */
size_t list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL);
size_t list_size = xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL);
char themepath[PATH_MAX_LENGTH] = {0};
fill_pathname_application_special(themepath, sizeof(themepath),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB);
xmb->categories.x_pos = xmb->icon.spacing.horizontal *
-(float)xmb->categories.selection_ptr;
@ -1376,9 +1359,8 @@ static void xmb_context_reset_horizontal_list(
strlcpy(sysname, path, sizeof(sysname));
path_remove_extension(sysname);
fill_pathname_join(iconpath, themepath, xmb->icon.dir,
sizeof(iconpath));
fill_pathname_slash(iconpath, sizeof(iconpath));
fill_pathname_application_special(iconpath, sizeof(iconpath),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
fill_pathname_join(texturepath, iconpath, sysname,
sizeof(texturepath));
@ -1411,18 +1393,6 @@ static void xmb_context_reset_horizontal_list(
static void xmb_refresh_horizontal_list(xmb_handle_t *xmb)
{
char mediapath[PATH_MAX_LENGTH] = {0};
char themepath[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr();
fill_pathname_join(
mediapath,
settings->directory.assets,
"xmb",
sizeof(mediapath));
fill_pathname_join(themepath, mediapath, xmb_theme_ident(), sizeof(themepath));
xmb_context_destroy_horizontal_list(xmb);
if (xmb->horizontal_list)
file_list_free(xmb->horizontal_list);
@ -1431,7 +1401,7 @@ static void xmb_refresh_horizontal_list(xmb_handle_t *xmb)
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
xmb_init_horizontal_list(xmb);
xmb_context_reset_horizontal_list(xmb, themepath);
xmb_context_reset_horizontal_list(xmb);
}
static int xmb_environ(enum menu_environ_cb type, void *data, void *userdata)
@ -2285,35 +2255,6 @@ static void xmb_frame(void *data)
menu_display_unset_viewport();
}
static void xmb_font(xmb_handle_t *xmb)
{
menu_display_ctx_font_t font_info;
char mediapath[PATH_MAX_LENGTH] = {0};
char themepath[PATH_MAX_LENGTH] = {0};
char fontpath[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr();
int font_size = menu_display_get_font_size();
fill_pathname_join(
mediapath,
settings->directory.assets,
"xmb",
sizeof(mediapath));
fill_pathname_join(themepath,
mediapath, xmb_theme_ident(), sizeof(themepath));
if (string_is_empty(settings->menu.xmb_font))
fill_pathname_join(fontpath, themepath, "font.ttf", sizeof(fontpath));
else
strlcpy(fontpath, settings->menu.xmb_font,sizeof(fontpath));
font_info.path = fontpath;
font_info.size = font_size;
if (!menu_display_font_main_init(&font_info))
RARCH_WARN("Failed to load font.");
}
static void xmb_layout_ps3(xmb_handle_t *xmb, int width)
{
unsigned new_font_size, new_header_height;
@ -2572,7 +2513,7 @@ static void *xmb_init(void **userdata)
menu_display_allocate_white_texture();
xmb_init_horizontal_list(xmb);
xmb_font(xmb);
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT);
xmb_init_ribbon(xmb);
return menu;
@ -2806,32 +2747,23 @@ static void xmb_context_reset_background(const char *iconpath)
static void xmb_context_reset(void *data)
{
char mediapath[PATH_MAX_LENGTH] = {0};
char themepath[PATH_MAX_LENGTH] = {0};
char iconpath[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr();
xmb_handle_t *xmb = (xmb_handle_t*)data;
if (!xmb)
return;
strlcpy(xmb->icon.dir, "png", sizeof(xmb->icon.dir));
xmb_fill_default_background_path(xmb,
xmb->background_file_path, sizeof(xmb->background_file_path));
fill_pathname_application_special(xmb->background_file_path,
sizeof(xmb->background_file_path),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG);
fill_pathname_join(
mediapath,
settings->directory.assets,
"xmb",
sizeof(mediapath));
fill_pathname_join(themepath, mediapath, xmb_theme_ident(), sizeof(themepath));
fill_pathname_join(iconpath, themepath, xmb->icon.dir, sizeof(iconpath));
fill_pathname_slash(iconpath, sizeof(iconpath));
fill_pathname_application_special(iconpath, sizeof(iconpath),
APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_ICONS);
xmb_layout(xmb);
xmb_font(xmb);
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_FONT);
xmb_context_reset_textures(xmb, iconpath);
xmb_context_reset_background(iconpath);
xmb_context_reset_horizontal_list(xmb, themepath);
xmb_context_reset_horizontal_list(xmb);
if (!string_is_equal(xmb_thumbnails_ident(), "OFF"))
xmb_update_thumbnail_image(xmb);

View File

@ -30,12 +30,14 @@
#include <formats/image.h>
#include <compat/strl.h>
#include <retro_stat.h>
#include <string/stdstring.h>
#include "menu_generic.h"
#include "../../config.def.h"
#include "../../list_special.h"
#include "../../file_path_special.h"
#include "../menu_driver.h"
#include "../menu_animation.h"
@ -167,29 +169,6 @@ struct zui_tabbed
static enum zarch_layout_type zarch_layout;
static void zarch_zui_font(void)
{
menu_display_ctx_font_t font_info;
char mediapath[PATH_MAX_LENGTH] = {0};
char fontpath[PATH_MAX_LENGTH] = {0};
settings_t *settings = config_get_ptr();
int font_size = menu_display_get_font_size();
fill_pathname_join(
mediapath,
settings->directory.assets,
"zarch",
sizeof(mediapath));
fill_pathname_join(fontpath,
mediapath, "Roboto-Condensed.ttf", sizeof(fontpath));
font_info.path = fontpath;
font_info.size = font_size;
if (!menu_display_font_main_init(&font_info))
RARCH_WARN("Failed to load font.");
}
static float zarch_zui_strwidth(void *fb_buf, const char *text, float scale)
{
return font_driver_get_message_width(fb_buf, text, strlen(text), scale);
@ -1033,7 +1012,7 @@ static void *zarch_init(void **userdata)
matrix_4x4_ortho(&zui->mvp, 0, 1, 1, 0, 0, 1);
zarch_zui_font();
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT);
return menu;
error:
@ -1118,7 +1097,7 @@ static void zarch_context_reset(void *data)
menu_display_allocate_white_texture();
menu_display_set_font_size(zui->font_size);
zarch_zui_font();
menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT);
}
static int zarch_iterate(void *data, void *userdata, enum menu_action action)

View File

@ -162,6 +162,26 @@ void menu_display_font_main_deinit(void)
menu_display_font_size = 0;
}
bool menu_display_font(enum application_special_type type)
{
menu_display_ctx_font_t font_info;
char fontpath[PATH_MAX_LENGTH] = {0};
int font_size = menu_display_get_font_size();
fill_pathname_application_special(fontpath, sizeof(fontpath), type);
font_info.path = fontpath;
font_info.size = font_size;
if (!menu_display_font_main_init(&font_info))
{
RARCH_WARN("Failed to load font.");
return false;
}
return true;
}
bool menu_display_font_main_init(menu_display_ctx_font_t *font)
{
menu_display_font_main_deinit();

View File

@ -23,6 +23,7 @@
#include <retro_common_api.h>
#include <gfx/math/matrix_4x4.h>
#include "../file_path_special.h"
#include "../gfx/video_context_driver.h"
#include "../gfx/video_coord_array.h"
@ -202,6 +203,8 @@ void menu_display_draw_text(const char *msg, int width, int height,
void menu_display_set_alpha(float *color, float alpha_value);
bool menu_display_font(enum application_special_type type);
extern uintptr_t menu_display_white_texture;
extern menu_display_ctx_driver_t menu_display_ctx_gl;

View File

@ -597,6 +597,21 @@ static int menu_displaylist_parse_network_info(menu_displaylist_info_t *info)
#endif
#endif
static uint64_t bytes_to_kb(uint64_t bytes)
{
return bytes / 1024;
}
static uint64_t bytes_to_mb(uint64_t bytes)
{
return bytes / 1024 / 1024;
}
static uint64_t bytes_to_gb(uint64_t bytes)
{
return bytes_to_kb(bytes) / 1024 / 1024;
}
static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
{
int controller;
@ -765,6 +780,73 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
menu_entries_add(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
{
char tmp[PATH_MAX_LENGTH] = {0};
char tmp2[PATH_MAX_LENGTH] = {0};
char tmp3[PATH_MAX_LENGTH] = {0};
uint64_t memory_used = frontend_driver_get_used_memory();
uint64_t memory_total = frontend_driver_get_total_memory();
if (memory_used != 0 && memory_total != 0)
{
#ifdef _WIN32
snprintf(tmp, sizeof(tmp),
"Memory (in bytes): %Iu/%Iu B",
memory_used,
memory_total
);
snprintf(tmp2, sizeof(tmp2),
"Memory (in megabytes): %Iu/%Iu MB",
bytes_to_mb(memory_used),
bytes_to_mb(memory_total)
);
snprintf(tmp3, sizeof(tmp3),
"Memory (in gigabytes): %Iu/%Iu GB",
bytes_to_gb(memory_used),
bytes_to_gb(memory_total)
);
#elif defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
snprintf(tmp, sizeof(tmp),
"Memory (in bytes) : %llu/%llu B",
(unsigned long long)memory_used,
(unsigned long long)memory_total
);
snprintf(tmp2, sizeof(tmp2),
"Memory (in megabytes) : %llu/%llu MB",
(unsigned long long)bytes_to_mb(memory_used),
(unsigned long long)bytes_to_mb(memory_total)
);
snprintf(tmp3, sizeof(tmp3),
"Memory (in gigabytes): %llu/%llu GB",
(unsigned long long)bytes_to_gb(memory_used),
(unsigned long long)bytes_to_gb(memory_total)
);
#else
snprintf(tmp, sizeof(tmp),
"Memory (in bytes): %lu/%lu B",
memory_used,
memory_total
);
snprintf(tmp2, sizeof(tmp2),
"Memory (in megabytes) : %1u/%1u MB",
bytes_to_mb(memory_used),
bytes_to_mb(memory_total)
);
snprintf(tmp3, sizeof(tmp3),
"Memory (in gigabytes) : %1u/%1u GB",
bytes_to_gb(memory_used),
bytes_to_gb(memory_total)
);
#endif
menu_entries_add(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
menu_entries_add(info->list, tmp2, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
menu_entries_add(info->list, tmp3, "",
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
}
}
if (frontend->get_powerstate)
{
int seconds = 0, percent = 0;

View File

@ -22,7 +22,7 @@
#include "configuration.h"
const char *msg_hash_to_str(uint32_t hash)
const char *msg_hash_to_str(enum msg_hash_enums msg)
{
const char *ret = NULL;
settings_t *settings = config_get_ptr();
@ -34,32 +34,32 @@ const char *msg_hash_to_str(uint32_t hash)
switch (settings->user_language)
{
case RETRO_LANGUAGE_FRENCH:
ret = msg_hash_to_str_fr(hash);
ret = msg_hash_to_str_fr(msg);
break;
case RETRO_LANGUAGE_GERMAN:
ret = msg_hash_to_str_de(hash);
ret = msg_hash_to_str_de(msg);
break;
case RETRO_LANGUAGE_SPANISH:
ret = msg_hash_to_str_es(hash);
ret = msg_hash_to_str_es(msg);
break;
case RETRO_LANGUAGE_ITALIAN:
ret = msg_hash_to_str_it(hash);
ret = msg_hash_to_str_it(msg);
break;
case RETRO_LANGUAGE_PORTUGUESE:
ret = msg_hash_to_str_pt(hash);
ret = msg_hash_to_str_pt(msg);
break;
case RETRO_LANGUAGE_DUTCH:
ret = msg_hash_to_str_nl(hash);
ret = msg_hash_to_str_nl(msg);
break;
case RETRO_LANGUAGE_ESPERANTO:
ret = msg_hash_to_str_eo(hash);
ret = msg_hash_to_str_eo(msg);
break;
case RETRO_LANGUAGE_POLISH:
ret = msg_hash_to_str_pl(hash);
ret = msg_hash_to_str_pl(msg);
break;
case RETRO_LANGUAGE_RUSSIAN:
#ifdef HAVE_UTF8
ret = msg_hash_to_str_ru(hash);
ret = msg_hash_to_str_ru(msg);
#endif
break;
default:
@ -71,7 +71,7 @@ const char *msg_hash_to_str(uint32_t hash)
return ret;
end:
return msg_hash_to_str_us(hash);
return msg_hash_to_str_us(msg);
}
uint32_t msg_hash_calculate(const char *s)

View File

@ -22,171 +22,124 @@
#include <retro_common_api.h>
#define MSG_UNKNOWN 0x3a834e55U
#define MSG_PROGRAM 0xc339565dU
#define MSG_FOUND_SHADER 0x817f42b7U
#define MSG_LOADING_HISTORY_FILE 0x865210d3U
#define MSG_SRAM_WILL_NOT_BE_SAVED 0x16f17d61U
#define MSG_RECEIVED 0xfe0c06acU
#define MSG_LOADING_CONTENT_FILE 0x236398dcU
#define MSG_USING_LIBRETRO_DUMMY_CORE_RECORDING_SKIPPED 0x9e8a1febU
#define MSG_RECORDING_TERMINATED_DUE_TO_RESIZE 0x361a07feU
#define MSG_FAILED_TO_START_RECORDING 0x90c3e2d5U
#define MSG_REWIND_INIT 0xf7732001U
#define MSG_REWIND_INIT_FAILED 0x9c1db0a6U
#define MSG_REWIND_INIT_FAILED_THREADED_AUDIO 0x359001b6U
#define MSG_REWIND_INIT_FAILED_NO_SAVESTATES 0x979b9cc3U
#define MSG_LIBRETRO_ABI_BREAK 0xf02cccd7U
#define MSG_NETPLAY_FAILED 0x61ee3426U
#define MSG_NETPLAY_FAILED_MOVIE_PLAYBACK_HAS_STARTED 0xb1e5dbfcU
#define MSG_DETECTED_VIEWPORT_OF 0xdf7002baU
#define MSG_RECORDING_TO 0x189fd324U
#define MSG_HW_RENDERED_MUST_USE_POSTSHADED_RECORDING 0x7f9f7659U
#define MSG_VIEWPORT_SIZE_CALCULATION_FAILED 0x9da84911U
#define MSG_AUTOSAVE_FAILED 0x9a02d8d1U
#define MSG_MOVIE_RECORD_STOPPED 0xbc7832c1U
#define MSG_MOVIE_PLAYBACK_ENDED 0xbeadce2aU
#define MSG_TAKING_SCREENSHOT 0xdcfda0e0U
#define MSG_FAILED_TO_TAKE_SCREENSHOT 0x7a480a2dU
#define MSG_CUSTOM_TIMING_GIVEN 0x259c95dfU
#define MSG_SAVING_STATE 0xe4f3eb4dU
#define MSG_LOADING_STATE 0x68d8d483U
#define MSG_FAILED_TO_SAVE_STATE_TO 0xcc005f3cU
#define MSG_FAILED_TO_SAVE_SRAM 0x0f72de6cU
#define MSG_STATE_SIZE 0x27b67400U
#define MSG_FAILED_TO_LOAD_CONTENT 0x0186e5a5U
#define MSG_COULD_NOT_READ_CONTENT_FILE 0x2dc7f4a0U
#define MSG_SAVED_SUCCESSFULLY_TO 0x9f59a7deU
#define MSG_BYTES 0x0f30b64cU
#define MSG_BLOCKING_SRAM_OVERWRITE 0x1f91d486U
#define MSG_UNRECOGNIZED_COMMAND 0x946b8a50U
#define MSG_SENDING_COMMAND 0x562cf28bU
#define MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT 0x5aa753b8U
#define MSG_REWINDING 0xccbeec2cU
#define MSG_SLOW_MOTION_REWIND 0x385adb27U
#define MSG_SLOW_MOTION 0x744c437fU
#define MSG_REWIND_REACHED_END 0x4f1aab8fU
#define MSG_FAILED_TO_START_MOVIE_RECORD 0x61221776U
#define MSG_CHEEVOS_HARDCORE_MODE_ENABLE 0x0d212ca9U
#define MSG_STATE_SLOT 0x27b67f67U
#define MSG_STARTING_MOVIE_RECORD_TO 0x6a7e0d50U
#define MSG_FAILED_TO_START_MOVIE_RECORD 0x61221776U
#define MSG_FAILED_TO_APPLY_SHADER 0x2094eb67U
#define MSG_APPLYING_SHADER 0x35599b7fU
#define MSG_SHADER 0x1bb1211cU
#define MSG_REDIRECTING_SAVESTATE_TO 0x8d98f7a6U
#define MSG_REDIRECTING_SAVEFILE_TO 0x868c54a5U
#define MSG_REDIRECTING_CHEATFILE_TO 0xd5f1b27bU
#define MSG_SCANNING 0x4c547516U
#define MSG_SCANNING_OF_DIRECTORY_FINISHED 0x399632a7U
#define MSG_COULD_NOT_PROCESS_ZIP_FILE 0xc18c89bbU
#define MSG_LOADED_STATE_FROM_SLOT 0xadb48582U
#define MSG_REMOVING_TEMPORARY_CONTENT_FILE 0x7121c9e7U
#define MSG_FAILED_TO_REMOVE_TEMPORARY_FILE 0xb6707b1aU
#define MSG_STARTING_MOVIE_PLAYBACK 0x96e545b6U
#define MSG_APPENDED_DISK 0x814ea0f0U
#define MSG_SKIPPING_SRAM_LOAD 0x88d4c8dbU
#define MSG_CONFIG_DIRECTORY_NOT_SET 0xcd45252aU
#define MSG_SAVED_STATE_TO_SLOT 0xe1e3dc3bU
#define MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES 0xd50adf46U
#define MSG_FAILED_TO_LOAD_STATE 0x91f348ebU
#define MSG_FAILED_TO_UNDO_LOAD_STATE 0xb6e2fc55U
#define MSG_FAILED_TO_UNDO_SAVE_STATE 0xf2e29478U
#define MSG_RESET 0x10474288U
#define MSG_AUDIO_MUTED 0xfa0c3bd5U
#define MSG_AUDIO_UNMUTED 0x0512bab8U
#define MSG_FAILED_TO_UNMUTE_AUDIO 0xf698763aU
#define MSG_FAILED_TO_LOAD_OVERLAY 0xacf201ecU
#define MSG_PAUSED 0x143e3307U
#define MSG_UNPAUSED 0x95aede0aU
#define MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS 0x6ba5abf9U
#define MSG_GRAB_MOUSE_STATE 0x893a7329U
#define MSG_FAILED_TO_LOAD_MOVIE_FILE 0x9455a5a9U
#define MSG_FAILED_TO 0x768f6dacU
#define MSG_SAVING_RAM_TYPE 0x9cd21d2dU
#define MSG_TO 0x005979a8U
#define MSG_VIRTUAL_DISK_TRAY 0x4aa37f15U
#define MSG_REMOVED_DISK_FROM_TRAY 0xf26a9653U
#define MSG_FAILED_TO_REMOVE_DISK_FROM_TRAY 0xc1c9a655U
#define MSG_GOT_INVALID_DISK_INDEX 0xb138dd76U
#define MSG_TASK_FAILED 0xb23ed64aU
#define MSG_DOWNLOADING 0x465305dbU
#define MSG_EXTRACTING 0x25a4c19eU
enum msg_hash_enums
{
MSG_UNKNOWN = 0,
MSG_PROGRAM,
MSG_FOUND_SHADER,
MSG_LOADING_HISTORY_FILE,
MSG_SRAM_WILL_NOT_BE_SAVED,
MSG_RECEIVED,
MSG_LOADING_CONTENT_FILE,
MSG_USING_LIBRETRO_DUMMY_CORE_RECORDING_SKIPPED,
MSG_RECORDING_TERMINATED_DUE_TO_RESIZE,
MSG_FAILED_TO_START_RECORDING,
MSG_REWIND_INIT,
MSG_REWIND_INIT_FAILED,
MSG_REWIND_INIT_FAILED_THREADED_AUDIO,
MSG_REWIND_INIT_FAILED_NO_SAVESTATES,
MSG_LIBRETRO_ABI_BREAK,
MSG_NETPLAY_FAILED,
MSG_NETPLAY_FAILED_MOVIE_PLAYBACK_HAS_STARTED,
MSG_DETECTED_VIEWPORT_OF,
MSG_RECORDING_TO,
MSG_HW_RENDERED_MUST_USE_POSTSHADED_RECORDING,
MSG_VIEWPORT_SIZE_CALCULATION_FAILED,
MSG_AUTOSAVE_FAILED,
MSG_MOVIE_RECORD_STOPPED,
MSG_MOVIE_PLAYBACK_ENDED,
MSG_TAKING_SCREENSHOT,
MSG_FAILED_TO_TAKE_SCREENSHOT,
MSG_CUSTOM_TIMING_GIVEN,
MSG_SAVING_STATE,
MSG_LOADING_STATE,
MSG_FAILED_TO_SAVE_STATE_TO,
MSG_FAILED_TO_SAVE_SRAM,
MSG_STATE_SIZE,
MSG_FAILED_TO_LOAD_CONTENT,
MSG_COULD_NOT_READ_CONTENT_FILE,
MSG_SAVED_SUCCESSFULLY_TO,
MSG_BYTES,
MSG_BLOCKING_SRAM_OVERWRITE,
MSG_UNRECOGNIZED_COMMAND,
MSG_SENDING_COMMAND,
MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT,
MSG_REWINDING,
MSG_SLOW_MOTION_REWIND,
MSG_SLOW_MOTION,
MSG_REWIND_REACHED_END,
MSG_FAILED_TO_START_MOVIE_RECORD,
MSG_CHEEVOS_HARDCORE_MODE_ENABLE,
MSG_STATE_SLOT,
MSG_STARTING_MOVIE_RECORD_TO,
MSG_FAILED_TO_APPLY_SHADER,
MSG_APPLYING_SHADER,
MSG_SHADER,
MSG_REDIRECTING_SAVESTATE_TO,
MSG_REDIRECTING_SAVEFILE_TO,
MSG_REDIRECTING_CHEATFILE_TO,
MSG_SCANNING,
MSG_SCANNING_OF_DIRECTORY_FINISHED,
MSG_COULD_NOT_PROCESS_ZIP_FILE,
MSG_LOADED_STATE_FROM_SLOT,
MSG_REMOVING_TEMPORARY_CONTENT_FILE,
MSG_FAILED_TO_REMOVE_TEMPORARY_FILE,
MSG_STARTING_MOVIE_PLAYBACK,
MSG_APPENDED_DISK,
MSG_SKIPPING_SRAM_LOAD,
MSG_CONFIG_DIRECTORY_NOT_SET,
MSG_SAVED_STATE_TO_SLOT,
MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES,
MSG_FAILED_TO_LOAD_STATE,
MSG_FAILED_TO_UNDO_LOAD_STATE,
MSG_FAILED_TO_UNDO_SAVE_STATE,
MSG_RESET,
MSG_AUDIO_MUTED,
MSG_AUDIO_UNMUTED,
MSG_FAILED_TO_UNMUTE_AUDIO,
MSG_FAILED_TO_LOAD_OVERLAY,
MSG_PAUSED,
MSG_UNPAUSED,
MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS,
MSG_GRAB_MOUSE_STATE,
MSG_FAILED_TO_LOAD_MOVIE_FILE,
MSG_FAILED_TO,
MSG_SAVING_RAM_TYPE,
MSG_TO,
MSG_VIRTUAL_DISK_TRAY,
MSG_REMOVED_DISK_FROM_TRAY,
MSG_FAILED_TO_REMOVE_DISK_FROM_TRAY,
MSG_GOT_INVALID_DISK_INDEX,
MSG_TASK_FAILED,
MSG_DOWNLOADING,
MSG_EXTRACTING
};
RETRO_BEGIN_DECLS
const char *msg_hash_to_str(uint32_t hash);
const char *msg_hash_to_str(enum msg_hash_enums msg);
const char *msg_hash_to_str_fr(uint32_t hash);
const char *msg_hash_to_str_fr(enum msg_hash_enums msg);
#ifdef HAVE_UTF8
const char *msg_hash_to_str_ru(uint32_t hash);
const char *msg_hash_to_str_ru(enum msg_hash_enums msg);
#endif
const char *msg_hash_to_str_de(uint32_t hash);
const char *msg_hash_to_str_de(enum msg_hash_enums msg);
const char *msg_hash_to_str_es(uint32_t hash);
const char *msg_hash_to_str_es(enum msg_hash_enums msg);
const char *msg_hash_to_str_eo(uint32_t hash);
const char *msg_hash_to_str_eo(enum msg_hash_enums msg);
const char *msg_hash_to_str_it(uint32_t hash);
const char *msg_hash_to_str_it(enum msg_hash_enums msg);
const char *msg_hash_to_str_pt(uint32_t hash);
const char *msg_hash_to_str_pt(enum msg_hash_enums msg);
const char *msg_hash_to_str_pl(uint32_t hash);
const char *msg_hash_to_str_pl(enum msg_hash_enums msg);
const char *msg_hash_to_str_nl(uint32_t hash);
const char *msg_hash_to_str_nl(enum msg_hash_enums msg);
const char *msg_hash_to_str_us(uint32_t hash);
const char *msg_hash_to_str_us(enum msg_hash_enums msg);
uint32_t msg_hash_calculate(const char *s);

View File

@ -59,7 +59,7 @@ C89_PULSE=no
HAVE_FREETYPE=auto # FreeType support
HAVE_STB_FONT=yes # stb_truetype font support
HAVE_XVIDEO=auto # XVideo support
HAVE_PYTHON=auto # Python 3 support for shaders
HAVE_PYTHON=no # Python 3 support for shaders
C89_PYTHON=no
HAVE_V4L2=auto # Video4linux2 support
HAVE_NEON=no # ARM NEON optimizations

View File

@ -51,6 +51,7 @@
#include "dynamic.h"
#include "msg_hash.h"
#include "movie.h"
#include "file_path_special.h"
#include "verbosity.h"
#include "frontend/frontend_driver.h"
@ -1183,7 +1184,6 @@ bool retroarch_validate_game_options(char *s, size_t len, bool mkdir)
const char *game_name = NULL;
rarch_system_info_t *system = NULL;
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
@ -1195,17 +1195,8 @@ bool retroarch_validate_game_options(char *s, size_t len, bool mkdir)
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;
/* Config directory: config_directory.
* Try config directory setting first,
* fallback to the location of the current configuration file. */
if (!string_is_empty(settings->directory.menu_config))
strlcpy(config_directory,
settings->directory.menu_config, sizeof(config_directory));
else if (!string_is_empty(global->path.config))
fill_pathname_basedir(config_directory,
global->path.config, sizeof(config_directory));
else
return false;
fill_pathname_application_special(config_directory, sizeof(config_directory),
APPLICATION_SPECIAL_DIRECTORY_CONFIG);
/* Concatenate strings into full paths for game_path */
fill_pathname_join(s,

View File

@ -101,15 +101,6 @@ void get_ios_version(int *major, int *minor);
@end
@interface RetroArch_OSX : NSObject <NSApplicationDelegate>
{
NSWindow* _window;
}
@property (nonatomic, retain) NSWindow IBOutlet* window;
@end
#endif
#define BOXSTRING(x) [NSString stringWithUTF8String:x]

View File

@ -72,7 +72,7 @@ static enum ui_msg_window_response ui_msg_window_cocoa_dialog(ui_msg_window_stat
break;
}
[alert beginSheetModalForWindow:((RetroArch_OSX*)[[NSApplication sharedApplication] delegate]).window
[alert beginSheetModalForWindow:ui_companion_driver_get_main_window()
modalDelegate:apple_platform
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
contextInfo:nil];

View File

@ -37,6 +37,19 @@
id apple_platform;
#ifdef OSX_PPC
@interface RetroArch_OSX : NSObject
#else
@interface RetroArch_OSX : NSObject <NSApplicationDelegate>
#endif
{
NSWindow* _window;
}
@property (nonatomic, retain) NSWindow IBOutlet* window;
@end
static void app_terminate(void)
{
[[NSApplication sharedApplication] terminate:nil];
@ -384,7 +397,7 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result)
if (browser)
{
ui_browser_window_state_t browser_state = {0};
ui_browser_window_state_t browser_state = {{0}};
settings_t *settings = config_get_ptr();
NSString *startdir = BOXSTRING(settings->directory.menu_content);
@ -546,6 +559,11 @@ static void ui_companion_cocoa_notify_list_pushed(void *data,
(void)menu_list;
}
static void *ui_companion_cocoa_get_main_window(void *data)
{
return ((RetroArch_OSX*)[[NSApplication sharedApplication] delegate]).window;
}
const ui_companion_driver_t ui_companion_cocoa = {
ui_companion_cocoa_init,
ui_companion_cocoa_deinit,
@ -557,6 +575,7 @@ const ui_companion_driver_t ui_companion_cocoa = {
NULL,
NULL,
NULL,
ui_companion_cocoa_get_main_window,
&ui_browser_window_cocoa,
&ui_msg_window_cocoa,
&ui_window_cocoa,

View File

@ -689,6 +689,7 @@ const ui_companion_driver_t ui_companion_cocoatouch = {
ui_companion_cocoatouch_notify_refresh,
ui_companion_cocoatouch_msg_queue_push,
ui_companion_cocoatouch_render_messagebox,
NULL,
&ui_browser_window_null,
&ui_msg_window_null,
&ui_window_null,

View File

@ -88,6 +88,7 @@ const ui_companion_driver_t ui_companion_null = {
NULL,
NULL,
NULL,
NULL,
&ui_browser_window_null,
&ui_msg_window_null,
&ui_window_null,

View File

@ -144,6 +144,7 @@ const ui_companion_driver_t ui_companion_qt = {
NULL,
NULL,
NULL,
NULL,
&ui_browser_window_qt,
&ui_msg_window_qt,
&ui_window_qt,

View File

@ -741,6 +741,7 @@ const ui_companion_driver_t ui_companion_win32 = {
NULL,
NULL,
NULL,
NULL,
&ui_browser_window_win32,
&ui_msg_window_win32,
&ui_window_win32,

View File

@ -201,3 +201,11 @@ const ui_application_t *ui_companion_driver_get_application_ptr(void)
return NULL;
return ui->application;
}
void *ui_companion_driver_get_main_window(void)
{
const ui_companion_driver_t *ui = ui_companion_get_ptr();
if (!ui || !ui->get_main_window)
return NULL;
return ui->get_main_window(ui_companion_data);
}

View File

@ -133,6 +133,7 @@ typedef struct ui_companion_driver
void (*notify_refresh)(void *data);
void (*msg_queue_push)(const char *msg, unsigned priority, unsigned duration, bool flush);
void (*render_messagebox)(const char *msg);
void *(*get_main_window)(void *data);
const ui_browser_window_t *browser_window;
const ui_msg_window_t *msg_window;
const ui_window_t *window;
@ -215,6 +216,8 @@ const ui_window_t *ui_companion_driver_get_window_ptr(void);
const ui_application_t *ui_companion_driver_get_application_ptr(void);
void *ui_companion_driver_get_main_window(void);
RETRO_END_DECLS
#endif