From 75220f3dc4a2fac0bc4174e178cbdb0fc39e14db Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 14:30:42 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Set=20the=20light=20mode=20once=20p?= =?UTF-8?q?er=20run=20of=20tiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The render loop reissued the light state calls for every tile even when the mode was unchanged. --- Client/UfrmMain.pas | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Client/UfrmMain.pas b/Client/UfrmMain.pas index b70cc57..f67afa3 100644 --- a/Client/UfrmMain.pas +++ b/Client/UfrmMain.pas @@ -2728,6 +2728,7 @@ var intensity, red, green, blue: GLfloat; blockInfo: PBlockInfo; item: TWorldItem; + lightMode: Integer; begin if not (sbsValid in FScreenBufferState) then RebuildScreenBuffer; @@ -2742,6 +2743,7 @@ begin UpdateFilter; blockInfo := nil; + lightMode := -1; while FScreenBuffer.Iterate(blockInfo) do begin if blockInfo^.State = ssFiltered then @@ -2752,11 +2754,19 @@ begin if acSelect.Checked or item.CanBeEdited or (item is TVirtualTile) then begin intensity := 1.0; - SetNormalLights; + if lightMode <> 0 then + begin + SetNormalLights; + lightMode := 0; + end; end else begin intensity := 0.5; - SetDarkLights; + if lightMode <> 1 then + begin + SetDarkLights; + lightMode := 1; + end; end; case blockInfo^.WalkRestriction of