1 // SONIC ROBO BLAST 2
2 //-----------------------------------------------------------------------------
3 // Copyright (C) 1998-2000 by DooM Legacy Team.
4 // Copyright (C) 1999-2020 by Sonic Team Junior.
5 //
6 // This program is free software distributed under the
7 // terms of the GNU General Public License, version 2.
8 // See the 'LICENSE' file for more details.
9 //-----------------------------------------------------------------------------
10 /// \file hw_light.h
11 /// \brief Dynamic lighting & coronas add on by Hurdler
12 
13 #ifndef _HW_LIGHTS_
14 #define _HW_LIGHTS_
15 
16 #include "hw_glob.h"
17 #include "hw_defs.h"
18 
19 #define NUMLIGHTFREESLOTS 32 // Free light slots (for SOCs)
20 
21 #ifdef ALAM_LIGHTING
22 #define NEWCORONAS
23 
24 #define DL_MAX_LIGHT 256 // maximum number of lights (extra lights are ignored)
25 
26 void HWR_InitLight(void);
27 void HWR_DL_AddLight(gl_vissprite_t *spr, GLPatch_t *patch);
28 void HWR_PlaneLighting(FOutVector *clVerts, int nrClipVerts);
29 void HWR_WallLighting(FOutVector *wlVerts);
30 void HWR_ResetLights(void);
31 void HWR_SetLights(int viewnumber);
32 
33 #ifdef NEWCORONAS
34 void HWR_DrawCoronas(void);
35 #else
36 void HWR_DoCoronasLighting(FOutVector *outVerts, gl_vissprite_t *spr);
37 #endif
38 
39 typedef struct
40 {
41 	int nb;
42 	light_t *p_lspr[DL_MAX_LIGHT];
43 	FVector position[DL_MAX_LIGHT]; // actually maximum DL_MAX_LIGHT lights
44 	mobj_t *mo[DL_MAX_LIGHT];
45 } dynlights_t;
46 
47 #endif
48 
49 typedef enum
50 {
51 	NOLIGHT = 0,
52 	RINGSPARK_L,
53 	SUPERSONIC_L, // Cool. =)
54 	SUPERSPARK_L,
55 	INVINCIBLE_L,
56 	GREENSHIELD_L,
57 	BLUESHIELD_L,
58 	YELLOWSHIELD_L,
59 	REDSHIELD_L,
60 	BLACKSHIELD_L,
61 	WHITESHIELD_L,
62 	SMALLREDBALL_L,
63 	RINGLIGHT_L,
64 	GREENSMALL_L,
65 	REDSMALL_L,
66 	GREENSHINE_L,
67 	ORANGESHINE_L,
68 	PINKSHINE_L,
69 	BLUESHINE_L,
70 	REDSHINE_L,
71 	LBLUESHINE_L,
72 	GREYSHINE_L,
73 	REDBALL_L,
74 	GREENBALL_L,
75 	BLUEBALL_L,
76 	NIGHTSLIGHT_L,
77 	JETLIGHT_L,
78 	GOOPLIGHT_L,
79 	STREETLIGHT_L,
80 
81 	// free slots for SOCs at run-time --------------------
82 	FREESLOT0_L,
83 	//
84 	// ... 32 free lights here ...
85 	//
86 	LASTFREESLOT_L = (FREESLOT0_L+NUMLIGHTFREESLOTS-1),
87 	// end of freeslots ---------------------------------------------
88 
89 	NUMLIGHTS
90 } lightspritenum_t;
91 
92 extern light_t lspr[NUMLIGHTS];
93 extern light_t *t_lspr[NUMSPRITES];
94 #endif
95