⚡ Set the light mode once per run of tiles
The render loop reissued the light state calls for every tile even when the mode was unchanged.
This commit is contained in:
+12
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user