This commit is contained in:
twinaphex 2018-01-08 23:30:07 +01:00
parent 7fdb621481
commit aa641325cb
1 changed files with 31 additions and 29 deletions

View File

@ -816,7 +816,8 @@ bool win32_window_create(void *data, unsigned style,
SetWindowLongPtr(main_window.hwnd,
GWL_EXSTYLE,
GetWindowLongPtr(main_window.hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
SetLayeredWindowAttributes(main_window.hwnd, 0, (255 * settings->uints.video_window_opacity) / 100, LWA_ALPHA);
SetLayeredWindowAttributes(main_window.hwnd, 0, (255 *
settings->uints.video_window_opacity) / 100, LWA_ALPHA);
#endif
#endif
return true;
@ -998,8 +999,9 @@ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use,
RECT *rect, RECT *mon_rect, DWORD *style)
{
#ifndef _XBOX
if (fullscreen)
{
settings_t *settings = config_get_ptr();
/* Windows only reports the refresh rates for modelines as
* an integer, so video_refresh_rate needs to be rounded. Also, account
* for black frame insertion using video_refresh_rate set to half
@ -1008,8 +1010,6 @@ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use,
unsigned refresh = roundf(settings->floats.video_refresh_rate
* refresh_mod * settings->uints.video_swap_interval);
if (fullscreen)
{
if (windowed_full)
{
*style = WS_EX_TOPMOST | WS_POPUP;
@ -1034,7 +1034,9 @@ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use,
*style = WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
rect->right = *width;
rect->bottom = *height;
AdjustWindowRect(rect, *style, FALSE);
g_resize_width = *width = rect->right - rect->left;
g_resize_height = *height = rect->bottom - rect->top;
}
@ -1207,7 +1209,7 @@ void win32_get_video_output_prev(
unsigned *width, unsigned *height)
{
DEVMODE dm;
int iModeNum;
unsigned i;
bool found = false;
unsigned prev_width = 0;
unsigned prev_height = 0;
@ -1220,9 +1222,9 @@ void win32_get_video_output_prev(
win32_get_video_output_size(&curr_width, &curr_height);
for (iModeNum = 0;
EnumDisplaySettings(NULL, iModeNum, &dm) != 0;
iModeNum++)
for (i = 0;
EnumDisplaySettings(NULL, i, &dm) != 0;
i++)
{
if ( dm.dmPelsWidth == curr_width
&& dm.dmPelsHeight == curr_height)
@ -1250,7 +1252,7 @@ void win32_get_video_output_next(
unsigned *width, unsigned *height)
{
DEVMODE dm;
int iModeNum;
int i;
bool found = false;
unsigned curr_width = 0;
unsigned curr_height = 0;
@ -1260,9 +1262,9 @@ void win32_get_video_output_next(
win32_get_video_output_size(&curr_width, &curr_height);
for (iModeNum = 0;
EnumDisplaySettings(NULL, iModeNum, &dm) != 0;
iModeNum++)
for (i = 0;
EnumDisplaySettings(NULL, i, &dm) != 0;
i++)
{
if (found)
{