cf7bc3e25e7c45d3d4b22e15a753f51cda862d28
1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 {$INCLUDE ../../shared/a_modes.inc}
18 interface
23 procedure r_Map_DrawPanels (PanelType: Word; hasAmbient: Boolean; constref ambColor: TDFColor); // unaccelerated
28 implementation
30 uses
31 {$INCLUDE ../nogl/noGLuses.inc}
36 r_panel
37 ;
40 begin
41 if (gDrawPanelList = nil) then gDrawPanelList := TBinHeapPanelDraw.Create() else gDrawPanelList.clear();
44 // old algo
48 var
50 begin
52 begin
53 // alas, no visible set
55 begin
62 begin
75 // new algo
77 var
80 begin
83 for mwit in it do if (((mwit^.tag and GridTagDoor) <> 0) = mwit^.Door) then gDrawPanelList.insert(mwit^);
85 // list will be rendered in `g_game.DrawPlayer()`
89 var
92 begin
93 it := mapGrid.forEachInAABB(lightX-radius, lightY-radius, radius*2, radius*2, (GridTagWall or GridTagDoor));
99 begin
102 else
107 var
111 begin
113 Exit;
118 begin
120 continue;
125 begin
128 end
129 else
130 begin
138 begin