[Scummvm-git-logs] scummvm master -> e1a7e2931877937a04e55f45a9eec6e6f7d471ff

spleen1981 noreply at scummvm.org
Thu Nov 14 16:12:13 UTC 2024


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8e758267b1 LIBRETRO: fix description typo
e1a7e29318 LIBRETRO: restore settings update on the fly


Commit: 8e758267b104d1af2c5789eb653336b7dc8b97a0
    https://github.com/scummvm/scummvm/commit/8e758267b104d1af2c5789eb653336b7dc8b97a0
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-11-14T17:11:45+01:00

Commit Message:
LIBRETRO: fix description typo

Changed paths:
    backends/platform/libretro/include/libretro-core-options-intl.h


diff --git a/backends/platform/libretro/include/libretro-core-options-intl.h b/backends/platform/libretro/include/libretro-core-options-intl.h
index 1e9b80c4f32..7564752a3fd 100644
--- a/backends/platform/libretro/include/libretro-core-options-intl.h
+++ b/backends/platform/libretro/include/libretro-core-options-intl.h
@@ -186,7 +186,7 @@ struct retro_core_option_v2_definition option_defs_it[] = {
 		"scummvm_framerate",
 		"Timing > Tetto frequenza dei fotogrammi",
 		"Tetto frequenza dei fotogrammi",
-		"Imposta il limite superiore della frequenza dei fotogrammi. La riduzione del limite migliorara le prestazioni sui dispositivi di fascia bassa. Il cambio di questa impostazione causerà il reset del core.",
+		"Imposta il limite superiore della frequenza dei fotogrammi. La riduzione del limite migliora le prestazioni sui dispositivi di fascia bassa. Il cambio di questa impostazione causerà il reset del core.",
 		NULL,
 		NULL,
 		{
@@ -198,7 +198,7 @@ struct retro_core_option_v2_definition option_defs_it[] = {
 		"scummvm_samplerate",
 		"Timing > Frequenza di campionamento",
 		"Frequenza di campionamento",
-		"Imposta la frequenza di campionamento. La riduzione della frequenza migliorara leggermente le prestazioni sui dispositivi di fascia bassa. Il cambio di questa impostazione causerà il reset del core.",
+		"Imposta la frequenza di campionamento. La riduzione della frequenza migliora leggermente le prestazioni sui dispositivi di fascia bassa. Il cambio di questa impostazione causerà il reset del core.",
 		NULL,
 		NULL,
 		{


Commit: e1a7e2931877937a04e55f45a9eec6e6f7d471ff
    https://github.com/scummvm/scummvm/commit/e1a7e2931877937a04e55f45a9eec6e6f7d471ff
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-11-14T17:12:05+01:00

Commit Message:
LIBRETRO: restore settings update on the fly

Changed paths:
    backends/platform/libretro/src/libretro-core.cpp


diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index 3274d2c287b..5b11d73fa04 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -98,6 +98,7 @@ static float audio_samples_accumulator = 0.0f;
 static int16 *audio_sample_buffer = NULL; // pointer to output buffer
 
 static bool input_bitmask_supported = false;
+static bool updating_variables = false;
 
 #ifdef USE_OPENGL
 static struct retro_hw_render_callback hw_render;
@@ -257,6 +258,7 @@ void retro_osd_notification(const char *msg) {
 
 static void update_variables(void) {
 	struct retro_variable var;
+	updating_variables = true;
 
 	var.key = "scummvm_gamepad_cursor_only";
 	var.value = NULL;
@@ -533,6 +535,34 @@ static void update_variables(void) {
 		retro_osd_notification("Core reload is needed to apply HW acceleration setting change.");
 		video_hw_mode &= ~VIDEO_GRAPHIC_MODE_RESET_PENDING;
 	}
+
+	updating_variables = false;
+}
+
+static void retro_set_options_display(void) {
+	/*struct retro_core_option_display option_display;
+
+	option_display.visible = opt_frameskip_threshold_display;
+	option_display.key = "scummvm_frameskip_threshold";
+	environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
+
+	option_display.visible = opt_frameskip_no_display;
+	option_display.key = "scummvm_frameskip_no";
+	environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);*/
+}
+
+static bool retro_update_options_display(void) {
+	if (updating_variables)
+		return false;
+
+	/* Core options */
+	bool updated = false;
+	if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) {
+		update_variables();
+		LIBRETRO_G_SYSTEM->refreshRetroSettings();
+		retro_set_options_display();
+	}
+	return updated;
 }
 
 bool retro_setting_get_gamepad_cursor_only(void) {
@@ -732,6 +762,10 @@ void retro_set_environment(retro_environment_t cb) {
 	environ_cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &tmp);
 	libretro_fill_options_mapper_data(environ_cb);
 	libretro_set_core_options(environ_cb, &has_categories);
+
+	/* Core option display callback */
+	struct retro_core_options_update_display_callback update_display_callback = {retro_update_options_display};
+	environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK, &update_display_callback);
 }
 
 unsigned retro_api_version(void) {
@@ -822,6 +856,8 @@ void retro_init(void) {
 	max_width = gui_width > max_width ? gui_width : max_width;
 	max_height = gui_height > max_height ? gui_height : max_height;
 
+	retro_set_options_display();
+
 	init_command_params();
 
 	setup_hw_rendering();
@@ -982,6 +1018,10 @@ bool retro_load_game_special(unsigned game_type, const struct retro_game_info *i
 }
 
 void retro_run(void) {
+	/* Settings change is covered by RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK
+	except in case of core options reset to defaults, for which the following call is needed*/
+	retro_update_options_display();
+
 #ifdef USE_HIGHRES
 	if (av_status & AV_STATUS_UPDATE_GUI) {
 		retro_gui_res_reset();




More information about the Scummvm-git-logs mailing list