diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index e64fb75ff..23ce11f11 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -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); diff --git a/source/core/rendering/scene/hw_bunchdrawer.cpp b/source/core/rendering/scene/hw_bunchdrawer.cpp index 6d595408c..d680760ee 100644 --- a/source/core/rendering/scene/hw_bunchdrawer.cpp +++ b/source/core/rendering/scene/hw_bunchdrawer.cpp @@ -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°. diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index bd0df60ce..7a482603b 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -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)) { diff --git a/source/core/textures/tilesetbuilder.cpp b/source/core/textures/tilesetbuilder.cpp index d30ed9067..2df297a6f 100644 --- a/source/core/textures/tilesetbuilder.cpp +++ b/source/core/textures/tilesetbuilder.cpp @@ -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) diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index c8be66a47..b40f171d6 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -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)) {