eb50ad9bfa35e6791e0783b2e8c8653477f6b236
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}
33 e_graphics,
35 g_panel, g_map
36 ;
39 begin
40 if (gDrawPanelList = nil) then gDrawPanelList := TBinHeapPanelDraw.Create() else gDrawPanelList.clear();
43 // old algo
47 var
49 begin
51 begin
52 // alas, no visible set
54 begin
60 begin
73 // new algo
75 var
78 begin
81 for mwit in it do if (((mwit^.tag and GridTagDoor) <> 0) = mwit^.Door) then gDrawPanelList.insert(mwit^);
83 // list will be rendered in `g_game.DrawPlayer()`
87 var
90 begin
91 it := mapGrid.forEachInAABB(lightX-radius, lightY-radius, radius*2, radius*2, (GridTagWall or GridTagDoor));
97 begin
100 else
105 var
108 begin
110 Exit;
115 begin
117 continue;
120 begin
123 end
124 else
125 begin
133 begin