- another bunch of picnums in Blood removed.

4 remaining after this.
This commit is contained in:
Christoph Oelckers 2023-01-02 22:20:03 +01:00
parent 83dfd77bd0
commit a662a3bd12
13 changed files with 33 additions and 27 deletions

View file

@ -331,7 +331,7 @@ static void ThrowThing(DBloodActor* actor, bool impact)
DBloodActor* spawned = nullptr;
if ((spawned = actFireThing(actor, 0., 0., (dv.Z / 32768.) - zThrow, curWeapon, dist * (2048. / 64800))) == nullptr) return;
if (pThinkInfo->picno < 0 && spawned->spr.type != kModernThingThrowableRock) spawned->spr.picnum = 0;
if (pThinkInfo->picno < 0 && spawned->spr.type != kModernThingThrowableRock) spawned->spr.setspritetexture(FNullTextureID());
spawned->SetOwner(actor);

View file

@ -720,7 +720,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
break;
case kDecorationTorch:
if (!owneractor->hasX() || owneractor->xspr.state == 1) {
pTSprite->picnum++;
pTSprite->setspritetexture(pTSprite->spritetexture() + 1);
viewAddEffect(tsprites, nTSprite, kViewEffectTorchHigh);
}
else {

View file

@ -750,12 +750,12 @@ DEFINE_ACTION_FUNCTION(_Blood, PowerupIcon)
{
PARAM_PROLOGUE;
PARAM_INT(pwup);
int tile = -1;
FTextureID tile = FNullTextureID();
if (pwup >= 0 && pwup < (int)countof(gPowerUpInfo))
{
tile = gPowerUpInfo[pwup].picnum;
tile = gPowerUpInfo[pwup].textureID();
}
FGameTexture* tex = tileGetTexture(tile);
FGameTexture* tex = TexMan.GetGameTexture(tile);
ACTION_RETURN_INT(tex ? tex->GetID().GetIndex() : -1);
}

View file

@ -39,12 +39,13 @@ struct FXDATA {
int32_t gravity;
int32_t drag; // air drag
int32_t defangle;
int16_t picnum;
int16_t picno;
uint8_t xrepeat;
uint8_t yrepeat;
ESpriteFlags cstat;
int8_t shade;
uint8_t pal;
FTextureID textureID() const { return tileGetTextureID(picno); }
};
FXDATA gFXData[] = {
@ -166,7 +167,7 @@ DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, const DVector3& p
auto actor = actSpawnSprite(pSector, pos, 1, 0);
actor->spr.type = nFx;
actor->spr.picnum = pFX->picnum;
actor->spr.setspritetexture(pFX->textureID());
actor->spr.cstat |= pFX->cstat;
actor->spr.shade = pFX->shade;
actor->spr.pal = pFX->pal;
@ -370,7 +371,7 @@ void fxPrecache()
{
for (int i = 0; i < kFXMax; i++)
{
tilePrecacheTile(gFXData[i].picnum, 0, 0);
tilePrecacheTile(gFXData[i].textureID(), 0, 0);
if (gFXData[i].seq)
seqPrecacheId(gFXData[i].seq, 0);
}

View file

@ -44,10 +44,11 @@ struct GIBFX
struct GIBTHING
{
int type;
int Kills;
int picno;
int chance;
int atc;
int at10;
FTextureID textureID() const { return tileGetTextureID(picno); }
};
struct GIBLIST
@ -369,8 +370,8 @@ void GibThing(DBloodActor* actor, GIBTHING* pGThing, DVector3* pPos, DVector3* p
auto gibactor = actSpawnThing(pSector, gPos, pGThing->type);
if (!gibactor) return;
if (pGThing->Kills > -1)
gibactor->spr.picnum = pGThing->Kills;
if (pGThing->textureID().isValid())
gibactor->spr.setspritetexture(pGThing->textureID());
if (pVel)
{
gibactor->vel = *pVel + DVector3(Random2F(pGThing->atc, 4), Random2F(pGThing->atc, 4), -RandomF(pGThing->at10, 8));
@ -521,8 +522,8 @@ void gibPrecache()
{
for (int j = 0; j < gibList[i].atc; j++)
{
if (pThing[j].Kills >= 0)
tilePrecacheTile(pThing[j].Kills, -1, 0);
if (pThing[j].textureID().isValid())
tilePrecacheTile(pThing[j].textureID(), -1, 0);
}
}
}

View file

@ -96,7 +96,6 @@ enum SurfaceType {
extern int nPrecacheCount;
inline FTextureID mirrortile;
void tilePrecacheTile(int nTile, int nType, int palette);
void tilePrecacheTile(FTextureID nTile, int nType, int palette);
int tileGetSurfType(CollisionBase& hit);

View file

@ -216,3 +216,5 @@ x(CIRCLESAWOFF, 656)
x(FLAREBURST, 2424)
x(BULLETCASE, 2465)
x(SHELLCASE, 2464)
x(WATERDRIP, 1147)
x(BLOODDRIP, 1160)

View file

@ -3974,7 +3974,7 @@ bool condCheckMixed(DBloodActor* aCond, const EVENT& event, int cmpOp, bool PUSH
switch (cond)
{
case 24: return condCmp(GetExtInfo(actor->spr.spritetexture()).surftype, arg1, arg2, cmpOp);
case 25: return condCmp(actor->spr.picnum, arg1, arg2, cmpOp);
case 25: return condCmp(legacyTileNum(actor->spr.spritetexture()), arg1, arg2, cmpOp);
case 26: return condCmp(actor->spr.pal, arg1, arg2, cmpOp);
case 27: return condCmp(actor->spr.shade, arg1, arg2, cmpOp);
case 28: return (arg3) ? condCmp((actor->spr.cstat & ESpriteFlags::FromInt(arg3)), arg1, arg2, cmpOp) : (actor->spr.cstat & ESpriteFlags::FromInt(arg1));
@ -7212,7 +7212,7 @@ void usePictureChanger(DBloodActor* sourceactor, int objType, sectortype* targSe
break;
case OBJ_SPRITE:
if (valueIsBetween(sourceactor->xspr.data1, -1, 32767))
objActor->spr.picnum = sourceactor->xspr.data1;
objActor->spr.setspritetexture(tileGetTextureID(sourceactor->xspr.data1));
if (sourceactor->xspr.data2 >= 0) objActor->spr.shade = (sourceactor->xspr.data2 > 127) ? 127 : sourceactor->xspr.data2;
else if (sourceactor->xspr.data2 < -1) objActor->spr.shade = (sourceactor->xspr.data2 < -127) ? -127 : sourceactor->xspr.data2;

View file

@ -190,10 +190,11 @@ struct AMMOINFO
struct POWERUPINFO
{
int16_t picnum;
int16_t picno;
bool pickupOnce;
int bonusTime;
int maxTime;
FTextureID textureID() const { return tileGetTextureID(picno); }
};
void playerResetPosture(PLAYER* pPlayer);

View file

@ -42,10 +42,10 @@ void gibPrecache();
//
//---------------------------------------------------------------------------
void tilePrecacheTile(int nTile, int nType, int palette)
void tilePrecacheTile(FTextureID nTex, int nType, int palette)
{
auto nTex = tileGetTextureID(nTile);
int n = 1;
if (!nTex.isValid()) return;
switch (GetExtInfo(nTex).picanm.extra & 7)
{
case 0:
@ -194,7 +194,7 @@ void PrecacheThing(DBloodActor* actor)
//case kThingObjectExplode: weird that only gib object is precached and this one is not
break;
}
tilePrecacheTile(actor->spr.picnum, -1, palette);
tilePrecacheTile(actor->spr.spritetexture(), -1, palette);
}
//---------------------------------------------------------------------------
@ -222,7 +222,7 @@ void PreloadCache()
PrecacheThing(actor);
break;
default:
tilePrecacheTile(actor->spr.picnum, -1, actor->spr.pal);
tilePrecacheTile(actor->spr.spritetexture(), -1, actor->spr.pal);
break;
}
}
@ -233,8 +233,8 @@ void PreloadCache()
seqPrecacheId(i, 0);
}
tilePrecacheTile(1147, -1, 0); // water drip
tilePrecacheTile(1160, -1, 0); // blood drip
tilePrecacheTile(aTexIds[kTexWATERDRIP], -1, 0); // water drip
tilePrecacheTile(aTexIds[kTexBLOODDRIP], -1, 0); // blood drip
// Player SEQs
seqPrecacheId(dudeInfo[31].seqStartID + 6, 0);

View file

@ -65,7 +65,7 @@ static void qavInitTileFinderMap()
return prevFrame->tiles[i].texid == thisFrame->tiles[i].texid ? &prevFrame->tiles[i] : nullptr;
});
// Interpolate between frames if the picnum is valid. This can be problematic if tile indices change between frames.
// Interpolate between frames if the tilenum is valid. This can be problematic if tile indices change between frames.
qavPrevTileFinders.Insert("index", [](FRAMEINFO* const thisFrame, FRAMEINFO* const prevFrame, const int i) -> TILE_FRAME* {
return prevFrame->tiles[i].texid.isValid() ? &prevFrame->tiles[i] : nullptr;
});

View file

@ -111,7 +111,7 @@ void Seq::Precache(int palette)
if ((version & 0xff00) != 0x300)
I_Error("Obsolete sequence version");
for (int i = 0; i < nFrames; i++)
tilePrecacheTile(seqGetTile(&frames[i]), -1, palette);
tilePrecacheTile(seqGetTexture(&frames[i]), -1, palette);
}
void seqPrecacheId(int id, int palette)
@ -252,7 +252,7 @@ void UpdateSprite(DBloodActor* actor, SEQFRAME* pFrame)
|| (pFrame->scaley && pFrame->scaley != int(actor->spr.scale.Y * INV_REPEAT_SCALE)))
actor->spr.flags |= 4;
}
actor->spr.picnum = seqGetTile(pFrame);
actor->spr.setspritetexture(seqGetTexture(pFrame));
if (pFrame->palette)
actor->spr.pal = pFrame->palette;
actor->spr.shade = pFrame->shade;

View file

@ -19,4 +19,6 @@ x(FLAREBURST)
x(BULLETCASE)
x(SHELLCASE)
x(FLAGHAVE)
x(ICONLEECH)
x(ICONLEECH)
x(WATERDRIP)
x(BLOODDRIP)