From 887823a6f29cc77561058a04f349f596f6360538 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Mon, 11 May 2026 13:06:40 -0400 Subject: remove uneccessary flooring --- teensy/teensy_renderer.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'teensy/teensy_renderer.c') diff --git a/teensy/teensy_renderer.c b/teensy/teensy_renderer.c index 2104695..da35738 100644 --- a/teensy/teensy_renderer.c +++ b/teensy/teensy_renderer.c @@ -129,10 +129,10 @@ void ty_draw_clear(struct ty_color col) void ty_draw_image(struct ty_image img, struct ty_vec2i pos) { - int x1 = fmin(fmax(floor(pos.x), 0), r.screen.width); - int y1 = fmin(fmax(floor(pos.y), 0), r.screen.height); - int x2 = fmin(fmax(floor(pos.x + img.width), 0), r.screen.width); - int y2 = fmin(fmax(floor(pos.y + img.height), 0), r.screen.height); + int x1 = fmin(fmax(pos.x, 0), r.screen.width); + int y1 = fmin(fmax(pos.y, 0), r.screen.height); + int x2 = fmin(fmax(pos.x + img.width, 0), r.screen.width); + int y2 = fmin(fmax(pos.y + img.height, 0), r.screen.height); for (int dy = y1; dy < y2; dy++) { for (int dx = x1; dx < x2; dx++) { @@ -156,10 +156,10 @@ void ty_draw_image_ex( struct ty_recti src, struct ty_recti dst ) { - int x1 = fmin(fmax(floor(dst.x), 0), r.screen.width); - int y1 = fmin(fmax(floor(dst.y), 0), r.screen.height); - int x2 = fmin(fmax(floor(dst.x + dst.w), 0), r.screen.width); - int y2 = fmin(fmax(floor(dst.y + dst.h), 0), r.screen.height); + int x1 = fmin(fmax(dst.x, 0), r.screen.width); + int y1 = fmin(fmax(dst.y, 0), r.screen.height); + int x2 = fmin(fmax(dst.x + dst.w, 0), r.screen.width); + int y2 = fmin(fmax(dst.y + dst.h, 0), r.screen.height); for (int dy = y1; dy < y2; dy++) { for (int dx = x1; dx < x2; dx++) { -- cgit v1.3-2-g0d8e