Use new core options accessors

This commit is contained in:
twinaphex 2016-09-17 13:40:25 +02:00
parent b51aca2fa5
commit e338b78792
2 changed files with 5 additions and 9 deletions

View File

@ -43,6 +43,7 @@
#include "../../managers/cheat_manager.h"
#include "../../tasks/tasks_internal.h"
#include "../../input/input_remapping.h"
#include "../../paths.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#include "../../verbosity.h"
@ -2497,14 +2498,10 @@ static int action_ok_option_create(const char *path,
if(config_file_write(conf, game_path))
{
global_t *global = global_get_ptr();
runloop_msg_queue_push(
msg_hash_to_str(MSG_CORE_OPTIONS_FILE_CREATED_SUCCESSFULLY),
1, 100, true);
strlcpy(global->path.core_options_path,
game_path, sizeof(global->path.core_options_path));
path_set_core_options(game_path);
}
config_file_free(conf);

View File

@ -1124,17 +1124,16 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
break;
case RUNLOOP_CTL_CORE_OPTIONS_DEINIT:
{
global_t *global = global_get_ptr();
if (!runloop_core_options)
return false;
/* check if game options file was just created and flush
to that file instead */
if(global && !string_is_empty(global->path.core_options_path))
if(!path_is_core_options_empty())
{
core_option_manager_flush_game_specific(runloop_core_options,
global->path.core_options_path);
global->path.core_options_path[0] = '\0';
path_get_core_options());
path_clear_core_options();
}
else
core_option_manager_flush(runloop_core_options);