From 31b1ad1d8b34f7f157c18618f4eaf2bdbd11d305 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Sat, 18 Feb 2023 03:47:00 +0300 Subject: [PATCH] gl: fix holmes scale and map offset --- src/game/renders/opengl/r_holmes.pas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/game/renders/opengl/r_holmes.pas b/src/game/renders/opengl/r_holmes.pas index f83fa6d..8c4bfdc 100644 --- a/src/game/renders/opengl/r_holmes.pas +++ b/src/game/renders/opengl/r_holmes.pas @@ -808,6 +808,11 @@ var begin if (gPlayer1 = nil) then exit; + glPushMatrix; + (* hack: scale and translate must be handled by hlmContext.glSetScaleTrans, but it dont work for some reason *) + glScalef(g_dbg_scale, g_dbg_scale, 1.0); + glTranslatef(-vpx, -vpy, 0); + if (hlmContext = nil) then hlmContext := r_fui_gfx_gl.TGxContext.Create(); gxSetContext(hlmContext); @@ -819,7 +824,7 @@ begin glScalef(g_dbg_scale, g_dbg_scale, 1.0); glTranslatef(-vpx, -vpy, 0); } - hlmContext.glSetScaleTrans(g_dbg_scale, -vpx, -vpy); +// hlmContext.glSetScaleTrans(g_dbg_scale, -vpx, -vpy); // uncomment when fix it glEnable(GL_SCISSOR_TEST); glScissor(0, gScreenHeight-gPlayerScreenSize.Y-1, gPlayerScreenSize.X, gPlayerScreenSize.Y); @@ -880,6 +885,8 @@ begin gxSetContext(nil); end; + glPopMatrix; + if showMapCurPos then begin s := Format('mappos:(%d,%d)', [pmsCurMapX, pmsCurMapY]); -- 2.29.2