diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2021-10-01 16:35:08 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2021-10-01 16:35:08 -0700 |
commit | b686b405c6a22b26e9b8082c92ed91513608bea3 (patch) | |
tree | 0000f671501863a8ee9b536ba869221d0f6710f9 /src/libs/txt | |
parent | d1da5500261e96efe0ede06fbebb32f0e191f3c1 (diff) |
*: 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_.
Diffstat (limited to 'src/libs/txt')
-rw-r--r-- | src/libs/txt/txt.c | 8 | ||||
-rw-r--r-- | src/libs/txt/txt.h | 4 |
2 files changed, 6 insertions, 6 deletions
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 <stdarg.h> #include <stdlib.h> -#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 <stdint.h> -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 |