From 0592c8529428165e2523e0cb054bff29e297777a Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Wed, 28 Dec 2022 17:06:42 +0300 Subject: [PATCH] gl: fix big textures on hardware with texture limits --- src/game/renders/opengl/r_draw.pas | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/game/renders/opengl/r_draw.pas b/src/game/renders/opengl/r_draw.pas index 55d9dad..1b1c626 100644 --- a/src/game/renders/opengl/r_draw.pas +++ b/src/game/renders/opengl/r_draw.pas @@ -137,22 +137,24 @@ implementation begin offx := 0; offy := 0; + glPushMatrix; + glTranslatef(x, y, 0); + glScalef(w / img.width, h / img.height, 1); for j := 0 to img.lines - 1 do begin for i := 0 to img.cols - 1 do begin n := img.GetTile(i, j); ASSERT(n <> nil); - glPushMatrix; - glTranslatef(x + offx, y + offy, 0); - glScalef(w / img.width, h / img.height, 1); DrawTile(n, 0, 0, n.width, n.height, flip, r, g, b, a, blend); - glPopMatrix; + glTranslatef(n.width, 0, 0); offx := offx + n.width; end; + glTranslatef(-offx, n.height, 0); offx := 0; offy := offy + n.height; end; + glPopMatrix; end end; -- 2.29.2