diff options
author | quou <quou@disroot.org> | 2024-08-03 16:14:19 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-08-03 16:14:19 +1000 |
commit | a5b1732c36b0a2b896521efacfb3bff485cef127 (patch) | |
tree | cd464a672545236a2b985e21dabaaba5db61d981 | |
parent | e0a2f217634c7e0133378a23c94e60c7f74c77fb (diff) |
Fix ren_texture
-rw-r--r-- | render.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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++; |