mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Refactor some more code to no longer use global->video_data.width/
global->video_data.height directly
This commit is contained in:
parent
79db0c2ab5
commit
b99ae6f4e4
@ -353,18 +353,21 @@ static void xdk_renderchain_set_final_viewport(void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool xdk_renderchain_render(void *data, const void *frame,
|
static bool xdk_renderchain_render(void *data, const void *frame,
|
||||||
unsigned width, unsigned height, unsigned pitch, unsigned rotation)
|
unsigned frame_width, unsigned frame_height,
|
||||||
|
unsigned pitch, unsigned rotation)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
unsigned width, height;
|
||||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
|
xdk_renderchain_t *chain = (xdk_renderchain_t*)d3d->renderchain_data;
|
||||||
uint64_t frame_count = video_driver_get_frame_count();
|
uint64_t frame_count = video_driver_get_frame_count();
|
||||||
|
|
||||||
renderchain_blit_to_texture(chain, frame, width, height, pitch);
|
video_driver_get_size(&width, &height);
|
||||||
renderchain_set_vertices(d3d, 1, width, height, frame_count);
|
|
||||||
|
renderchain_blit_to_texture(chain, frame, frame_width, frame_height, pitch);
|
||||||
|
renderchain_set_vertices(d3d, 1, frame_width, frame_height, frame_count);
|
||||||
|
|
||||||
d3d_set_texture(d3dr, 0, chain->tex);
|
d3d_set_texture(d3dr, 0, chain->tex);
|
||||||
d3d_set_viewport(chain->dev, &d3d->final_viewport);
|
d3d_set_viewport(chain->dev, &d3d->final_viewport);
|
||||||
@ -378,8 +381,7 @@ static bool xdk_renderchain_render(void *data, const void *frame,
|
|||||||
d3d_set_stream_source(d3dr, i, chain->vertex_buf, 0, sizeof(Vertex));
|
d3d_set_stream_source(d3dr, i, chain->vertex_buf, 0, sizeof(Vertex));
|
||||||
|
|
||||||
d3d_draw_primitive(d3dr, D3DPT_TRIANGLESTRIP, 0, 2);
|
d3d_draw_primitive(d3dr, D3DPT_TRIANGLESTRIP, 0, 2);
|
||||||
renderchain_set_mvp(d3d, global->video_data.width,
|
renderchain_set_mvp(d3d, width, height, d3d->dev_rotation);
|
||||||
global->video_data.height, d3d->dev_rotation);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,6 @@ static void d3d_resize(void *data, unsigned new_width, unsigned new_height)
|
|||||||
{
|
{
|
||||||
d3d_video_t *d3d = (d3d_video_t*)curD3D;
|
d3d_video_t *d3d = (d3d_video_t*)curD3D;
|
||||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
|
|
||||||
if (!d3dr)
|
if (!d3dr)
|
||||||
return;
|
return;
|
||||||
@ -65,8 +64,10 @@ static void d3d_resize(void *data, unsigned new_width, unsigned new_height)
|
|||||||
if (new_width != d3d->video_info.width || new_height != d3d->video_info.height)
|
if (new_width != d3d->video_info.width || new_height != d3d->video_info.height)
|
||||||
{
|
{
|
||||||
RARCH_LOG("[D3D]: Resize %ux%u.\n", new_width, new_height);
|
RARCH_LOG("[D3D]: Resize %ux%u.\n", new_width, new_height);
|
||||||
d3d->video_info.width = global->video_data.width = new_width;
|
d3d->video_info.width = new_width;
|
||||||
d3d->video_info.height = global->video_data.height = new_height;
|
d3d->video_info.height = new_height;
|
||||||
|
video_driver_set_size_width(new_width);
|
||||||
|
video_driver_set_size_height(new_height);
|
||||||
d3d_restore(d3d);
|
d3d_restore(d3d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -846,3 +846,19 @@ void video_driver_get_size(unsigned *width, unsigned *height)
|
|||||||
if (height)
|
if (height)
|
||||||
*height = global->video_data.height;
|
*height = global->video_data.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void video_driver_set_size_width(unsigned width)
|
||||||
|
{
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
if (!global)
|
||||||
|
return;
|
||||||
|
global->video_data.width = width;
|
||||||
|
}
|
||||||
|
|
||||||
|
void video_driver_set_size_height(unsigned height)
|
||||||
|
{
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
if (!global)
|
||||||
|
return;
|
||||||
|
global->video_data.height = height;
|
||||||
|
}
|
||||||
|
@ -342,6 +342,10 @@ bool video_driver_set_viewport(unsigned width, unsigned height,
|
|||||||
|
|
||||||
void video_driver_get_size(unsigned *width, unsigned *height);
|
void video_driver_get_size(unsigned *width, unsigned *height);
|
||||||
|
|
||||||
|
void video_driver_set_size_width(unsigned width);
|
||||||
|
|
||||||
|
void video_driver_set_size_height(unsigned width);
|
||||||
|
|
||||||
uint64_t video_driver_get_frame_count(void);
|
uint64_t video_driver_get_frame_count(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user