Allow all mobjs to have shadow

This commit is contained in:
indev authored and Alug committed 2024-06-02 22:13:45 +02:00
1 parent d57783aa3a
commit 932f6d83f7
5 files changed
+32 -46

No files matched your search

+2 -22
View File
@@ -4648,28 +4648,8 @@ void HWR_DrawSprites(void)
{
if (spr->mobj && cv_shadow.value)
{
switch (spr->mobj->type)
{
case MT_PLAYER:
case MT_SMALLMACE: case MT_BIGMACE:
case MT_PUMA: case MT_BIGPUMA:
case MT_FALLINGROCK:
case MT_SMK_MOLE: case MT_SMK_THWOMP:
//case MT_RANDOMITEM:
case MT_FLOATINGITEM:
case MT_BATTLEBUMPER:
case MT_BANANA: case MT_BANANA_SHIELD:
//case MT_EGGMANITEM: case MT_EGGMANITEM_SHIELD:
case MT_ORBINAUT: case MT_ORBINAUT_SHIELD:
case MT_JAWZ: case MT_JAWZ_DUD: case MT_JAWZ_SHIELD:
case MT_SSMINE: case MT_SSMINE_SHIELD:
case MT_BALLHOG: case MT_SINK:
case MT_THUNDERSHIELD: case MT_ROCKETSNEAKER:
case MT_SPB:
HWR_DrawDropShadow(spr->mobj);
default:
break;
}
if (spr->mobj->haveshadow)
HWR_DrawDropShadow(spr->mobj);
}
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
+2 -2
View File
@@ -655,7 +655,7 @@ static int lib_pSpawnShadowMobj(lua_State *L)
NOHUD
if (!caster)
return LUA_ErrInvalid(L, "mobj_t");
//P_SpawnShadowMobj(caster);
caster->haveshadow = true;
return 0;
}
@@ -3266,4 +3266,4 @@ int LUA_BaseLib(lua_State *L)
lua_pushvalue(L, LUA_GLOBALSINDEX);
luaL_register(L, NULL, lib);
return 0;
}
}
+25
View File
@@ -9398,6 +9398,31 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
mobj->z = z;
mobj->colorized = false;
// Those have shadow by default
switch (type)
{
case MT_PLAYER:
case MT_SMALLMACE: case MT_BIGMACE:
case MT_PUMA: case MT_BIGPUMA:
case MT_FALLINGROCK:
case MT_SMK_MOLE: case MT_SMK_THWOMP:
//case MT_RANDOMITEM:
case MT_FLOATINGITEM:
case MT_BATTLEBUMPER:
case MT_BANANA: case MT_BANANA_SHIELD:
//case MT_EGGMANITEM: case MT_EGGMANITEM_SHIELD:
case MT_ORBINAUT: case MT_ORBINAUT_SHIELD:
case MT_JAWZ: case MT_JAWZ_DUD: case MT_JAWZ_SHIELD:
case MT_SSMINE: case MT_SSMINE_SHIELD:
case MT_BALLHOG: case MT_SINK:
case MT_THUNDERSHIELD: case MT_ROCKETSNEAKER:
case MT_SPB:
mobj->haveshadow = true;
default:
break;
}
mobj->whiteshadow = mobj->frame & FF_FULLBRIGHT;
// DANGER! This can cause P_SpawnMobj to return NULL!
+1
View File
@@ -399,6 +399,7 @@ typedef struct mobj_s
boolean resetinterp; // if true, some fields should not be interpolated (see R_InterpolateMobjState implementation)
boolean colorized; // Whether the mobj uses the rainbow colormap
boolean haveshadow;
boolean whiteshadow; // Use white shadow, set to true by default for fullbright objects
boolean mirrored; // The object's rotations will be mirrored left to right, e.g., see frame AL from the right and AR from the left
+2 -22
View File
@@ -1964,28 +1964,8 @@ static void R_ProjectSprite(mobj_t *thing)
if (cv_shadow.value)
{
switch (oldthing->type)
{
case MT_PLAYER:
case MT_SMALLMACE: case MT_BIGMACE:
case MT_PUMA: case MT_BIGPUMA:
case MT_FALLINGROCK:
case MT_SMK_MOLE: case MT_SMK_THWOMP:
//case MT_RANDOMITEM:
case MT_FLOATINGITEM:
case MT_BATTLEBUMPER:
case MT_BANANA: case MT_BANANA_SHIELD:
//case MT_EGGMANITEM: case MT_EGGMANITEM_SHIELD:
case MT_ORBINAUT: case MT_ORBINAUT_SHIELD:
case MT_JAWZ: case MT_JAWZ_DUD: case MT_JAWZ_SHIELD:
case MT_SSMINE: case MT_SSMINE_SHIELD:
case MT_BALLHOG: case MT_SINK:
case MT_THUNDERSHIELD: case MT_ROCKETSNEAKER:
case MT_SPB:
R_ProjectDropShadow(oldthing, vis, basetx, basetz);
default:
break;
}
if (oldthing->haveshadow)
R_ProjectDropShadow(oldthing, vis, basetx, basetz);
}
// Debug