diff options
| author | iamcheeseman <[email protected]> | 2026-05-11 13:06:40 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-11 13:06:40 -0400 |
| commit | 887823a6f29cc77561058a04f349f596f6360538 (patch) | |
| tree | 5557d9d91126c70f1d8e025229f46344a36d5999 | |
| parent | 8a91b5adccbb24a17ff69e81d08f3e6dad4f9fda (diff) | |
remove uneccessary flooring
| -rw-r--r-- | teensy/teensy_renderer.c | 16 |
1 files changed, 8 insertions, 8 deletions
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++) { |
