mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Remove hashes from task_overlay
This commit is contained in:
parent
938f6cc26e
commit
fae9223641
@ -28,12 +28,6 @@
|
|||||||
|
|
||||||
RETRO_BEGIN_DECLS
|
RETRO_BEGIN_DECLS
|
||||||
|
|
||||||
#define BOX_RADIAL 0x18df06d2U
|
|
||||||
#define BOX_RECT 0x7c9d4d93U
|
|
||||||
|
|
||||||
#define KEY_ANALOG_LEFT 0x56b92e81U
|
|
||||||
#define KEY_ANALOG_RIGHT 0x2e4dc654U
|
|
||||||
|
|
||||||
/* Overlay driver acts as a medium between input drivers
|
/* Overlay driver acts as a medium between input drivers
|
||||||
* and video driver.
|
* and video driver.
|
||||||
*
|
*
|
||||||
|
@ -110,7 +110,6 @@ static bool task_overlay_load_desc(
|
|||||||
bool normalized, float alpha_mod, float range_mod)
|
bool normalized, float alpha_mod, float range_mod)
|
||||||
{
|
{
|
||||||
float width_mod, height_mod;
|
float width_mod, height_mod;
|
||||||
uint32_t box_hash, key_hash;
|
|
||||||
char overlay_desc_key[64];
|
char overlay_desc_key[64];
|
||||||
char conf_key[64];
|
char conf_key[64];
|
||||||
char overlay_desc_normalized_key[64];
|
char overlay_desc_normalized_key[64];
|
||||||
@ -174,50 +173,40 @@ static bool task_overlay_load_desc(
|
|||||||
y = list->elems[2].data;
|
y = list->elems[2].data;
|
||||||
box = list->elems[3].data;
|
box = list->elems[3].data;
|
||||||
|
|
||||||
box_hash = djb2_calculate(box);
|
|
||||||
key_hash = djb2_calculate(key);
|
|
||||||
|
|
||||||
desc->retro_key_idx = 0;
|
desc->retro_key_idx = 0;
|
||||||
BIT256_CLEAR_ALL(desc->button_mask);
|
BIT256_CLEAR_ALL(desc->button_mask);
|
||||||
|
|
||||||
switch (key_hash)
|
if (string_is_equal(key, "analog_left"))
|
||||||
|
desc->type = OVERLAY_TYPE_ANALOG_LEFT;
|
||||||
|
else if (string_is_equal(key, "analog_right"))
|
||||||
|
desc->type = OVERLAY_TYPE_ANALOG_RIGHT;
|
||||||
|
else if (strstr(key, "retrok_") == key)
|
||||||
{
|
{
|
||||||
case KEY_ANALOG_LEFT:
|
desc->type = OVERLAY_TYPE_KEYBOARD;
|
||||||
desc->type = OVERLAY_TYPE_ANALOG_LEFT;
|
desc->retro_key_idx = input_config_translate_str_to_rk(key + 7);
|
||||||
break;
|
}
|
||||||
case KEY_ANALOG_RIGHT:
|
else
|
||||||
desc->type = OVERLAY_TYPE_ANALOG_RIGHT;
|
{
|
||||||
break;
|
char *save = NULL;
|
||||||
default:
|
const char *tmp = strtok_r(key, "|", &save);
|
||||||
if (strstr(key, "retrok_") == key)
|
|
||||||
{
|
|
||||||
desc->type = OVERLAY_TYPE_KEYBOARD;
|
|
||||||
desc->retro_key_idx = input_config_translate_str_to_rk(key + 7);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char *save = NULL;
|
|
||||||
const char *tmp = strtok_r(key, "|", &save);
|
|
||||||
|
|
||||||
desc->type = OVERLAY_TYPE_BUTTONS;
|
desc->type = OVERLAY_TYPE_BUTTONS;
|
||||||
|
|
||||||
for (; tmp; tmp = strtok_r(NULL, "|", &save))
|
for (; tmp; tmp = strtok_r(NULL, "|", &save))
|
||||||
{
|
{
|
||||||
if (!string_is_equal(tmp, file_path_str(FILE_PATH_NUL)))
|
if (!string_is_equal(tmp, file_path_str(FILE_PATH_NUL)))
|
||||||
BIT256_SET(desc->button_mask, input_config_translate_str_to_bind_id(tmp));
|
BIT256_SET(desc->button_mask, input_config_translate_str_to_bind_id(tmp));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BIT256_GET(desc->button_mask, RARCH_OVERLAY_NEXT))
|
if (BIT256_GET(desc->button_mask, RARCH_OVERLAY_NEXT))
|
||||||
{
|
{
|
||||||
char overlay_target_key[64];
|
char overlay_target_key[64];
|
||||||
|
|
||||||
snprintf(overlay_target_key, sizeof(overlay_target_key),
|
snprintf(overlay_target_key, sizeof(overlay_target_key),
|
||||||
"overlay%u_desc%u_next_target", ol_idx, desc_idx);
|
"overlay%u_desc%u_next_target", ol_idx, desc_idx);
|
||||||
config_get_array(conf, overlay_target_key,
|
config_get_array(conf, overlay_target_key,
|
||||||
desc->next_index_name, sizeof(desc->next_index_name));
|
desc->next_index_name, sizeof(desc->next_index_name));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
width_mod = 1.0f;
|
width_mod = 1.0f;
|
||||||
@ -232,18 +221,15 @@ static bool task_overlay_load_desc(
|
|||||||
desc->x = (float)strtod(x, NULL) * width_mod;
|
desc->x = (float)strtod(x, NULL) * width_mod;
|
||||||
desc->y = (float)strtod(y, NULL) * height_mod;
|
desc->y = (float)strtod(y, NULL) * height_mod;
|
||||||
|
|
||||||
switch (box_hash)
|
if (string_is_equal(box, "radial"))
|
||||||
|
desc->hitbox = OVERLAY_HITBOX_RADIAL;
|
||||||
|
else if (string_is_equal(box, "rect"))
|
||||||
|
desc->hitbox = OVERLAY_HITBOX_RECT;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
case BOX_RADIAL:
|
RARCH_ERR("[Overlay]: Hitbox type (%s) is invalid. Use \"radial\" or \"rect\".\n", box);
|
||||||
desc->hitbox = OVERLAY_HITBOX_RADIAL;
|
ret = false;
|
||||||
break;
|
goto end;
|
||||||
case BOX_RECT:
|
|
||||||
desc->hitbox = OVERLAY_HITBOX_RECT;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
RARCH_ERR("[Overlay]: Hitbox type (%s) is invalid. Use \"radial\" or \"rect\".\n", box);
|
|
||||||
ret = false;
|
|
||||||
goto end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (desc->type)
|
switch (desc->type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user