(Menu) Cleanups/refactors
This commit is contained in:
parent
653a0e5773
commit
6482969459
|
@ -237,7 +237,6 @@ static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
|
|||
unsigned modetype, level, viHeightMultiplier, viWidth, tvmode,
|
||||
max_width, max_height, i;
|
||||
gx_video_t *gx = (gx_video_t*)data;
|
||||
menu_framebuf_t *frame_buf = menu_display_fb_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
(void)level;
|
||||
|
@ -395,7 +394,6 @@ static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
|
|||
gx_mode.efbHeight, (gx_mode.viTVMode & 3) == VI_INTERLACE
|
||||
? "interlaced" : "progressive");
|
||||
|
||||
if (frame_buf)
|
||||
{
|
||||
size_t new_fb_pitch;
|
||||
unsigned new_fb_width;
|
||||
|
@ -412,8 +410,7 @@ static void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines,
|
|||
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_SET_WIDTH, &new_fb_width);
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_SET_HEIGHT, &new_fb_height);
|
||||
|
||||
frame_buf->pitch = new_fb_pitch;
|
||||
menu_display_ctl(MENU_DISPLAY_CTL_SET_FB_PITCH, &new_fb_pitch);
|
||||
}
|
||||
|
||||
if (tvmode == VI_PAL)
|
||||
|
|
|
@ -673,7 +673,7 @@ static void *rgui_init(void)
|
|||
fill_rect(frame_buf->data, frame_buf->pitch, 0, frame_buf->height,
|
||||
frame_buf->width, 4, gray_filler);
|
||||
|
||||
rgui->last_width = frame_buf->width;
|
||||
rgui->last_width = frame_buf->width;
|
||||
rgui->last_height = frame_buf->height;
|
||||
|
||||
return menu;
|
||||
|
|
|
@ -266,6 +266,14 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
|
|||
*ptr = frame_buf->pitch;
|
||||
}
|
||||
return true;
|
||||
case MENU_DISPLAY_CTL_SET_FB_PITCH:
|
||||
{
|
||||
size_t *ptr = (size_t*)data;
|
||||
if (!ptr)
|
||||
return false;
|
||||
frame_buf->pitch = *ptr;
|
||||
}
|
||||
return true;
|
||||
case MENU_DISPLAY_CTL_UPDATE_PENDING:
|
||||
{
|
||||
menu_animation_t *anim = menu_animation_get_ptr();
|
||||
|
|
|
@ -43,7 +43,8 @@ enum menu_display_ctl_state
|
|||
MENU_DISPLAY_CTL_SET_WIDTH,
|
||||
MENU_DISPLAY_CTL_SET_HEIGHT,
|
||||
MENU_DISPLAY_CTL_FB_DATA,
|
||||
MENU_DISPLAY_CTL_FB_PITCH
|
||||
MENU_DISPLAY_CTL_FB_PITCH,
|
||||
MENU_DISPLAY_CTL_SET_FB_PITCH
|
||||
};
|
||||
|
||||
typedef struct menu_framebuf
|
||||
|
|
Loading…
Reference in New Issue