1 //-------------------------------------------------------------------------
2 /*
3 Copyright (C) 1997, 2005 - 3D Realms Entertainment
4 
5 This file is part of Shadow Warrior version 1.2
6 
7 Shadow Warrior is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
11 
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 
16 See the GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 
22 Original Source: 1997 - Frank Maddin and Jim Norwood
23 Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
24 */
25 //-------------------------------------------------------------------------
26 
27 
28 void SectorLightShade(SPRITEp sp, short intensity);
29 void DiffuseLighting(SPRITEp sp);
30 void DoLightingMatch(short match, short state);
31 void InitLighting(void);
32 void DoLighting(void);
33 
34 // Descriptive Light variables mapped from other variables
35 
36 #define LIGHT_Match(sp)         (SP_TAG2((sp)))
37 #define LIGHT_Type(sp)          (SP_TAG3((sp)))
38 #define LIGHT_MaxTics(sp)       (SP_TAG4((sp)))
39 #define LIGHT_MaxBright(sp)     (SP_TAG5((sp)))
40 #define LIGHT_MaxDark(sp)       (SP_TAG6((sp)))
41 #define LIGHT_ShadeInc(sp)      (SP_TAG7((sp)))
42 
43 #define LIGHT_Dir(sp)           (!!(TEST((sp)->extra, SPRX_BOOL10)))
44 #define LIGHT_DirChange(sp)     (FLIP((sp)->extra, SPRX_BOOL10))
45 
46 #define LIGHT_Shade(sp)         ((sp)->shade)
47 #define LIGHT_FloorShade(sp)    ((sp)->xoffset)
48 #define LIGHT_CeilingShade(sp)  ((sp)->yoffset)
49 #define LIGHT_Tics(sp)          ((sp)->z)
50 
51 #define LIGHT_DiffuseNum(sp) (SP_TAG3((sp)))
52 #define LIGHT_DiffuseMult(sp) (SP_TAG4((sp)))
53 
54 enum LightTypes {LIGHT_CONSTANT, LIGHT_FLICKER, LIGHT_FADE, LIGHT_FLICKER_ON, LIGHT_FADE_TO_ON_OFF};
55