1 #ifndef SOFT_FAKE3D_H
2 #define SOFT_FAKE3D_H
3 
4 #include "p_3dfloors.h"
5 
6 // special types
7 
8 struct HeightLevel
9 {
10 	fixed_t height;
11 	struct HeightLevel *prev;
12 	struct HeightLevel *next;
13 };
14 
15 struct HeightStack
16 {
17 	HeightLevel *height_top;
18 	HeightLevel *height_cur;
19 	int height_max;
20 };
21 
22 struct ClipStack
23 {
24 	short floorclip[MAXWIDTH];
25 	short ceilingclip[MAXWIDTH];
26 	F3DFloor *ffloor;
27 	ClipStack *next;
28 };
29 
30 // external varialbes
31 
32 // fake3D flags:
33 enum
34 {
35 	// BSP stage:
36 	FAKE3D_FAKEFLOOR		= 1,	// fake floor, mark seg as FAKE
37 	FAKE3D_FAKECEILING		= 2,	// fake ceiling, mark seg as FAKE
38 	FAKE3D_FAKEBACK			= 4,	// R_AddLine with fake backsector, mark seg as FAKE
39 	FAKE3D_FAKEMASK			= 7,
40 	FAKE3D_CLIPBOTFRONT		= 8,	// use front sector clipping info (bottom)
41 	FAKE3D_CLIPTOPFRONT		= 16,	// use front sector clipping info (top)
42 
43 	// sorting stage:
44 	FAKE3D_CLIPBOTTOM		= 1,	// clip bottom
45 	FAKE3D_CLIPTOP			= 2,	// clip top
46 	FAKE3D_REFRESHCLIP		= 4,	// refresh clip info
47 	FAKE3D_DOWN2UP			= 8,	// rendering from down to up (floors)
48 };
49 
50 extern int fake3D;
51 extern F3DFloor *fakeFloor;
52 extern fixed_t fakeHeight;
53 extern fixed_t fakeAlpha;
54 extern int fakeActive;
55 extern fixed_t sclipBottom;
56 extern fixed_t sclipTop;
57 extern HeightLevel *height_top;
58 extern HeightLevel *height_cur;
59 extern int CurrentMirror;
60 extern int CurrentSkybox;
61 EXTERN_CVAR(Int, r_3dfloors);
62 
63 // functions
64 void R_3D_DeleteHeights();
65 void R_3D_AddHeight(secplane_t *add, sector_t *sec);
66 void R_3D_NewClip();
67 void R_3D_ResetClip();
68 void R_3D_EnterSkybox();
69 void R_3D_LeaveSkybox();
70 
71 #endif
72