mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Make input overlay configurable.
This commit is contained in:
parent
60a4a20a79
commit
ca9f081d27
11
driver.c
11
driver.c
@ -721,8 +721,17 @@ void init_video_input(void)
|
|||||||
|
|
||||||
// TODO: This should probably be done somewhere else.
|
// TODO: This should probably be done somewhere else.
|
||||||
if (driver.overlay)
|
if (driver.overlay)
|
||||||
|
{
|
||||||
input_overlay_free(driver.overlay);
|
input_overlay_free(driver.overlay);
|
||||||
driver.overlay = input_overlay_new(NULL);
|
driver.overlay = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*g_settings.input.overlay)
|
||||||
|
{
|
||||||
|
driver.overlay = input_overlay_new(g_settings.input.overlay);
|
||||||
|
if (!driver.overlay)
|
||||||
|
RARCH_ERR("Failed to load overlay.\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninit_video_input(void)
|
void uninit_video_input(void)
|
||||||
|
@ -185,6 +185,8 @@ struct settings
|
|||||||
|
|
||||||
unsigned turbo_period;
|
unsigned turbo_period;
|
||||||
unsigned turbo_duty_cycle;
|
unsigned turbo_duty_cycle;
|
||||||
|
|
||||||
|
char overlay[PATH_MAX];
|
||||||
} input;
|
} input;
|
||||||
|
|
||||||
char libretro[PATH_MAX];
|
char libretro[PATH_MAX];
|
||||||
|
@ -28,9 +28,8 @@ struct input_overlay
|
|||||||
|
|
||||||
input_overlay_t *input_overlay_new(const char *overlay)
|
input_overlay_t *input_overlay_new(const char *overlay)
|
||||||
{
|
{
|
||||||
(void)overlay;
|
|
||||||
|
|
||||||
input_overlay_t *ol = (input_overlay_t*)calloc(1, sizeof(*ol));
|
input_overlay_t *ol = (input_overlay_t*)calloc(1, sizeof(*ol));
|
||||||
|
|
||||||
if (!ol)
|
if (!ol)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -46,9 +45,8 @@ input_overlay_t *input_overlay_new(const char *overlay)
|
|||||||
if (!ol->iface)
|
if (!ol->iface)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
// Test hardcoded.
|
|
||||||
struct texture_image img = {0};
|
struct texture_image img = {0};
|
||||||
if (!texture_image_load("/tmp/basic_overlay.png", &img))
|
if (!texture_image_load(overlay, &img))
|
||||||
{
|
{
|
||||||
RARCH_ERR("Failed to load overlay image.\n");
|
RARCH_ERR("Failed to load overlay image.\n");
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -196,6 +196,9 @@
|
|||||||
# Defines axis threshold. Possible values are [0.0, 1.0]
|
# Defines axis threshold. Possible values are [0.0, 1.0]
|
||||||
# input_axis_threshold = 0.5
|
# input_axis_threshold = 0.5
|
||||||
|
|
||||||
|
# Path to input overlay
|
||||||
|
# input_overlay =
|
||||||
|
|
||||||
# Keyboard input. Will recognize normal keypresses and special keys like "left", "right", and so on.
|
# Keyboard input. Will recognize normal keypresses and special keys like "left", "right", and so on.
|
||||||
# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely,
|
# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely,
|
||||||
# rather than relying on a default.
|
# rather than relying on a default.
|
||||||
|
@ -564,6 +564,8 @@ bool config_load_file(const char *path)
|
|||||||
CONFIG_GET_INT(input.turbo_period, "input_turbo_period");
|
CONFIG_GET_INT(input.turbo_period, "input_turbo_period");
|
||||||
CONFIG_GET_INT(input.turbo_duty_cycle, "input_duty_cycle");
|
CONFIG_GET_INT(input.turbo_duty_cycle, "input_duty_cycle");
|
||||||
|
|
||||||
|
CONFIG_GET_PATH(input.overlay, "input_overlay");
|
||||||
|
|
||||||
if (config_get_string(conf, "environment_variables",
|
if (config_get_string(conf, "environment_variables",
|
||||||
&g_extern.system.environment))
|
&g_extern.system.environment))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user