- eliminate the last remaining references to the tile manager in the core renderer files.

The only thing left is the sky which needs more refactoring first and the tileUpdatePicnum call for sprites which cannot be resolved by the texture manager because Blood has a randomization factor included here.
This commit is contained in:
Christoph Oelckers 2022-12-06 22:30:52 +01:00
parent e26d9106aa
commit 71ca2c4677
5 changed files with 11 additions and 13 deletions

View file

@ -373,7 +373,7 @@ bool ShowRedLine(int j, int i)
if (((wal->cstat | wal->nextWall()->cstat) & (CSTAT_WALL_MASKED | CSTAT_WALL_1WAY)) == 0)
if (sector[i].floorz == wal->nextSector()->floorz)
return false;
if (sector[i].floorpicnum != wal->nextSector()->floorpicnum)
if (sector[i].floortexture() != wal->nextSector()->floortexture())
return false;
if (sector[i].floorshade != wal->nextSector()->floorshade)
return false;
@ -431,7 +431,7 @@ static void drawwhitelines(const DVector2& cpos, const DVector2& cangvect, const
for (auto& wal : sector[i].walls)
{
if (wal.nextwall >= 0) continue;
if (!gFullMap && !tileGetTexture(wal.wallpicnum)->isValid()) continue;
if (!gFullMap && !wal.walltexture().isValid()) continue;
if (isSWALL() && !gFullMap && !show2dwall[wallindex(&wal)])
continue;
@ -524,8 +524,8 @@ static void renderDrawMapView(const DVector2& cpos, const DVector2& cangvect, co
if (sect->floorstat & CSTAT_SECTOR_SKY) continue;
int picnum = sect->floorpicnum;
if ((unsigned)picnum >= (unsigned)MAXTILES) continue;
auto flortex = sect->floortexture();
if (!flortex.isValid()) continue;
int translation = TRANSLATION(Translation_Remap + curbasepal, sector[i].floorpal);
PalEntry light = shadeToLight(sector[i].floorshade);
@ -541,7 +541,7 @@ static void renderDrawMapView(const DVector2& cpos, const DVector2& cangvect, co
vertices[j] = { float(v.X), float(v.Y), mesh->texcoords[j].X, mesh->texcoords[j].Y };
}
twod->AddPoly(tileGetTexture(picnum, true), vertices.Data(), vertices.Size(), (unsigned*)indices->Data(), indices->Size(), translation, light,
twod->AddPoly(TexMan.GetGameTexture(flortex, true), vertices.Data(), vertices.Size(), (unsigned*)indices->Data(), indices->Size(), translation, light,
LegacyRenderStyles[STYLE_Translucent], &viewport3d);
}
}
@ -581,9 +581,8 @@ static void renderDrawMapView(const DVector2& cpos, const DVector2& cangvect, co
}
int translation = TRANSLATION(Translation_Remap + curbasepal, actor->spr.pal);
int picnum = actor->spr.picnum;
const static unsigned indices[] = { 0, 1, 2, 0, 2, 3 };
twod->AddPoly(tileGetTexture(picnum, true), vertices.Data(), vertices.Size(), indices, 6, translation, color, rs, &viewport3d);
twod->AddPoly(TexMan.GetGameTexture(actor->spr.spritetexture(), true), vertices.Data(), vertices.Size(), indices, 6, translation, color, rs, &viewport3d);
}
}

View file

@ -388,7 +388,7 @@ int checkTranslucentReplacement(FTextureID picnum, int pal);
inline bool maskWallHasTranslucency(const walltype* wall)
{
return (wall->cstat & CSTAT_WALL_TRANSLUCENT) || checkTranslucentReplacement(tileGetTexture(wall->wallpicnum)->GetID(), wall->pal);
return (wall->cstat & CSTAT_WALL_TRANSLUCENT) || checkTranslucentReplacement(wall->walltexture(), wall->pal);
}
inline bool spriteHasTranslucency(const tspritetype* tspr)
@ -397,7 +397,7 @@ inline bool spriteHasTranslucency(const tspritetype* tspr)
(tspr->ownerActor->sprext.alpha))
return true;
return checkTranslucentReplacement(tileGetTexture(tspr->picnum)->GetID(), tspr->pal);
return checkTranslucentReplacement(tspr->spritetexture(), tspr->pal);
}
inline void SetSpriteTranslucency(const tspritetype* sprite, float& alpha, FRenderStyle& RenderStyle)

View file

@ -413,8 +413,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int section
void HWFlat::ProcessFlatSprite(HWDrawInfo* di, tspritetype* sprite, sectortype* sector)
{
int tilenum = sprite->picnum;
texture = tileGetTexture(tilenum);
texture = TexMan.GetGameTexture(sprite->spritetexture());
bool belowfloor = false;
if (sprite->pos.Z > sprite->sectp->floorz)
{

View file

@ -318,7 +318,7 @@ void HWSprite::Process(HWDrawInfo* di, tspritetype* spr, sectortype* sector, int
if (spr == nullptr)
return;
auto tex = tileGetTexture(spr->picnum);
auto tex = TexMan.GetGameTexture(spr->spritetexture());
if (!tex || !tex->isValid()) return;
texture = tex;

View file

@ -1126,7 +1126,7 @@ int HWWall::CheckWallSprite(tspritetype* spr, tspritetype* last)
void HWWall::ProcessWallSprite(HWDrawInfo* di, tspritetype* spr, sectortype* sector)
{
auto tex = tileGetTexture(spr->picnum);
auto tex = TexMan.GetGameTexture(spr->spritetexture());
if (!tex || !tex->isValid()) return;
seg = nullptr;