gzdoom/src/swrenderer/scene/r_3dfloors.h

84 lines
1.7 KiB
C
Raw Normal View History

2017-01-04 17:54:14 +00:00
#pragma once
#include "p_3dfloors.h"
EXTERN_CVAR(Int, r_3dfloors);
namespace swrenderer
{
2017-01-04 17:54:14 +00:00
struct HeightLevel
{
double height;
struct HeightLevel *prev;
struct HeightLevel *next;
};
2017-01-04 17:54:14 +00:00
struct HeightStack
{
HeightLevel *height_top;
HeightLevel *height_cur;
int height_max;
};
2017-01-04 17:54:14 +00:00
struct ClipStack
{
short floorclip[MAXWIDTH];
short ceilingclip[MAXWIDTH];
F3DFloor *ffloor;
ClipStack *next;
};
2017-01-04 17:54:14 +00:00
enum Fake3DOpaque
{
// BSP stage:
FAKE3D_FAKEFLOOR = 1, // fake floor, mark seg as FAKE
FAKE3D_FAKECEILING = 2, // fake ceiling, mark seg as FAKE
FAKE3D_FAKEBACK = 4, // RenderLine with fake backsector, mark seg as FAKE
FAKE3D_FAKEMASK = 7,
FAKE3D_CLIPBOTFRONT = 8, // use front sector clipping info (bottom)
FAKE3D_CLIPTOPFRONT = 16, // use front sector clipping info (top)
};
2017-01-04 17:54:14 +00:00
enum Fake3DTranslucent
{
// sorting stage:
FAKE3D_CLIPBOTTOM = 1, // clip bottom
FAKE3D_CLIPTOP = 2, // clip top
FAKE3D_REFRESHCLIP = 4, // refresh clip info
FAKE3D_DOWN2UP = 8, // rendering from down to up (floors)
};
2017-01-04 17:54:14 +00:00
class Clip3DFloors
{
public:
static Clip3DFloors *Instance();
2017-01-04 17:54:14 +00:00
void Cleanup();
2017-01-04 17:54:14 +00:00
void DeleteHeights();
void AddHeight(secplane_t *add, sector_t *sec);
void NewClip();
void ResetClip();
void EnterSkybox();
void LeaveSkybox();
2017-01-04 17:54:14 +00:00
int fake3D = 0;
2017-01-04 17:54:14 +00:00
F3DFloor *fakeFloor = nullptr;
fixed_t fakeAlpha = 0;
bool fakeActive = false;
double sclipBottom = 0;
double sclipTop = 0;
HeightLevel *height_top = nullptr;
HeightLevel *height_cur = nullptr;
int CurrentSkybox = 0;
2017-01-04 17:54:14 +00:00
private:
int height_max = -1;
TArray<HeightStack> toplist;
ClipStack *clip_top = nullptr;
ClipStack *clip_cur = nullptr;
};
}