mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Revert const ptr commit
This commit is contained in:
parent
b64f9bd64b
commit
fe958b46d7
82
retroarch.c
82
retroarch.c
@ -909,7 +909,7 @@ bool wifi_driver_ctl(enum rarch_wifi_ctl_state state, void *data)
|
||||
case RARCH_WIFI_CTL_START:
|
||||
if (wifi_driver && wifi_data && wifi_driver->start)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
if (settings->bools.wifi_allow)
|
||||
return wifi_driver->start(wifi_data);
|
||||
}
|
||||
@ -1052,7 +1052,7 @@ void ui_companion_driver_deinit(void)
|
||||
|
||||
void ui_companion_driver_init_first(void)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
ui_companion = (ui_companion_driver_t*)ui_companion_init_first();
|
||||
|
||||
@ -1079,7 +1079,7 @@ void ui_companion_driver_init_first(void)
|
||||
void ui_companion_driver_toggle(bool force)
|
||||
{
|
||||
#ifdef HAVE_QT
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
#endif
|
||||
|
||||
if (ui_companion && ui_companion->toggle)
|
||||
@ -1104,7 +1104,7 @@ void ui_companion_driver_notify_refresh(void)
|
||||
{
|
||||
const ui_companion_driver_t *ui = ui_companion;
|
||||
#ifdef HAVE_QT
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
#endif
|
||||
|
||||
if (!ui)
|
||||
@ -1216,7 +1216,7 @@ const char *ui_companion_driver_get_ident(void)
|
||||
void ui_companion_driver_log_msg(const char *msg)
|
||||
{
|
||||
#ifdef HAVE_QT
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
if (settings->bools.desktop_menu_enable)
|
||||
if (ui_companion_qt_data && qt_is_inited)
|
||||
@ -2802,7 +2802,7 @@ static INLINE bool input_keys_pressed_other_sources(unsigned i,
|
||||
static int16_t input_joypad_axis(const input_device_driver_t *drv,
|
||||
unsigned port, uint32_t joyaxis)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
float input_analog_deadzone = settings->floats.input_analog_deadzone;
|
||||
float input_analog_sensitivity = settings->floats.input_analog_sensitivity;
|
||||
int16_t val = drv->axis(port, joyaxis);
|
||||
@ -4128,7 +4128,7 @@ void input_driver_unset_nonblock_state(void)
|
||||
bool input_driver_init_command(void)
|
||||
{
|
||||
#ifdef HAVE_COMMAND
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
bool input_stdin_cmd_enable = settings->bools.stdin_cmd_enable;
|
||||
bool input_network_cmd_enable = settings->bools.network_cmd_enable;
|
||||
bool grab_stdin = current_input->grab_stdin && current_input->grab_stdin(current_input_data);
|
||||
@ -4185,7 +4185,7 @@ void input_driver_deinit_mapper(void)
|
||||
bool input_driver_init_remote(void)
|
||||
{
|
||||
#ifdef HAVE_NETWORKGAMEPAD
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
if (!settings->bools.network_remote_enable)
|
||||
return false;
|
||||
@ -4204,7 +4204,7 @@ bool input_driver_init_remote(void)
|
||||
|
||||
bool input_driver_init_mapper(void)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
if (!settings->bools.input_remap_binds_enable)
|
||||
return false;
|
||||
@ -4377,7 +4377,7 @@ const input_device_driver_t *input_joypad_init_driver(
|
||||
bool input_joypad_set_rumble(const input_device_driver_t *drv,
|
||||
unsigned port, enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
unsigned joy_idx = settings->uints.input_joypad_map[port];
|
||||
|
||||
if (!drv || !drv->set_rumble || joy_idx >= MAX_USERS)
|
||||
@ -5245,7 +5245,7 @@ static void input_config_get_bind_string_joykey(
|
||||
char *buf, const char *prefix,
|
||||
const struct retro_keybind *bind, size_t size)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
bool label_show = settings->bools.input_descriptor_label_show;
|
||||
|
||||
if (GET_HAT_DIR(bind->joykey))
|
||||
@ -5293,7 +5293,7 @@ static void input_config_get_bind_string_joykey(
|
||||
static void input_config_get_bind_string_joyaxis(char *buf, const char *prefix,
|
||||
const struct retro_keybind *bind, size_t size)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
if (bind->joyaxis_label &&
|
||||
!string_is_empty(bind->joyaxis_label)
|
||||
@ -6561,7 +6561,7 @@ static void audio_mixer_menu_stop_cb(
|
||||
|
||||
static enum resampler_quality audio_driver_get_resampler_quality(void)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
if (!settings)
|
||||
return RESAMPLER_QUALITY_DONTCARE;
|
||||
@ -7374,7 +7374,7 @@ void audio_driver_set_buffer_size(size_t bufsize)
|
||||
static void audio_driver_monitor_adjust_system_rates(void)
|
||||
{
|
||||
float timing_skew;
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
float video_refresh_rate = settings->floats.video_refresh_rate;
|
||||
float max_timing_skew = settings->floats.audio_max_timing_skew;
|
||||
struct retro_system_av_info *av_info = &video_driver_av_info;
|
||||
@ -7993,7 +7993,7 @@ bool audio_driver_disable_callback(void)
|
||||
/* Sets audio monitor rate to new value. */
|
||||
static void audio_driver_monitor_set_rate(void)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
double new_src_ratio = (double)settings->uints.audio_out_rate /
|
||||
audio_driver_input;
|
||||
|
||||
@ -9189,7 +9189,7 @@ bool video_driver_cached_frame(void)
|
||||
static void video_driver_monitor_adjust_system_rates(void)
|
||||
{
|
||||
float timing_skew = 0.0f;
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
float video_refresh_rate = settings->floats.video_refresh_rate;
|
||||
float timing_skew_hz = video_refresh_rate;
|
||||
const struct retro_system_timing *info = (const struct retro_system_timing*)&video_driver_av_info.timing;
|
||||
@ -9287,7 +9287,7 @@ bool video_driver_supports_viewport_read(void)
|
||||
|
||||
bool video_driver_prefer_viewport_read(void)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
return settings->bools.video_gpu_screenshot ||
|
||||
(video_driver_is_hw_context() && !current_video->read_frame_raw);
|
||||
}
|
||||
@ -9437,7 +9437,7 @@ void video_driver_monitor_reset(void)
|
||||
|
||||
void video_driver_set_aspect_ratio(void)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
unsigned aspect_ratio_idx = settings->uints.video_aspect_ratio_idx;
|
||||
|
||||
switch (aspect_ratio_idx)
|
||||
@ -10736,7 +10736,7 @@ bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data)
|
||||
bool video_context_driver_swap_interval(int *interval)
|
||||
{
|
||||
int current_interval = *interval;
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
bool adaptive_vsync_enabled = video_driver_test_all_flags(GFX_CTX_FLAGS_ADAPTIVE_VSYNC) && settings->bools.video_adaptive_vsync;
|
||||
|
||||
if (!current_video_context.swap_interval)
|
||||
@ -10795,7 +10795,7 @@ bool video_context_driver_get_refresh_rate(float *refresh_rate)
|
||||
|
||||
bool video_context_driver_input_driver(gfx_ctx_input_t *inp)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
const char *joypad_name = settings->arrays.input_joypad_driver;
|
||||
|
||||
if (!current_video_context.input_driver)
|
||||
@ -11648,7 +11648,7 @@ bool driver_location_start(void)
|
||||
{
|
||||
if (location_driver && location_data && location_driver->start)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
if (settings->bools.location_allow)
|
||||
return location_driver->start(location_data);
|
||||
|
||||
@ -11823,7 +11823,7 @@ bool driver_camera_start(void)
|
||||
{
|
||||
if (camera_driver && camera_data && camera_driver->start)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
if (settings->bools.camera_allow)
|
||||
return camera_driver->start(camera_data);
|
||||
|
||||
@ -12105,7 +12105,7 @@ void driver_set_nonblock_state(void)
|
||||
/* Only apply non-block-state for video if we're using vsync. */
|
||||
if (video_driver_is_active() && video_driver_get_ptr_internal(false))
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
bool video_nonblock = enable;
|
||||
|
||||
if (!settings->bools.video_vsync || runloop_force_nonblock)
|
||||
@ -13009,7 +13009,7 @@ static void run_ahead(int runahead_count, bool useSecondary)
|
||||
{
|
||||
if (!runahead_create())
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
if (!settings->bools.run_ahead_hide_warnings)
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RUNAHEAD_CORE_DOES_NOT_SUPPORT_SAVESTATES), 0, 2 * 60, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
||||
core_run();
|
||||
@ -13146,7 +13146,7 @@ void rarch_core_runtime_tick(void)
|
||||
/* Account for slow motion */
|
||||
if (runloop_slowmotion)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
frame_time = (retro_time_t)((double)
|
||||
frame_time * settings->floats.slowmotion_ratio);
|
||||
}
|
||||
@ -14270,10 +14270,10 @@ bool retroarch_main_init(int argc, char *argv[])
|
||||
|
||||
if (!string_is_empty(fullpath))
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
enum rarch_content_type cont_type = path_is_media_type(fullpath);
|
||||
bool builtin_imageviewer = settings->bools.multimedia_builtin_imageviewer_enable;
|
||||
bool builtin_mediaplayer = settings->bools.multimedia_builtin_mediaplayer_enable;
|
||||
bool builtin_imageviewer = settings ? settings->bools.multimedia_builtin_imageviewer_enable : false;
|
||||
bool builtin_mediaplayer = settings ? settings->bools.multimedia_builtin_mediaplayer_enable : false;
|
||||
|
||||
retroarch_main_init_media(cont_type, builtin_mediaplayer,
|
||||
builtin_imageviewer);
|
||||
@ -14358,7 +14358,7 @@ bool retroarch_main_init(int argc, char *argv[])
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
if (settings->bools.audio_enable_menu)
|
||||
audio_driver_load_menu_sounds();
|
||||
@ -14386,7 +14386,7 @@ bool retroarch_is_on_main_thread(void)
|
||||
void rarch_menu_running(void)
|
||||
{
|
||||
#if defined(HAVE_MENU) || defined(HAVE_OVERLAY)
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_TOGGLE, NULL);
|
||||
@ -14407,7 +14407,7 @@ void rarch_menu_running(void)
|
||||
void rarch_menu_running_finished(bool quit)
|
||||
{
|
||||
#if defined(HAVE_MENU) || defined(HAVE_OVERLAY)
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
#endif
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_TOGGLE, NULL);
|
||||
@ -14417,14 +14417,14 @@ void rarch_menu_running_finished(bool quit)
|
||||
|
||||
if (!quit)
|
||||
/* Stop menu background music before we exit the menu */
|
||||
if (settings->bools.audio_enable_menu && settings->bools.audio_enable_menu_bgm)
|
||||
if (settings && settings->bools.audio_enable_menu && settings->bools.audio_enable_menu_bgm)
|
||||
audio_driver_mixer_stop_stream(AUDIO_MIXER_SYSTEM_SLOT_BGM);
|
||||
|
||||
#endif
|
||||
video_driver_set_texture_enable(false, false);
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (!quit)
|
||||
if (settings->bools.input_overlay_hide_in_menu)
|
||||
if (settings && settings->bools.input_overlay_hide_in_menu)
|
||||
command_event(CMD_EVENT_OVERLAY_INIT, NULL);
|
||||
#endif
|
||||
}
|
||||
@ -14747,7 +14747,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
return runloop_game_options_active;
|
||||
case RARCH_CTL_SET_FRAME_LIMIT:
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
struct retro_system_av_info *av_info = &video_driver_av_info;
|
||||
float fastforward_ratio_orig = settings->floats.fastforward_ratio;
|
||||
float fastforward_ratio = (fastforward_ratio_orig == 0.0f) ? 1.0f : fastforward_ratio_orig;
|
||||
@ -14808,7 +14808,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
/* Only write to file if content has run for a non-zero length of time */
|
||||
if (libretro_core_runtime_usec > 0)
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
|
||||
/* Per core logging */
|
||||
if (settings->bools.content_runtime_log)
|
||||
@ -14918,7 +14918,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
case RARCH_CTL_TASK_INIT:
|
||||
{
|
||||
#ifdef HAVE_THREADS
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
bool threaded_enable = settings->bools.threaded_data_runloop_enable;
|
||||
#else
|
||||
bool threaded_enable = false;
|
||||
@ -14963,7 +14963,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
break;
|
||||
case RARCH_CTL_CORE_OPTIONS_GET:
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
unsigned log_level = settings->uints.libretro_log_level;
|
||||
|
||||
struct retro_variable *var = (struct retro_variable*)data;
|
||||
@ -14983,7 +14983,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
break;
|
||||
case RARCH_CTL_CORE_OPTIONS_INIT:
|
||||
{
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
char *game_options_path = NULL;
|
||||
const struct retro_variable *vars =
|
||||
(const struct retro_variable*)data;
|
||||
@ -14999,7 +14999,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
else
|
||||
{
|
||||
char buf[PATH_MAX_LENGTH];
|
||||
const char *options_path = settings->paths.path_core_options;
|
||||
const char *options_path = settings ? settings->paths.path_core_options : NULL;
|
||||
|
||||
buf[0] = '\0';
|
||||
|
||||
@ -15191,7 +15191,7 @@ static bool retroarch_load_shader_preset_internal(
|
||||
*/
|
||||
static bool retroarch_load_shader_preset(void)
|
||||
{
|
||||
const settings_t *settings = configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
const rarch_system_info_t *system = &runloop_system;
|
||||
const char *video_shader_directory = settings->paths.directory_video_shader;
|
||||
const char *core_name = system->info.library_name;
|
||||
@ -17582,7 +17582,7 @@ void rarch_log_file_init(void)
|
||||
char log_directory[PATH_MAX_LENGTH];
|
||||
char log_file_path[PATH_MAX_LENGTH];
|
||||
FILE *fp = NULL;
|
||||
const settings_t *settings = (const settings_t*)configuration_settings;
|
||||
settings_t *settings = configuration_settings;
|
||||
bool log_to_file = settings->bools.log_to_file;
|
||||
bool log_to_file_timestamp = settings->bools.log_to_file_timestamp;
|
||||
bool logging_to_file = is_logging_to_file();
|
||||
|
Loading…
x
Reference in New Issue
Block a user