mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-23 17:31:14 +00:00
- handle exclusion of tilenum 0 for sprites in the backend.
This commit is contained in:
parent
a76494363c
commit
058f1b4233
5 changed files with 8 additions and 14 deletions
source
core
games/blood/src
|
@ -241,8 +241,6 @@ inline int pushmove(DVector2& pos, double z, sectortype** pSect, double walldist
|
|||
int FindBestSector(const DVector3& pos);
|
||||
|
||||
|
||||
tspritetype* renderAddTsprite(tspriteArray& tsprites, DCoreActor* actor);
|
||||
|
||||
void setWallSectors();
|
||||
void GetWallSpritePosition(const spritetypebase* spr, const DVector2& pos, DVector2* out, bool render = false);
|
||||
void GetFlatSpritePosition(DCoreActor* spr, const DVector2& pos, DVector2* out, double* outz = nullptr, bool render = false);
|
||||
|
|
|
@ -680,6 +680,11 @@ void BunchDrawer::ProcessSection(int sectionnum, bool portal)
|
|||
if ((actor->spr.cstat & CSTAT_SPRITE_INVISIBLE) || actor->spr.scale.X == 0 || actor->spr.scale.Y == 0) // skip invisible sprites
|
||||
continue;
|
||||
|
||||
auto tex = actor->spr.spritetexture();
|
||||
if (!tex.isValid()) continue;
|
||||
auto tx = TexMan.GetGameTexture(tex);
|
||||
if (tx->GetUseType() == ETextureType::FirstDefined) continue;
|
||||
|
||||
auto viewvec = actor->spr.pos.XY() - DVector2(viewx, -viewy); // note that viewy is in render coordinates
|
||||
|
||||
// this checks if the sprite is it behind the camera, which will not work if the pitch is high enough to necessitate a FOV of more than 180°.
|
||||
|
|
|
@ -292,8 +292,7 @@ void HWDrawInfo::DispatchSprites()
|
|||
}
|
||||
if (tspr->cstat2 & CSTAT2_SPRITE_FULLBRIGHT)
|
||||
tspr->shade = -127;
|
||||
tspr->picnum = legacyTileNum(texid);
|
||||
int tilenum = tspr->picnum;
|
||||
tspr->setspritetexture(texid);
|
||||
|
||||
if (!(actor->sprext.renderflags & SPREXT_NOTMD) && !(tspr->cstat2 & CSTAT2_SPRITE_NOMODEL))
|
||||
{
|
||||
|
|
|
@ -293,7 +293,7 @@ void ConstructTileset()
|
|||
FStringf tname("#%05d", i);
|
||||
if (info.tile[i].tileimage == nullptr)
|
||||
{
|
||||
if (info.tile[i].imported == nullptr)
|
||||
if (info.tile[i].imported == nullptr || i == 0)
|
||||
{
|
||||
ftex = nulltex->GetTexture();
|
||||
gtex = MakeGameTexture(ftex, tname, ETextureType::Null);
|
||||
|
@ -308,7 +308,7 @@ void ConstructTileset()
|
|||
{
|
||||
if (info.tile[i].imported) ftex = info.tile[i].imported->GetTexture();
|
||||
else ftex = new FImageTexture(info.tile[i].tileimage);
|
||||
gtex = MakeGameTexture(ftex, tname, ETextureType::Any);
|
||||
gtex = MakeGameTexture(ftex, tname, i == 0? ETextureType::FirstDefined : ETextureType::Any);
|
||||
gtex->SetOffsets(info.tile[i].leftOffset, info.tile[i].topOffset);
|
||||
}
|
||||
if (info.tile[i].extinfo.picanm.sf & PICANM_NOFULLBRIGHT_BIT)
|
||||
|
|
|
@ -550,14 +550,6 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
|
|||
pTSprite->scale = DVector2(0, 0);
|
||||
continue;
|
||||
}
|
||||
// skip tile 0 on face sprites. tile 0 is a simple wall texture in Blood,
|
||||
// but there are maps that use 0 on some operator sprites that may show up in portals as a result.
|
||||
// Since the wall texture is perfectly fine for wall and floor sprites, these will be allowed to pass.
|
||||
if (legacyTileNum(nTex) == 0 && (pTSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FACING)
|
||||
{
|
||||
pTSprite->scale = DVector2(0, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cl_interpolate && owneractor->interpolated && !(pTSprite->flags & 512))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue