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 | |
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')
-rw-r--r-- | src/libs/ray/ray_camera.c | 4 | ||||
-rw-r--r-- | src/libs/ray/ray_camera.h | 6 | ||||
-rw-r--r-- | src/libs/ray/ray_render.c | 4 | ||||
-rw-r--r-- | src/libs/ray/ray_render.h | 4 | ||||
-rw-r--r-- | src/libs/txt/txt.c | 8 | ||||
-rw-r--r-- | src/libs/txt/txt.h | 4 |
6 files changed, 15 insertions, 15 deletions
diff --git a/src/libs/ray/ray_camera.c b/src/libs/ray/ray_camera.c index a0e3d02..4e01877 100644 --- a/src/libs/ray/ray_camera.c +++ b/src/libs/ray/ray_camera.c @@ -1,4 +1,4 @@ -#include "fb.h" +#include "til_fb.h" #include "ray_camera.h" #include "ray_euler.h" @@ -51,7 +51,7 @@ void ray_camera_frame_prepare(const ray_camera_t *camera, unsigned frame_width, /* Begin a frame's fragment, initializing frame and ray. */ -void ray_camera_fragment_begin(ray_camera_frame_t *frame, fb_fragment_t *fb_fragment, ray_ray_t *res_ray, ray_camera_fragment_t *res_fragment) +void ray_camera_fragment_begin(ray_camera_frame_t *frame, til_fb_fragment_t *fb_fragment, ray_ray_t *res_ray, ray_camera_fragment_t *res_fragment) { res_fragment->frame = frame; res_fragment->fb_fragment = fb_fragment; diff --git a/src/libs/ray/ray_camera.h b/src/libs/ray/ray_camera.h index 0a8af2a..06bb2db 100644 --- a/src/libs/ray/ray_camera.h +++ b/src/libs/ray/ray_camera.h @@ -3,7 +3,7 @@ #include <math.h> -#include "fb.h" +#include "til_fb.h" #include "ray_3f.h" #include "ray_euler.h" @@ -39,7 +39,7 @@ typedef struct ray_camera_frame_t { typedef struct ray_camera_fragment_t { ray_camera_frame_t *frame; /* the frame supplied to fragment_begin() */ - fb_fragment_t *fb_fragment; /* the fragment supplied to fragment_begin() */ + til_fb_fragment_t *fb_fragment; /* the fragment supplied to fragment_begin() */ ray_ray_t *ray; /* the ray supplied to frame_begin(), which gets updated as we step through the frame. */ ray_3f_t cur_w, cur_e; /* current row's west and east ends */ @@ -49,7 +49,7 @@ typedef struct ray_camera_fragment_t { void ray_camera_frame_prepare(const ray_camera_t *camera, unsigned frame_width, unsigned frame_height, ray_camera_frame_t *res_frame); -void ray_camera_fragment_begin(ray_camera_frame_t *frame, fb_fragment_t *fb_fragment, ray_ray_t *res_ray, ray_camera_fragment_t *res_fragment); +void ray_camera_fragment_begin(ray_camera_frame_t *frame, til_fb_fragment_t *fb_fragment, ray_ray_t *res_ray, ray_camera_fragment_t *res_fragment); /* Step the ray through the fragment on the x axis, returns 1 when rays remain on this axis, 0 at the end. */ diff --git a/src/libs/ray/ray_render.c b/src/libs/ray/ray_render.c index dbbfb47..535b71a 100644 --- a/src/libs/ray/ray_render.c +++ b/src/libs/ray/ray_render.c @@ -1,7 +1,7 @@ #include <stdlib.h> #include <math.h> -#include "fb.h" +#include "til_fb.h" #include "ray_camera.h" #include "ray_color.h" @@ -200,7 +200,7 @@ static inline ray_color_t trace_ray(ray_render_t *render, ray_ray_t *primary_ray } -void ray_render_trace_fragment(ray_render_t *render, fb_fragment_t *fb_fragment) +void ray_render_trace_fragment(ray_render_t *render, til_fb_fragment_t *fb_fragment) { uint32_t *buf = fb_fragment->buf; ray_camera_fragment_t fragment; diff --git a/src/libs/ray/ray_render.h b/src/libs/ray/ray_render.h index 69daf86..e6597d1 100644 --- a/src/libs/ray/ray_render.h +++ b/src/libs/ray/ray_render.h @@ -1,7 +1,7 @@ #ifndef _RAY_RENDER_H #define _RAY_RENDER_H -#include "fb.h" +#include "til_fb.h" #include "ray_camera.h" #include "ray_scene.h" @@ -10,6 +10,6 @@ typedef struct ray_render_t ray_render_t; ray_render_t * ray_render_new(const ray_scene_t *scene, const ray_camera_t *camera, unsigned frame_width, unsigned frame_height); void ray_render_free(ray_render_t *render); -void ray_render_trace_fragment(ray_render_t *render, fb_fragment_t *fb_fragment); +void ray_render_trace_fragment(ray_render_t *render, til_fb_fragment_t *fb_fragment); #endif 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 |