mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
(gfx_display) Make gfx_display_set_fb_size - get rid of the small
getter/setter functions - also finally take this opportunity to stop setting framebuffer width/height/pitch for menu drivers that don't use a framebuffer texture at all
This commit is contained in:
parent
6d9ee4c161
commit
618cfacd59
@ -534,9 +534,7 @@ static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
|
||||
|
||||
new_fb_pitch = new_fb_width * 2;
|
||||
|
||||
gfx_display_set_width(new_fb_width);
|
||||
gfx_display_set_height(new_fb_height);
|
||||
gfx_display_set_framebuffer_pitch(new_fb_pitch);
|
||||
gfx_display_set_framebuf(new_fb_width, new_fb_height, new_fb_pitch);
|
||||
|
||||
GX_SetViewportJitter(0, 0, gx_mode.fbWidth, gx_mode.efbHeight, 0, 1, 1);
|
||||
GX_SetDispCopySrc(0, 0, gx_mode.fbWidth, gx_mode.efbHeight);
|
||||
|
@ -531,8 +531,12 @@ void gfx_display_draw_quad(
|
||||
void *data,
|
||||
unsigned video_width,
|
||||
unsigned video_height,
|
||||
int x, int y, unsigned w, unsigned h,
|
||||
unsigned width, unsigned height,
|
||||
int x,
|
||||
int y,
|
||||
unsigned w,
|
||||
unsigned h,
|
||||
unsigned width,
|
||||
unsigned height,
|
||||
float *color,
|
||||
uintptr_t *texture)
|
||||
{
|
||||
@ -1092,24 +1096,17 @@ void gfx_display_get_fb_size(unsigned *fb_width,
|
||||
*fb_pitch = p_disp->framebuf_pitch;
|
||||
}
|
||||
|
||||
/* Set the display framebuffer's width. */
|
||||
void gfx_display_set_width(unsigned width)
|
||||
{
|
||||
gfx_display_t *p_disp = disp_get_ptr();
|
||||
p_disp->framebuf_width = width;
|
||||
}
|
||||
|
||||
/* Set the display framebuffer's height. */
|
||||
void gfx_display_set_height(unsigned height)
|
||||
/* Set the display framebuffer's dimensions. */
|
||||
void gfx_display_set_fb_size(
|
||||
unsigned width,
|
||||
unsigned height,
|
||||
size_t pitch
|
||||
)
|
||||
{
|
||||
gfx_display_t *p_disp = disp_get_ptr();
|
||||
p_disp->framebuf_width = width;
|
||||
p_disp->framebuf_height = height;
|
||||
}
|
||||
|
||||
void gfx_display_set_framebuffer_pitch(size_t pitch)
|
||||
{
|
||||
gfx_display_t *p_disp = disp_get_ptr();
|
||||
p_disp->framebuf_pitch = pitch;
|
||||
p_disp->framebuf_pitch = pitch;
|
||||
}
|
||||
|
||||
void gfx_display_set_msg_force(bool state)
|
||||
@ -1274,9 +1271,8 @@ void gfx_display_init_white_texture(uintptr_t white_texture)
|
||||
TEXTURE_FILTER_NEAREST, &gfx_display_white_texture);
|
||||
}
|
||||
|
||||
void gfx_display_free(void)
|
||||
void gfx_display_free(gfx_display_t *p_disp)
|
||||
{
|
||||
gfx_display_t *p_disp = disp_get_ptr();
|
||||
video_coord_array_free(&p_disp->dispca);
|
||||
|
||||
p_disp->msg_force = false;
|
||||
@ -1288,9 +1284,8 @@ void gfx_display_free(void)
|
||||
p_disp->dispctx = NULL;
|
||||
}
|
||||
|
||||
void gfx_display_init(void)
|
||||
void gfx_display_init(gfx_display_t *p_disp)
|
||||
{
|
||||
gfx_display_t *p_disp = disp_get_ptr();
|
||||
video_coord_array_t *p_dispca = &p_disp->dispca;
|
||||
|
||||
p_disp->has_windowed = video_driver_has_windowed();
|
||||
|
@ -223,9 +223,9 @@ struct gfx_display
|
||||
bool framebuf_dirty;
|
||||
};
|
||||
|
||||
void gfx_display_free(void);
|
||||
void gfx_display_free(gfx_display_t *p_disp);
|
||||
|
||||
void gfx_display_init(void);
|
||||
void gfx_display_init(gfx_display_t *p_disp);
|
||||
|
||||
void gfx_display_draw_cursor(
|
||||
gfx_display_t *p_disp,
|
||||
@ -258,11 +258,10 @@ void gfx_display_scissor_begin(
|
||||
|
||||
void gfx_display_font_free(font_data_t *font);
|
||||
|
||||
void gfx_display_set_width(unsigned width);
|
||||
void gfx_display_get_fb_size(unsigned *fb_width, unsigned *fb_height,
|
||||
size_t *fb_pitch);
|
||||
void gfx_display_set_height(unsigned height);
|
||||
void gfx_display_set_framebuffer_pitch(size_t pitch);
|
||||
|
||||
void gfx_display_set_fb_size(unsigned width, unsigned height, size_t pitch);
|
||||
|
||||
void gfx_display_set_msg_force(bool state);
|
||||
bool gfx_display_init_first_driver(gfx_display_t *p_disp,
|
||||
|
@ -791,9 +791,6 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
||||
|
||||
gfx_display_set_width(width);
|
||||
gfx_display_set_height(height);
|
||||
|
||||
gfx_display_init_white_texture(gfx_display_white_texture);
|
||||
|
||||
file_list_initialize(&ozone->horizontal_list);
|
||||
|
@ -5695,9 +5695,10 @@ static bool rgui_set_aspect_ratio(rgui_t *rgui,
|
||||
return false;
|
||||
|
||||
/* Configure 'menu display' settings */
|
||||
gfx_display_set_width(rgui->frame_buf.width);
|
||||
gfx_display_set_height(rgui->frame_buf.height);
|
||||
gfx_display_set_framebuffer_pitch(rgui->frame_buf.width * sizeof(uint16_t));
|
||||
gfx_display_set_fb_size(
|
||||
rgui->frame_buf.width,
|
||||
rgui->frame_buf.height,
|
||||
rgui->frame_buf.width * sizeof(uint16_t));
|
||||
|
||||
/* Determine terminal layout */
|
||||
rgui->term_layout.start_x = (3 * 5) + 1;
|
||||
|
@ -3366,13 +3366,6 @@ static void *stripes_init(void **userdata, bool video_is_threaded)
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
||||
|
||||
/* TODO/FIXME - we don't use framebuffer at all
|
||||
* for XMB, we should refactor this dependency
|
||||
* away. */
|
||||
|
||||
gfx_display_set_width(width);
|
||||
gfx_display_set_height(height);
|
||||
|
||||
gfx_display_init_white_texture(gfx_display_white_texture);
|
||||
|
||||
file_list_initialize(&stripes->horizontal_list);
|
||||
|
@ -5833,13 +5833,6 @@ static void *xmb_init(void **userdata, bool video_is_threaded)
|
||||
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
|
||||
|
||||
/* TODO/FIXME - we don't use framebuffer at all
|
||||
* for XMB, we should refactor this dependency
|
||||
* away. */
|
||||
|
||||
gfx_display_set_width(width);
|
||||
gfx_display_set_height(height);
|
||||
|
||||
gfx_display_init_white_texture(gfx_display_white_texture);
|
||||
|
||||
file_list_initialize(&xmb->horizontal_list);
|
||||
|
@ -4787,7 +4787,7 @@ static bool menu_driver_init_internal(
|
||||
settings))
|
||||
return false;
|
||||
|
||||
gfx_display_init();
|
||||
gfx_display_init(&p_rarch->dispgfx);
|
||||
|
||||
/* TODO/FIXME - can we get rid of this? Is this needed? */
|
||||
configuration_set_string(settings,
|
||||
@ -5395,7 +5395,7 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
}
|
||||
|
||||
gfx_animation_deinit(&p_rarch->anim);
|
||||
gfx_display_free();
|
||||
gfx_display_free(&p_rarch->dispgfx);
|
||||
|
||||
menu_entries_settings_deinit(menu_st);
|
||||
menu_entries_list_deinit(p_rarch->menu_driver_ctx, menu_st);
|
||||
|
Loading…
x
Reference in New Issue
Block a user