mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
Settings struct now has a flags variable
This commit is contained in:
parent
9efb498bde
commit
01a9745f5b
6 changed files with 83 additions and 76 deletions
|
@ -4563,7 +4563,7 @@ bool config_unload_override(void)
|
||||||
* Might be useful for other devices as well? */
|
* Might be useful for other devices as well? */
|
||||||
if ( settings->bools.video_window_save_positions
|
if ( settings->bools.video_window_save_positions
|
||||||
&& !settings->bools.video_fullscreen)
|
&& !settings->bools.video_fullscreen)
|
||||||
settings->skip_window_positions = true;
|
settings->flags |= SETTINGS_FLG_SKIP_WINDOW_POSITIONS;
|
||||||
|
|
||||||
if (flags & RUNLOOP_FLAG_CORE_RUNNING)
|
if (flags & RUNLOOP_FLAG_CORE_RUNNING)
|
||||||
command_event(CMD_EVENT_REINIT, NULL);
|
command_event(CMD_EVENT_REINIT, NULL);
|
||||||
|
|
|
@ -40,31 +40,31 @@
|
||||||
|
|
||||||
#define configuration_set_float(settings, var, newvar) \
|
#define configuration_set_float(settings, var, newvar) \
|
||||||
{ \
|
{ \
|
||||||
settings->modified = true; \
|
settings->flags |= SETTINGS_FLG_MODIFIED; \
|
||||||
var = newvar; \
|
var = newvar; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define configuration_set_bool(settings, var, newvar) \
|
#define configuration_set_bool(settings, var, newvar) \
|
||||||
{ \
|
{ \
|
||||||
settings->modified = true; \
|
settings->flags |= SETTINGS_FLG_MODIFIED; \
|
||||||
var = newvar; \
|
var = newvar; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define configuration_set_uint(settings, var, newvar) \
|
#define configuration_set_uint(settings, var, newvar) \
|
||||||
{ \
|
{ \
|
||||||
settings->modified = true; \
|
settings->flags |= SETTINGS_FLG_MODIFIED; \
|
||||||
var = newvar; \
|
var = newvar; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define configuration_set_int(settings, var, newvar) \
|
#define configuration_set_int(settings, var, newvar) \
|
||||||
{ \
|
{ \
|
||||||
settings->modified = true; \
|
settings->flags |= SETTINGS_FLG_MODIFIED; \
|
||||||
var = newvar; \
|
var = newvar; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define configuration_set_string(settings, var, newvar) \
|
#define configuration_set_string(settings, var, newvar) \
|
||||||
{ \
|
{ \
|
||||||
settings->modified = true; \
|
settings->flags |= SETTINGS_FLG_MODIFIED; \
|
||||||
strlcpy(var, newvar, sizeof(var)); \
|
strlcpy(var, newvar, sizeof(var)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +88,12 @@ enum override_type
|
||||||
OVERRIDE_GAME
|
OVERRIDE_GAME
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum settings_glob_flags
|
||||||
|
{
|
||||||
|
SETTINGS_FLG_MODIFIED = (1 << 0),
|
||||||
|
SETTINGS_FLG_SKIP_WINDOW_POSITIONS = (1 << 1)
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct settings
|
typedef struct settings
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
|
@ -590,8 +596,6 @@ typedef struct settings
|
||||||
char app_icon[PATH_MAX_LENGTH];
|
char app_icon[PATH_MAX_LENGTH];
|
||||||
} paths;
|
} paths;
|
||||||
|
|
||||||
bool modified;
|
|
||||||
bool skip_window_positions;
|
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
@ -1089,6 +1093,8 @@ typedef struct settings
|
||||||
#endif
|
#endif
|
||||||
} bools;
|
} bools;
|
||||||
|
|
||||||
|
uint8_t flags;
|
||||||
|
|
||||||
} settings_t;
|
} settings_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -417,8 +417,8 @@ inline static int dxgi_compute_intersection_area(
|
||||||
int ax1, int ay1, int ax2, int ay2,
|
int ax1, int ay1, int ax2, int ay2,
|
||||||
int bx1, int by1, int bx2, int by2)
|
int bx1, int by1, int bx2, int by2)
|
||||||
{
|
{
|
||||||
return MAX(0, MIN(ax2, bx2) -
|
return MAX(0, MIN(ax2, bx2) -
|
||||||
MAX(ax1, bx1))
|
MAX(ax1, bx1))
|
||||||
* MAX(0, MIN(ay2, by2) - MAX(ay1, by1));
|
* MAX(0, MIN(ay2, by2) - MAX(ay1, by1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,10 +485,10 @@ bool dxgi_check_display_hdr_support(DXGIFactory1 factory, HWND hwnd)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
while ( dxgi_adapter->EnumOutputs(i, ¤t_output)
|
while ( dxgi_adapter->EnumOutputs(i, ¤t_output)
|
||||||
!= DXGI_ERROR_NOT_FOUND)
|
!= DXGI_ERROR_NOT_FOUND)
|
||||||
#else
|
#else
|
||||||
while ( dxgi_adapter->lpVtbl->EnumOutputs(dxgi_adapter, i, ¤t_output)
|
while ( dxgi_adapter->lpVtbl->EnumOutputs(dxgi_adapter, i, ¤t_output)
|
||||||
!= DXGI_ERROR_NOT_FOUND)
|
!= DXGI_ERROR_NOT_FOUND)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -506,10 +506,10 @@ bool dxgi_check_display_hdr_support(DXGIFactory1 factory, HWND hwnd)
|
||||||
ax1 = rect.left;
|
ax1 = rect.left;
|
||||||
ay1 = rect.top;
|
ay1 = rect.top;
|
||||||
ax2 = rect.right;
|
ax2 = rect.right;
|
||||||
ay2 = rect.bottom;
|
ay2 = rect.bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the rectangle bounds of current output */
|
/* Get the rectangle bounds of current output */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
if (FAILED(current_output->GetDesc(&desc)))
|
if (FAILED(current_output->GetDesc(&desc)))
|
||||||
#else
|
#else
|
||||||
|
@ -521,7 +521,7 @@ bool dxgi_check_display_hdr_support(DXGIFactory1 factory, HWND hwnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO/FIXME - DesktopCoordinates won't work for WinRT */
|
/* TODO/FIXME - DesktopCoordinates won't work for WinRT */
|
||||||
r = desc.DesktopCoordinates;
|
r = desc.DesktopCoordinates;
|
||||||
bx1 = r.left;
|
bx1 = r.left;
|
||||||
by1 = r.top;
|
by1 = r.top;
|
||||||
bx2 = r.right;
|
bx2 = r.right;
|
||||||
|
@ -567,9 +567,9 @@ bool dxgi_check_display_hdr_support(DXGIFactory1 factory, HWND hwnd)
|
||||||
video_driver_set_hdr_support();
|
video_driver_set_hdr_support();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
settings_t* settings = config_get_ptr();
|
settings_t* settings = config_get_ptr();
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
settings->bools.video_hdr_enable = false;
|
settings->bools.video_hdr_enable = false;
|
||||||
|
|
||||||
video_driver_unset_hdr_support();
|
video_driver_unset_hdr_support();
|
||||||
}
|
}
|
||||||
|
@ -614,14 +614,14 @@ void dxgi_swapchain_color_space(
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
if (SUCCEEDED(chain_handle->CheckColorSpaceSupport(
|
if (SUCCEEDED(chain_handle->CheckColorSpaceSupport(
|
||||||
color_space, &color_space_support))
|
color_space, &color_space_support))
|
||||||
&& ((color_space_support &
|
&& ((color_space_support &
|
||||||
DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT)
|
DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT)
|
||||||
== DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT))
|
== DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT))
|
||||||
#else
|
#else
|
||||||
if (SUCCEEDED(chain_handle->lpVtbl->CheckColorSpaceSupport(
|
if (SUCCEEDED(chain_handle->lpVtbl->CheckColorSpaceSupport(
|
||||||
chain_handle, color_space, &color_space_support))
|
chain_handle, color_space, &color_space_support))
|
||||||
&& ((color_space_support &
|
&& ((color_space_support &
|
||||||
DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT)
|
DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT)
|
||||||
== DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT))
|
== DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -656,16 +656,16 @@ void dxgi_set_hdr_metadata(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
static DXGI_HDR_METADATA_HDR10 g_hdr10_meta_data = {0};
|
static DXGI_HDR_METADATA_HDR10 g_hdr10_meta_data = {0};
|
||||||
static const display_chromaticities_t
|
static const display_chromaticities_t
|
||||||
display_chromaticity_list[] =
|
display_chromaticity_list[] =
|
||||||
{
|
{
|
||||||
{ 0.64000f, 0.33000f, 0.30000f, 0.60000f, 0.15000f, 0.06000f, 0.31270f, 0.32900f }, /* Rec709 */
|
{ 0.64000f, 0.33000f, 0.30000f, 0.60000f, 0.15000f, 0.06000f, 0.31270f, 0.32900f }, /* Rec709 */
|
||||||
{ 0.70800f, 0.29200f, 0.17000f, 0.79700f, 0.13100f, 0.04600f, 0.31270f, 0.32900f }, /* Rec2020 */
|
{ 0.70800f, 0.29200f, 0.17000f, 0.79700f, 0.13100f, 0.04600f, 0.31270f, 0.32900f }, /* Rec2020 */
|
||||||
};
|
};
|
||||||
const display_chromaticities_t* chroma = NULL;
|
const display_chromaticities_t* chroma = NULL;
|
||||||
DXGI_HDR_METADATA_HDR10 hdr10_meta_data = {0};
|
DXGI_HDR_METADATA_HDR10 hdr10_meta_data = {0};
|
||||||
int selected_chroma = 0;
|
int selected_chroma = 0;
|
||||||
|
|
||||||
if (!handle)
|
if (!handle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -687,8 +687,8 @@ void dxgi_set_hdr_metadata(
|
||||||
|
|
||||||
|
|
||||||
/* Now select the chromacity based on colour space */
|
/* Now select the chromacity based on colour space */
|
||||||
if ( chain_bit_depth == DXGI_SWAPCHAIN_BIT_DEPTH_10
|
if ( chain_bit_depth == DXGI_SWAPCHAIN_BIT_DEPTH_10
|
||||||
&& chain_color_space ==
|
&& chain_color_space ==
|
||||||
DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020)
|
DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020)
|
||||||
selected_chroma = 1;
|
selected_chroma = 1;
|
||||||
else
|
else
|
||||||
|
@ -709,29 +709,29 @@ void dxgi_set_hdr_metadata(
|
||||||
/* Set the HDR meta data */
|
/* Set the HDR meta data */
|
||||||
chroma =
|
chroma =
|
||||||
&display_chromaticity_list[selected_chroma];
|
&display_chromaticity_list[selected_chroma];
|
||||||
hdr10_meta_data.RedPrimary[0] =
|
hdr10_meta_data.RedPrimary[0] =
|
||||||
(UINT16)(chroma->red_x * 50000.0f);
|
(UINT16)(chroma->red_x * 50000.0f);
|
||||||
hdr10_meta_data.RedPrimary[1] =
|
hdr10_meta_data.RedPrimary[1] =
|
||||||
(UINT16)(chroma->red_y * 50000.0f);
|
(UINT16)(chroma->red_y * 50000.0f);
|
||||||
hdr10_meta_data.GreenPrimary[0] =
|
hdr10_meta_data.GreenPrimary[0] =
|
||||||
(UINT16)(chroma->green_x * 50000.0f);
|
(UINT16)(chroma->green_x * 50000.0f);
|
||||||
hdr10_meta_data.GreenPrimary[1] =
|
hdr10_meta_data.GreenPrimary[1] =
|
||||||
(UINT16)(chroma->green_y * 50000.0f);
|
(UINT16)(chroma->green_y * 50000.0f);
|
||||||
hdr10_meta_data.BluePrimary[0] =
|
hdr10_meta_data.BluePrimary[0] =
|
||||||
(UINT16)(chroma->blue_x * 50000.0f);
|
(UINT16)(chroma->blue_x * 50000.0f);
|
||||||
hdr10_meta_data.BluePrimary[1] =
|
hdr10_meta_data.BluePrimary[1] =
|
||||||
(UINT16)(chroma->blue_y * 50000.0f);
|
(UINT16)(chroma->blue_y * 50000.0f);
|
||||||
hdr10_meta_data.WhitePoint[0] =
|
hdr10_meta_data.WhitePoint[0] =
|
||||||
(UINT16)(chroma->white_x * 50000.0f);
|
(UINT16)(chroma->white_x * 50000.0f);
|
||||||
hdr10_meta_data.WhitePoint[1] =
|
hdr10_meta_data.WhitePoint[1] =
|
||||||
(UINT16)(chroma->white_y * 50000.0f);
|
(UINT16)(chroma->white_y * 50000.0f);
|
||||||
hdr10_meta_data.MaxMasteringLuminance =
|
hdr10_meta_data.MaxMasteringLuminance =
|
||||||
(UINT)(max_output_nits * 10000.0f);
|
(UINT)(max_output_nits * 10000.0f);
|
||||||
hdr10_meta_data.MinMasteringLuminance =
|
hdr10_meta_data.MinMasteringLuminance =
|
||||||
(UINT)(min_output_nits * 10000.0f);
|
(UINT)(min_output_nits * 10000.0f);
|
||||||
hdr10_meta_data.MaxContentLightLevel =
|
hdr10_meta_data.MaxContentLightLevel =
|
||||||
(UINT16)(max_cll);
|
(UINT16)(max_cll);
|
||||||
hdr10_meta_data.MaxFrameAverageLightLevel =
|
hdr10_meta_data.MaxFrameAverageLightLevel =
|
||||||
(UINT16)(max_fall);
|
(UINT16)(max_fall);
|
||||||
|
|
||||||
if (g_hdr10_meta_data.RedPrimary != hdr10_meta_data.RedPrimary ||
|
if (g_hdr10_meta_data.RedPrimary != hdr10_meta_data.RedPrimary ||
|
||||||
|
|
|
@ -877,12 +877,12 @@ static void win32_save_position(void)
|
||||||
placement.rcNormalPosition.right = 0;
|
placement.rcNormalPosition.right = 0;
|
||||||
placement.rcNormalPosition.bottom = 0;
|
placement.rcNormalPosition.bottom = 0;
|
||||||
|
|
||||||
/* If 'skip_window_positions' is true it means we've
|
/* If SETTINGS_FLG_SKIP_WINDOW_POSITIONS is set, it means we've
|
||||||
* just unloaded an override that had fullscreen mode
|
* just unloaded an override that had fullscreen mode
|
||||||
* enabled while we have windowed mode set globally,
|
* enabled while we have windowed mode set globally,
|
||||||
* in this case we skip the following blocks to not
|
* in this case we skip the following blocks to not
|
||||||
* end up with fullscreen size and position. */
|
* end up with fullscreen size and position. */
|
||||||
if (!settings->skip_window_positions)
|
if (!(settings->flags & SETTINGS_FLG_SKIP_WINDOW_POSITIONS))
|
||||||
{
|
{
|
||||||
if (GetWindowPlacement(main_window.hwnd, &placement))
|
if (GetWindowPlacement(main_window.hwnd, &placement))
|
||||||
{
|
{
|
||||||
|
@ -897,7 +897,7 @@ static void win32_save_position(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
settings->skip_window_positions = false;
|
settings->flags &= ~SETTINGS_FLG_SKIP_WINDOW_POSITIONS;
|
||||||
|
|
||||||
if (window_save_positions)
|
if (window_save_positions)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7343,7 +7343,8 @@ static int action_ok_push_dropdown_item_input_select_reserved_device(const char
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
settings->modified = true;
|
|
||||||
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
|
|
||||||
command_event(CMD_EVENT_REINIT, NULL);
|
command_event(CMD_EVENT_REINIT, NULL);
|
||||||
|
|
||||||
|
@ -7401,7 +7402,7 @@ static int action_ok_push_dropdown_item_input_select_physical_keyboard(const cha
|
||||||
* now or already working as the physical keyboard.
|
* now or already working as the physical keyboard.
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
|
|
||||||
command_event(CMD_EVENT_REINIT, NULL);
|
command_event(CMD_EVENT_REINIT, NULL);
|
||||||
|
|
||||||
|
|
|
@ -1050,8 +1050,8 @@ static int setting_generic_action_ok_default(
|
||||||
|
|
||||||
void setting_generic_handle_change(rarch_setting_t *setting)
|
void setting_generic_handle_change(rarch_setting_t *setting)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
|
|
||||||
if (setting->change_handler)
|
if (setting->change_handler)
|
||||||
setting->change_handler(setting);
|
setting->change_handler(setting);
|
||||||
|
@ -5766,7 +5766,7 @@ static int setting_action_left_input_device_index(
|
||||||
else
|
else
|
||||||
*p = MAX_INPUT_DEVICES - 1;
|
*p = MAX_INPUT_DEVICES - 1;
|
||||||
|
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5786,7 +5786,7 @@ static int setting_action_left_input_device_reservation_type(
|
||||||
else
|
else
|
||||||
*p = INPUT_DEVICE_RESERVATION_LAST - 1;
|
*p = INPUT_DEVICE_RESERVATION_LAST - 1;
|
||||||
|
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5807,7 +5807,7 @@ static int setting_action_left_input_mouse_index(
|
||||||
else
|
else
|
||||||
*p = MAX_INPUT_DEVICES - 1;
|
*p = MAX_INPUT_DEVICES - 1;
|
||||||
|
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7962,7 +7962,7 @@ static int setting_action_right_analog_dpad_mode(
|
||||||
|
|
||||||
port = setting->index_offset;
|
port = setting->index_offset;
|
||||||
|
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
settings->uints.input_analog_dpad_mode[port] =
|
settings->uints.input_analog_dpad_mode[port] =
|
||||||
(settings->uints.input_analog_dpad_mode[port] + 1)
|
(settings->uints.input_analog_dpad_mode[port] + 1)
|
||||||
% ANALOG_DPAD_LAST;
|
% ANALOG_DPAD_LAST;
|
||||||
|
@ -8056,7 +8056,7 @@ static int setting_action_right_input_device_index(
|
||||||
else
|
else
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8076,7 +8076,7 @@ static int setting_action_right_input_device_reservation_type(
|
||||||
else
|
else
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8096,7 +8096,7 @@ static int setting_action_right_input_mouse_index(
|
||||||
else
|
else
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8644,23 +8644,23 @@ static void general_write_handler(rarch_setting_t *setting)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case MENU_ENUM_LABEL_VIDEO_SCALE:
|
case MENU_ENUM_LABEL_VIDEO_SCALE:
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
settings->uints.video_scale = *setting->value.target.unsigned_integer;
|
settings->uints.video_scale = *setting->value.target.unsigned_integer;
|
||||||
|
|
||||||
if (!settings->bools.video_fullscreen)
|
if (!settings->bools.video_fullscreen)
|
||||||
rarch_cmd = CMD_EVENT_REINIT;
|
rarch_cmd = CMD_EVENT_REINIT;
|
||||||
break;
|
break;
|
||||||
case MENU_ENUM_LABEL_VIDEO_HDR_ENABLE:
|
case MENU_ENUM_LABEL_VIDEO_HDR_ENABLE:
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
settings->bools.video_hdr_enable = *setting->value.target.boolean;
|
settings->bools.video_hdr_enable = *setting->value.target.boolean;
|
||||||
|
|
||||||
rarch_cmd = CMD_EVENT_REINIT;
|
rarch_cmd = CMD_EVENT_REINIT;
|
||||||
break;
|
break;
|
||||||
case MENU_ENUM_LABEL_VIDEO_HDR_MAX_NITS:
|
case MENU_ENUM_LABEL_VIDEO_HDR_MAX_NITS:
|
||||||
{
|
{
|
||||||
video_driver_state_t *video_st = video_state_get_ptr();
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
settings->floats.video_hdr_max_nits = roundf(*setting->value.target.fraction);
|
settings->floats.video_hdr_max_nits = roundf(*setting->value.target.fraction);
|
||||||
|
|
||||||
if (video_st && video_st->poke && video_st->poke->set_hdr_max_nits)
|
if (video_st && video_st->poke && video_st->poke->set_hdr_max_nits)
|
||||||
video_st->poke->set_hdr_max_nits(video_st->data, settings->floats.video_hdr_max_nits);
|
video_st->poke->set_hdr_max_nits(video_st->data, settings->floats.video_hdr_max_nits);
|
||||||
|
@ -8668,10 +8668,10 @@ static void general_write_handler(rarch_setting_t *setting)
|
||||||
break;
|
break;
|
||||||
case MENU_ENUM_LABEL_VIDEO_HDR_PAPER_WHITE_NITS:
|
case MENU_ENUM_LABEL_VIDEO_HDR_PAPER_WHITE_NITS:
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
video_driver_state_t *video_st = video_state_get_ptr();
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
settings->floats.video_hdr_paper_white_nits = roundf(*setting->value.target.fraction);
|
settings->floats.video_hdr_paper_white_nits = roundf(*setting->value.target.fraction);
|
||||||
|
|
||||||
|
|
||||||
if (video_st && video_st->poke && video_st->poke->set_hdr_paper_white_nits)
|
if (video_st && video_st->poke && video_st->poke->set_hdr_paper_white_nits)
|
||||||
|
@ -8680,9 +8680,9 @@ static void general_write_handler(rarch_setting_t *setting)
|
||||||
break;
|
break;
|
||||||
case MENU_ENUM_LABEL_VIDEO_HDR_CONTRAST:
|
case MENU_ENUM_LABEL_VIDEO_HDR_CONTRAST:
|
||||||
{
|
{
|
||||||
video_driver_state_t *video_st = video_state_get_ptr();
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
settings->floats.video_hdr_display_contrast = *setting->value.target.fraction;
|
settings->floats.video_hdr_display_contrast = *setting->value.target.fraction;
|
||||||
|
|
||||||
if (video_st && video_st->poke && video_st->poke->set_hdr_contrast)
|
if (video_st && video_st->poke && video_st->poke->set_hdr_contrast)
|
||||||
video_st->poke->set_hdr_contrast(video_st->data, VIDEO_HDR_MAX_CONTRAST - settings->floats.video_hdr_display_contrast);
|
video_st->poke->set_hdr_contrast(video_st->data, VIDEO_HDR_MAX_CONTRAST - settings->floats.video_hdr_display_contrast);
|
||||||
|
@ -8690,9 +8690,9 @@ static void general_write_handler(rarch_setting_t *setting)
|
||||||
break;
|
break;
|
||||||
case MENU_ENUM_LABEL_VIDEO_HDR_EXPAND_GAMUT:
|
case MENU_ENUM_LABEL_VIDEO_HDR_EXPAND_GAMUT:
|
||||||
{
|
{
|
||||||
video_driver_state_t *video_st = video_state_get_ptr();
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
settings->bools.video_hdr_expand_gamut = *setting->value.target.boolean;
|
settings->bools.video_hdr_expand_gamut = *setting->value.target.boolean;
|
||||||
|
|
||||||
if (video_st && video_st->poke && video_st->poke->set_hdr_expand_gamut)
|
if (video_st && video_st->poke && video_st->poke->set_hdr_expand_gamut)
|
||||||
video_st->poke->set_hdr_expand_gamut(video_st->data, settings->bools.video_hdr_expand_gamut);
|
video_st->poke->set_hdr_expand_gamut(video_st->data, settings->bools.video_hdr_expand_gamut);
|
||||||
|
@ -8703,7 +8703,7 @@ static void general_write_handler(rarch_setting_t *setting)
|
||||||
break;
|
break;
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
case MENU_ENUM_LABEL_INPUT_SELECT_PHYSICAL_KEYBOARD:
|
case MENU_ENUM_LABEL_INPUT_SELECT_PHYSICAL_KEYBOARD:
|
||||||
settings->modified = true;
|
settings->flags |= SETTINGS_FLG_MODIFIED;
|
||||||
strlcpy(settings->arrays.input_android_physical_keyboard, setting->value.target.string, sizeof(settings->arrays.input_android_physical_keyboard));
|
strlcpy(settings->arrays.input_android_physical_keyboard, setting->value.target.string, sizeof(settings->arrays.input_android_physical_keyboard));
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue