From b686b405c6a22b26e9b8082c92ed91513608bea3 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 1 Oct 2021 16:35:08 -0700 Subject: *: librototiller->libtil Largely mechanical rename of librototiller -> libtil, but introducing a til_ prefix to all librototiller (now libtil) functions and types where a rototiller prefix was absent. This is just a step towards a more libized librototiller, and til is just a nicer to type/read prefix than rototiller_. --- src/libs/txt/txt.c | 8 ++++---- src/libs/txt/txt.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libs/txt') diff --git a/src/libs/txt/txt.c b/src/libs/txt/txt.c index e42d8c2..02b753f 100644 --- a/src/libs/txt/txt.c +++ b/src/libs/txt/txt.c @@ -2,7 +2,7 @@ #include #include -#include "fb.h" +#include "til_fb.h" #include "ascii/ascii.h" #include "txt.h" @@ -153,19 +153,19 @@ static int overlaps(int x1, int y1, unsigned w1, unsigned h1, int x2, int y2, un } -static inline void draw_char(fb_fragment_t *fragment, uint32_t color, int x, int y, char c) +static inline void draw_char(til_fb_fragment_t *fragment, uint32_t color, int x, int y, char c) { /* TODO: this could be optimized to skip characters with no overlap */ for (int i = 0; i < ASCII_HEIGHT; i++) { for (int j = 0; j < ASCII_WIDTH; j++) { if (ascii_chars[c][i * ASCII_WIDTH + j]) - fb_fragment_put_pixel_checked(fragment, x + j, y + i, color); + til_fb_fragment_put_pixel_checked(fragment, x + j, y + i, color); } } } -void txt_render_fragment(txt_t *txt, fb_fragment_t *fragment, uint32_t color, int x, int y, txt_align_t alignment) +void txt_render_fragment(txt_t *txt, til_fb_fragment_t *fragment, uint32_t color, int x, int y, txt_align_t alignment) { int jx, jy, col, row; char c, *str; diff --git a/src/libs/txt/txt.h b/src/libs/txt/txt.h index 8c68e30..a924b25 100644 --- a/src/libs/txt/txt.h +++ b/src/libs/txt/txt.h @@ -3,7 +3,7 @@ #include -typedef struct fb_fragment_t fb_fragment_t; +typedef struct til_fb_fragment_t til_fb_fragment_t; typedef struct txt_t txt_t; typedef enum txt_halign_t { @@ -28,6 +28,6 @@ typedef struct txt_align_t { txt_t * txt_new(const char *str); txt_t * txt_newf(const char *fmt, ...); txt_t * txt_free(txt_t *txt); -void txt_render_fragment(txt_t *txt, fb_fragment_t *fragment, uint32_t color, int x, int y, txt_align_t alignment); +void txt_render_fragment(txt_t *txt, til_fb_fragment_t *fragment, uint32_t color, int x, int y, txt_align_t alignment); #endif -- cgit v1.2.3