mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-09 03:29:43 -10:00
video: the output size travels as one word, in and out
video_driver_get_output_dims() hands back the word the state already holds and video_driver_set_output_dims() takes one, so a reader gets a coherent pair from a single atomic load rather than two halves split out of it. VIDEO_DRIVER_OUTPUT_WIDTH/HEIGHT were aliases for VIDEO_SCALE_W/H and go with them. The window check hands its size back the same way: check_window on the context-driver vtable, win32_check_window and x11_check_window each take one unsigned* where they took two, and a driver passes the field itself - d3d10, d3d11 and d3d12 give &d3dN->vp.full_dims straight to win32_check_window. The drivers' own size locals travel packed alongside, and the runloop's two aspect checks compare one word against the size they last laid out for.
This commit is contained in:
1 parent
9383fe9628
commit
dc44cc7b0a
80 files changed
+388
-407
No files matched your search
@@ -2933,13 +2933,13 @@ void command_event_reinit(const int flags)
|
||||
* premature render). */
|
||||
if (menu_st->flags & MENU_ST_FLAG_ALIVE)
|
||||
{
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
if ( menu_st->driver_ctx
|
||||
&& menu_st->driver_ctx->render)
|
||||
menu_st->driver_ctx->render(
|
||||
menu_st->userdata,
|
||||
VIDEO_DRIVER_OUTPUT_WIDTH(output_size),
|
||||
VIDEO_DRIVER_OUTPUT_HEIGHT(output_size),
|
||||
VIDEO_SCALE_W(output_size),
|
||||
VIDEO_SCALE_H(output_size),
|
||||
false);
|
||||
|
||||
if ( video_st->poke
|
||||
|
||||
@@ -339,7 +339,7 @@ void d3d9_make_d3dpp(d3d9_video_t *d3d,
|
||||
unsigned width = 0;
|
||||
unsigned height = 0;
|
||||
d3d9_get_video_size(d3d, &width, &height);
|
||||
video_driver_set_output_size(width, height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(width, height));
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(width, height);
|
||||
d3dpp->BackBufferWidth = width;
|
||||
d3dpp->BackBufferHeight = height;
|
||||
|
||||
@@ -127,7 +127,7 @@ typedef struct gdi
|
||||
unsigned frame_height;
|
||||
unsigned screen_width;
|
||||
unsigned screen_height;
|
||||
/* Surface (window) size last published via video_driver_set_output_size,
|
||||
/* Surface (window) size last published via video_driver_set_output_dims,
|
||||
* tracked here so gdi_alive can read it without locking. */
|
||||
unsigned full_width;
|
||||
unsigned full_height;
|
||||
|
||||
@@ -494,7 +494,7 @@ bool sdl3_ctx_has_focus(void *data)
|
||||
}
|
||||
|
||||
void sdl3_ctx_check_window(void *data, bool *quit, bool *resize,
|
||||
unsigned *width, unsigned *height)
|
||||
unsigned *dims)
|
||||
{
|
||||
SDL_Window *win = sdl3_ctx_window(data);
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ float sdl3_ctx_get_refresh_rate(void *data);
|
||||
void sdl3_ctx_update_title(void *data);
|
||||
bool sdl3_ctx_has_focus(void *data);
|
||||
void sdl3_ctx_check_window(void *data, bool *quit, bool *resize,
|
||||
unsigned *width, unsigned *height);
|
||||
unsigned *dims);
|
||||
|
||||
/* Retrieve the DISPLAY_METRIC_DPI for the window's display scale.
|
||||
* This usually ends up being scale * 96 DPI, or false otherwise. */
|
||||
|
||||
@@ -1527,7 +1527,7 @@ bool gfx_ctx_wl_has_focus(void *data)
|
||||
|
||||
void gfx_ctx_wl_check_window_common(gfx_ctx_wayland_data_t *wl,
|
||||
void (*get_video_size)(void*, unsigned*, unsigned*), bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
/* this function works with SCALED sizes, it's used from the renderer */
|
||||
unsigned new_width, new_height;
|
||||
@@ -1538,13 +1538,11 @@ void gfx_ctx_wl_check_window_common(gfx_ctx_wayland_data_t *wl,
|
||||
|
||||
if ( wl->pending_buffer_scale != wl->buffer_scale
|
||||
|| wl->pending_fractional_scale_num != wl->fractional_scale_num
|
||||
|| new_width != *width
|
||||
|| new_height != *height)
|
||||
|| VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
wl->buffer_scale = wl->pending_buffer_scale;
|
||||
wl->fractional_scale_num = wl->pending_fractional_scale_num;
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,4 +55,4 @@ bool gfx_ctx_wl_has_focus(void *data);
|
||||
|
||||
void gfx_ctx_wl_check_window_common(gfx_ctx_wayland_data_t *wl,
|
||||
void (*get_video_size)(void*, unsigned*, unsigned*), bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height);
|
||||
bool *resize, unsigned *dims);
|
||||
@@ -1941,7 +1941,7 @@ void win32_show_cursor(void *data, bool state)
|
||||
|
||||
void win32_check_window(void *data,
|
||||
bool *quit, bool *resize,
|
||||
unsigned *width, unsigned *height)
|
||||
unsigned *dims)
|
||||
{
|
||||
bool video_is_threaded = video_driver_is_threaded();
|
||||
if (video_is_threaded)
|
||||
@@ -1951,8 +1951,7 @@ void win32_check_window(void *data,
|
||||
if (g_win32_flags & WIN32_CMN_FLAG_RESIZED)
|
||||
{
|
||||
*resize = true;
|
||||
*width = g_win32_resize_width;
|
||||
*height = g_win32_resize_height;
|
||||
*dims = VIDEO_SCALE_PACK(g_win32_resize_width, g_win32_resize_height);
|
||||
g_win32_flags &= ~WIN32_CMN_FLAG_RESIZED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ bool win32_hotplug_due(void);
|
||||
|
||||
void win32_check_window(void *data,
|
||||
bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height);
|
||||
bool *resize, unsigned *dims);
|
||||
|
||||
void win32_set_window(unsigned *width, unsigned *height,
|
||||
bool fullscreen, bool windowed_full, void *rect_data);
|
||||
|
||||
@@ -783,17 +783,16 @@ bool x11_alive(void *data)
|
||||
}
|
||||
|
||||
void x11_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width = *width;
|
||||
unsigned new_height = *height;
|
||||
unsigned new_width = VIDEO_SCALE_W(*dims);
|
||||
unsigned new_height = VIDEO_SCALE_H(*dims);
|
||||
|
||||
x11_get_video_size(data, &new_width, &new_height);
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ void x11_exit_fullscreen(Display *dpy);
|
||||
#endif
|
||||
|
||||
void x11_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height);
|
||||
bool *resize, unsigned *dims);
|
||||
|
||||
void x11_get_video_size(void *data, unsigned *width, unsigned *height);
|
||||
|
||||
|
||||
@@ -198,13 +198,11 @@ static void caca_create(caca_t *caca)
|
||||
0xF800, 0x7E0, 0x1F, 0x0);
|
||||
|
||||
/* Publish the canvas (terminal grid) size as the surface size,
|
||||
* not the core's frame size. video_driver_set_output_size feeds the
|
||||
* not the core's frame size. video_driver_set_output_dims feeds the
|
||||
* value used by menu drivers, the CRT switcher and the input
|
||||
* subsystem to size their output; passing the core's frame
|
||||
* dimensions instead would lie to all of them. */
|
||||
video_driver_set_output_size(
|
||||
caca_get_canvas_width(caca->cv),
|
||||
caca_get_canvas_height(caca->cv));
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(caca_get_canvas_width(caca->cv), caca_get_canvas_height(caca->cv)));
|
||||
}
|
||||
|
||||
static void *caca_init(const video_info_t *video,
|
||||
@@ -327,9 +325,7 @@ static bool caca_alive(void *data)
|
||||
{
|
||||
caca_t *caca = (caca_t*)data;
|
||||
/* Canvas size, not core frame size -- see comment in caca_create. */
|
||||
video_driver_set_output_size(
|
||||
caca_get_canvas_width(caca->cv),
|
||||
caca_get_canvas_height(caca->cv));
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(caca_get_canvas_width(caca->cv), caca_get_canvas_height(caca->cv)));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1702,7 +1702,7 @@ static void* ctr_init(const video_info_t* video,
|
||||
CTR_TOP_FRAMEBUFFER_HEIGHT);
|
||||
ctr->vp.full_dims = VIDEO_SCALE_PACK(CTR_TOP_FRAMEBUFFER_WIDTH,
|
||||
CTR_TOP_FRAMEBUFFER_HEIGHT);
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(ctr->vp.dims), VIDEO_SCALE_H(ctr->vp.dims));
|
||||
video_driver_set_output_dims(ctr->vp.dims);
|
||||
|
||||
ctr->drawbuffers.top.left = vramAlloc(CTR_TOP_FRAMEBUFFER_WIDTH * CTR_TOP_FRAMEBUFFER_HEIGHT * 2 * sizeof(uint32_t));
|
||||
ctr->drawbuffers.top.right = (void*)((uint32_t*)ctr->drawbuffers.top.left + CTR_TOP_FRAMEBUFFER_WIDTH * CTR_TOP_FRAMEBUFFER_HEIGHT);
|
||||
|
||||
+4
-9
@@ -2402,7 +2402,7 @@ static void *d3d10_gfx_init(const video_info_t* video,
|
||||
d3d10->device->lpVtbl->OMSetRenderTargets(d3d10->device, 1,
|
||||
&d3d10->renderTargetView, NULL);
|
||||
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(d3d10->vp.full_dims), VIDEO_SCALE_H(d3d10->vp.full_dims));
|
||||
video_driver_set_output_dims(d3d10->vp.full_dims);
|
||||
d3d10->viewport.Width = VIDEO_SCALE_W(d3d10->vp.full_dims);
|
||||
d3d10->viewport.Height = VIDEO_SCALE_H(d3d10->vp.full_dims);
|
||||
d3d10->flags |= D3D10_ST_FLAG_RESIZE_VIEWPORT;
|
||||
@@ -2960,7 +2960,7 @@ static bool d3d10_gfx_frame(
|
||||
d3d10->flags &= ~D3D10_ST_FLAG_RESIZE_CHAIN;
|
||||
d3d10->flags |= D3D10_ST_FLAG_RESIZE_VIEWPORT;
|
||||
|
||||
video_driver_set_output_size(video_width, video_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(video_width, video_height));
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -3551,12 +3551,7 @@ static bool d3d10_gfx_alive(void* data)
|
||||
bool resize_chain = false;
|
||||
d3d10_video_t* d3d10 = (d3d10_video_t*)data;
|
||||
|
||||
unsigned full_w = VIDEO_SCALE_W(d3d10->vp.full_dims);
|
||||
unsigned full_h = VIDEO_SCALE_H(d3d10->vp.full_dims);
|
||||
|
||||
win32_check_window(NULL, &quit, &resize_chain, &full_w, &full_h);
|
||||
|
||||
d3d10->vp.full_dims = VIDEO_SCALE_PACK(full_w, full_h);
|
||||
win32_check_window(NULL, &quit, &resize_chain, &d3d10->vp.full_dims);
|
||||
|
||||
if (resize_chain)
|
||||
d3d10->flags |= D3D10_ST_FLAG_RESIZE_CHAIN;
|
||||
@@ -3566,7 +3561,7 @@ static bool d3d10_gfx_alive(void* data)
|
||||
if ( (d3d10->flags & D3D10_ST_FLAG_RESIZE_CHAIN)
|
||||
&& (VIDEO_SCALE_W(d3d10->vp.full_dims) != 0)
|
||||
&& (VIDEO_SCALE_H(d3d10->vp.full_dims) != 0))
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(d3d10->vp.full_dims), VIDEO_SCALE_H(d3d10->vp.full_dims));
|
||||
video_driver_set_output_dims(d3d10->vp.full_dims);
|
||||
|
||||
return !quit;
|
||||
}
|
||||
|
||||
+4
-9
@@ -3681,7 +3681,7 @@ static void *d3d11_gfx_init(const video_info_t* video,
|
||||
|
||||
matrix_4x4_identity(d3d11->identity);
|
||||
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(d3d11->vp.full_dims), VIDEO_SCALE_H(d3d11->vp.full_dims));
|
||||
video_driver_set_output_dims(d3d11->vp.full_dims);
|
||||
d3d11->viewport.Width = VIDEO_SCALE_W(d3d11->vp.full_dims);
|
||||
d3d11->viewport.Height = VIDEO_SCALE_H(d3d11->vp.full_dims);
|
||||
d3d11->scissor.right = VIDEO_SCALE_W(d3d11->vp.full_dims);
|
||||
@@ -4910,7 +4910,7 @@ static bool d3d11_gfx_frame_body(
|
||||
d3d11->flags &= ~D3D11_ST_FLAG_RESIZE_CHAIN;
|
||||
d3d11->flags |= D3D11_ST_FLAG_RESIZE_VIEWPORT;
|
||||
|
||||
video_driver_set_output_size(video_width, video_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(video_width, video_height));
|
||||
|
||||
#ifdef HAVE_DXGI_HDR
|
||||
#ifdef __WINRT__
|
||||
@@ -6034,12 +6034,7 @@ static bool d3d11_gfx_alive(void* data)
|
||||
bool resize_chain = false;
|
||||
d3d11_video_t* d3d11 = (d3d11_video_t*)data;
|
||||
|
||||
unsigned full_w = VIDEO_SCALE_W(d3d11->vp.full_dims);
|
||||
unsigned full_h = VIDEO_SCALE_H(d3d11->vp.full_dims);
|
||||
|
||||
win32_check_window(NULL, &quit, &resize_chain, &full_w, &full_h);
|
||||
|
||||
d3d11->vp.full_dims = VIDEO_SCALE_PACK(full_w, full_h);
|
||||
win32_check_window(NULL, &quit, &resize_chain, &d3d11->vp.full_dims);
|
||||
|
||||
if (resize_chain)
|
||||
d3d11->flags |= D3D11_ST_FLAG_RESIZE_CHAIN;
|
||||
@@ -6049,7 +6044,7 @@ static bool d3d11_gfx_alive(void* data)
|
||||
if ( (d3d11->flags & D3D11_ST_FLAG_RESIZE_CHAIN)
|
||||
&& (VIDEO_SCALE_W(d3d11->vp.full_dims) != 0)
|
||||
&& (VIDEO_SCALE_H(d3d11->vp.full_dims) != 0))
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(d3d11->vp.full_dims), VIDEO_SCALE_H(d3d11->vp.full_dims));
|
||||
video_driver_set_output_dims(d3d11->vp.full_dims);
|
||||
|
||||
return !quit;
|
||||
}
|
||||
|
||||
+4
-9
@@ -5120,7 +5120,7 @@ static void *d3d12_gfx_init(const video_info_t* video,
|
||||
matrix_4x4_identity(d3d12->identity);
|
||||
|
||||
d3d12_gfx_set_rotation(d3d12, 0);
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(d3d12->vp.full_dims), VIDEO_SCALE_H(d3d12->vp.full_dims));
|
||||
video_driver_set_output_dims(d3d12->vp.full_dims);
|
||||
d3d12->chain.viewport.Width = VIDEO_SCALE_W(d3d12->vp.full_dims);
|
||||
d3d12->chain.viewport.Height = VIDEO_SCALE_H(d3d12->vp.full_dims);
|
||||
|
||||
@@ -5781,7 +5781,7 @@ static bool d3d12_gfx_frame(
|
||||
d3d12->flags &= ~D3D12_ST_FLAG_RESIZE_CHAIN;
|
||||
d3d12->flags |= D3D12_ST_FLAG_RESIZE_VIEWPORT;
|
||||
|
||||
video_driver_set_output_size(video_width, video_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(video_width, video_height));
|
||||
|
||||
#ifdef HAVE_DXGI_HDR
|
||||
#ifdef __WINRT__
|
||||
@@ -7144,12 +7144,7 @@ static bool d3d12_gfx_alive(void* data)
|
||||
bool resize_chain = false;
|
||||
d3d12_video_t* d3d12 = (d3d12_video_t*)data;
|
||||
|
||||
unsigned full_w = VIDEO_SCALE_W(d3d12->vp.full_dims);
|
||||
unsigned full_h = VIDEO_SCALE_H(d3d12->vp.full_dims);
|
||||
|
||||
win32_check_window(NULL, &quit, &resize_chain, &full_w, &full_h);
|
||||
|
||||
d3d12->vp.full_dims = VIDEO_SCALE_PACK(full_w, full_h);
|
||||
win32_check_window(NULL, &quit, &resize_chain, &d3d12->vp.full_dims);
|
||||
|
||||
if (resize_chain)
|
||||
d3d12->flags |= D3D12_ST_FLAG_RESIZE_CHAIN;
|
||||
@@ -7159,7 +7154,7 @@ static bool d3d12_gfx_alive(void* data)
|
||||
if ( (d3d12->flags & D3D12_ST_FLAG_RESIZE_CHAIN)
|
||||
&& (VIDEO_SCALE_W(d3d12->vp.full_dims) != 0)
|
||||
&& (VIDEO_SCALE_H(d3d12->vp.full_dims) != 0))
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(d3d12->vp.full_dims), VIDEO_SCALE_H(d3d12->vp.full_dims));
|
||||
video_driver_set_output_dims(d3d12->vp.full_dims);
|
||||
|
||||
return !quit;
|
||||
}
|
||||
|
||||
+12
-13
@@ -2066,7 +2066,7 @@ static void d3d8_make_d3dpp(void *data,
|
||||
unsigned height = 0;
|
||||
|
||||
d3d8_get_video_size(d3d, &width, &height);
|
||||
video_driver_set_output_size(width, height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(width, height));
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(width, height);
|
||||
d3dpp->BackBufferWidth = width;
|
||||
d3dpp->BackBufferHeight = height;
|
||||
@@ -2362,14 +2362,14 @@ static void d3d8_set_resize(d3d8_video_t *d3d,
|
||||
|
||||
d3d->video_info.width = new_width;
|
||||
d3d->video_info.height = new_height;
|
||||
video_driver_set_output_size(new_width, new_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(new_width, new_height));
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
}
|
||||
|
||||
static bool d3d8_alive(void *data)
|
||||
{
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
unsigned temp_dims = VIDEO_SCALE_PACK(0,
|
||||
0);
|
||||
bool ret = false;
|
||||
d3d8_video_t *d3d = (d3d8_video_t*)data;
|
||||
bool quit = false;
|
||||
@@ -2380,10 +2380,9 @@ static bool d3d8_alive(void *data)
|
||||
* this driver, so it stays in sync with the output size as
|
||||
* long as no other code path sets it. In practice nothing
|
||||
* does -- see video_driver.c audit. */
|
||||
temp_width = VIDEO_SCALE_W(d3d->vp.full_dims);
|
||||
temp_height = VIDEO_SCALE_H(d3d->vp.full_dims);
|
||||
temp_dims = d3d->vp.full_dims;
|
||||
|
||||
win32_check_window(NULL, &quit, &resize, &temp_width, &temp_height);
|
||||
win32_check_window(NULL, &quit, &resize, &temp_dims);
|
||||
|
||||
if (quit)
|
||||
d3d->quitting = quit;
|
||||
@@ -2391,16 +2390,16 @@ static bool d3d8_alive(void *data)
|
||||
if (resize)
|
||||
{
|
||||
d3d->should_resize = true;
|
||||
d3d8_set_resize(d3d, temp_width, temp_height);
|
||||
d3d8_set_resize(d3d, VIDEO_SCALE_W(temp_dims), VIDEO_SCALE_H(temp_dims));
|
||||
d3d8_restore(d3d);
|
||||
}
|
||||
|
||||
ret = !quit;
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
if (VIDEO_SCALE_W(temp_dims) != 0 && VIDEO_SCALE_H(temp_dims) != 0)
|
||||
{
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(temp_width, temp_height);
|
||||
video_driver_set_output_dims(temp_dims);
|
||||
d3d->vp.full_dims = temp_dims;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -2501,12 +2500,12 @@ static bool d3d8_init_internal(d3d8_video_t *d3d,
|
||||
{
|
||||
unsigned new_width = info->fullscreen ? full_x : info->width;
|
||||
unsigned new_height = info->fullscreen ? full_y : info->height;
|
||||
video_driver_set_output_size(new_width, new_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(new_width, new_height));
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
|
||||
#ifdef HAVE_WINDOW
|
||||
/* Use new_width / new_height directly rather than reading
|
||||
* them back via video_driver_get_output_size: nothing in the
|
||||
* them back via video_driver_get_output_dims: nothing in the
|
||||
* codebase sets the output size between the
|
||||
* set_size above and this call except us. */
|
||||
if (!win32_set_video_mode(d3d, new_width, new_height,
|
||||
|
||||
+12
-13
@@ -3979,12 +3979,12 @@ static bool d3d9_cg_init_internal(d3d9_video_t *d3d,
|
||||
{
|
||||
unsigned new_width = info->fullscreen ? full_x : info->width;
|
||||
unsigned new_height = info->fullscreen ? full_y : info->height;
|
||||
video_driver_set_output_size(new_width, new_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(new_width, new_height));
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
|
||||
#ifdef HAVE_WINDOW
|
||||
/* Use new_width / new_height directly rather than reading
|
||||
* them back via video_driver_get_output_size: nothing in the
|
||||
* them back via video_driver_get_output_dims: nothing in the
|
||||
* codebase sets the output size between the
|
||||
* set_size above and this call except us. */
|
||||
if (!win32_set_video_mode(d3d, new_width, new_height,
|
||||
@@ -4848,14 +4848,14 @@ static void d3d9_cg_set_resize(d3d9_video_t *d3d,
|
||||
|
||||
d3d->video_info.width = new_width;
|
||||
d3d->video_info.height = new_height;
|
||||
video_driver_set_output_size(new_width, new_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(new_width, new_height));
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
}
|
||||
|
||||
static bool d3d9_cg_alive(void *data)
|
||||
{
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
unsigned temp_dims = VIDEO_SCALE_PACK(0,
|
||||
0);
|
||||
bool ret = false;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
@@ -4864,10 +4864,9 @@ static bool d3d9_cg_alive(void *data)
|
||||
/* Read from local bookkeeping rather than video_st (which would
|
||||
* cross threads needlessly). d3d->vp.full_* is
|
||||
* written at every set_size call site in this driver. */
|
||||
temp_width = VIDEO_SCALE_W(d3d->vp.full_dims);
|
||||
temp_height = VIDEO_SCALE_H(d3d->vp.full_dims);
|
||||
temp_dims = d3d->vp.full_dims;
|
||||
|
||||
win32_check_window(NULL, &quit, &resize, &temp_width, &temp_height);
|
||||
win32_check_window(NULL, &quit, &resize, &temp_dims);
|
||||
|
||||
if (quit)
|
||||
d3d->quitting = quit;
|
||||
@@ -4875,17 +4874,17 @@ static bool d3d9_cg_alive(void *data)
|
||||
if (resize)
|
||||
{
|
||||
d3d->should_resize = true;
|
||||
d3d9_cg_set_resize(d3d, temp_width, temp_height);
|
||||
d3d9_cg_set_resize(d3d, VIDEO_SCALE_W(temp_dims), VIDEO_SCALE_H(temp_dims));
|
||||
d3d9_cg_restore(d3d);
|
||||
}
|
||||
|
||||
ret = !quit;
|
||||
|
||||
if ( temp_width != 0 &&
|
||||
temp_height != 0)
|
||||
if ( VIDEO_SCALE_W(temp_dims) != 0 &&
|
||||
VIDEO_SCALE_H(temp_dims) != 0)
|
||||
{
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(temp_width, temp_height);
|
||||
video_driver_set_output_dims(temp_dims);
|
||||
d3d->vp.full_dims = temp_dims;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
+12
-13
@@ -7291,12 +7291,12 @@ static bool d3d9_hlsl_init_internal(d3d9_video_t *d3d,
|
||||
{
|
||||
unsigned new_width = info->fullscreen ? full_x : info->width;
|
||||
unsigned new_height = info->fullscreen ? full_y : info->height;
|
||||
video_driver_set_output_size(new_width, new_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(new_width, new_height));
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
|
||||
#ifdef HAVE_WINDOW
|
||||
/* Use new_width / new_height directly rather than reading
|
||||
* them back via video_driver_get_output_size: nothing in the
|
||||
* them back via video_driver_get_output_dims: nothing in the
|
||||
* codebase sets the output size between the
|
||||
* set_size above and this call except us. */
|
||||
if (!win32_set_video_mode(d3d, new_width, new_height,
|
||||
@@ -8272,14 +8272,14 @@ static void d3d9_hlsl_set_resize(d3d9_video_t *d3d,
|
||||
|
||||
d3d->video_info.width = new_width;
|
||||
d3d->video_info.height = new_height;
|
||||
video_driver_set_output_size(new_width, new_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(new_width, new_height));
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
}
|
||||
|
||||
static bool d3d9_hlsl_alive(void *data)
|
||||
{
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
unsigned temp_dims = VIDEO_SCALE_PACK(0,
|
||||
0);
|
||||
bool ret = false;
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
@@ -8288,10 +8288,9 @@ static bool d3d9_hlsl_alive(void *data)
|
||||
/* Read from local bookkeeping rather than video_st (which would
|
||||
* cross threads needlessly). d3d->vp.full_* is
|
||||
* written at every set_size call site in this driver. */
|
||||
temp_width = VIDEO_SCALE_W(d3d->vp.full_dims);
|
||||
temp_height = VIDEO_SCALE_H(d3d->vp.full_dims);
|
||||
temp_dims = d3d->vp.full_dims;
|
||||
|
||||
win32_check_window(NULL, &quit, &resize, &temp_width, &temp_height);
|
||||
win32_check_window(NULL, &quit, &resize, &temp_dims);
|
||||
|
||||
if (quit)
|
||||
d3d->quitting = quit;
|
||||
@@ -8299,17 +8298,17 @@ static bool d3d9_hlsl_alive(void *data)
|
||||
if (resize)
|
||||
{
|
||||
d3d->should_resize = true;
|
||||
d3d9_hlsl_set_resize(d3d, temp_width, temp_height);
|
||||
d3d9_hlsl_set_resize(d3d, VIDEO_SCALE_W(temp_dims), VIDEO_SCALE_H(temp_dims));
|
||||
d3d9_hlsl_restore(d3d);
|
||||
}
|
||||
|
||||
ret = !quit;
|
||||
|
||||
if ( temp_width != 0 &&
|
||||
temp_height != 0)
|
||||
if ( VIDEO_SCALE_W(temp_dims) != 0 &&
|
||||
VIDEO_SCALE_H(temp_dims) != 0)
|
||||
{
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
d3d->vp.full_dims = VIDEO_SCALE_PACK(temp_width, temp_height);
|
||||
video_driver_set_output_dims(temp_dims);
|
||||
d3d->vp.full_dims = temp_dims;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
+14
-11
@@ -2457,6 +2457,7 @@ static void gdi_create(gdi_t *gdi)
|
||||
static void *gdi_init(const video_info_t *video,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned full_x, full_y;
|
||||
unsigned mode_width = 0, mode_height = 0;
|
||||
unsigned win_width = 0, win_height = 0;
|
||||
@@ -2531,9 +2532,11 @@ static void *gdi_init(const video_info_t *video,
|
||||
/* Get real known video size, which might have been altered by context. */
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(temp_width, temp_height));
|
||||
else
|
||||
video_driver_get_output_size(&temp_width, &temp_height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
temp_width = VIDEO_SCALE_W(out_dims);
|
||||
temp_height = VIDEO_SCALE_H(out_dims);
|
||||
gdi->full_width = temp_width;
|
||||
gdi->full_height = temp_height;
|
||||
|
||||
@@ -3156,8 +3159,8 @@ static bool gdi_frame(void *data, const void *frame,
|
||||
|
||||
static bool gdi_alive(void *data)
|
||||
{
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
unsigned temp_dims = VIDEO_SCALE_PACK(0,
|
||||
0);
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
bool ret = false;
|
||||
@@ -3166,22 +3169,22 @@ static bool gdi_alive(void *data)
|
||||
/* Read from local bookkeeping rather than video_st (which would
|
||||
* cross threads needlessly). gdi->full_{width,height}
|
||||
* is written at every set_size call site in this driver. */
|
||||
temp_width = gdi->full_width;
|
||||
temp_height = gdi->full_height;
|
||||
temp_dims = VIDEO_SCALE_PACK(gdi->full_width,
|
||||
gdi->full_height);
|
||||
|
||||
win32_check_window(NULL,
|
||||
&quit, &resize, &temp_width, &temp_height);
|
||||
&quit, &resize, &temp_dims);
|
||||
|
||||
ret = !quit;
|
||||
|
||||
if (resize)
|
||||
gdi->should_resize = true;
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
if (VIDEO_SCALE_W(temp_dims) != 0 && VIDEO_SCALE_H(temp_dims) != 0)
|
||||
{
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
gdi->full_width = temp_width;
|
||||
gdi->full_height = temp_height;
|
||||
video_driver_set_output_dims(temp_dims);
|
||||
gdi->full_width = VIDEO_SCALE_W(temp_dims);
|
||||
gdi->full_height = VIDEO_SCALE_H(temp_dims);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
+13
-11
@@ -1309,6 +1309,7 @@ static void gl1_overlay_tex_geom(void *data,
|
||||
static void *gl1_init(const video_info_t *video,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned full_x, full_y;
|
||||
#ifdef VITA
|
||||
static bool vgl_inited = false;
|
||||
@@ -1443,9 +1444,11 @@ static void *gl1_init(const video_info_t *video,
|
||||
/* Get real known video size, which might have been altered by context. */
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(temp_width, temp_height));
|
||||
else
|
||||
video_driver_get_output_size(&temp_width, &temp_height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
temp_width = VIDEO_SCALE_W(out_dims);
|
||||
temp_height = VIDEO_SCALE_H(out_dims);
|
||||
gl1->vp.full_dims = VIDEO_SCALE_PACK(temp_width, temp_height);
|
||||
|
||||
RARCH_LOG("[GL1] Using resolution %ux%u.\n", temp_width, temp_height);
|
||||
@@ -2718,8 +2721,8 @@ static void gl1_set_nonblock_state(void *data, bool state,
|
||||
|
||||
static bool gl1_alive(void *data)
|
||||
{
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
unsigned temp_dims = VIDEO_SCALE_PACK(0,
|
||||
0);
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
bool ret = false;
|
||||
@@ -2728,21 +2731,20 @@ static bool gl1_alive(void *data)
|
||||
/* Read from local bookkeeping rather than video_st: this runs on
|
||||
* the video thread, and gl1->vp.full_* is this driver's own state,
|
||||
* written at every set_size call site in this driver. */
|
||||
temp_width = VIDEO_SCALE_W(gl1->vp.full_dims);
|
||||
temp_height = VIDEO_SCALE_H(gl1->vp.full_dims);
|
||||
temp_dims = gl1->vp.full_dims;
|
||||
|
||||
gl1->ctx_driver->check_window(gl1->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height);
|
||||
&quit, &resize, &temp_dims);
|
||||
|
||||
if (resize)
|
||||
gl1->flags |= GL1_FLAG_SHOULD_RESIZE;
|
||||
|
||||
ret = !quit;
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
if (VIDEO_SCALE_W(temp_dims) != 0 && VIDEO_SCALE_H(temp_dims) != 0)
|
||||
{
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
gl1->vp.full_dims = VIDEO_SCALE_PACK(temp_width, temp_height);
|
||||
video_driver_set_output_dims(temp_dims);
|
||||
gl1->vp.full_dims = temp_dims;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -2853,7 +2855,7 @@ static void gl1_viewport_info(void *data, struct video_viewport *vp)
|
||||
|
||||
/* gl1->vp carries full_width/full_height (written at every
|
||||
* set_size call site), so the struct copy populates them
|
||||
* directly without a video_driver_get_output_size round-trip. */
|
||||
* directly without a video_driver_get_output_dims round-trip. */
|
||||
*vp = gl1->vp;
|
||||
|
||||
/* Adjust as GL viewport is bottom-up. */
|
||||
|
||||
+14
-11
@@ -5403,6 +5403,7 @@ static bool renderchain_gl2_init_first(void **renderchain_handle)
|
||||
static void *gl2_init(const video_info_t *video,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
unsigned out_dims_o;
|
||||
enum gfx_wrap_type wrap_type;
|
||||
unsigned full_x, full_y;
|
||||
unsigned shader_info_num;
|
||||
@@ -5667,9 +5668,11 @@ static void *gl2_init(const video_info_t *video,
|
||||
/* Get real known video size, which might have been altered by context. */
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(temp_width, temp_height));
|
||||
else
|
||||
video_driver_get_output_size(&temp_width, &temp_height);
|
||||
out_dims_o = video_driver_get_output_dims();
|
||||
temp_width = VIDEO_SCALE_W(out_dims_o);
|
||||
temp_height = VIDEO_SCALE_H(out_dims_o);
|
||||
gl->video_width = temp_width;
|
||||
gl->video_height = temp_height;
|
||||
|
||||
@@ -5871,18 +5874,18 @@ static bool gl2_alive(void *data)
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
gl2_t *gl = (gl2_t*)data;
|
||||
unsigned temp_width = gl->video_width;
|
||||
unsigned temp_height = gl->video_height;
|
||||
unsigned temp_dims = VIDEO_SCALE_PACK(gl->video_width,
|
||||
gl->video_height);
|
||||
|
||||
gl->ctx_driver->check_window(gl->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height);
|
||||
&quit, &resize, &temp_dims);
|
||||
|
||||
#ifdef __WINRT__
|
||||
if (is_running_on_xbox())
|
||||
{
|
||||
/* Match the output res to the display resolution */
|
||||
temp_width = uwp_get_width();
|
||||
temp_height = uwp_get_height();
|
||||
temp_dims = VIDEO_SCALE_PACK(uwp_get_width(),
|
||||
uwp_get_height());
|
||||
}
|
||||
#endif
|
||||
if (quit)
|
||||
@@ -5892,11 +5895,11 @@ static bool gl2_alive(void *data)
|
||||
|
||||
ret = !(gl->flags & GL2_FLAG_QUITTING);
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
if (VIDEO_SCALE_W(temp_dims) != 0 && VIDEO_SCALE_H(temp_dims) != 0)
|
||||
{
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
gl->video_width = temp_width;
|
||||
gl->video_height = temp_height;
|
||||
video_driver_set_output_dims(temp_dims);
|
||||
gl->video_width = VIDEO_SCALE_W(temp_dims);
|
||||
gl->video_height = VIDEO_SCALE_H(temp_dims);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
+14
-11
@@ -3261,6 +3261,7 @@ static void gl3_set_viewport_wrapper(void *data,
|
||||
static void *gl3_init(const video_info_t *video,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
unsigned out_dims_o;
|
||||
unsigned full_x, full_y;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool video_gpu_record = settings->bools.video_gpu_record;
|
||||
@@ -3444,9 +3445,11 @@ static void *gl3_init(const video_info_t *video,
|
||||
/* Get real known video size, which might have been altered by context. */
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(temp_width, temp_height));
|
||||
else
|
||||
video_driver_get_output_size(&temp_width, &temp_height);
|
||||
out_dims_o = video_driver_get_output_dims();
|
||||
temp_width = VIDEO_SCALE_W(out_dims_o);
|
||||
temp_height = VIDEO_SCALE_H(out_dims_o);
|
||||
gl->video_width = temp_width;
|
||||
gl->video_height = temp_height;
|
||||
|
||||
@@ -3742,11 +3745,11 @@ static bool gl3_alive(void *data)
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
gl3_t *gl = (gl3_t*)data;
|
||||
unsigned temp_width = gl->video_width;
|
||||
unsigned temp_height = gl->video_height;
|
||||
unsigned temp_dims = VIDEO_SCALE_PACK(gl->video_width,
|
||||
gl->video_height);
|
||||
|
||||
gl->ctx_driver->check_window(gl->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height);
|
||||
&quit, &resize, &temp_dims);
|
||||
|
||||
#ifdef __WINRT__
|
||||
if (is_running_on_xbox())
|
||||
@@ -3755,8 +3758,8 @@ static bool gl3_alive(void *data)
|
||||
* to be 1920x1080 and currently there is now way to set ANGLE to
|
||||
* use a variable resolution swapchain so regardless of the size
|
||||
* the window is always 1080p */
|
||||
temp_width = 1920;
|
||||
temp_height = 1080;
|
||||
temp_dims = VIDEO_SCALE_PACK(1920,
|
||||
1080);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3767,11 +3770,11 @@ static bool gl3_alive(void *data)
|
||||
|
||||
ret = !(gl->flags & GL3_FLAG_QUITTING);
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
if (VIDEO_SCALE_W(temp_dims) != 0 && VIDEO_SCALE_H(temp_dims) != 0)
|
||||
{
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
gl->video_width = temp_width;
|
||||
gl->video_height = temp_height;
|
||||
video_driver_set_output_dims(temp_dims);
|
||||
gl->video_width = VIDEO_SCALE_W(temp_dims);
|
||||
gl->video_height = VIDEO_SCALE_H(temp_dims);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -1360,7 +1360,7 @@ static void *gx2_init(const video_info_t *video,
|
||||
wiiu->render_mode.height);
|
||||
}
|
||||
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(wiiu->vp.dims), VIDEO_SCALE_H(wiiu->vp.dims));
|
||||
video_driver_set_output_dims(wiiu->vp.dims);
|
||||
|
||||
driver_ctl(RARCH_DRIVER_CTL_SET_REFRESH_RATE, &refresh_rate);
|
||||
|
||||
|
||||
@@ -2040,7 +2040,7 @@ static void *gxm_gfx_init(const video_info_t *video,
|
||||
vita->video_width = temp_width;
|
||||
vita->video_height = temp_height;
|
||||
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(temp_width, temp_height));
|
||||
gxm_set_viewport_wrapper(vita, temp_width, temp_height, false, true);
|
||||
|
||||
if (input && input_data)
|
||||
|
||||
+1
-1
@@ -4626,7 +4626,7 @@ static void metal_pull_cached_frame_cb(void *userdata,
|
||||
- (void)setViewportWidth:(unsigned)width height:(unsigned)height forceFull:(BOOL)forceFull allowRotate:(BOOL)allowRotate
|
||||
{
|
||||
_viewport->full_dims = VIDEO_SCALE_PACK(width, height);
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(_viewport->full_dims), VIDEO_SCALE_H(_viewport->full_dims));
|
||||
video_driver_set_output_dims(_viewport->full_dims);
|
||||
_layer.drawableSize = CGSizeMake(width, height);
|
||||
video_driver_update_viewport(_viewport, forceFull, _keepAspect, YES);
|
||||
_context.viewport = _viewport; /* Update matrix */
|
||||
|
||||
@@ -357,7 +357,7 @@ static void network_gfx_set_nonblock_state(void *a, bool b, bool c, unsigned d)
|
||||
|
||||
static bool network_gfx_alive(void *data)
|
||||
{
|
||||
/* The video_driver_get_output_size + conditional set_size dance that
|
||||
/* The video_driver_get_output_dims + conditional set_size dance that
|
||||
* used to live here was a copy-paste from d3d8_alive, where the
|
||||
* intermediate win32_check_window call mutates the fetched
|
||||
* size on window resize. The network driver has no equivalent
|
||||
|
||||
@@ -1579,7 +1579,7 @@ static void* rsx_init(const video_info_t* video,
|
||||
rsx->vp.dims = VIDEO_SCALE_PACK(rsx->width, rsx->height);
|
||||
rsx->vp.full_dims = VIDEO_SCALE_PACK(rsx->width, rsx->height);
|
||||
rsx->rgb32 = video->rgb32;
|
||||
video_driver_set_output_size(VIDEO_SCALE_W(rsx->vp.dims), VIDEO_SCALE_H(rsx->vp.dims));
|
||||
video_driver_set_output_dims(rsx->vp.dims);
|
||||
rsx_set_viewport(rsx, VIDEO_SCALE_W(rsx->vp.dims), VIDEO_SCALE_H(rsx->vp.dims), false, true);
|
||||
|
||||
if (input && input_data)
|
||||
|
||||
@@ -270,7 +270,7 @@ static void sdl_refresh_viewport(sdl2_video_t *vid)
|
||||
* relative to that tiny coordinate space, and end up drawing into
|
||||
* the top-left corner of the actual SDL framebuffer. Most other
|
||||
* drivers (vga, gx2, d3d8, d3d9 common) make this call too. */
|
||||
video_driver_set_output_size(win_w, win_h);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(win_w, win_h));
|
||||
|
||||
vid->flags &= ~SDL2_FLAG_SHOULD_RESIZE;
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ static void sdl3_refresh_viewport(sdl3_video_t *vid)
|
||||
|
||||
/* Tell the rest of the engine about our actual window dimensions
|
||||
* (mirrors sdl2_gfx / vga / gx2). */
|
||||
video_driver_set_output_size(win_w, win_h);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(win_w, win_h));
|
||||
|
||||
vid->flags &= ~SDL3_FLAG_SHOULD_RESIZE;
|
||||
|
||||
|
||||
@@ -484,7 +484,7 @@ static bool sixel_gfx_frame(void *data, const void *frame,
|
||||
|
||||
static bool sixel_gfx_alive(void *data)
|
||||
{
|
||||
/* The video_driver_get_output_size + conditional set_size dance that
|
||||
/* The video_driver_get_output_dims + conditional set_size dance that
|
||||
* used to live here was a copy-paste from d3d8_alive, where the
|
||||
* intermediate win32_check_window call mutates the fetched
|
||||
* size on window resize. sixel has no equivalent windowing
|
||||
|
||||
+15
-11
@@ -105,6 +105,8 @@ static INLINE bool vg_query_extension(const char *ext)
|
||||
static void *vg_init(const video_info_t *video,
|
||||
input_driver_t **input, void **input_data)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned out_dims;
|
||||
unsigned win_width, win_height;
|
||||
VGfloat clearColor[4] = {0, 0, 0, 1};
|
||||
int interval = 0;
|
||||
@@ -145,7 +147,7 @@ static void *vg_init(const video_info_t *video,
|
||||
RARCH_LOG("[VG] Detecting screen resolution: %ux%u.\n", temp_width, temp_height);
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(temp_width, temp_height));
|
||||
|
||||
interval = video->vsync ? 1 : 0;
|
||||
|
||||
@@ -162,9 +164,9 @@ static void *vg_init(const video_info_t *video,
|
||||
win_width = video->width;
|
||||
win_height = video->height;
|
||||
|
||||
if (video->fullscreen && (win_width == 0) && (win_height == 0))
|
||||
{
|
||||
video_driver_get_output_size(&temp_width, &temp_height);
|
||||
if (video->fullscreen && (win_width == 0) && out_dims = video_driver_get_output_dims();
|
||||
temp_width = VIDEO_SCALE_W(out_dims);
|
||||
temp_height = VIDEO_SCALE_H(out_dims);emp_width, &temp_height);
|
||||
|
||||
win_width = temp_width;
|
||||
win_height = temp_height;
|
||||
@@ -193,10 +195,12 @@ static void *vg_init(const video_info_t *video,
|
||||
{
|
||||
RARCH_LOG("[VG] Verified window resolution %ux%u.\n",
|
||||
temp_width, temp_height);
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(temp_width, temp_height));
|
||||
}
|
||||
else
|
||||
video_driver_get_output_size(&temp_width, &temp_height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
temp_width = VIDEO_SCALE_W(out_dims);
|
||||
temp_height = VIDEO_SCALE_H(out_dims);
|
||||
|
||||
vg->mScreenAspect = (float)temp_width / temp_height;
|
||||
|
||||
@@ -431,15 +435,15 @@ static bool vg_alive(void *data)
|
||||
{
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
unsigned temp_width = 0;
|
||||
unsigned temp_height = 0;
|
||||
unsigned temp_dims = VIDEO_SCALE_PACK(0,
|
||||
0);
|
||||
vg_t *vg = (vg_t*)data;
|
||||
|
||||
vg->ctx_driver->check_window(vg->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height);
|
||||
&quit, &resize, &temp_dims);
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
if (VIDEO_SCALE_W(temp_dims) != 0 && VIDEO_SCALE_H(temp_dims) != 0)
|
||||
video_driver_set_output_dims(temp_dims);
|
||||
|
||||
return !quit;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ static void vga_gfx_set_nonblock_state(void *a, bool b, bool c, unsigned d) { }
|
||||
static bool vga_gfx_alive(void *data)
|
||||
{
|
||||
/* Publish the actual VGA framebuffer dimensions as the output
|
||||
* size, not the core's frame size. video_driver_set_output_size
|
||||
* size, not the core's frame size. video_driver_set_output_dims
|
||||
* feeds the value used by menu drivers, the CRT switcher and the
|
||||
* input subsystem to size their output and absolute-coordinate
|
||||
* ranges; passing the core's frame dimensions would lie to all
|
||||
@@ -345,7 +345,7 @@ static bool vga_gfx_alive(void *data)
|
||||
* VGA_HEIGHT (320x200 mode 13h); the core's frame is scaled
|
||||
* into that fixed-size framebuffer per-pixel in vga_gfx_frame. */
|
||||
(void)data;
|
||||
video_driver_set_output_size(VGA_WIDTH, VGA_HEIGHT);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(VGA_WIDTH, VGA_HEIGHT));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+13
-11
@@ -6102,6 +6102,7 @@ static void *vulkan_init(const video_info_t *video,
|
||||
input_driver_t **input,
|
||||
void **input_data)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned full_x, full_y;
|
||||
unsigned win_width;
|
||||
unsigned win_height;
|
||||
@@ -6202,9 +6203,11 @@ static void *vulkan_init(const video_info_t *video,
|
||||
temp_height = mode_height;
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(temp_width, temp_height));
|
||||
else
|
||||
video_driver_get_output_size(&temp_width, &temp_height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
temp_width = VIDEO_SCALE_W(out_dims);
|
||||
temp_height = VIDEO_SCALE_H(out_dims);
|
||||
vk->video_width = temp_width;
|
||||
vk->video_height = temp_height;
|
||||
vk->translate_x = 0.0;
|
||||
@@ -6595,17 +6598,16 @@ static bool vulkan_alive(void *data)
|
||||
bool quit = false;
|
||||
bool resize = false;
|
||||
vk_t *vk = (vk_t*)data;
|
||||
unsigned temp_width;
|
||||
unsigned temp_height;
|
||||
unsigned temp_dims = 0;
|
||||
|
||||
if (!vk)
|
||||
return false;
|
||||
|
||||
temp_width = vk->video_width;
|
||||
temp_height = vk->video_height;
|
||||
temp_dims = VIDEO_SCALE_PACK(vk->video_width,
|
||||
vk->video_height);
|
||||
|
||||
vk->ctx_driver->check_window(vk->ctx_data,
|
||||
&quit, &resize, &temp_width, &temp_height);
|
||||
&quit, &resize, &temp_dims);
|
||||
|
||||
if (quit)
|
||||
vk->flags |= VK_FLAG_QUITTING;
|
||||
@@ -6614,11 +6616,11 @@ static bool vulkan_alive(void *data)
|
||||
|
||||
ret = (!(vk->flags & VK_FLAG_QUITTING));
|
||||
|
||||
if (temp_width != 0 && temp_height != 0)
|
||||
if (VIDEO_SCALE_W(temp_dims) != 0 && VIDEO_SCALE_H(temp_dims) != 0)
|
||||
{
|
||||
video_driver_set_output_size(temp_width, temp_height);
|
||||
vk->video_width = temp_width;
|
||||
vk->video_height = temp_height;
|
||||
video_driver_set_output_dims(temp_dims);
|
||||
vk->video_width = VIDEO_SCALE_W(temp_dims);
|
||||
vk->video_height = VIDEO_SCALE_H(temp_dims);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -157,7 +157,7 @@ static void android_gfx_ctx_get_video_size(void *data,
|
||||
}
|
||||
|
||||
static void android_gfx_ctx_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width = 0;
|
||||
unsigned new_height = 0;
|
||||
@@ -169,13 +169,12 @@ static void android_gfx_ctx_check_window(void *data, bool *quit,
|
||||
egl_get_video_size(&and->egl, &new_width, &new_height);
|
||||
#endif
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (new_width != VIDEO_SCALE_W(*dims) || new_height != VIDEO_SCALE_H(*dims))
|
||||
{
|
||||
RARCH_LOG("[Android] Resizing (%u x %u) -> (%u x %u).\n",
|
||||
*width, *height, new_width, new_height);
|
||||
VIDEO_SCALE_W(*dims), VIDEO_SCALE_H(*dims), new_width, new_height);
|
||||
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ static void android_gfx_ctx_vk_get_video_size(void *data,
|
||||
}
|
||||
|
||||
static void android_gfx_ctx_vk_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
struct android_app *android_app = (struct android_app*)g_android;
|
||||
unsigned new_width = 0;
|
||||
@@ -122,13 +122,12 @@ static void android_gfx_ctx_vk_check_window(void *data, bool *quit,
|
||||
new_height = (unsigned)retro_atomic_load_acquire_int(
|
||||
&android_app->content_rect.height);
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (new_width != VIDEO_SCALE_W(*dims) || new_height != VIDEO_SCALE_H(*dims))
|
||||
{
|
||||
RARCH_LOG("[Vulkan] Resizing (%ux%u) -> (%ux%u).\n",
|
||||
*width, *height, new_width, new_height);
|
||||
VIDEO_SCALE_W(*dims), VIDEO_SCALE_H(*dims), new_width, new_height);
|
||||
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ static void cocoa_gl_gfx_ctx_bind_hw_render(void *data, bool enable)
|
||||
}
|
||||
|
||||
static void cocoa_gl_gfx_ctx_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width, new_height;
|
||||
|
||||
@@ -381,10 +381,9 @@ static void cocoa_gl_gfx_ctx_check_window(void *data, bool *quit,
|
||||
|
||||
cocoa_gl_gfx_ctx_get_video_size_ts(data, &new_width, &new_height);
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ static gfx_ctx_proc_t cocoa_vk_gfx_ctx_get_proc_address(const char *symbol_name)
|
||||
static void cocoa_vk_gfx_ctx_bind_hw_render(void *data, bool enable) { }
|
||||
|
||||
static void cocoa_vk_gfx_ctx_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width, new_height;
|
||||
cocoa_vk_ctx_data_t *cocoa_ctx = (cocoa_vk_ctx_data_t*)data;
|
||||
@@ -228,10 +228,9 @@ static void cocoa_vk_gfx_ctx_check_window(void *data, bool *quit,
|
||||
|
||||
cocoa_vk_gfx_ctx_get_video_size_ts(data, &new_width, &new_height);
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,12 +521,11 @@ static void gfx_ctx_drm_swap_interval(void *data, int interval)
|
||||
}
|
||||
|
||||
static void gfx_ctx_drm_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
*resize = false;
|
||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||
*width = g_drm_mode->hdisplay;
|
||||
*height = g_drm_mode->vdisplay;
|
||||
*dims = VIDEO_SCALE_PACK(g_drm_mode->hdisplay, g_drm_mode->vdisplay);
|
||||
}
|
||||
|
||||
static void drm_flip_handler(int fd, unsigned frame,
|
||||
|
||||
@@ -279,7 +279,7 @@ unsigned *width, unsigned *height)
|
||||
}
|
||||
|
||||
static void gfx_ctx_go2_drm_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned w, h;
|
||||
gfx_ctx_go2_drm_data_t
|
||||
@@ -303,10 +303,9 @@ static void gfx_ctx_go2_drm_check_window(void *data, bool *quit,
|
||||
h = drm->native_height;
|
||||
}
|
||||
|
||||
if (*width != w || *height != h)
|
||||
if (VIDEO_SCALE_W(*dims) != w || VIDEO_SCALE_H(*dims) != h)
|
||||
{
|
||||
*width = drm->fb_width = w;
|
||||
*height = drm->fb_height = h;
|
||||
*dims = VIDEO_SCALE_PACK(drm->fb_width = w, drm->fb_height = h);
|
||||
*resize = false;
|
||||
}
|
||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||
|
||||
@@ -49,7 +49,7 @@ static void gfx_ctx_emscripten_swap_interval(void *data, int interval)
|
||||
}
|
||||
|
||||
static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
int input_width;
|
||||
int input_height;
|
||||
@@ -58,8 +58,7 @@ static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
|
||||
platform_emscripten_get_canvas_size(&input_width, &input_height);
|
||||
|
||||
*resize = (emscripten->fb_width != input_width || emscripten->fb_height != input_height);
|
||||
*width = emscripten->fb_width = (unsigned)input_width;
|
||||
*height = emscripten->fb_height = (unsigned)input_height;
|
||||
*dims = VIDEO_SCALE_PACK(emscripten->fb_width = (unsigned)input_width, emscripten->fb_height = (unsigned)input_height);
|
||||
*quit = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ static void gfx_ctx_emscripten_webgl_swap_interval(void *data, int interval)
|
||||
}
|
||||
|
||||
static void gfx_ctx_emscripten_webgl_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
int input_width;
|
||||
int input_height;
|
||||
@@ -52,8 +52,7 @@ static void gfx_ctx_emscripten_webgl_check_window(void *data, bool *quit,
|
||||
platform_emscripten_get_canvas_size(&input_width, &input_height);
|
||||
|
||||
*resize = (emscripten->fb_width != input_width || emscripten->fb_height != input_height);
|
||||
*width = emscripten->fb_width = (unsigned)input_width;
|
||||
*height = emscripten->fb_height = (unsigned)input_height;
|
||||
*dims = VIDEO_SCALE_PACK(emscripten->fb_width = (unsigned)input_width, emscripten->fb_height = (unsigned)input_height);
|
||||
*quit = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ static void gfx_ctx_null_get_video_size(
|
||||
|
||||
static void gfx_ctx_null_swap_interval(void *data, int interval) { }
|
||||
static void gfx_ctx_null_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height) { }
|
||||
bool *resize, unsigned *dims) { }
|
||||
static bool gfx_ctx_null_set_video_mode(void *data,
|
||||
unsigned width, unsigned height,
|
||||
bool fullscreen) { return true; }
|
||||
|
||||
@@ -92,15 +92,14 @@ error:
|
||||
}
|
||||
|
||||
static void gfx_ctx_khr_display_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data;
|
||||
*resize = (khr->vk.flags & VK_DATA_FLAG_NEED_NEW_SWAPCHAIN) ? true : false;
|
||||
|
||||
if (khr->width != *width || khr->height != *height)
|
||||
if (khr->width != VIDEO_SCALE_W(*dims) || khr->height != VIDEO_SCALE_H(*dims))
|
||||
{
|
||||
*width = khr->width;
|
||||
*height = khr->height;
|
||||
*dims = VIDEO_SCALE_PACK(khr->width, khr->height);
|
||||
*resize = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -303,16 +303,15 @@ error:
|
||||
}
|
||||
|
||||
static void gfx_ctx_mali_fbdev_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width, new_height;
|
||||
|
||||
gfx_ctx_mali_fbdev_get_video_size(data, &new_width, &new_height);
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ static void gfx_ctx_opendingux_get_video_size(void *data,
|
||||
}
|
||||
|
||||
static void gfx_ctx_opendingux_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width, new_height;
|
||||
opendingux_ctx_data_t *viv = (opendingux_ctx_data_t*)data;
|
||||
@@ -114,10 +114,9 @@ static void gfx_ctx_opendingux_check_window(void *data, bool *quit,
|
||||
#ifdef HAVE_EGL
|
||||
egl_get_video_size(&viv->egl, &new_width, &new_height);
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -178,16 +178,15 @@ error:
|
||||
}
|
||||
|
||||
static void orbis_ctx_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width, new_height;
|
||||
|
||||
orbis_ctx_get_video_size(data, &new_width, &new_height);
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -286,12 +286,10 @@ static void osmesa_ctx_get_video_size(void *data,
|
||||
}
|
||||
|
||||
static void osmesa_ctx_check_window(void *data, bool *quit,
|
||||
bool *resize,unsigned *width,
|
||||
unsigned *height)
|
||||
bool *resize,unsigned *dims)
|
||||
{
|
||||
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
|
||||
*width = osmesa->width;
|
||||
*height = osmesa->height;
|
||||
*dims = VIDEO_SCALE_PACK(osmesa->width, osmesa->height);
|
||||
*resize = false;
|
||||
*quit = false;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ static void gfx_ctx_ps3_set_swap_interval(void *data, int interval)
|
||||
}
|
||||
|
||||
static void gfx_ctx_ps3_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
*quit = false;
|
||||
*resize = false;
|
||||
|
||||
@@ -262,7 +262,7 @@ static void gfx_ctx_qnx_get_video_size(void *data,
|
||||
}
|
||||
|
||||
static void gfx_ctx_qnx_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width, new_height;
|
||||
qnx_ctx_data_t *qnx = (qnx_ctx_data_t*)data;
|
||||
@@ -271,10 +271,9 @@ static void gfx_ctx_qnx_check_window(void *data, bool *quit,
|
||||
egl_get_video_size(&qnx->egl, &new_width, &new_height);
|
||||
#endif
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,8 +190,7 @@ static void sdl1_ctx_update_title(void *data)
|
||||
}
|
||||
|
||||
static void sdl1_ctx_check_window(void *data, bool *quit,
|
||||
bool *resize,unsigned *width,
|
||||
unsigned *height)
|
||||
bool *resize,unsigned *dims)
|
||||
{
|
||||
SDL_Event event;
|
||||
gfx_ctx_sdl1_data_t *sdl = (gfx_ctx_sdl1_data_t*)data;
|
||||
@@ -218,8 +217,7 @@ static void sdl1_ctx_check_window(void *data, bool *quit,
|
||||
|
||||
if (sdl->resized)
|
||||
{
|
||||
*width = sdl->new_width;
|
||||
*height = sdl->new_height;
|
||||
*dims = VIDEO_SCALE_PACK(sdl->new_width, sdl->new_height);
|
||||
*resize = true;
|
||||
sdl->resized = false;
|
||||
}
|
||||
|
||||
@@ -269,8 +269,7 @@ static void sdl2_ctx_update_title(void *data)
|
||||
}
|
||||
|
||||
static void sdl2_ctx_check_window(void *data, bool *quit,
|
||||
bool *resize,unsigned *width,
|
||||
unsigned *height)
|
||||
bool *resize,unsigned *dims)
|
||||
{
|
||||
SDL_Event event;
|
||||
gfx_ctx_sdl2_data_t *sdl = (gfx_ctx_sdl2_data_t*)data;
|
||||
@@ -301,8 +300,7 @@ static void sdl2_ctx_check_window(void *data, bool *quit,
|
||||
|
||||
if (sdl->resized)
|
||||
{
|
||||
*width = sdl->new_width;
|
||||
*height = sdl->new_height;
|
||||
*dims = VIDEO_SCALE_PACK(sdl->new_width, sdl->new_height);
|
||||
*resize = true;
|
||||
sdl->resized = false;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ static void sdl3_vk_ctx_swap_buffers(void *data)
|
||||
}
|
||||
|
||||
static void sdl3_vk_ctx_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
gfx_ctx_sdl3_vk_data_t *sdl = (gfx_ctx_sdl3_vk_data_t*)data;
|
||||
|
||||
|
||||
@@ -115,20 +115,19 @@ error:
|
||||
}
|
||||
|
||||
static void switch_ctx_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width, new_height;
|
||||
|
||||
switch_ctx_get_video_size(data, &new_width, &new_height);
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
switch_ctx_data_t *ctx_nx = (switch_ctx_data_t *)data;
|
||||
|
||||
ctx_nx->width = *width;
|
||||
ctx_nx->height = *height;
|
||||
ctx_nx->width = VIDEO_SCALE_W(*dims);
|
||||
ctx_nx->height = VIDEO_SCALE_H(*dims);
|
||||
|
||||
ctx_nx->native_window.width = ctx_nx->width;
|
||||
ctx_nx->native_window.height = ctx_nx->height;
|
||||
|
||||
@@ -89,7 +89,7 @@ static INLINE bool gfx_ctx_vc_egl_query_extension(vc_ctx_data_t *vc, const char
|
||||
}
|
||||
|
||||
static void gfx_ctx_vc_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
*resize = false;
|
||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||
|
||||
@@ -56,16 +56,15 @@ static void vita_get_video_size(void *data, unsigned *width, unsigned *height)
|
||||
}
|
||||
|
||||
static void vita_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width, new_height;
|
||||
|
||||
vita_get_video_size(data, &new_width, &new_height);
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ static void gfx_ctx_vivante_get_video_size(void *data,
|
||||
}
|
||||
|
||||
static void gfx_ctx_vivante_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
unsigned new_width, new_height;
|
||||
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
||||
@@ -120,10 +120,9 @@ static void gfx_ctx_vivante_check_window(void *data, bool *quit,
|
||||
gfx_ctx_vivante_get_video_size(&viv->egl, &new_width, &new_height);
|
||||
#endif
|
||||
|
||||
if (new_width != *width || new_height != *height)
|
||||
if (VIDEO_SCALE_PACK(new_width, new_height) != *dims)
|
||||
{
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
*dims = VIDEO_SCALE_PACK(new_width, new_height);
|
||||
*resize = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ static void gfx_ctx_w_vk_swap_interval(void *data, int interval)
|
||||
}
|
||||
|
||||
static void gfx_ctx_w_vk_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
float refresh_rate = settings->floats.video_refresh_rate;
|
||||
@@ -98,8 +98,8 @@ static void gfx_ctx_w_vk_check_window(void *data, bool *quit,
|
||||
&& (g_win32_refresh_rate)
|
||||
&& (g_win32_refresh_rate != refresh_rate)
|
||||
&& (fabsf(g_win32_refresh_rate - refresh_rate) > 0.1f)
|
||||
&& (g_win32_resize_width == *width)
|
||||
&& (g_win32_resize_height == *height))
|
||||
&& (g_win32_resize_width == VIDEO_SCALE_W(*dims))
|
||||
&& (g_win32_resize_height == VIDEO_SCALE_H(*dims)))
|
||||
{
|
||||
g_win32_refresh_rate = settings->floats.video_refresh_rate;
|
||||
command_event(CMD_EVENT_REINIT, NULL);
|
||||
|
||||
@@ -111,10 +111,11 @@ static void gfx_ctx_wl_destroy_resources(gfx_ctx_wayland_data_t *wl)
|
||||
}
|
||||
|
||||
static void gfx_ctx_wl_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
||||
gfx_ctx_wl_check_window_common(wl, gfx_ctx_wl_get_video_size_common, quit, resize, width, height);
|
||||
gfx_ctx_wl_check_window_common(wl, gfx_ctx_wl_get_video_size_common,
|
||||
quit, resize, dims);
|
||||
}
|
||||
|
||||
static bool gfx_ctx_wl_set_resize(void *data, unsigned width, unsigned height)
|
||||
|
||||
@@ -54,7 +54,7 @@ static void gfx_ctx_wl_destroy_resources(gfx_ctx_wayland_data_t *wl)
|
||||
}
|
||||
|
||||
static void gfx_ctx_wl_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
||||
|
||||
@@ -62,8 +62,8 @@ static void gfx_ctx_wl_check_window(void *data, bool *quit,
|
||||
* central place, so use that to trigger swapchain reinit. */
|
||||
*resize = wl->vk.flags & VK_DATA_FLAG_NEED_NEW_SWAPCHAIN;
|
||||
|
||||
gfx_ctx_wl_check_window_common(wl, gfx_ctx_wl_get_video_size_common, quit, resize,
|
||||
width, height);
|
||||
gfx_ctx_wl_check_window_common(wl, gfx_ctx_wl_get_video_size_common,
|
||||
quit, resize, dims);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -173,10 +173,10 @@ static void gfx_ctx_x_vk_swap_buffers(void *data)
|
||||
}
|
||||
|
||||
static void gfx_ctx_x_vk_check_window(void *data, bool *quit,
|
||||
bool *resize, unsigned *width, unsigned *height)
|
||||
bool *resize, unsigned *dims)
|
||||
{
|
||||
gfx_ctx_x_vk_data_t *x = (gfx_ctx_x_vk_data_t*)data;
|
||||
x11_check_window(data, quit, resize, width, height);
|
||||
x11_check_window(data, quit, resize, dims);
|
||||
|
||||
if (x->vk.flags & VK_DATA_FLAG_NEED_NEW_SWAPCHAIN)
|
||||
*resize = true;
|
||||
@@ -459,8 +459,8 @@ static bool gfx_ctx_x_vk_set_video_mode(void *data,
|
||||
|
||||
{
|
||||
bool quit, resize;
|
||||
unsigned width = 0, height = 0;
|
||||
x11_check_window(x, &quit, &resize, &width, &height);
|
||||
unsigned dims = 0;
|
||||
x11_check_window(x, &quit, &resize, &dims);
|
||||
|
||||
/* FIXME/TODO - threading error here */
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ static void crt_aspect_ratio_switch(
|
||||
RARCH_LOG("[CRT] Setting aspect ratio: %f.\n", fly_aspect);
|
||||
RARCH_LOG("[CRT] Setting screen size: %dx%d.\n",
|
||||
width, height);
|
||||
video_driver_set_output_size(width, height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(width, height));
|
||||
if (video_st->current_video && video_st->current_video->set_viewport)
|
||||
video_st->current_video->set_viewport(
|
||||
video_st->data, width, height, true, true);
|
||||
@@ -133,7 +133,10 @@ static void crt_switch_set_aspect(
|
||||
/* used to fix aspect should the engine not find a resolution */
|
||||
if (srm_width == 0)
|
||||
{
|
||||
video_driver_get_output_size(&patched_width, &patched_height);
|
||||
unsigned out_dims;
|
||||
out_dims = video_driver_get_output_dims();
|
||||
patched_width = VIDEO_SCALE_W(out_dims);
|
||||
patched_height = VIDEO_SCALE_H(out_dims);
|
||||
srm_xscale = 1;
|
||||
srm_yscale = 1;
|
||||
}
|
||||
@@ -599,7 +602,7 @@ static void switch_res_crt(
|
||||
1.0f,
|
||||
1.0f,
|
||||
false);
|
||||
video_driver_set_output_size(width , height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(width, height));
|
||||
command_event(CMD_EVENT_VIDEO_APPLY_STATE_CHANGES, NULL);
|
||||
}
|
||||
}
|
||||
@@ -747,7 +750,7 @@ void crt_switch_res_core(
|
||||
crt_mode, corrected_width, monitor_index-1, super_width);
|
||||
crt_switch_set_aspect(p_switch, native_width, height, native_width,
|
||||
height ,(float)1,(float)1, false);
|
||||
video_driver_set_output_size(native_width , height);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(native_width, height));
|
||||
}
|
||||
else
|
||||
switch_res_crt(p_switch, p_switch->ra_core_width,
|
||||
|
||||
+17
-22
@@ -1847,9 +1847,9 @@ bool video_display_server_has_refresh_rate(float hz)
|
||||
|
||||
if (video_list)
|
||||
{
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(&video_driver_st);
|
||||
unsigned video_driver_width = VIDEO_DRIVER_OUTPUT_WIDTH(output_size);
|
||||
unsigned video_driver_height = VIDEO_DRIVER_OUTPUT_HEIGHT(output_size);
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(&video_driver_st);
|
||||
unsigned video_driver_width = VIDEO_SCALE_W(output_size);
|
||||
unsigned video_driver_height = VIDEO_SCALE_H(output_size);
|
||||
|
||||
for (i = 0; i < size && !rate_exists; i++)
|
||||
{
|
||||
@@ -2566,19 +2566,14 @@ void video_driver_set_filtering(unsigned index,
|
||||
index, smooth, ctx_scaling);
|
||||
}
|
||||
|
||||
void video_driver_get_output_size(unsigned *width, unsigned *height)
|
||||
unsigned video_driver_get_output_dims(void)
|
||||
{
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(&video_driver_st);
|
||||
if (width)
|
||||
*width = VIDEO_DRIVER_OUTPUT_WIDTH(output_size);
|
||||
if (height)
|
||||
*height = VIDEO_DRIVER_OUTPUT_HEIGHT(output_size);
|
||||
return VIDEO_DRIVER_OUTPUT_DIMS(&video_driver_st);
|
||||
}
|
||||
|
||||
void video_driver_set_output_size(unsigned width, unsigned height)
|
||||
void video_driver_set_output_dims(unsigned dims)
|
||||
{
|
||||
retro_atomic_store_release_int(&video_driver_st.output_size_packed,
|
||||
(int)VIDEO_SCALE_PACK(width, height));
|
||||
retro_atomic_store_release_int(&video_driver_st.output_dims, (int)dims);
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
@@ -2892,9 +2887,9 @@ void video_driver_set_aspect_ratio(void)
|
||||
|
||||
case ASPECT_RATIO_FULL:
|
||||
{
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
unsigned width = VIDEO_DRIVER_OUTPUT_WIDTH(output_size);
|
||||
unsigned height = VIDEO_DRIVER_OUTPUT_HEIGHT(output_size);
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
unsigned width = VIDEO_SCALE_W(output_size);
|
||||
unsigned height = VIDEO_SCALE_H(output_size);
|
||||
|
||||
if (width != 0 && height != 0)
|
||||
aspectratio_lut[ASPECT_RATIO_FULL].value = (float)width / (float)height;
|
||||
@@ -4771,9 +4766,9 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||
video_info->widgets_userdata = NULL;
|
||||
#endif
|
||||
|
||||
output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
video_info->width = VIDEO_DRIVER_OUTPUT_WIDTH(output_size);
|
||||
video_info->height = VIDEO_DRIVER_OUTPUT_HEIGHT(output_size);
|
||||
output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
video_info->width = VIDEO_SCALE_W(output_size);
|
||||
video_info->height = VIDEO_SCALE_H(output_size);
|
||||
#ifdef HAVE_THREADS
|
||||
if (is_threaded)
|
||||
video_info->scale_dims = video_thread_get_scale(video_st);
|
||||
@@ -7736,8 +7731,8 @@ VIDEO_NOINLINE static void video_driver_scanline_before_frame(video_driver_state
|
||||
uint16_t frame_time_target,
|
||||
uint16_t core_run_time)
|
||||
{
|
||||
uint16_t video_height = (uint16_t)VIDEO_DRIVER_OUTPUT_HEIGHT(
|
||||
VIDEO_DRIVER_OUTPUT_SIZE(video_st));
|
||||
uint16_t video_height = (uint16_t)VIDEO_SCALE_H(
|
||||
VIDEO_DRIVER_OUTPUT_DIMS(video_st));
|
||||
int16_t scanline_next = video_st->scanline[SCANLINE_NEXT];
|
||||
int16_t scanline_hold = video_st->scanline[SCANLINE_HOLD];
|
||||
int16_t scanline_blank = video_st->scanline[SCANLINE_TOTAL] - video_height;
|
||||
@@ -7820,8 +7815,8 @@ VIDEO_NOINLINE static void video_driver_scanline_after_frame(video_driver_state_
|
||||
uint16_t frame_time_target,
|
||||
uint16_t core_run_time)
|
||||
{
|
||||
uint16_t video_height = (uint16_t)VIDEO_DRIVER_OUTPUT_HEIGHT(
|
||||
VIDEO_DRIVER_OUTPUT_SIZE(video_st));
|
||||
uint16_t video_height = (uint16_t)VIDEO_SCALE_H(
|
||||
VIDEO_DRIVER_OUTPUT_DIMS(video_st));
|
||||
int16_t scanline_next = video_st->scanline[SCANLINE_NEXT];
|
||||
int16_t scanline_total = video_st->scanline[SCANLINE_TOTAL];
|
||||
int16_t scanline_blank = video_st->scanline[SCANLINE_TOTAL] - video_height;
|
||||
|
||||
+13
-14
@@ -83,12 +83,10 @@
|
||||
#define VIDEO_DRIVER_GET_HW_CONTEXT_INTERNAL(video_st) (&video_st->hw_render)
|
||||
|
||||
/* The output size as one value, from one load of
|
||||
* video_driver_state_t::output_size_packed. Take it once and read both
|
||||
* video_driver_state_t::output_dims. Take it once and read both
|
||||
* halves from it: two loads could pair a width with another size's
|
||||
* height. */
|
||||
#define VIDEO_DRIVER_OUTPUT_SIZE(video_st) ((unsigned)retro_atomic_load_acquire_int(&(video_st)->output_size_packed))
|
||||
#define VIDEO_DRIVER_OUTPUT_WIDTH(size) VIDEO_SCALE_W(size)
|
||||
#define VIDEO_DRIVER_OUTPUT_HEIGHT(size) VIDEO_SCALE_H(size)
|
||||
#define VIDEO_DRIVER_OUTPUT_DIMS(video_st) ((unsigned)retro_atomic_load_acquire_int(&(video_st)->output_dims))
|
||||
|
||||
#define VIDEO_HAS_FOCUS(video_st) ((video_st->current_video && video_st->data && video_st->current_video->focus) ? (video_st->current_video->focus(video_st->data)) : true)
|
||||
|
||||
@@ -711,9 +709,9 @@ typedef struct gfx_ctx_driver
|
||||
update_window_title_cb update_window_title;
|
||||
|
||||
/* Queries for resize and quit events.
|
||||
* Also processes events. */
|
||||
void (*check_window)(void*, bool*, bool*,
|
||||
unsigned*, unsigned*);
|
||||
* Also processes events. The size is one word in
|
||||
* VIDEO_SCALE_PACK's layout, read and written through it. */
|
||||
void (*check_window)(void*, bool*, bool*, unsigned*);
|
||||
|
||||
/* Acknowledge a resize event. This is needed for some APIs.
|
||||
* Most backends will ignore this. */
|
||||
@@ -1255,8 +1253,8 @@ typedef struct
|
||||
* 16, one value so a reader gets a matching pair without a lock.
|
||||
* Set by the drivers - on the video thread under the threaded video
|
||||
* wrapper - and read by the main thread, the menu and tasks, through
|
||||
* video_driver_set_output_size() / video_driver_get_output_size(). */
|
||||
retro_atomic_int_t output_size_packed;
|
||||
* video_driver_set_output_dims() / video_driver_get_output_dims(). */
|
||||
retro_atomic_int_t output_dims;
|
||||
/* Where the statistics overlay's text is built, for the frame
|
||||
* descriptor to point at (video_frame_info_t::stat_text) */
|
||||
char stat_text[1536];
|
||||
@@ -1670,10 +1668,11 @@ void video_driver_set_filtering(unsigned index, bool smooth, bool ctx_scaling);
|
||||
const char *video_driver_get_ident(void);
|
||||
|
||||
/**
|
||||
* video_driver_get_output_size / video_driver_set_output_size:
|
||||
* video_driver_get_output_dims / video_driver_set_output_dims:
|
||||
*
|
||||
* Get or set the output dimensions -- the size of the area where
|
||||
* the active video driver presents pixels to the user.
|
||||
* Get or set the output size -- the area where the active video
|
||||
* driver presents pixels to the user -- as one word, width in the
|
||||
* high half and height in the low, VIDEO_SCALE_PACK's layout.
|
||||
*
|
||||
* Per-driver mapping of "output area":
|
||||
* desktop GL/D3D/Vulkan/Metal -- the window's client area
|
||||
@@ -1698,9 +1697,9 @@ const char *video_driver_get_ident(void);
|
||||
* Threaded video: the read and write are protected by
|
||||
* video_st->display_lock; safe to call from any thread.
|
||||
*/
|
||||
void video_driver_get_output_size(unsigned *width, unsigned *height);
|
||||
unsigned video_driver_get_output_dims(void);
|
||||
|
||||
void video_driver_set_output_size(unsigned width, unsigned height);
|
||||
void video_driver_set_output_dims(unsigned dims);
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
struct overlay;
|
||||
|
||||
@@ -283,9 +283,12 @@ static void video_shader_replace_wildcards_impl(
|
||||
break;
|
||||
case RARCH_WILDCARD_VIEWPORT_ASPECT_ORIENTATION:
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned viewport_width = 0;
|
||||
unsigned viewport_height = 0;
|
||||
video_driver_get_output_size(&viewport_width, &viewport_height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
viewport_width = VIDEO_SCALE_W(out_dims);
|
||||
viewport_height = VIDEO_SCALE_H(out_dims);
|
||||
_len = strlcpy(replace_text,
|
||||
(viewport_height > 0 && (float)viewport_width / viewport_height < 1)
|
||||
? "VIEW-ASPECT-ORIENT-VERT"
|
||||
|
||||
@@ -1873,6 +1873,7 @@ static void video_thread_loop(void *data)
|
||||
{
|
||||
if (thr->driver->frame)
|
||||
{
|
||||
unsigned out_dims_o;
|
||||
bool ret;
|
||||
video_frame_info_t *video_info = &thr->frame.slot[slot].video_info;
|
||||
unsigned out_w = 0, out_h = 0;
|
||||
@@ -1886,7 +1887,9 @@ static void video_thread_loop(void *data)
|
||||
* from the frame info would rebuild them at the old size
|
||||
* and draw the menu into a corner of the window. The size
|
||||
* the driver reported last is what it must draw to now. */
|
||||
video_driver_get_output_size(&out_w, &out_h);
|
||||
out_dims_o = video_driver_get_output_dims();
|
||||
out_w = VIDEO_SCALE_W(out_dims_o);
|
||||
out_h = VIDEO_SCALE_H(out_dims_o);
|
||||
if (out_w && out_h)
|
||||
{
|
||||
video_info->width = out_w;
|
||||
|
||||
@@ -1248,8 +1248,11 @@ static int android_check_quick_tap(android_input_t *android)
|
||||
static INLINE void android_mouse_calculate_deltas(android_input_t *android,
|
||||
AInputEvent *event,size_t motion_ptr,int source)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned video_width, video_height;
|
||||
video_driver_get_output_size(&video_width, &video_height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
video_width = VIDEO_SCALE_W(out_dims);
|
||||
video_height = VIDEO_SCALE_H(out_dims);
|
||||
|
||||
float x = 0;
|
||||
float x_delta = 0;
|
||||
|
||||
@@ -313,8 +313,11 @@ static EM_BOOL rwebinput_mouse_cb(int event_type,
|
||||
|
||||
if (rwebinput->pointerlock_active)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned video_width, video_height;
|
||||
video_driver_get_output_size(&video_width, &video_height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
video_width = VIDEO_SCALE_W(out_dims);
|
||||
video_height = VIDEO_SCALE_H(out_dims);
|
||||
|
||||
rwebinput->mouse.x += mouse_event->movementX;
|
||||
rwebinput->mouse.y += mouse_event->movementY;
|
||||
|
||||
@@ -4079,12 +4079,12 @@ static void input_overlay_get_mouse_scale(settings_t *settings,
|
||||
if (geom->base_height)
|
||||
{
|
||||
float adj_x, adj_y;
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
float speed = settings->floats.input_overlay_mouse_speed;
|
||||
float swipe_thres =
|
||||
655.35f * settings->floats.input_overlay_mouse_swipe_threshold;
|
||||
float display_aspect = (float)VIDEO_DRIVER_OUTPUT_WIDTH(output_size)
|
||||
/ VIDEO_DRIVER_OUTPUT_HEIGHT(output_size);
|
||||
float display_aspect = (float)VIDEO_SCALE_W(output_size)
|
||||
/ VIDEO_SCALE_H(output_size);
|
||||
float core_aspect = (float)geom->base_width / geom->base_height;
|
||||
|
||||
if (display_aspect > core_aspect)
|
||||
@@ -6591,10 +6591,10 @@ static void input_overlay_enable_(bool enable)
|
||||
|
||||
if (auto_rotate)
|
||||
{
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
input_overlay_auto_rotate_(
|
||||
VIDEO_DRIVER_OUTPUT_WIDTH(output_size),
|
||||
VIDEO_DRIVER_OUTPUT_HEIGHT(output_size), true, ol);
|
||||
VIDEO_SCALE_W(output_size),
|
||||
VIDEO_SCALE_H(output_size), true, ol);
|
||||
}
|
||||
|
||||
/* Enable */
|
||||
|
||||
@@ -3741,7 +3741,7 @@ static float materialui_get_scroll(materialui_handle_t *mui,
|
||||
return 0;
|
||||
|
||||
/* Read cached size from mui rather than locking video_st via
|
||||
* video_driver_get_output_size: mui->last_{width,height} is updated
|
||||
* video_driver_get_output_dims: mui->last_{width,height} is updated
|
||||
* every frame in materialui_render. */
|
||||
height = VIDEO_SCALE_H(mui->last_dims);
|
||||
|
||||
@@ -9745,6 +9745,7 @@ static void materialui_menu_animation_update_time(float *s,
|
||||
|
||||
static void *materialui_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned width, height;
|
||||
settings_t *settings = config_get_ptr();
|
||||
gfx_animation_t *p_anim = anim_get_ptr();
|
||||
@@ -9772,7 +9773,9 @@ static void *materialui_init(void **userdata, bool video_is_threaded)
|
||||
|
||||
/* Get DPI/screen-size-aware base unit size for
|
||||
* UI elements */
|
||||
video_driver_get_output_size(&width, &height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
width = VIDEO_SCALE_W(out_dims);
|
||||
height = VIDEO_SCALE_H(out_dims);
|
||||
|
||||
mui->last_dims = VIDEO_SCALE_PACK(width, height);
|
||||
mui->last_scale_factor = gfx_display_get_dpi_scale(
|
||||
@@ -11774,7 +11777,7 @@ static int materialui_pointer_up(void *userdata,
|
||||
return -1;
|
||||
|
||||
/* Read cached size from mui rather than locking video_st via
|
||||
* video_driver_get_output_size: mui->last_{width,height} is updated
|
||||
* video_driver_get_output_dims: mui->last_{width,height} is updated
|
||||
* every frame in materialui_render. */
|
||||
|
||||
/* All input is ignored if user was previously
|
||||
|
||||
@@ -9976,6 +9976,7 @@ static void ozone_menu_animation_update_time(
|
||||
|
||||
static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned i;
|
||||
bool fallback_color_theme = false;
|
||||
unsigned width, height, color_theme = 0;
|
||||
@@ -9997,7 +9998,9 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
for (i = 0; i < 16; i++)
|
||||
ozone->pure_white[i] = 1.00f;
|
||||
|
||||
video_driver_get_output_size(&width, &height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
width = VIDEO_SCALE_W(out_dims);
|
||||
height = VIDEO_SCALE_H(out_dims);
|
||||
|
||||
/* Also used as a tag for cursor animation */
|
||||
ozone->default_theme = &ozone_theme_dark;
|
||||
|
||||
+5
-2
@@ -586,7 +586,7 @@ typedef struct xmb_handle
|
||||
* from video_info->{width,height} so non-render code paths
|
||||
* (selection_pointer_changed, list_open_new, list_switch_new,
|
||||
* list_cache, pointer_up, layout) can read the size without
|
||||
* locking video_st via video_driver_get_output_size. */
|
||||
* locking video_st via video_driver_get_output_dims. */
|
||||
/* The video size this was last laid out for, one word,
|
||||
* VIDEO_SCALE_PACK's layout. */
|
||||
unsigned last_dims;
|
||||
@@ -10532,6 +10532,7 @@ static void xmb_menu_animation_update_time(
|
||||
|
||||
static void *xmb_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
unsigned out_dims;
|
||||
int i;
|
||||
unsigned width, height;
|
||||
xmb_handle_t *xmb = NULL;
|
||||
@@ -10543,7 +10544,9 @@ static void *xmb_init(void **userdata, bool video_is_threaded)
|
||||
if (!menu)
|
||||
return NULL;
|
||||
|
||||
video_driver_get_output_size(&width, &height);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
width = VIDEO_SCALE_W(out_dims);
|
||||
height = VIDEO_SCALE_H(out_dims);
|
||||
|
||||
if (!(xmb = (xmb_handle_t*)calloc(1, sizeof(xmb_handle_t))))
|
||||
{
|
||||
|
||||
+6
-6
@@ -6081,9 +6081,9 @@ MENU_NOINLINE static int menu_input_post_iterate(
|
||||
menu_file_list_cbs_t *cbs = selection_buf && selection_buf->size
|
||||
? (menu_file_list_cbs_t*)selection_buf->list[selection].actiondata
|
||||
: NULL;
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
unsigned output_width = VIDEO_DRIVER_OUTPUT_WIDTH(output_size);
|
||||
unsigned output_height = VIDEO_DRIVER_OUTPUT_HEIGHT(output_size);
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
unsigned output_width = VIDEO_SCALE_W(output_size);
|
||||
unsigned output_height = VIDEO_SCALE_H(output_size);
|
||||
|
||||
MENU_ENTRY_INITIALIZE(entry);
|
||||
entry.flags |= MENU_ENTRY_FLAG_PATH_ENABLED
|
||||
@@ -7245,10 +7245,10 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
break;
|
||||
case RARCH_MENU_CTL_OSK_PTR_AT_POS:
|
||||
{
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(
|
||||
video_state_get_ptr());
|
||||
unsigned width = VIDEO_DRIVER_OUTPUT_WIDTH(output_size);
|
||||
unsigned height = VIDEO_DRIVER_OUTPUT_HEIGHT(output_size);
|
||||
unsigned width = VIDEO_SCALE_W(output_size);
|
||||
unsigned height = VIDEO_SCALE_H(output_size);
|
||||
menu_ctx_pointer_t *point = (menu_ctx_pointer_t*)data;
|
||||
if (!menu_st->driver_ctx || !menu_st->driver_ctx->osk_ptr_at_pos)
|
||||
{
|
||||
|
||||
+12
-12
@@ -1784,7 +1784,7 @@ void drivers_init(
|
||||
VIDEO_FLAG_FORCE_FULLSCREEN) ? true : false;
|
||||
bool video_is_fullscreen = settings->bools.video_fullscreen
|
||||
|| rarch_force_fullscreen;
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
|
||||
p_dispwidget->active= gfx_widgets_init(
|
||||
p_disp,
|
||||
@@ -1792,8 +1792,8 @@ void drivers_init(
|
||||
settings,
|
||||
(uintptr_t)&p_dispwidget->active,
|
||||
video_is_threaded,
|
||||
VIDEO_DRIVER_OUTPUT_WIDTH(output_size),
|
||||
VIDEO_DRIVER_OUTPUT_HEIGHT(output_size),
|
||||
VIDEO_SCALE_W(output_size),
|
||||
VIDEO_SCALE_H(output_size),
|
||||
video_is_fullscreen,
|
||||
settings->paths.directory_assets,
|
||||
settings->paths.path_font);
|
||||
@@ -4220,15 +4220,15 @@ bool command_event(enum event_command cmd, void *data)
|
||||
VIDEO_FLAG_FORCE_FULLSCREEN) ? true : false;
|
||||
bool video_is_fullscreen = settings->bools.video_fullscreen
|
||||
|| force_fs;
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
p_dispwidget->active = gfx_widgets_init(
|
||||
disp_get_ptr(),
|
||||
anim_get_ptr(),
|
||||
settings,
|
||||
(uintptr_t)&p_dispwidget->active,
|
||||
VIDEO_DRIVER_IS_THREADED_INTERNAL(video_st),
|
||||
VIDEO_DRIVER_OUTPUT_WIDTH(output_size),
|
||||
VIDEO_DRIVER_OUTPUT_HEIGHT(output_size),
|
||||
VIDEO_SCALE_W(output_size),
|
||||
VIDEO_SCALE_H(output_size),
|
||||
video_is_fullscreen,
|
||||
settings->paths.directory_assets,
|
||||
settings->paths.path_font);
|
||||
@@ -4473,13 +4473,13 @@ bool command_event(enum event_command cmd, void *data)
|
||||
command_event(CMD_EVENT_VIDEO_SET_ASPECT_RATIO, NULL);
|
||||
|
||||
/* Check orientation, if required */
|
||||
output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
if (inp_overlay_auto_rotate)
|
||||
if (check_rotation)
|
||||
if (*check_rotation)
|
||||
input_overlay_auto_rotate_(
|
||||
VIDEO_DRIVER_OUTPUT_WIDTH(output_size),
|
||||
VIDEO_DRIVER_OUTPUT_HEIGHT(output_size),
|
||||
VIDEO_SCALE_W(output_size),
|
||||
VIDEO_SCALE_H(output_size),
|
||||
settings->bools.input_overlay_enable,
|
||||
ol);
|
||||
}
|
||||
@@ -4893,11 +4893,11 @@ bool command_event(enum event_command cmd, void *data)
|
||||
layout_desc.auto_scale = settings->bools.input_overlay_auto_scale;
|
||||
}
|
||||
|
||||
output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_state_get_ptr());
|
||||
output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_state_get_ptr());
|
||||
input_overlay_set_scale_factor(ol,
|
||||
&layout_desc,
|
||||
VIDEO_DRIVER_OUTPUT_WIDTH(output_size),
|
||||
VIDEO_DRIVER_OUTPUT_HEIGHT(output_size));
|
||||
VIDEO_SCALE_W(output_size),
|
||||
VIDEO_SCALE_H(output_size));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -6432,9 +6432,8 @@ static enum runloop_state_enum runloop_check_state(
|
||||
bool focused = true;
|
||||
#if defined(HAVE_MENU) || defined(HAVE_GFX_WIDGETS)
|
||||
/* Snapshot of the output size. The video thread sets it through
|
||||
* video_driver_set_output_size() while this function runs. */
|
||||
unsigned output_width = 0;
|
||||
unsigned output_height = 0;
|
||||
* video_driver_set_output_dims() while this function runs. */
|
||||
unsigned output_dims = 0;
|
||||
#endif
|
||||
bool rarch_is_initialized = !!runloop_is_inited();
|
||||
bool runloop_paused = !!(runloop_st->flags & RUNLOOP_FLAG_PAUSED);
|
||||
@@ -6578,15 +6577,13 @@ static enum runloop_state_enum runloop_check_state(
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (settings->bools.input_overlay_enable)
|
||||
{
|
||||
static unsigned last_width = 0;
|
||||
static unsigned last_height = 0;
|
||||
unsigned video_driver_width = 0;
|
||||
unsigned video_driver_height = 0;
|
||||
static unsigned last_dims = 0;
|
||||
unsigned video_driver_dims = 0;
|
||||
bool check_next_rotation = true;
|
||||
bool input_overlay_hide_when_gamepad_connected = settings->bools.input_overlay_hide_when_gamepad_connected;
|
||||
bool input_overlay_auto_rotate = settings->bools.input_overlay_auto_rotate;
|
||||
|
||||
video_driver_get_output_size(&video_driver_width, &video_driver_height);
|
||||
video_driver_dims = video_driver_get_output_dims();
|
||||
|
||||
/* Check whether overlay should be hidden
|
||||
* when a gamepad is connected */
|
||||
@@ -6621,8 +6618,7 @@ static enum runloop_state_enum runloop_check_state(
|
||||
HOTKEY_CHECK(RARCH_OVERLAY_NEXT, CMD_EVENT_OVERLAY_NEXT, true, &check_next_rotation);
|
||||
|
||||
/* Check whether video aspect has changed */
|
||||
if ( (video_driver_width != last_width)
|
||||
|| (video_driver_height != last_height))
|
||||
if (video_driver_dims != last_dims)
|
||||
{
|
||||
/* Update scaling/offset factors */
|
||||
command_event(CMD_EVENT_OVERLAY_SET_SCALE_FACTOR, NULL);
|
||||
@@ -6630,13 +6626,12 @@ static enum runloop_state_enum runloop_check_state(
|
||||
/* Check overlay rotation, if required */
|
||||
if (input_overlay_auto_rotate)
|
||||
input_overlay_auto_rotate_(
|
||||
video_driver_width,
|
||||
video_driver_height,
|
||||
VIDEO_SCALE_W(video_driver_dims),
|
||||
VIDEO_SCALE_H(video_driver_dims),
|
||||
settings->bools.input_overlay_enable,
|
||||
input_st->overlay_ptr);
|
||||
|
||||
last_width = video_driver_width;
|
||||
last_height = video_driver_height;
|
||||
last_dims = video_driver_dims;
|
||||
}
|
||||
|
||||
/* Check OSK hotkey */
|
||||
@@ -6655,22 +6650,17 @@ static enum runloop_state_enum runloop_check_state(
|
||||
*/
|
||||
if (settings->uints.video_aspect_ratio_idx == ASPECT_RATIO_FULL)
|
||||
{
|
||||
static unsigned last_width = 0;
|
||||
static unsigned last_height = 0;
|
||||
unsigned video_driver_width = 0;
|
||||
unsigned video_driver_height = 0;
|
||||
|
||||
video_driver_get_output_size(&video_driver_width, &video_driver_height);
|
||||
static unsigned last_dims = 0;
|
||||
unsigned video_driver_dims =
|
||||
video_driver_get_output_dims();
|
||||
|
||||
/* Check whether video aspect has changed */
|
||||
if ( (video_driver_width != last_width)
|
||||
|| (video_driver_height != last_height))
|
||||
if (video_driver_dims != last_dims)
|
||||
{
|
||||
/* Update set aspect ratio so the full matches the current video width & height */
|
||||
command_event(CMD_EVENT_VIDEO_SET_ASPECT_RATIO, NULL);
|
||||
|
||||
last_width = video_driver_width;
|
||||
last_height = video_driver_height;
|
||||
last_dims = video_driver_dims;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6899,14 +6889,14 @@ static enum runloop_state_enum runloop_check_state(
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MENU) || defined(HAVE_GFX_WIDGETS)
|
||||
video_driver_get_output_size(&output_width, &output_height);
|
||||
output_dims = video_driver_get_output_dims();
|
||||
|
||||
gfx_animation_update(
|
||||
current_time,
|
||||
settings->bools.menu_timedate_enable,
|
||||
settings->floats.menu_ticker_speed,
|
||||
output_width,
|
||||
output_height);
|
||||
VIDEO_SCALE_W(output_dims),
|
||||
VIDEO_SCALE_H(output_dims));
|
||||
|
||||
#if defined(HAVE_GFX_WIDGETS)
|
||||
if (widgets_active)
|
||||
@@ -6929,8 +6919,8 @@ static enum runloop_state_enum runloop_check_state(
|
||||
gfx_widgets_iterate_layout(
|
||||
p_disp,
|
||||
settings,
|
||||
output_width,
|
||||
output_height,
|
||||
VIDEO_SCALE_W(output_dims),
|
||||
VIDEO_SCALE_H(output_dims),
|
||||
video_is_fullscreen,
|
||||
settings->paths.directory_assets,
|
||||
settings->paths.path_font,
|
||||
@@ -6941,8 +6931,8 @@ static enum runloop_state_enum runloop_check_state(
|
||||
gfx_widgets_iterate(
|
||||
p_disp,
|
||||
settings,
|
||||
output_width,
|
||||
output_height,
|
||||
VIDEO_SCALE_W(output_dims),
|
||||
VIDEO_SCALE_H(output_dims),
|
||||
video_is_fullscreen,
|
||||
settings->paths.directory_assets,
|
||||
settings->paths.path_font,
|
||||
@@ -7354,8 +7344,8 @@ static enum runloop_state_enum runloop_check_state(
|
||||
if (menu->driver_ctx->render)
|
||||
menu->driver_ctx->render(
|
||||
menu->userdata,
|
||||
output_width,
|
||||
output_height,
|
||||
VIDEO_SCALE_W(output_dims),
|
||||
VIDEO_SCALE_H(output_dims),
|
||||
(runloop_st->flags & RUNLOOP_FLAG_IDLE) ? true : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -316,18 +316,14 @@ unsigned int retroarch_get_rotation(void) { return 0; }
|
||||
float video_driver_get_aspect_ratio(void) { return 4.0f / 3.0f; }
|
||||
void video_driver_scanline_init(void) { }
|
||||
void video_monitor_set_refresh_rate(float hz) { (void)hz; }
|
||||
void video_driver_set_output_size(unsigned width, unsigned height)
|
||||
void video_driver_set_output_dims(unsigned dims)
|
||||
{
|
||||
(void)width;
|
||||
(void)height;
|
||||
(void)dims;
|
||||
}
|
||||
|
||||
void video_driver_get_output_size(unsigned *width, unsigned *height)
|
||||
unsigned video_driver_get_output_dims(void)
|
||||
{
|
||||
if (width)
|
||||
*width = 640;
|
||||
if (height)
|
||||
*height = 480;
|
||||
return VIDEO_SCALE_PACK(640, 480);
|
||||
}
|
||||
|
||||
static const char *ctx_ident = "wl";
|
||||
|
||||
@@ -133,10 +133,9 @@ bool video_context_driver_get_flags(gfx_ctx_flags_t *flags)
|
||||
|
||||
float video_driver_get_core_aspect(void) { return 4.0f / 3.0f; }
|
||||
|
||||
void video_driver_get_output_size(unsigned *width, unsigned *height)
|
||||
unsigned video_driver_get_output_dims(void)
|
||||
{
|
||||
*width = 1920;
|
||||
*height = 1080;
|
||||
return VIDEO_SCALE_PACK(1920, 1080);
|
||||
}
|
||||
|
||||
void video_driver_modify_disp_flags(uint32_t set_bits, uint32_t clear_bits)
|
||||
|
||||
@@ -2010,7 +2010,7 @@ static bool rslane_frame(void *data, const void *frame,
|
||||
unsigned spins = 0;
|
||||
while (RSLANE_GET() == 1 && spins++ < 2000)
|
||||
retro_sleep(1);
|
||||
video_driver_set_output_size(rslane_report_w, rslane_report_h);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(rslane_report_w, rslane_report_h));
|
||||
RSLANE_SET(3);
|
||||
}
|
||||
else if (RSLANE_GET() == 3 && !rslane_seen)
|
||||
@@ -2027,6 +2027,7 @@ static bool rslane_frame(void *data, const void *frame,
|
||||
|
||||
static void lane_resize_under_wrapper(void)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned had = failures;
|
||||
thread_video_t *thr;
|
||||
unsigned before_w = 0, before_h = 0;
|
||||
@@ -2048,7 +2049,9 @@ static void lane_resize_under_wrapper(void)
|
||||
rslane_driver.frame = rslane_frame;
|
||||
thr->driver = &rslane_driver;
|
||||
|
||||
video_driver_get_output_size(&before_w, &before_h);
|
||||
out_dims = video_driver_get_output_dims();
|
||||
before_w = VIDEO_SCALE_W(out_dims);
|
||||
before_h = VIDEO_SCALE_H(out_dims);
|
||||
rslane_report_w = before_w + 320;
|
||||
rslane_report_h = before_h + 200;
|
||||
rslane_seen_w = rslane_seen_h = 0;
|
||||
@@ -2076,7 +2079,7 @@ static void lane_resize_under_wrapper(void)
|
||||
thr->driver = rslane_inner;
|
||||
RSLANE_SET(0);
|
||||
/* Put the size and the menu back for the lanes that follow. */
|
||||
video_driver_set_output_size(before_w, before_h);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(before_w, before_h));
|
||||
if (!menu_is_up())
|
||||
command_event(CMD_EVENT_MENU_TOGGLE, NULL);
|
||||
run_frames(2);
|
||||
@@ -2213,6 +2216,7 @@ static void lane_dupe_under_wrapper(void)
|
||||
|
||||
static void lane_size_pair_round_trip(void)
|
||||
{
|
||||
unsigned out_dims;
|
||||
unsigned had = failures;
|
||||
unsigned w, h;
|
||||
size_t pitch;
|
||||
@@ -2220,13 +2224,17 @@ static void lane_size_pair_round_trip(void)
|
||||
static uint8_t pix[320 * 200 * sizeof(uint32_t)];
|
||||
|
||||
/* The output size. */
|
||||
video_driver_set_output_size(1280, 720);
|
||||
video_driver_get_output_size(&w, &h);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(1280, 720));
|
||||
out_dims = video_driver_get_output_dims();
|
||||
w = VIDEO_SCALE_W(out_dims);
|
||||
h = VIDEO_SCALE_H(out_dims);
|
||||
CHECK(w == 1280 && h == 720,
|
||||
"the output size came back %ux%u, not 1280x720", w, h);
|
||||
|
||||
video_driver_set_output_size(VIDEO_SCALE_DIM_MAX + 1, 720);
|
||||
video_driver_get_output_size(&w, &h);
|
||||
video_driver_set_output_dims(VIDEO_SCALE_PACK(VIDEO_SCALE_DIM_MAX + 1, 720));
|
||||
out_dims = video_driver_get_output_dims();
|
||||
w = VIDEO_SCALE_W(out_dims);
|
||||
h = VIDEO_SCALE_H(out_dims);
|
||||
CHECK(w == VIDEO_SCALE_DIM_MAX && h == 720,
|
||||
"an out-of-range output width came back as %u, not clamped to %u",
|
||||
w, VIDEO_SCALE_DIM_MAX);
|
||||
|
||||
+3
-3
@@ -343,7 +343,7 @@ bool steam_open_osk(void)
|
||||
{
|
||||
bool shown = false;
|
||||
bool on_deck = false;
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_SIZE(
|
||||
unsigned output_size = VIDEO_DRIVER_OUTPUT_DIMS(
|
||||
video_state_get_ptr());
|
||||
|
||||
/* Only open the Steam OSK if running on a Steam Deck,
|
||||
@@ -356,8 +356,8 @@ bool steam_open_osk(void)
|
||||
MistFloatingGamepadTextInputMode_SingleLine,
|
||||
0,
|
||||
0,
|
||||
VIDEO_DRIVER_OUTPUT_WIDTH(output_size),
|
||||
VIDEO_DRIVER_OUTPUT_HEIGHT(output_size) / 2,
|
||||
VIDEO_SCALE_W(output_size),
|
||||
VIDEO_SCALE_H(output_size) / 2,
|
||||
&shown
|
||||
);
|
||||
|
||||
|
||||
+10
-10
@@ -760,11 +760,11 @@ static bool take_screenshot_viewport(
|
||||
video_st->data, hdr_buffer,
|
||||
runloop_flags & RUNLOOP_FLAG_IDLE, &hdr))
|
||||
{
|
||||
output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
if (VIDEO_SCALE_W(vp.dims) > VIDEO_DRIVER_OUTPUT_WIDTH(output_size))
|
||||
VIDEO_SCALE_PUT_W(vp.dims, VIDEO_DRIVER_OUTPUT_WIDTH(output_size));
|
||||
if (VIDEO_SCALE_H(vp.dims) > VIDEO_DRIVER_OUTPUT_HEIGHT(output_size))
|
||||
VIDEO_SCALE_PUT_H(vp.dims, VIDEO_DRIVER_OUTPUT_HEIGHT(output_size));
|
||||
output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
if (VIDEO_SCALE_W(vp.dims) > VIDEO_SCALE_W(output_size))
|
||||
VIDEO_SCALE_PUT_W(vp.dims, VIDEO_SCALE_W(output_size));
|
||||
if (VIDEO_SCALE_H(vp.dims) > VIDEO_SCALE_H(output_size))
|
||||
VIDEO_SCALE_PUT_H(vp.dims, VIDEO_SCALE_H(output_size));
|
||||
|
||||
/* 48-bit RGB, bottom-up (pitch = width*6, negated top-down
|
||||
* inside screenshot_dump_direct like the BGR24 path). */
|
||||
@@ -788,11 +788,11 @@ static bool take_screenshot_viewport(
|
||||
video_st->data, buffer, runloop_flags & RUNLOOP_FLAG_IDLE)))
|
||||
{
|
||||
/* Limit image to screen size */
|
||||
output_size = VIDEO_DRIVER_OUTPUT_SIZE(video_st);
|
||||
if (VIDEO_SCALE_W(vp.dims) > VIDEO_DRIVER_OUTPUT_WIDTH(output_size))
|
||||
VIDEO_SCALE_PUT_W(vp.dims, VIDEO_DRIVER_OUTPUT_WIDTH(output_size));
|
||||
if (VIDEO_SCALE_H(vp.dims) > VIDEO_DRIVER_OUTPUT_HEIGHT(output_size))
|
||||
VIDEO_SCALE_PUT_H(vp.dims, VIDEO_DRIVER_OUTPUT_HEIGHT(output_size));
|
||||
output_size = VIDEO_DRIVER_OUTPUT_DIMS(video_st);
|
||||
if (VIDEO_SCALE_W(vp.dims) > VIDEO_SCALE_W(output_size))
|
||||
VIDEO_SCALE_PUT_W(vp.dims, VIDEO_SCALE_W(output_size));
|
||||
if (VIDEO_SCALE_H(vp.dims) > VIDEO_SCALE_H(output_size))
|
||||
VIDEO_SCALE_PUT_H(vp.dims, VIDEO_SCALE_H(output_size));
|
||||
|
||||
/* Data read from viewport is in bottom-up order, suitable for BMP. */
|
||||
if (screenshot_dump(screenshot_dir,
|
||||
|
||||
Reference in new issue
Block a user