mirror of
https://github.com/libretro/RetroArch
synced 2025-03-22 07:21:15 +00:00
Cleanup
This commit is contained in:
parent
142503d3b5
commit
a67896ab2b
@ -500,9 +500,10 @@ bool win32_load_content_from_gui(const char *szFilename)
|
|||||||
{
|
{
|
||||||
bool okay = false;
|
bool okay = false;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
bool video_is_fs = settings->bools.video_fullscreen;
|
||||||
|
|
||||||
/* Fullscreen: Show mouse cursor for dialog */
|
/* Fullscreen: Show mouse cursor for dialog */
|
||||||
if (settings->bools.video_fullscreen)
|
if (video_is_fs)
|
||||||
video_driver_show_mouse();
|
video_driver_show_mouse();
|
||||||
|
|
||||||
/* Pick one core that could be compatible, ew */
|
/* Pick one core that could be compatible, ew */
|
||||||
@ -515,7 +516,7 @@ bool win32_load_content_from_gui(const char *szFilename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Fullscreen: Hide mouse cursor after dialog */
|
/* Fullscreen: Hide mouse cursor after dialog */
|
||||||
if (settings->bools.video_fullscreen)
|
if (video_is_fs)
|
||||||
video_driver_hide_mouse();
|
video_driver_hide_mouse();
|
||||||
return okay;
|
return okay;
|
||||||
}
|
}
|
||||||
@ -658,16 +659,15 @@ static bool win32_browser(
|
|||||||
|
|
||||||
static LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
static LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
||||||
{
|
{
|
||||||
WPARAM mode = wparam & 0xffff;
|
WPARAM mode = wparam & 0xffff;
|
||||||
enum event_command cmd = CMD_EVENT_NONE;
|
enum event_command cmd = CMD_EVENT_NONE;
|
||||||
bool do_wm_close = false;
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case ID_M_LOAD_CORE:
|
case ID_M_LOAD_CORE:
|
||||||
{
|
{
|
||||||
char win32_file[PATH_MAX_LENGTH] = {0};
|
char win32_file[PATH_MAX_LENGTH] = {0};
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
char *title_cp = NULL;
|
char *title_cp = NULL;
|
||||||
size_t converted = 0;
|
size_t converted = 0;
|
||||||
const char *extensions = "Libretro core (.dll)\0*.dll\0All Files\0*.*\0\0";
|
const char *extensions = "Libretro core (.dll)\0*.dll\0All Files\0*.*\0\0";
|
||||||
@ -711,6 +711,7 @@ static LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
|||||||
const char *extensions = "All Files (*.*)\0*.*\0\0";
|
const char *extensions = "All Files (*.*)\0*.*\0\0";
|
||||||
const char *title = msg_hash_to_str(
|
const char *title = msg_hash_to_str(
|
||||||
MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST);
|
MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST);
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
const char *initial_dir = settings->paths.directory_menu_content;
|
const char *initial_dir = settings->paths.directory_menu_content;
|
||||||
|
|
||||||
/* Convert UTF8 to UTF16, then back to the
|
/* Convert UTF8 to UTF16, then back to the
|
||||||
@ -778,30 +779,33 @@ static LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
|||||||
cmd = CMD_EVENT_TAKE_SCREENSHOT;
|
cmd = CMD_EVENT_TAKE_SCREENSHOT;
|
||||||
break;
|
break;
|
||||||
case ID_M_QUIT:
|
case ID_M_QUIT:
|
||||||
do_wm_close = true;
|
PostMessage(owner, WM_CLOSE, 0, 0);
|
||||||
break;
|
break;
|
||||||
case ID_M_TOGGLE_DESKTOP:
|
case ID_M_TOGGLE_DESKTOP:
|
||||||
cmd = CMD_EVENT_UI_COMPANION_TOGGLE;
|
cmd = CMD_EVENT_UI_COMPANION_TOGGLE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (mode >= ID_M_WINDOW_SCALE_1X && mode <= ID_M_WINDOW_SCALE_10X)
|
|
||||||
{
|
{
|
||||||
unsigned idx = (mode - (ID_M_WINDOW_SCALE_1X-1));
|
settings_t *settings = config_get_ptr();
|
||||||
rarch_ctl(RARCH_CTL_SET_WINDOWED_SCALE, &idx);
|
if (mode >= ID_M_WINDOW_SCALE_1X && mode <= ID_M_WINDOW_SCALE_10X)
|
||||||
cmd = CMD_EVENT_RESIZE_WINDOWED_SCALE;
|
{
|
||||||
}
|
unsigned idx = (mode - (ID_M_WINDOW_SCALE_1X-1));
|
||||||
else if (mode == ID_M_STATE_INDEX_AUTO)
|
rarch_ctl(RARCH_CTL_SET_WINDOWED_SCALE, &idx);
|
||||||
{
|
cmd = CMD_EVENT_RESIZE_WINDOWED_SCALE;
|
||||||
signed idx = -1;
|
}
|
||||||
configuration_set_int(
|
else if (mode == ID_M_STATE_INDEX_AUTO)
|
||||||
settings, settings->ints.state_slot, idx);
|
{
|
||||||
}
|
signed idx = -1;
|
||||||
else if (mode >= (ID_M_STATE_INDEX_AUTO+1)
|
configuration_set_int(
|
||||||
&& mode <= (ID_M_STATE_INDEX_AUTO+10))
|
settings, settings->ints.state_slot, idx);
|
||||||
{
|
}
|
||||||
signed idx = (mode - (ID_M_STATE_INDEX_AUTO+1));
|
else if (mode >= (ID_M_STATE_INDEX_AUTO+1)
|
||||||
configuration_set_int(
|
&& mode <= (ID_M_STATE_INDEX_AUTO+10))
|
||||||
settings, settings->ints.state_slot, idx);
|
{
|
||||||
|
signed idx = (mode - (ID_M_STATE_INDEX_AUTO+1));
|
||||||
|
configuration_set_int(
|
||||||
|
settings, settings->ints.state_slot, idx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -809,9 +813,6 @@ static LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
|
|||||||
if (cmd != CMD_EVENT_NONE)
|
if (cmd != CMD_EVENT_NONE)
|
||||||
command_event(cmd, NULL);
|
command_event(cmd, NULL);
|
||||||
|
|
||||||
if (do_wm_close)
|
|
||||||
PostMessage(owner, WM_CLOSE, 0, 0);
|
|
||||||
|
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -890,7 +891,8 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
|||||||
mod |= RETROKMOD_META;
|
mod |= RETROKMOD_META;
|
||||||
|
|
||||||
#if _WIN32_WINNT >= 0x0501 /* XP */
|
#if _WIN32_WINNT >= 0x0501 /* XP */
|
||||||
if (settings && string_is_equal(settings->arrays.input_driver, "raw"))
|
if (settings &&
|
||||||
|
string_is_equal(settings->arrays.input_driver, "raw"))
|
||||||
keysym = (unsigned)wparam;
|
keysym = (unsigned)wparam;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user