summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-08-03 16:14:19 +1000
committerquou <quou@disroot.org>2024-08-03 16:14:19 +1000
commita5b1732c36b0a2b896521efacfb3bff485cef127 (patch)
treecd464a672545236a2b985e21dabaaba5db61d981
parente0a2f217634c7e0133378a23c94e60c7f74c77fb (diff)
Fix ren_texture
-rw-r--r--render.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/render.c b/render.c
index f3000de..32ca500 100644
--- a/render.c
+++ b/render.c
@@ -492,10 +492,10 @@ void ren_texture(
ex = rect.x + rect.w;
ey = rect.y + rect.h;
for (y = rect.y; y < ey; y++) {
- int v = (y << fbits) / re->h;
+ int v = ((y - re->y) << fbits) / re->h;
int x;
for (x = rect.x; x < ex; x++) {
- int u = (x << fbits) / re->w;
+ int u = ((x - re->x) << fbits) / re->w;
Colour c = sample_tex(t, u, v);
*d = blend(*d, c);
d++;