aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--teensy/teensy_renderer.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/teensy/teensy_renderer.c b/teensy/teensy_renderer.c
index b51d2a9..d3f73fd 100644
--- a/teensy/teensy_renderer.c
+++ b/teensy/teensy_renderer.c
@@ -8,6 +8,8 @@
#include "teensy_context.h"
#include "teensy_list.h"
+#define BLEND_COLOR ty_color(255, 0, 255)
+
struct ty_renderer r;
static
@@ -134,10 +136,16 @@ void ty_draw_image(struct ty_image img, struct ty_vec2i pos)
for (int dy = y1; dy < y2; dy++) {
for (int dx = x1; dx < x2; dx++) {
+ struct ty_color px = ty_img_get_pixel(
+ img,
+ ty_vec2i(dx - x1, dy - y1)
+ );
+ if (memcmp(&px, &BLEND_COLOR, sizeof(px)) == 0)
+ continue;
ty_img_set_pixel(
r.screen,
ty_vec2i(dx, dy),
- ty_img_get_pixel(img, ty_vec2i(dx - x1, dy - y1))
+ px
);
}
}
@@ -157,11 +165,14 @@ void ty_draw_image_ex(
for (int dx = x1; dx < x2; dx++) {
int img_x = ((dx - x1) * src.w) / dst.w + src.x;
int img_y = ((dy - y1) * src.h) / dst.h + src.y;
+ struct ty_color px = ty_img_get_pixel(img, ty_vec2i(img_x, img_y));
+ if (memcmp(&px, &BLEND_COLOR, sizeof(px)) == 0)
+ continue;
ty_img_set_pixel(
r.screen,
ty_vec2i(dx, dy),
- ty_img_get_pixel(img, ty_vec2i(img_x, img_y))
+ px
);
}
}