From: DeaDDooMER Date: Wed, 28 Dec 2022 14:06:42 +0000 (+0300) Subject: gl: fix big textures on hardware with texture limits X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=commitdiff_plain;h=0592c8529428165e2523e0cb054bff29e297777a gl: fix big textures on hardware with texture limits --- 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;