diff --git a/src/r_splats.c b/src/r_splats.c index bfd0197ca..c2aae1a93 100644 --- a/src/r_splats.c +++ b/src/r_splats.c @@ -141,6 +141,7 @@ static void rasterize_segment_tex(INT32 x1, INT32 y1, INT32 x2, INT32 y2, INT32 void R_DrawFloorSplat(vissprite_t *spr) { floorsplat_t splat; + pslope_t localslope; mobj_t *mobj = spr->mobj; fixed_t tr_x, tr_y, rot_x, rot_y, rot_z; @@ -258,6 +259,9 @@ void R_DrawFloorSplat(vissprite_t *spr) if (standingslope && (renderflags & RF_OBJECTSLOPESPLAT)) splat.slope = standingslope; + + if (!splat.slope && R_SplatSlope(mobj, (vector3_t){splat.x, splat.y, splat.z}, &localslope)) + splat.slope = &localslope; } // Translate diff --git a/src/r_spritefx.cpp b/src/r_spritefx.cpp index 448c65974..098cc14e8 100644 --- a/src/r_spritefx.cpp +++ b/src/r_spritefx.cpp @@ -10,6 +10,7 @@ #include "d_player.h" #include "p_tick.h" +#include "r_splats.h" #include "r_things.h" INT32 R_ThingLightLevel(mobj_t* thing) @@ -29,3 +30,17 @@ INT32 R_ThingLightLevel(mobj_t* thing) return lightlevel; } + +// Use this function to set the slope of a splat sprite. +// +// slope->o, slope->d and slope->zdelta must be set, none of +// the other fields on pslope_t are used. +// +// Return true if you want the slope to be used. The object +// must have RF_SLOPESPLAT and mobj_t.floorspriteslope must be +// NULL. (If RF_OBJECTSLOPESPLAT is set, then +// mobj_t.standingslope must also be NULL.) +boolean R_SplatSlope(mobj_t* mobj, vector3_t position, pslope_t* slope) +{ + return false; +} diff --git a/src/r_things.h b/src/r_things.h index 78b6c013e..2737ded62 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -94,6 +94,7 @@ boolean R_ThingIsFullDark (mobj_t *thing); boolean R_ThingIsFlashing(mobj_t *thing); INT32 R_ThingLightLevel(mobj_t *thing); +boolean R_SplatSlope(mobj_t *thing, vector3_t position, pslope_t *slope); // -------------- // MASKED DRAWING