Skip to content

Commit

Permalink
Draw sprite shadows for monsters and players by default, and allow ac…
Browse files Browse the repository at this point in the history
…tor overrides for them.
  • Loading branch information
nashmuhandes authored and Doom2fan committed Jun 10, 2020
1 parent 790b7cb commit 1f24556
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/playsim/actor.h
Expand Up @@ -412,6 +412,8 @@ enum ActorFlag8
MF8_RETARGETAFTERSLAM = 0x00000080, // Forces jumping to the idle state after slamming into something
MF8_RECREATELIGHTS = 0x00000100, // Internal flag that signifies that the light attachments need to be recreated at the
MF8_STOPRAILS = 0x00000200, // [MC] Prevent rails from going further if an actor has this flag.
MF8_CASTSPRITESHADOW = 0x00000400, // Sprite shadow overrides
MF8_NOSPRITESHADOW = 0x00000800, // Ditto
};

// --- mobj.renderflags ---
Expand Down
3 changes: 2 additions & 1 deletion src/rendering/swrenderer/scene/r_opaque_pass.cpp
Expand Up @@ -970,7 +970,8 @@ namespace swrenderer
bool drawSpriteShadows =
(
r_actorshadows &&
((thing->flags3 & MF3_ISMONSTER) || thing->IsKindOf(NAME_PlayerPawn))
((thing->flags3 & MF3_ISMONSTER) || thing->IsKindOf(NAME_PlayerPawn) || (thing->flags8 & MF8_CASTSPRITESHADOW)) &&
!(thing->flags8 & MF8_NOSPRITESHADOW)
);

if (drawSpriteShadows)
Expand Down
2 changes: 2 additions & 0 deletions src/scripting/thingdef_data.cpp
Expand Up @@ -325,6 +325,8 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(MF8, NOFRICTIONBOUNCE, AActor, flags8),
DEFINE_FLAG(MF8, RETARGETAFTERSLAM, AActor, flags8),
DEFINE_FLAG(MF8, STOPRAILS, AActor, flags8),
DEFINE_FLAG(MF8, CASTSPRITESHADOW, AActor, flags8),
DEFINE_FLAG(MF8, NOSPRITESHADOW, AActor, flags8),

// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
Expand Down

0 comments on commit 1f24556

Please sign in to comment.