aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dc/dc.c12
-rw-r--r--teensy/teensy_renderer.c6
2 files changed, 15 insertions, 3 deletions
diff --git a/dc/dc.c b/dc/dc.c
index a654fbe..a532f0a 100644
--- a/dc/dc.c
+++ b/dc/dc.c
@@ -33,6 +33,18 @@ void tick(void)
)
);
+ ty_draw_image_ex(
+ img,
+ ty_recti(
+ 0, 0,
+ img.width, img.height
+ ),
+ ty_recti(
+ sin(-ty_get_time()) * 50, SCREEN_HEIGHT / 2,
+ 32, 64
+ )
+ );
+
ty_draw_image_rot(
img,
ty_vec2i(SCREEN_WIDTH/2, SCREEN_HEIGHT/2),
diff --git a/teensy/teensy_renderer.c b/teensy/teensy_renderer.c
index db9193f..1df1f1b 100644
--- a/teensy/teensy_renderer.c
+++ b/teensy/teensy_renderer.c
@@ -158,7 +158,7 @@ void ty_draw_image(ty_Image img, ty_Vec2i pos)
for (int dx = p1.x; dx < p2.x; dx++) {
ty_Color px = ty_img_get_pixel(
img,
- ty_vec2i(dx - p1.x, dy - p1.y)
+ ty_vec2i(dx - pos.x, dy - pos.y)
);
if (memcmp(&px, &BLEND_COLOR, sizeof(px)) == 0)
continue;
@@ -181,8 +181,8 @@ void ty_draw_image_ex(
for (int dy = p1.y; dy < p2.y; dy++) {
for (int dx = p1.x; dx < p2.x; dx++) {
- int img_x = ((dx - p1.x) * src.w) / dst.w + src.x;
- int img_y = ((dy - p1.y) * src.h) / dst.h + src.y;
+ int img_x = ((dx - dst.x) * src.w) / dst.w + src.x;
+ int img_y = ((dy - dst.y) * src.h) / dst.h + src.y;
ty_Color px = ty_img_get_pixel(img, ty_vec2i(img_x, img_y));
if (memcmp(&px, &BLEND_COLOR, sizeof(px)) == 0)
continue;