summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++;