mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 04:20:28 +00:00
Create file_path_str FILE_PATH_NUL
This commit is contained in:
parent
5ba74302b2
commit
fa7eb9d8c8
@ -2368,7 +2368,7 @@ static void save_keybind_joykey(config_file_t *conf, const char *prefix,
|
||||
if (bind->joykey == NO_BTN)
|
||||
{
|
||||
if (save_empty)
|
||||
config_set_string(conf, key, "nul");
|
||||
config_set_string(conf, key, file_path_str(FILE_PATH_NUL));
|
||||
}
|
||||
else if (GET_HAT_DIR(bind->joykey))
|
||||
save_keybind_hat(conf, key, bind);
|
||||
@ -2389,7 +2389,7 @@ static void save_keybind_axis(config_file_t *conf, const char *prefix,
|
||||
if (bind->joyaxis == AXIS_NONE)
|
||||
{
|
||||
if (save_empty)
|
||||
config_set_string(conf, key, "nul");
|
||||
config_set_string(conf, key, file_path_str(FILE_PATH_NUL));
|
||||
}
|
||||
else if (AXIS_NEG_GET(bind->joyaxis) != AXIS_DIR_NONE)
|
||||
{
|
||||
|
@ -26,6 +26,7 @@ enum file_path_enum
|
||||
{
|
||||
FILE_PATH_UNKNOWN = 0,
|
||||
FILE_PATH_PROGRAM_NAME,
|
||||
FILE_PATH_NUL,
|
||||
FILE_PATH_LOG_WARN,
|
||||
FILE_PATH_LOG_ERROR,
|
||||
FILE_PATH_LOG_INFO,
|
||||
|
@ -25,6 +25,8 @@ const char *file_path_str(enum file_path_enum enum_idx)
|
||||
#else
|
||||
return "RetroArch";
|
||||
#endif
|
||||
case FILE_PATH_NUL:
|
||||
return "nul";
|
||||
case FILE_PATH_LOG_WARN:
|
||||
return "[WARN]";
|
||||
case FILE_PATH_LOG_ERROR:
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "input_keymaps.h"
|
||||
#include "input_remapping.h"
|
||||
|
||||
#include "../file_path_special.h"
|
||||
#include "../general.h"
|
||||
#include "../verbosity.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -300,7 +301,7 @@ void input_config_parse_joy_button(config_file_t *conf, const char *prefix,
|
||||
if (config_get_array(conf, key, tmp, sizeof(tmp)))
|
||||
{
|
||||
btn = tmp;
|
||||
if (string_is_equal(btn, "nul"))
|
||||
if (string_is_equal(btn, file_path_str(FILE_PATH_NUL)))
|
||||
bind->joykey = NO_BTN;
|
||||
else
|
||||
{
|
||||
@ -336,7 +337,7 @@ void input_config_parse_joy_axis(config_file_t *conf, const char *prefix,
|
||||
|
||||
if (config_get_array(conf, key, tmp, sizeof(tmp)))
|
||||
{
|
||||
if (string_is_equal(tmp, "nul"))
|
||||
if (string_is_equal(tmp, file_path_str(FILE_PATH_NUL)))
|
||||
bind->joyaxis = AXIS_NONE;
|
||||
else if (strlen(tmp) >= 2 && (*tmp == '+' || *tmp == '-'))
|
||||
{
|
||||
@ -365,7 +366,7 @@ static void input_config_get_bind_string_joykey(char *buf, const char *prefix,
|
||||
|
||||
if (GET_HAT_DIR(bind->joykey))
|
||||
{
|
||||
const char *dir = NULL;
|
||||
const char *dir = "?";
|
||||
|
||||
switch (GET_HAT_DIR(bind->joykey))
|
||||
{
|
||||
@ -382,7 +383,6 @@ static void input_config_get_bind_string_joykey(char *buf, const char *prefix,
|
||||
dir = "right";
|
||||
break;
|
||||
default:
|
||||
dir = "?";
|
||||
break;
|
||||
}
|
||||
|
||||
@ -447,7 +447,7 @@ void input_config_get_bind_string(char *buf, const struct retro_keybind *bind,
|
||||
|
||||
#ifndef RARCH_CONSOLE
|
||||
input_keymaps_translate_rk_to_str(bind->key, key, sizeof(key));
|
||||
if (string_is_equal(key, "nul"))
|
||||
if (string_is_equal(key, file_path_str(FILE_PATH_NUL)))
|
||||
*key = '\0';
|
||||
|
||||
snprintf(keybuf, sizeof(keybuf), "(Key: %s)", key);
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include "tasks_internal.h"
|
||||
|
||||
#include "../file_path_special.h"
|
||||
#include "../input/input_config.h"
|
||||
#include "../input/input_overlay.h"
|
||||
#include "../configuration.h"
|
||||
@ -181,7 +182,7 @@ static bool task_overlay_load_desc(
|
||||
|
||||
for (; tmp; tmp = strtok_r(NULL, "|", &save))
|
||||
{
|
||||
if (!string_is_equal(tmp, "nul"))
|
||||
if (!string_is_equal(tmp, file_path_str(FILE_PATH_NUL)))
|
||||
desc->key_mask |= UINT64_C(1)
|
||||
<< input_config_translate_str_to_bind_id(tmp);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user