mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
- basic groundwork for render feature visibility flags. I haven't gotten very far with it yet, but since I am taking a break I am going to commit what I have and continue it later.
todo: * call a render class function in D_Main that enumerates the capabilities of the current renderer into a global variable to be accessed later * add a debug-specific cvar to always show all actors, regardless of these filters * put in checks in the renderer themselves that check both flagsets and reject rendering of any sprite/model that does not fit the definition's criteria
This commit is contained in:
parent
0df2779004
commit
80bb1d908a
2 changed files with 43 additions and 1 deletions
23
src/actor.h
23
src/actor.h
|
@ -516,6 +516,25 @@ enum ActorBounceFlag
|
|||
|
||||
};
|
||||
|
||||
// this is a special flag set that is exposed directly to DECORATE/ZScript
|
||||
// these flags are for filtering actor visibility based on certain conditions of the renderer's feature support.
|
||||
// currently, no renderer supports every single one of these features.
|
||||
enum ActorRenderFeatureFlag
|
||||
{
|
||||
RFF_FLATSPRITES = 1<<0, // flat sprites
|
||||
RFF_MODELS = 1<<1, // 3d models
|
||||
RFF_SLOPE3DFLOORS = 1<<2, // sloped 3d floor support
|
||||
RFF_TILTPITCH = 1<<3, // full free-look
|
||||
RFF_ROLLSPRITES = 1<<4, // roll sprites
|
||||
RFF_UNCLIPPEDTEX = 1<<5, // midtex and sprite can render "into" flats and walls
|
||||
RFF_FRAGMENTSHADER = 1<<6, // fragment (material) shaders
|
||||
RFF_POSTSHADER = 1<<7, // post-process shaders (renderbuffers)
|
||||
RFF_BRIGHTMAP = 1<<8, // brightmaps
|
||||
RFF_COLORMAP = 1<<9, // custom colormaps (incl. ability to fullbright certain ranges, ala Strife)
|
||||
RFF_POLYGONAL = 1<<10, // uses polygons instead of wallscans/visplanes (i.e. softpoly and hardware opengl)
|
||||
RFF_TRUECOLOR = 1<<11, // renderer is currently truecolor
|
||||
};
|
||||
|
||||
// [TP] Flagset definitions
|
||||
typedef TFlags<ActorFlag> ActorFlags;
|
||||
typedef TFlags<ActorFlag2> ActorFlags2;
|
||||
|
@ -527,6 +546,7 @@ typedef TFlags<ActorFlag7> ActorFlags7;
|
|||
typedef TFlags<ActorFlag8> ActorFlags8;
|
||||
typedef TFlags<ActorRenderFlag> ActorRenderFlags;
|
||||
typedef TFlags<ActorBounceFlag, uint16_t> ActorBounceFlags;
|
||||
typedef TFlags<ActorRenderFeatureFlag> ActorRenderFeatureFlags;
|
||||
DEFINE_TFLAGS_OPERATORS (ActorFlags)
|
||||
DEFINE_TFLAGS_OPERATORS (ActorFlags2)
|
||||
DEFINE_TFLAGS_OPERATORS (ActorFlags3)
|
||||
|
@ -537,6 +557,7 @@ DEFINE_TFLAGS_OPERATORS (ActorFlags7)
|
|||
DEFINE_TFLAGS_OPERATORS (ActorFlags8)
|
||||
DEFINE_TFLAGS_OPERATORS (ActorRenderFlags)
|
||||
DEFINE_TFLAGS_OPERATORS (ActorBounceFlags)
|
||||
DEFINE_TFLAGS_OPERATORS (ActorRenderFeatureFlags)
|
||||
|
||||
// Used to affect the logic for thing activation through death, USESPECIAL and BUMPSPECIAL
|
||||
// "thing" refers to what has the flag and the special, "trigger" refers to what used or bumped it
|
||||
|
@ -1024,6 +1045,8 @@ public:
|
|||
uint32_t Translation;
|
||||
|
||||
ActorRenderFlags renderflags; // Different rendering flags
|
||||
ActorRenderFeatureFlags renderrequired; // current renderer must have this feature set
|
||||
ActorRenderFeatureFlags renderhidden; // current renderer must *not* have any of these features
|
||||
ActorFlags flags;
|
||||
ActorFlags2 flags2; // Heretic flags
|
||||
ActorFlags3 flags3; // [RH] Hexen/Heretic actor-dependant behavior made flaggable
|
||||
|
|
|
@ -1171,4 +1171,23 @@ enum EWeaponState
|
|||
WF_USER2OK = 1 << 9,
|
||||
WF_USER3OK = 1 << 10,
|
||||
WF_USER4OK = 1 << 11,
|
||||
};
|
||||
};
|
||||
|
||||
// these flags are for filtering actor visibility based on certain conditions of the renderer's feature support.
|
||||
// currently, no renderer supports every single one of these features.
|
||||
enum ActorRenderFeatureFlag
|
||||
{
|
||||
RFF_FLATSPRITES = 1<<0, // flat sprites
|
||||
RFF_MODELS = 1<<1, // 3d models
|
||||
RFF_SLOPE3DFLOORS = 1<<2, // sloped 3d floor support
|
||||
RFF_TILTPITCH = 1<<3, // full free-look
|
||||
RFF_ROLLSPRITES = 1<<4, // roll sprites
|
||||
RFF_UNCLIPPEDTEX = 1<<5, // midtex and sprite can render "into" flats and walls
|
||||
RFF_FRAGMENTSHADER = 1<<6, // fragment (material) shaders
|
||||
RFF_POSTSHADER = 1<<7, // post-process shaders (renderbuffers)
|
||||
RFF_BRIGHTMAP = 1<<8, // brightmaps
|
||||
RFF_COLORMAP = 1<<9, // custom colormaps (incl. ability to fullbright certain ranges, ala Strife)
|
||||
RFF_POLYGONAL = 1<<10, // uses polygons instead of wallscans/visplanes (i.e. softpoly and hardware opengl)
|
||||
RFF_TRUECOLOR = 1<<11, // renderer is currently truecolor
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue