Remove configuration.h header dependencies

This commit is contained in:
twinaphex 2017-01-17 19:39:12 +01:00
parent d0ec96ba7b
commit 0c814f767c
9 changed files with 22 additions and 22 deletions

View file

@ -2011,7 +2011,7 @@ bool command_event(enum event_command cmd, void *data)
#endif
{
if (settings->rewind_enable)
state_manager_event_init();
state_manager_event_init(settings->rewind_buffer_size);
}
}
break;

View file

@ -23,6 +23,7 @@
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <string/stdstring.h>
#include <retro_miscellaneous.h>
#ifdef HAVE_CONFIG_H
#include "../config.h"
@ -33,7 +34,8 @@
#endif
#include "cheat_manager.h"
#include "../configuration.h"
#include "../msg_hash.h"
#include "../runloop.h"
#include "../dynamic.h"
#include "../core.h"
@ -127,20 +129,18 @@ void cheat_manager_set_code(unsigned i, const char *str)
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool cheat_manager_save(const char *path)
bool cheat_manager_save(const char *path, const char *cheat_database)
{
bool ret;
unsigned i;
char buf[PATH_MAX_LENGTH];
char cheats_file[PATH_MAX_LENGTH];
config_file_t *conf = NULL;
settings_t *settings = config_get_ptr();
cheat_manager_t *handle = cheat_manager_state;
buf[0] = cheats_file[0] = '\0';
fill_pathname_join(buf, settings->path.cheat_database,
path, sizeof(buf));
fill_pathname_join(buf, cheat_database, path, sizeof(buf));
fill_pathname_noext(cheats_file, buf, ".cht", sizeof(cheats_file));

View file

@ -36,7 +36,7 @@ bool cheat_manager_load(const char *path);
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool cheat_manager_save(const char *path);
bool cheat_manager_save(const char *path, const char *cheat_database);
bool cheat_manager_realloc(unsigned new_size);

View file

@ -164,7 +164,7 @@ core_option_manager_t *core_option_manager_new(const char *conf_path,
if (!opt)
return NULL;
if (*conf_path)
if (!string_is_empty(conf_path))
opt->conf = config_file_new(conf_path);
if (!opt->conf)
opt->conf = config_file_new(NULL);

View file

@ -21,7 +21,7 @@
#include <boolean.h>
#include <retro_common_api.h>
#include "lists/string_list.h"
#include <lists/string_list.h>
RETRO_BEGIN_DECLS

View file

@ -23,7 +23,6 @@
#include <algorithms/mismatch.h>
#include "state_manager.h"
#include "../configuration.h"
#include "../msg_hash.h"
#include "../movie.h"
#include "../core.h"
@ -504,12 +503,11 @@ static void state_manager_capacity(state_manager_t *state,
}
#endif
void state_manager_event_init(void)
void state_manager_event_init(unsigned rewind_buffer_size)
{
retro_ctx_serialize_info_t serial_info;
retro_ctx_size_info_t info;
void *state = NULL;
settings_t *settings = config_get_ptr();
if (rewind_state.state)
return;
@ -533,10 +531,10 @@ void state_manager_event_init(void)
RARCH_LOG("%s: %u MB\n",
msg_hash_to_str(MSG_REWIND_INIT),
(unsigned)(settings->rewind_buffer_size / 1000000));
(unsigned)(rewind_buffer_size / 1000000));
rewind_state.state = state_manager_new(rewind_state.size,
settings->rewind_buffer_size);
rewind_buffer_size);
if (!rewind_state.state)
RARCH_WARN("%s.\n", msg_hash_to_str(MSG_REWIND_INIT_FAILED));
@ -579,7 +577,8 @@ void state_manager_event_deinit(void)
*
* Checks if rewind toggle/hold was being pressed and/or held.
**/
void state_manager_check_rewind(bool pressed)
void state_manager_check_rewind(bool pressed,
unsigned rewind_granularity)
{
static bool first = true;
@ -631,10 +630,9 @@ void state_manager_check_rewind(bool pressed)
else
{
static unsigned cnt = 0;
settings_t *settings = config_get_ptr();
cnt = (cnt + 1) % (settings->rewind_granularity ?
settings->rewind_granularity : 1); /* Avoid possible SIGFPE. */
cnt = (cnt + 1) % (rewind_granularity ?
rewind_granularity : 1); /* Avoid possible SIGFPE. */
if ((cnt == 0) || bsv_movie_ctl(BSV_MOVIE_CTL_IS_INITED, NULL))
{

View file

@ -32,7 +32,7 @@ bool state_manager_frame_is_reversed(void);
void state_manager_event_deinit(void);
void state_manager_event_init(void);
void state_manager_event_init(unsigned rewind_buffer_size);
/**
* check_rewind:
@ -40,7 +40,7 @@ void state_manager_event_init(void);
*
* Checks if rewind toggle/hold was being pressed and/or held.
**/
void state_manager_check_rewind(bool pressed);
void state_manager_check_rewind(bool pressed, unsigned rewind_granularity);
RETRO_END_DECLS

View file

@ -1894,6 +1894,7 @@ static void menu_input_st_string_cb_cheat_file_save_as(
if (str && *str)
{
rarch_setting_t *setting = NULL;
settings_t *settings = config_get_ptr();
const char *label = menu_input_dialog_get_label_buffer();
if (!string_is_empty(label))
@ -1905,7 +1906,7 @@ static void menu_input_st_string_cb_cheat_file_save_as(
menu_setting_generic(setting, false);
}
else if (!string_is_empty(label))
cheat_manager_save(str);
cheat_manager_save(str, settings->path.cheat_database);
}
menu_input_dialog_end();

View file

@ -966,7 +966,8 @@ static enum runloop_state runloop_check_state(
#ifdef HAVE_CHEEVOS
if (!settings->cheevos.hardcore_mode_enable)
#endif
state_manager_check_rewind(runloop_cmd_press(current_input, RARCH_REWIND));
state_manager_check_rewind(runloop_cmd_press(current_input, RARCH_REWIND),
settings->rewind_granularity);
runloop_slowmotion = runloop_cmd_press(current_input, RARCH_SLOWMOTION);