e2c706e18bd74aade01faf3e562208fa707cc4c2
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_Panel_DrawShadowVolume (constref p: TPanel; lightX, lightY: Integer; radius: Integer);
25 implementation
27 uses
28 {$INCLUDE ../nogl/noGLuses.inc}
30 e_graphics,
31 g_basic, g_textures
32 ;
34 // TODO: remove WITH operator
38 begin
40 begin
41 if {Enabled and} (FCurTexture >= 0) and (Width > 0) and (Height > 0) and (Alpha < 255) {and g_Collide(X, Y, Width, Height, sX, sY, sWidth, sHeight)} then
42 begin
44 begin
46 Exit;
49 TextureIDs[FCurTexture].AnTex.Draw(X + xx * TextureWidth, Y + yy * TextureHeight, TMirrorType.None);
50 end
51 else
52 begin
54 LongWord(TEXTURE_SPECIAL_WATER): e_DrawFillQuad(X, Y, X + Width - 1, Y + Height - 1, 0, 0, 255, 0, TBlending.Filter);
55 LongWord(TEXTURE_SPECIAL_ACID1): e_DrawFillQuad(X, Y, X + Width - 1, Y + Height - 1, 0, 230, 0, 0, TBlending.Filter);
56 LongWord(TEXTURE_SPECIAL_ACID2): e_DrawFillQuad(X, Y, X + Width - 1, Y + Height - 1, 230, 0, 0, 0, TBlending.Filter);
59 begin
62 end
63 else
64 begin
72 else
73 begin
75 e_DrawFill(TextureIDs[FCurTexture].Tex, X, Y, Width div TextureWidth, Height div TextureHeight, Alpha, True, Blending, hasAmbient)
76 else
77 e_DrawFillX(TextureIDs[FCurTexture].Tex, X, Y, Width, Height, Alpha, True, Blending, g_dbg_scale, hasAmbient);
80 end
81 end
82 end
83 end
84 end
87 procedure r_Panel_DrawShadowVolume (constref p: TPanel; lightX, lightY: Integer; radius: Integer);
90 begin
92 //e_WriteLog(Format(' : (%d,%d)', [x + (x - lightX) * 300, y + (y - lightY) * 300]), MSG_WARNING);
96 begin
97 // does this side facing the light?
99 //e_WriteLog(Format('lightpan: (%d,%d)-(%d,%d)', [x0, y0, x1, y1]), MSG_WARNING);
100 // this edge is facing the light, extrude and draw it
107 begin
109 begin
111 if Enabled and (FCurTexture >= 0) and (Width > 0) and (Height > 0) and (Alpha < 255) {and g_Collide(X, Y, Width, Height, sX, sY, sWidth, sHeight)} then
112 begin
114 begin
126 //e_DrawFill(TextureIDs[FCurTexture].Tex, X, Y, Width div TextureWidth, Height div TextureHeight, Alpha, True, Blending);
132 glEnd;
133 end
134 end