- got rid of a large chunk of picnum accesses in Exhumed.

This commit is contained in:
Christoph Oelckers 2023-01-02 19:39:35 +01:00
parent f115f9427d
commit 0e097903c4
17 changed files with 27 additions and 20 deletions

View file

@ -101,7 +101,7 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, const FName seqFile, int seqInde
pActor->spr.cstat = 0; pActor->spr.cstat = 0;
pActor->clipdist = 2.5; pActor->clipdist = 2.5;
pActor->spr.scale = DVector2(nScale, nScale); pActor->spr.scale = DVector2(nScale, nScale);
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.Angles.Yaw = nullAngle; pActor->spr.Angles.Yaw = nullAngle;
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;

View file

@ -68,7 +68,7 @@ void BuildAnubis(DExhumedActor* ap, const DVector3& pos, sectortype* pSector, DA
ap->spr.xoffset = 0; ap->spr.xoffset = 0;
ap->spr.shade = -12; ap->spr.shade = -12;
ap->spr.yoffset = 0; ap->spr.yoffset = 0;
ap->spr.picnum = 1; setvalidpic(ap);
ap->spr.pal = ap->sector()->ceilingpal; ap->spr.pal = ap->sector()->ceilingpal;
ap->clipdist = 15; ap->clipdist = 15;
ap->spr.Angles.Yaw = nAngle; ap->spr.Angles.Yaw = nAngle;

View file

@ -64,7 +64,7 @@ static DExhumedActor* BuildBubble(const DVector3& pos, sectortype* pSector, cons
pActor->spr.scale = DVector2(0.625, 0.625); pActor->spr.scale = DVector2(0.625, 0.625);
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.Angles.Yaw = nAngle; pActor->spr.Angles.Yaw = nAngle;
pActor->vel.X = 0; pActor->vel.X = 0;
pActor->vel.Y = 0; pActor->vel.Y = 0;

View file

@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "exhumedactor.h" #include "exhumedactor.h"
#include "serialize_obj.h" #include "serialize_obj.h"
#include "texturemanager.h" #include "texturemanager.h"
#include "texinfo.h"
#include "player.h" #include "player.h"
BEGIN_PS_NS BEGIN_PS_NS
@ -86,6 +87,12 @@ void menu_DoPlasma();
void DoEnergyTile(); void DoEnergyTile();
void InitEnergyTile(); void InitEnergyTile();
void setvalidpic(DExhumedActor* actor)
{
// all we want here is setting it to something that passes renderer validation. This is never used to draw the sprite.
actor->spr.setspritetexture(tileGetTextureID(1));
}
extern int EndLevel; extern int EndLevel;
extern int32_t g_commandSetup; extern int32_t g_commandSetup;
extern int32_t g_noSetup; extern int32_t g_noSetup;

View file

@ -66,7 +66,7 @@ void BuildFishLimb(DExhumedActor* pActor, int anim)
//getSequence(pChunkActor->nSeqFile, pChunkActor->nCount)->getFirstTexID(); //getSequence(pChunkActor->nSeqFile, pChunkActor->nCount)->getFirstTexID();
pChunkActor->spr.picnum = anim; setvalidpic(pChunkActor);
pChunkActor->spr.lotag = runlist_HeadRun() + 1; pChunkActor->spr.lotag = runlist_HeadRun() + 1;
pChunkActor->clipdist = 0; pChunkActor->clipdist = 0;

View file

@ -129,7 +129,7 @@ void BuildGrenade(int nPlayer)
pActor->spr.shade = -64; pActor->spr.shade = -64;
pActor->spr.scale = DVector2(0.3125, 0.3125); pActor->spr.scale = DVector2(0.3125, 0.3125);
pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE; pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE;
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.pal = 0; pActor->spr.pal = 0;
pActor->clipdist = 7.5; pActor->clipdist = 7.5;
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;

View file

@ -51,7 +51,7 @@ DExhumedActor* BuildLavaLimb(DExhumedActor* pActor, int move, double height)
pLimbActor->spr.xoffset = 0; pLimbActor->spr.xoffset = 0;
pLimbActor->spr.yoffset = 0; pLimbActor->spr.yoffset = 0;
pLimbActor->spr.scale = DVector2(1.40625, 1.40625); pLimbActor->spr.scale = DVector2(1.40625, 1.40625);
pLimbActor->spr.picnum = (move & 3) % 3; pLimbActor->spr.detail = (move & 3) % 3;
pLimbActor->spr.hitag = 0; pLimbActor->spr.hitag = 0;
pLimbActor->spr.lotag = runlist_HeadRun() + 1; pLimbActor->spr.lotag = runlist_HeadRun() + 1;
pLimbActor->clipdist = 0; pLimbActor->clipdist = 0;

View file

@ -59,7 +59,7 @@ void BuildLion(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
pActor->clipdist = 15; pActor->clipdist = 15;
pActor->spr.shade = -12; pActor->spr.shade = -12;
pActor->spr.scale = DVector2(0.625, 0.625); pActor->spr.scale = DVector2(0.625, 0.625);
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;

View file

@ -67,7 +67,7 @@ void BuildMummy(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;
pActor->spr.Angles.Yaw = nAngle; pActor->spr.Angles.Yaw = nAngle;
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.hitag = 0; pActor->spr.hitag = 0;
pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.lotag = runlist_HeadRun() + 1;
pActor->spr.extra = -1; pActor->spr.extra = -1;

View file

@ -430,7 +430,7 @@ void BuildTail()
pTailActor->spr.cstat = 0; pTailActor->spr.cstat = 0;
pTailActor->clipdist = 25; pTailActor->clipdist = 25;
pTailActor->spr.scale = DVector2(1.25, 1.25); pTailActor->spr.scale = DVector2(1.25, 1.25);
pTailActor->spr.picnum = 1; setvalidpic(pTailActor);
pTailActor->spr.pal = pTailActor->sector()->ceilingpal; pTailActor->spr.pal = pTailActor->sector()->ceilingpal;
pTailActor->spr.xoffset = 0; pTailActor->spr.xoffset = 0;
pTailActor->spr.yoffset = 0; pTailActor->spr.yoffset = 0;
@ -475,8 +475,8 @@ void BuildQueenEgg(int nQueen, int nVal)
pActor2->spr.xoffset = 0; pActor2->spr.xoffset = 0;
pActor2->spr.yoffset = 0; pActor2->spr.yoffset = 0;
pActor2->spr.shade = -12; pActor2->spr.shade = -12;
pActor2->spr.picnum = 1; setvalidpic(pActor2);
pActor2->spr.Angles.Yaw = pActor->spr.Angles.Yaw + RandomAngle9() - DAngle45; pActor2->spr.Angles.Yaw = pActor->spr.Angles.Yaw + RandomAngle9() - DAngle45;
pActor2->backuppos(); pActor2->backuppos();
if (!nVal) if (!nVal)
@ -757,7 +757,7 @@ void BuildQueenHead(int nQueen)
pActor2->clipdist = 17.5; pActor2->clipdist = 17.5;
pActor2->spr.scale = DVector2(1.25, 1.25); pActor2->spr.scale = DVector2(1.25, 1.25);
pActor2->spr.cstat = 0; pActor2->spr.cstat = 0;
pActor2->spr.picnum = 1; setvalidpic(pActor2);
pActor2->spr.shade = -12; pActor2->spr.shade = -12;
pActor2->spr.pal = 0; pActor2->spr.pal = 0;
pActor2->spr.xoffset = 0; pActor2->spr.xoffset = 0;
@ -1182,7 +1182,7 @@ void BuildQueen(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
pActor->spr.scale = DVector2(1.25, 1.25); pActor->spr.scale = DVector2(1.25, 1.25);
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.Angles.Yaw = nAngle; pActor->spr.Angles.Yaw = nAngle;
pActor->vel.X = 0; pActor->vel.X = 0;
pActor->vel.Y = 0; pActor->vel.Y = 0;

View file

@ -90,7 +90,7 @@ void BuildRat(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D
pActor->spr.shade = -12; pActor->spr.shade = -12;
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->clipdist = 7.5; pActor->clipdist = 7.5;
pActor->spr.Angles.Yaw = nAngle; pActor->spr.Angles.Yaw = nAngle;

View file

@ -61,7 +61,7 @@ void BuildRex(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D
pActor->clipdist = 20; pActor->clipdist = 20;
pActor->spr.shade = -12; pActor->spr.shade = -12;
pActor->spr.scale = DVector2(1, 1); pActor->spr.scale = DVector2(1, 1);
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;

View file

@ -58,7 +58,7 @@ void BuildRoach(int nType, DExhumedActor* pActor, const DVector3& pos, sectortyp
pActor->spr.shade = -12; pActor->spr.shade = -12;
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->clipdist = 15; pActor->clipdist = 15;
pActor->spr.Angles.Yaw = angle; pActor->spr.Angles.Yaw = angle;

View file

@ -62,7 +62,7 @@ void BuildScorp(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector,
pActor->clipdist = 17.5; pActor->clipdist = 17.5;
pActor->spr.shade = -12; pActor->spr.shade = -12;
pActor->spr.scale = DVector2(1.25, 1.25); pActor->spr.scale = DVector2(1.25, 1.25);
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.pal = pActor->sector()->ceilingpal;
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;

View file

@ -70,7 +70,7 @@ void BuildSet(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, D
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;
pActor->spr.Angles.Yaw = nAngle; pActor->spr.Angles.Yaw = nAngle;
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.hitag = 0; pActor->spr.hitag = 0;
pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.lotag = runlist_HeadRun() + 1;
pActor->spr.extra = -1; pActor->spr.extra = -1;

View file

@ -68,7 +68,7 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, const DVector3& pos, sectortype*
spp->spr.xoffset = 0; spp->spr.xoffset = 0;
spp->spr.yoffset = 0; spp->spr.yoffset = 0;
spp->spr.Angles.Yaw = nAngle; spp->spr.Angles.Yaw = nAngle;
spp->spr.picnum = 1; setvalidpic(spp);
spp->spr.hitag = 0; spp->spr.hitag = 0;
spp->spr.lotag = runlist_HeadRun() + 1; spp->spr.lotag = runlist_HeadRun() + 1;
spp->spr.extra = -1; spp->spr.extra = -1;

View file

@ -70,7 +70,7 @@ DExhumedActor* BuildWasp(DExhumedActor* pActor, const DVector3& pos, sectortype*
pActor->spr.xoffset = 0; pActor->spr.xoffset = 0;
pActor->spr.yoffset = 0; pActor->spr.yoffset = 0;
pActor->spr.picnum = 1; setvalidpic(pActor);
pActor->spr.Angles.Yaw = nAngle; pActor->spr.Angles.Yaw = nAngle;
pActor->vel.X = 0; pActor->vel.X = 0;
pActor->vel.Y = 0; pActor->vel.Y = 0;