From: DeaDDooMER Date: Sun, 10 Sep 2023 12:21:45 +0000 (+0300) Subject: gl: optimize grid drawing X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-editor.git;a=commitdiff_plain;h=65146e985a7cb6ab434f1bd4594211f09e1a9409 gl: optimize grid drawing --- diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 44cf2a4..bf92c22 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -2949,22 +2949,23 @@ begin else a := 0; + glDisable(GL_TEXTURE_2D); + glColor3ub(GetRValue(DotColor), GetGValue(DotColor), GetBValue(DotColor)); + glPointSize(DotSize); + glBegin(GL_POINTS); x := MapOffset.X mod DotStep; - y := MapOffset.Y mod DotStep; - while x < RenderPanel.Width do begin + y := MapOffset.Y mod DotStep; while y < RenderPanel.Height do begin - e_DrawPoint(DotSize, x + a, y + a, - GetRValue(DotColor), - GetGValue(DotColor), - GetBValue(DotColor)); + glVertex2i(x + a, y + a); y += DotStep; end; x += DotStep; - y := MapOffset.Y mod DotStep; end; + glEnd(); + glColor4ub(e_Colors.R, e_Colors.G, e_Colors.B, 255); end; // Превью текстуры: