mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 08:31:23 +00:00
Convert FakeSide to enum class
This commit is contained in:
parent
5f8075f726
commit
47ca45bf18
8 changed files with 30 additions and 27 deletions
|
@ -85,7 +85,7 @@ namespace swrenderer
|
||||||
*ceilinglightlevel = sec->GetCeilingLight();
|
*ceilinglightlevel = sec->GetCeilingLight();
|
||||||
}
|
}
|
||||||
|
|
||||||
FakeSide = FAKED_Center;
|
FakeSide = WaterFakeSide::Center;
|
||||||
|
|
||||||
const sector_t *s = sec->GetHeightSec();
|
const sector_t *s = sec->GetHeightSec();
|
||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
|
@ -125,7 +125,7 @@ namespace swrenderer
|
||||||
*ceilinglightlevel = s->GetCeilingLight();
|
*ceilinglightlevel = s->GetCeilingLight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FakeSide = FAKED_BelowFloor;
|
FakeSide = WaterFakeSide::BelowFloor;
|
||||||
return tempsec;
|
return tempsec;
|
||||||
}
|
}
|
||||||
return sec;
|
return sec;
|
||||||
|
@ -224,7 +224,7 @@ namespace swrenderer
|
||||||
*ceilinglightlevel = s->GetCeilingLight();
|
*ceilinglightlevel = s->GetCeilingLight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FakeSide = FAKED_BelowFloor;
|
FakeSide = WaterFakeSide::BelowFloor;
|
||||||
}
|
}
|
||||||
else if (heightsec && heightsec->ceilingplane.PointOnSide(ViewPos) <= 0 &&
|
else if (heightsec && heightsec->ceilingplane.PointOnSide(ViewPos) <= 0 &&
|
||||||
orgceilz > refceilz && !(s->MoreFlags & SECF_FAKEFLOORONLY))
|
orgceilz > refceilz && !(s->MoreFlags & SECF_FAKEFLOORONLY))
|
||||||
|
@ -261,7 +261,7 @@ namespace swrenderer
|
||||||
*ceilinglightlevel = s->GetCeilingLight();
|
*ceilinglightlevel = s->GetCeilingLight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FakeSide = FAKED_AboveCeiling;
|
FakeSide = WaterFakeSide::AboveCeiling;
|
||||||
}
|
}
|
||||||
sec = tempsec; // Use other sector
|
sec = tempsec; // Use other sector
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,11 +28,11 @@ namespace swrenderer
|
||||||
// the texture calculations.
|
// the texture calculations.
|
||||||
#define TOO_CLOSE_Z (3072.0 / (1<<12))
|
#define TOO_CLOSE_Z (3072.0 / (1<<12))
|
||||||
|
|
||||||
enum
|
enum class WaterFakeSide
|
||||||
{
|
{
|
||||||
FAKED_Center,
|
Center,
|
||||||
FAKED_BelowFloor,
|
BelowFloor,
|
||||||
FAKED_AboveCeiling
|
AboveCeiling
|
||||||
};
|
};
|
||||||
|
|
||||||
class RenderBSP
|
class RenderBSP
|
||||||
|
@ -57,10 +57,10 @@ namespace swrenderer
|
||||||
void AddPolyobjs(subsector_t *sub);
|
void AddPolyobjs(subsector_t *sub);
|
||||||
void FakeDrawLoop(subsector_t *sub, visplane_t *floorplane, visplane_t *ceilingplane);
|
void FakeDrawLoop(subsector_t *sub, visplane_t *floorplane, visplane_t *ceilingplane);
|
||||||
|
|
||||||
subsector_t *InSubsector;
|
subsector_t *InSubsector = nullptr;
|
||||||
sector_t *frontsector;
|
sector_t *frontsector = nullptr;
|
||||||
uint8_t FakeSide;
|
WaterFakeSide FakeSide = WaterFakeSide::Center;
|
||||||
bool r_fakingunderwater;
|
bool r_fakingunderwater = false;
|
||||||
|
|
||||||
SWRenderLine renderline;
|
SWRenderLine renderline;
|
||||||
};
|
};
|
||||||
|
|
|
@ -602,7 +602,7 @@ void R_DrawVisVoxel(vissprite_t *spr, int minslabz, int maxslabz, short *cliptop
|
||||||
// R_ProjectSprite
|
// R_ProjectSprite
|
||||||
// Generates a vissprite for a thing if it might be visible.
|
// Generates a vissprite for a thing if it might be visible.
|
||||||
//
|
//
|
||||||
void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector)
|
void R_ProjectSprite (AActor *thing, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector)
|
||||||
{
|
{
|
||||||
double tr_x;
|
double tr_x;
|
||||||
double tr_y;
|
double tr_y;
|
||||||
|
@ -817,12 +817,12 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
|
||||||
|
|
||||||
if (heightsec != NULL) // only clip things which are in special sectors
|
if (heightsec != NULL) // only clip things which are in special sectors
|
||||||
{
|
{
|
||||||
if (fakeside == FAKED_AboveCeiling)
|
if (fakeside == WaterFakeSide::AboveCeiling)
|
||||||
{
|
{
|
||||||
if (gzt < heightsec->ceilingplane.ZatPoint(pos))
|
if (gzt < heightsec->ceilingplane.ZatPoint(pos))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (fakeside == FAKED_BelowFloor)
|
else if (fakeside == WaterFakeSide::BelowFloor)
|
||||||
{
|
{
|
||||||
if (gzb >= heightsec->floorplane.ZatPoint(pos))
|
if (gzb >= heightsec->floorplane.ZatPoint(pos))
|
||||||
return;
|
return;
|
||||||
|
@ -1035,7 +1035,7 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
|
||||||
//
|
//
|
||||||
// killough 9/18/98: add lightlevel as parameter, fixing underwater lighting
|
// killough 9/18/98: add lightlevel as parameter, fixing underwater lighting
|
||||||
// [RH] Save which side of heightsec sprite is on here.
|
// [RH] Save which side of heightsec sprite is on here.
|
||||||
void R_AddSprites (sector_t *sec, int lightlevel, int fakeside)
|
void R_AddSprites (sector_t *sec, int lightlevel, WaterFakeSide fakeside)
|
||||||
{
|
{
|
||||||
F3DFloor *fakeceiling = NULL;
|
F3DFloor *fakeceiling = NULL;
|
||||||
F3DFloor *fakefloor = NULL;
|
F3DFloor *fakefloor = NULL;
|
||||||
|
@ -1447,12 +1447,12 @@ void R_DrawSprite (vissprite_t *spr)
|
||||||
|
|
||||||
if (spr->heightsec && !(spr->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
if (spr->heightsec && !(spr->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||||
{ // only things in specially marked sectors
|
{ // only things in specially marked sectors
|
||||||
if (spr->FakeFlatStat != FAKED_AboveCeiling)
|
if (spr->FakeFlatStat != WaterFakeSide::AboveCeiling)
|
||||||
{
|
{
|
||||||
double hz = spr->heightsec->floorplane.ZatPoint(spr->gpos);
|
double hz = spr->heightsec->floorplane.ZatPoint(spr->gpos);
|
||||||
int h = xs_RoundToInt(CenterY - (hz - ViewPos.Z) * scale);
|
int h = xs_RoundToInt(CenterY - (hz - ViewPos.Z) * scale);
|
||||||
|
|
||||||
if (spr->FakeFlatStat == FAKED_BelowFloor)
|
if (spr->FakeFlatStat == WaterFakeSide::BelowFloor)
|
||||||
{ // seen below floor: clip top
|
{ // seen below floor: clip top
|
||||||
if (!spr->bIsVoxel && h > topclip)
|
if (!spr->bIsVoxel && h > topclip)
|
||||||
{
|
{
|
||||||
|
@ -1469,12 +1469,12 @@ void R_DrawSprite (vissprite_t *spr)
|
||||||
hzb = MAX(hzb, hz);
|
hzb = MAX(hzb, hz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (spr->FakeFlatStat != FAKED_BelowFloor && !(spr->heightsec->MoreFlags & SECF_FAKEFLOORONLY))
|
if (spr->FakeFlatStat != WaterFakeSide::BelowFloor && !(spr->heightsec->MoreFlags & SECF_FAKEFLOORONLY))
|
||||||
{
|
{
|
||||||
double hz = spr->heightsec->ceilingplane.ZatPoint(spr->gpos);
|
double hz = spr->heightsec->ceilingplane.ZatPoint(spr->gpos);
|
||||||
int h = xs_RoundToInt(CenterY - (hz - ViewPos.Z) * scale);
|
int h = xs_RoundToInt(CenterY - (hz - ViewPos.Z) * scale);
|
||||||
|
|
||||||
if (spr->FakeFlatStat == FAKED_AboveCeiling)
|
if (spr->FakeFlatStat == WaterFakeSide::AboveCeiling)
|
||||||
{ // seen above ceiling: clip bottom
|
{ // seen above ceiling: clip bottom
|
||||||
if (!spr->bIsVoxel && h < botclip)
|
if (!spr->bIsVoxel && h < botclip)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#define __R_THINGS__
|
#define __R_THINGS__
|
||||||
|
|
||||||
#include "swrenderer/things/r_visiblesprite.h"
|
#include "swrenderer/things/r_visiblesprite.h"
|
||||||
|
#include "swrenderer/scene/r_bsp.h"
|
||||||
|
|
||||||
struct particle_t;
|
struct particle_t;
|
||||||
struct FVoxel;
|
struct FVoxel;
|
||||||
|
@ -63,7 +64,7 @@ void R_DrawMaskedColumn (FTexture *texture, fixed_t column, bool unmasked = fals
|
||||||
|
|
||||||
void R_CacheSprite (spritedef_t *sprite);
|
void R_CacheSprite (spritedef_t *sprite);
|
||||||
void R_SortVisSprites (int (*compare)(const void *, const void *), size_t first);
|
void R_SortVisSprites (int (*compare)(const void *, const void *), size_t first);
|
||||||
void R_AddSprites (sector_t *sec, int lightlevel, int fakeside);
|
void R_AddSprites (sector_t *sec, int lightlevel, WaterFakeSide fakeside);
|
||||||
void R_DrawSprites ();
|
void R_DrawSprites ();
|
||||||
void R_ClearSprites ();
|
void R_ClearSprites ();
|
||||||
void R_DrawMasked ();
|
void R_DrawMasked ();
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
namespace swrenderer
|
namespace swrenderer
|
||||||
{
|
{
|
||||||
void R_ProjectParticle(particle_t *particle, const sector_t *sector, int shade, int fakeside)
|
void R_ProjectParticle(particle_t *particle, const sector_t *sector, int shade, WaterFakeSide fakeside)
|
||||||
{
|
{
|
||||||
double tr_x, tr_y;
|
double tr_x, tr_y;
|
||||||
double tx, ty;
|
double tx, ty;
|
||||||
|
@ -134,7 +134,7 @@ namespace swrenderer
|
||||||
|
|
||||||
if (heightsec) // only clip things which are in special sectors
|
if (heightsec) // only clip things which are in special sectors
|
||||||
{
|
{
|
||||||
if (fakeside == FAKED_AboveCeiling)
|
if (fakeside == WaterFakeSide::AboveCeiling)
|
||||||
{
|
{
|
||||||
topplane = §or->ceilingplane;
|
topplane = §or->ceilingplane;
|
||||||
botplane = &heightsec->ceilingplane;
|
botplane = &heightsec->ceilingplane;
|
||||||
|
@ -142,7 +142,7 @@ namespace swrenderer
|
||||||
botpic = heightsec->GetTexture(sector_t::ceiling);
|
botpic = heightsec->GetTexture(sector_t::ceiling);
|
||||||
map = heightsec->ColorMap;
|
map = heightsec->ColorMap;
|
||||||
}
|
}
|
||||||
else if (fakeside == FAKED_BelowFloor)
|
else if (fakeside == WaterFakeSide::BelowFloor)
|
||||||
{
|
{
|
||||||
topplane = &heightsec->floorplane;
|
topplane = &heightsec->floorplane;
|
||||||
botplane = §or->floorplane;
|
botplane = §or->floorplane;
|
||||||
|
|
|
@ -14,10 +14,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "r_visiblesprite.h"
|
#include "r_visiblesprite.h"
|
||||||
|
#include "swrenderer/scene/r_bsp.h"
|
||||||
|
|
||||||
namespace swrenderer
|
namespace swrenderer
|
||||||
{
|
{
|
||||||
void R_ProjectParticle(particle_t *, const sector_t *sector, int shade, int fakeside);
|
void R_ProjectParticle(particle_t *, const sector_t *sector, int shade, WaterFakeSide fakeside);
|
||||||
void R_DrawParticle(vissprite_t *);
|
void R_DrawParticle(vissprite_t *);
|
||||||
void R_DrawMaskedSegsBehindParticle(const vissprite_t *vis);
|
void R_DrawMaskedSegsBehindParticle(const vissprite_t *vis);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "swrenderer/line/r_line.h"
|
#include "swrenderer/line/r_line.h"
|
||||||
|
#include "swrenderer/scene/r_bsp.h"
|
||||||
|
|
||||||
struct particle_t;
|
struct particle_t;
|
||||||
struct FVoxel;
|
struct FVoxel;
|
||||||
|
@ -76,7 +77,7 @@ namespace swrenderer
|
||||||
uint8_t bWallSprite : 1; // [RH] This is a wall sprite
|
uint8_t bWallSprite : 1; // [RH] This is a wall sprite
|
||||||
uint8_t bSplitSprite : 1; // [RH] Sprite was split by a drawseg
|
uint8_t bSplitSprite : 1; // [RH] Sprite was split by a drawseg
|
||||||
uint8_t bInMirror : 1; // [RH] Sprite is "inside" a mirror
|
uint8_t bInMirror : 1; // [RH] Sprite is "inside" a mirror
|
||||||
uint8_t FakeFlatStat; // [RH] which side of fake/floor ceiling sprite is on
|
WaterFakeSide FakeFlatStat; // [RH] which side of fake/floor ceiling sprite is on
|
||||||
short renderflags;
|
short renderflags;
|
||||||
uint32_t Translation; // [RH] for color translation
|
uint32_t Translation; // [RH] for color translation
|
||||||
visstyle_t Style;
|
visstyle_t Style;
|
||||||
|
|
|
@ -118,7 +118,7 @@ namespace swrenderer
|
||||||
vis->Style.RenderStyle = thing->RenderStyle;
|
vis->Style.RenderStyle = thing->RenderStyle;
|
||||||
vis->FillColor = thing->fillcolor;
|
vis->FillColor = thing->fillcolor;
|
||||||
vis->Translation = thing->Translation;
|
vis->Translation = thing->Translation;
|
||||||
vis->FakeFlatStat = 0;
|
vis->FakeFlatStat = WaterFakeSide::Center;
|
||||||
vis->Style.Alpha = float(thing->Alpha);
|
vis->Style.Alpha = float(thing->Alpha);
|
||||||
vis->fakefloor = NULL;
|
vis->fakefloor = NULL;
|
||||||
vis->fakeceiling = NULL;
|
vis->fakeceiling = NULL;
|
||||||
|
|
Loading…
Reference in a new issue