Merge branch 'overlay' of https://github.com/Themaister/RetroArch into overlay

This commit is contained in:
twinaphex 2012-12-20 20:50:37 +01:00
commit c135cf7e6d
5 changed files with 19 additions and 5 deletions

View File

@ -721,8 +721,17 @@ void init_video_input(void)
// TODO: This should probably be done somewhere else.
if (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)

View File

@ -185,6 +185,8 @@ struct settings
unsigned turbo_period;
unsigned turbo_duty_cycle;
char overlay[PATH_MAX];
} input;
char libretro[PATH_MAX];

View File

@ -28,9 +28,8 @@ struct input_overlay
input_overlay_t *input_overlay_new(const char *overlay)
{
(void)overlay;
input_overlay_t *ol = (input_overlay_t*)calloc(1, sizeof(*ol));
if (!ol)
goto error;
@ -46,9 +45,8 @@ input_overlay_t *input_overlay_new(const char *overlay)
if (!ol->iface)
goto error;
// Test hardcoded.
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");
goto error;

View File

@ -196,6 +196,9 @@
# Defines axis threshold. Possible values are [0.0, 1.0]
# 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, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely,
# rather than relying on a default.

View File

@ -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_duty_cycle, "input_duty_cycle");
CONFIG_GET_PATH(input.overlay, "input_overlay");
if (config_get_string(conf, "environment_variables",
&g_extern.system.environment))
{