From 28d12a899645be09dae7e4cb8c293bf7fc64d6ad Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 30 Nov 2023 11:34:15 -0800 Subject: til: wire up til_video_setup_t throughout *_fb Preparatory commit for aspect ratio settings at the fb layer. This slightly reworks how main::setup_video() integrates the selected fb backend's setup_func to better resemble how the module setup_funcs work now, with more clearly separated settings-building and setup-baking/finalizing phases. Which makes inserting the ratio setting in the middle of the front-end and back-end setup_funcs fairly trivial. Not a fan of all the casts, but there will probably be more helpers introduced to take care of that and make til_video_setup_t more of a first-class thing facilitating the fb stuff. --- src/til_fb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/til_fb.c') diff --git a/src/til_fb.c b/src/til_fb.c index a802c40..3c19ae5 100644 --- a/src/til_fb.c +++ b/src/til_fb.c @@ -8,6 +8,7 @@ #include "til_fb.h" #include "til_settings.h" #include "til_util.h" +#include "til_video_setup.h" /* Copyright (C) 2016-2017 Vito Caputo */ @@ -550,7 +551,7 @@ til_fb_t * til_fb_free(til_fb_t *fb) /* create a new fb instance */ -int til_fb_new(const til_fb_ops_t *ops, const char *title, const til_setup_t *setup, int n_pages, til_fb_t **res_fb) +int til_fb_new(const til_fb_ops_t *ops, const char *title, const til_video_setup_t *setup, int n_pages, til_fb_t **res_fb) { _til_fb_page_t *page; til_fb_t *fb; @@ -560,7 +561,7 @@ int til_fb_new(const til_fb_ops_t *ops, const char *title, const til_setup_t *se assert(ops->page_alloc); assert(ops->page_free); assert(ops->page_flip); - assert(!setup || setup->creator == ops); + assert(!setup && setup->til_setup.creator == ops); assert(n_pages > 1); assert(res_fb); -- cgit v1.2.1