Change prototype of video_driver_set_size

This commit is contained in:
twinaphex 2020-01-31 03:47:50 +01:00
parent b490c774bf
commit f0e889b552
23 changed files with 52 additions and 50 deletions

View File

@ -261,7 +261,7 @@
_viewport->full_width = width;
_viewport->full_height = height;
video_driver_set_size(&_viewport->full_width, &_viewport->full_height);
video_driver_set_size(_viewport->full_width, _viewport->full_height);
_layer.drawableSize = CGSizeMake(width, height);
video_driver_update_viewport(_viewport, forceFull, _keepAspect);

View File

@ -62,7 +62,7 @@ static void caca_gfx_create(void)
caca_dither = caca_create_dither(16, caca_video_width, caca_video_height, caca_video_pitch,
0xf800, 0x7e0, 0x1f, 0x0);
video_driver_set_size(&caca_video_width, &caca_video_height);
video_driver_set_size(caca_video_width, caca_video_height);
}
static void *caca_gfx_init(const video_info_t *video,
@ -192,7 +192,7 @@ static void caca_gfx_set_nonblock_state(void *data, bool toggle)
static bool caca_gfx_alive(void *data)
{
(void)data;
video_driver_set_size(&caca_video_width, &caca_video_height);
video_driver_set_size(caca_video_width, caca_video_height);
return true;
}

View File

@ -345,7 +345,7 @@ static void* ctr_init(const video_info_t* video,
ctr->vp.height = CTR_TOP_FRAMEBUFFER_HEIGHT;
ctr->vp.full_width = CTR_TOP_FRAMEBUFFER_WIDTH;
ctr->vp.full_height = CTR_TOP_FRAMEBUFFER_HEIGHT;
video_driver_set_size(&ctr->vp.width, &ctr->vp.height);
video_driver_set_size(ctr->vp.width, ctr->vp.height);
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);

View File

@ -700,7 +700,7 @@ static void *d3d10_gfx_init(const video_info_t* video,
D3D10SetRenderTargets(d3d10->device, 1, &d3d10->renderTargetView, NULL);
video_driver_set_size(&d3d10->vp.full_width, &d3d10->vp.full_height);
video_driver_set_size(d3d10->vp.full_width, d3d10->vp.full_height);
d3d10->viewport.Width = d3d10->vp.full_width;
d3d10->viewport.Height = d3d10->vp.full_height;
d3d10->resize_viewport = true;
@ -1222,7 +1222,7 @@ static bool d3d10_gfx_frame(
d3d10->resize_chain = false;
d3d10->resize_viewport = true;
video_driver_set_size(&video_info->width, &video_info->height);
video_driver_set_size(video_info->width, video_info->height);
}
PERF_START();
@ -1540,8 +1540,10 @@ static bool d3d10_gfx_alive(void* data)
win32_check_window(&quit, &d3d10->resize_chain, &d3d10->vp.full_width, &d3d10->vp.full_height);
if (d3d10->resize_chain && d3d10->vp.full_width != 0 && d3d10->vp.full_height != 0)
video_driver_set_size(&d3d10->vp.full_width, &d3d10->vp.full_height);
if ( d3d10->resize_chain
&& d3d10->vp.full_width != 0
&& d3d10->vp.full_height != 0)
video_driver_set_size(d3d10->vp.full_width, d3d10->vp.full_height);
return !quit;
}

View File

@ -777,7 +777,7 @@ static void *d3d11_gfx_init(const video_info_t* video,
D3D11SetRenderTargets(d3d11->context, 1, &d3d11->renderTargetView, NULL);
video_driver_set_size(&d3d11->vp.full_width, &d3d11->vp.full_height);
video_driver_set_size(d3d11->vp.full_width, d3d11->vp.full_height);
d3d11->viewport.Width = d3d11->vp.full_width;
d3d11->viewport.Height = d3d11->vp.full_height;
d3d11->resize_viewport = true;
@ -1303,7 +1303,7 @@ static bool d3d11_gfx_frame(
d3d11->resize_chain = false;
d3d11->resize_viewport = true;
video_driver_set_size(&video_info->width, &video_info->height);
video_driver_set_size(video_info->width, video_info->height);
}
#ifdef __WINRT__
@ -1619,7 +1619,7 @@ static bool d3d11_gfx_alive(void* data)
win32_check_window(&quit, &d3d11->resize_chain, &d3d11->vp.full_width, &d3d11->vp.full_height);
if (d3d11->resize_chain && d3d11->vp.full_width != 0 && d3d11->vp.full_height != 0)
video_driver_set_size(&d3d11->vp.full_width, &d3d11->vp.full_height);
video_driver_set_size(d3d11->vp.full_width, d3d11->vp.full_height);
return !quit;
}

View File

@ -992,7 +992,7 @@ static void *d3d12_gfx_init(const video_info_t* video,
}
d3d12_gfx_set_rotation(d3d12, 0);
video_driver_set_size(&d3d12->vp.full_width, &d3d12->vp.full_height);
video_driver_set_size(d3d12->vp.full_width, d3d12->vp.full_height);
d3d12->chain.viewport.Width = d3d12->vp.full_width;
d3d12->chain.viewport.Height = d3d12->vp.full_height;
d3d12->resize_viewport = true;
@ -1194,7 +1194,7 @@ static bool d3d12_gfx_frame(
d3d12->ubo_values.OutputSize.width = d3d12->chain.viewport.Width;
d3d12->ubo_values.OutputSize.height = d3d12->chain.viewport.Height;
video_driver_set_size(&video_info->width, &video_info->height);
video_driver_set_size(video_info->width, video_info->height);
}
D3D12ResetCommandAllocator(d3d12->queue.allocator);
@ -1608,8 +1608,10 @@ static bool d3d12_gfx_alive(void* data)
win32_check_window(&quit, &d3d12->resize_chain, &d3d12->vp.full_width, &d3d12->vp.full_height);
if (d3d12->resize_chain && d3d12->vp.full_width != 0 && d3d12->vp.full_height != 0)
video_driver_set_size(&d3d12->vp.full_width, &d3d12->vp.full_height);
if ( d3d12->resize_chain
&& d3d12->vp.full_width != 0
&& d3d12->vp.full_height != 0)
video_driver_set_size(d3d12->vp.full_width, d3d12->vp.full_height);
return !quit;
}

View File

@ -699,7 +699,7 @@ static void d3d8_make_d3dpp(void *data,
unsigned height = 0;
d3d8_get_video_size(d3d, &width, &height);
video_driver_set_size(&width, &height);
video_driver_set_size(width, height);
#endif
video_driver_get_size(&d3dpp->BackBufferWidth,
&d3dpp->BackBufferHeight);
@ -1026,7 +1026,7 @@ static bool d3d8_set_resize(d3d8_video_t *d3d,
RARCH_LOG("[D3D8]: Resize %ux%u.\n", new_width, new_height);
d3d->video_info.width = new_width;
d3d->video_info.height = new_height;
video_driver_set_size(&new_width, &new_height);
video_driver_set_size(new_width, new_height);
return true;
}
@ -1060,7 +1060,7 @@ static bool d3d8_alive(void *data)
ret = !quit;
if (temp_width != 0 && temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
return ret;
}
@ -1168,7 +1168,7 @@ 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_size(&new_width, &new_height);
video_driver_set_size(new_width, new_height);
}
#ifdef HAVE_WINDOW

View File

@ -98,7 +98,7 @@ static bool d3d9_set_resize(d3d9_video_t *d3d,
RARCH_LOG("[D3D9]: Resize %ux%u.\n", new_width, new_height);
d3d->video_info.width = new_width;
d3d->video_info.height = new_height;
video_driver_set_size(&new_width, &new_height);
video_driver_set_size(new_width, new_height);
return true;
}
@ -709,7 +709,7 @@ void d3d9_make_d3dpp(void *data,
unsigned width = 0;
unsigned height = 0;
d3d9_get_video_size(d3d, &width, &height);
video_driver_set_size(&width, &height);
video_driver_set_size(width, height);
#endif
video_driver_get_size(&d3dpp->BackBufferWidth,
&d3dpp->BackBufferHeight);
@ -1077,7 +1077,7 @@ static bool d3d9_alive(void *data)
if ( temp_width != 0 &&
temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
return ret;
}
@ -1192,7 +1192,7 @@ static bool d3d9_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_size(&new_width, &new_height);
video_driver_set_size(new_width, new_height);
}
#ifdef HAVE_WINDOW

View File

@ -198,7 +198,7 @@ static void *fpga_gfx_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_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
video_driver_get_size(&temp_width, &temp_height);
@ -365,7 +365,7 @@ static bool fpga_gfx_alive(void *data)
video_context_driver_check_window(&size_data);
if (temp_width != 0 && temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
return true;
}

View File

@ -162,7 +162,7 @@ static void *gdi_gfx_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_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
video_driver_get_size(&temp_width, &temp_height);
@ -393,7 +393,7 @@ static bool gdi_gfx_alive(void *data)
ret = !quit;
if (temp_width != 0 && temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
return ret;
}

View File

@ -3789,7 +3789,7 @@ 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_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
video_driver_get_size(&temp_width, &temp_height);
gl->video_width = temp_width;
@ -3980,7 +3980,7 @@ static bool gl2_alive(void *data)
if (temp_width != 0 && temp_height != 0)
{
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
gl->video_width = temp_width;
gl->video_height = temp_height;
}

View File

@ -347,7 +347,7 @@ static void *gl1_gfx_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_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
video_driver_get_size(&temp_width, &temp_height);
@ -972,7 +972,7 @@ static bool gl1_gfx_alive(void *data)
ret = !quit;
if (temp_width != 0 && temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
return ret;
}

View File

@ -1299,7 +1299,7 @@ static void *gl_core_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_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
video_driver_get_size(&temp_width, &temp_height);
gl->video_width = temp_width;
gl->video_height = temp_height;
@ -1565,7 +1565,7 @@ static bool gl_core_alive(void *data)
if (temp_width != 0 && temp_height != 0)
{
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
gl->video_width = temp_width;
gl->video_height = temp_height;
}

View File

@ -442,7 +442,7 @@ static void *wiiu_gfx_init(const video_info_t *video,
wiiu->vp.height = wiiu->render_mode.height;
wiiu->vp.full_width = wiiu->render_mode.width;
wiiu->vp.full_height = wiiu->render_mode.height;
video_driver_set_size(&wiiu->vp.width, &wiiu->vp.height);
video_driver_set_size(wiiu->vp.width, wiiu->vp.height);
driver_ctl(RARCH_DRIVER_CTL_SET_REFRESH_RATE, &refresh_rate);

View File

@ -348,7 +348,7 @@ static bool network_gfx_alive(void *data)
&quit, &resize, &temp_width, &temp_height, is_shutdown);
if (temp_width != 0 && temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
return true;
}

View File

@ -450,7 +450,7 @@ static bool sixel_gfx_alive(void *data)
&quit, &resize, &temp_width, &temp_height, is_shutdown);
if (temp_width != 0 && temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
return true;
}

View File

@ -120,7 +120,7 @@ static void *switch_init(const video_info_t *video,
sw->vp.height = 720;
sw->vp.full_width = 1280;
sw->vp.full_height = 720;
video_driver_set_size(&sw->vp.width, &sw->vp.height);
video_driver_set_size(sw->vp.width, sw->vp.height);
sw->vsync = video->vsync;
sw->rgb32 = video->rgb32;

View File

@ -140,7 +140,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_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
interval = video->vsync ? 1 : 0;
@ -193,7 +193,7 @@ static void *vg_init(const video_info_t *video,
if (temp_width != 0 && temp_height != 0)
{
RARCH_LOG("[VG]: Verified window resolution %ux%u.\n", temp_width, temp_height);
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
}
video_driver_get_size(&temp_width, &temp_height);
@ -463,7 +463,7 @@ static bool vg_alive(void *data)
&quit, &resize, &temp_width, &temp_height, is_shutdown);
if (temp_width != 0 && temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
return !quit;
}

View File

@ -257,7 +257,7 @@ static void vga_gfx_set_nonblock_state(void *data, bool toggle)
static bool vga_gfx_alive(void *data)
{
(void)data;
video_driver_set_size(&vga_video_width, &vga_video_height);
video_driver_set_size(vga_video_width, vga_video_height);
return true;
}

View File

@ -92,7 +92,7 @@ static void *vita2d_gfx_init(const video_info_t *video,
vita->tex_filter = video->smooth
? SCE_GXM_TEXTURE_FILTER_LINEAR : SCE_GXM_TEXTURE_FILTER_POINT;
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
vita2d_gfx_set_viewport(vita, temp_width, temp_height, false, true);
if (input && input_data)

View File

@ -1225,7 +1225,7 @@ static void *vulkan_init(const video_info_t *video,
temp_height = mode.height;
if (temp_width != 0 && temp_height != 0)
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
video_driver_get_size(&temp_width, &temp_height);
vk->video_width = temp_width;
vk->video_height = temp_height;
@ -1357,7 +1357,7 @@ static bool vulkan_alive(void *data)
if (temp_width != 0 && temp_height != 0)
{
video_driver_set_size(&temp_width, &temp_height);
video_driver_set_size(temp_width, temp_height);
vk->video_width = temp_width;
vk->video_height = temp_height;
}

View File

@ -20814,16 +20814,14 @@ void video_driver_get_size(unsigned *width, unsigned *height)
#endif
}
void video_driver_set_size(unsigned *width, unsigned *height)
void video_driver_set_size(unsigned width, unsigned height)
{
#ifdef HAVE_THREADS
bool is_threaded = video_driver_is_threaded_internal();
video_driver_threaded_lock(is_threaded);
#endif
if (width)
video_driver_width = *width;
if (height)
video_driver_height = *height;
video_driver_width = width;
video_driver_height = height;
#ifdef HAVE_THREADS
video_driver_threaded_unlock(is_threaded);
#endif

View File

@ -1632,7 +1632,7 @@ bool video_driver_set_viewport(unsigned width, unsigned height,
void video_driver_get_size(unsigned *width, unsigned *height);
void video_driver_set_size(unsigned *width, unsigned *height);
void video_driver_set_size(unsigned width, unsigned height);
float video_driver_get_aspect_ratio(void);