mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-03-01 14:41:06 +00:00
- fixed wall sprite rendering.
This commit is contained in:
parent
efe0d57fca
commit
d1c23d1ad0
3 changed files with 11 additions and 11 deletions
|
@ -215,13 +215,13 @@ void GetWallSpritePosition(const spritetype* spr, vec2_t pos, vec2_t* out, bool
|
||||||
int width, leftofs;
|
int width, leftofs;
|
||||||
if (render && hw_hightile && TileFiles.tiledata[spr->picnum].h_xsize)
|
if (render && hw_hightile && TileFiles.tiledata[spr->picnum].h_xsize)
|
||||||
{
|
{
|
||||||
width = TileFiles.tiledata[spr->picnum].h_xsize * spr->xrepeat;
|
width = TileFiles.tiledata[spr->picnum].h_xsize;
|
||||||
leftofs = (TileFiles.tiledata[spr->picnum].h_xoffs + spr->xoffset) * spr->xrepeat;
|
leftofs = (TileFiles.tiledata[spr->picnum].h_xoffs + spr->xoffset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
width = tex->GetTexelWidth() * spr->xrepeat;
|
width = tex->GetTexelWidth();
|
||||||
leftofs = (tex->GetTexelLeftOffset() + spr->xoffset) * spr->xrepeat;
|
leftofs = (tex->GetTexelLeftOffset() + spr->xoffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = bsin(spr->ang) * spr->xrepeat;
|
int x = bsin(spr->ang) * spr->xrepeat;
|
||||||
|
|
|
@ -283,10 +283,6 @@ void HWDrawInfo::DispatchSprites()
|
||||||
|
|
||||||
setgotpic(tilenum);
|
setgotpic(tilenum);
|
||||||
|
|
||||||
if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT) != CSTAT_SPRITE_ALIGNMENT_SLAB)
|
|
||||||
tileUpdatePicnum(&tilenum, spritenum + 32768, 0);
|
|
||||||
|
|
||||||
|
|
||||||
while (!(spriteext[spritenum].flags & SPREXT_NOTMD))
|
while (!(spriteext[spritenum].flags & SPREXT_NOTMD))
|
||||||
{
|
{
|
||||||
int pt = Ptile2tile(tspr->picnum, tspr->pal);
|
int pt = Ptile2tile(tspr->picnum, tspr->pal);
|
||||||
|
@ -326,6 +322,9 @@ void HWDrawInfo::DispatchSprites()
|
||||||
tspr->pos.y -= bsin(tspr->ang, -13);
|
tspr->pos.y -= bsin(tspr->ang, -13);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tileUpdatePicnum(&tilenum, sprite->owner + 32768, 0);
|
||||||
|
tspr->picnum = tilenum;
|
||||||
|
|
||||||
switch (tspr->cstat & CSTAT_SPRITE_ALIGNMENT)
|
switch (tspr->cstat & CSTAT_SPRITE_ALIGNMENT)
|
||||||
{
|
{
|
||||||
case CSTAT_SPRITE_ALIGNMENT_FACING:
|
case CSTAT_SPRITE_ALIGNMENT_FACING:
|
||||||
|
|
|
@ -1128,10 +1128,10 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect
|
||||||
glseg.y2 = pos[1].y * (1 / -16.f);
|
glseg.y2 = pos[1].y * (1 / -16.f);
|
||||||
tcs[LOLFT].u = tcs[UPLFT].u = (spr->cstat & CSTAT_SPRITE_XFLIP) ? 1.f : 0.f;
|
tcs[LOLFT].u = tcs[UPLFT].u = (spr->cstat & CSTAT_SPRITE_XFLIP) ? 1.f : 0.f;
|
||||||
tcs[LORGT].u = tcs[UPRGT].u = (spr->cstat & CSTAT_SPRITE_XFLIP) ? 0.f : 1.f;
|
tcs[LORGT].u = tcs[UPRGT].u = (spr->cstat & CSTAT_SPRITE_XFLIP) ? 0.f : 1.f;
|
||||||
tcs[UPLFT].v = tcs[UPRGT].u = (spr->cstat & CSTAT_SPRITE_YFLIP) ? 0.f : 1.f;
|
tcs[UPLFT].v = tcs[UPRGT].v = (spr->cstat & CSTAT_SPRITE_YFLIP) ? 1.f : 0.f;
|
||||||
tcs[LOLFT].v = tcs[LORGT].u = (spr->cstat & CSTAT_SPRITE_YFLIP) ? 0.f : 1.f;
|
tcs[LOLFT].v = tcs[LORGT].v = (spr->cstat & CSTAT_SPRITE_YFLIP) ? 0.f : 1.f;
|
||||||
ztop[0] = ztop[1] = (sprz - height) * (1 / -256.);
|
|
||||||
zbottom[0] = zbottom[1] = (sprz) * (1 / -256.);
|
zbottom[0] = zbottom[1] = (sprz) * (1 / -256.);
|
||||||
|
ztop[0] = ztop[1] = (sprz - ((height * spr->yrepeat) << 2)) * (1 / -256.);
|
||||||
|
|
||||||
|
|
||||||
// Clip sprites to ceilings/floors
|
// Clip sprites to ceilings/floors
|
||||||
|
@ -1157,4 +1157,5 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sect
|
||||||
zbottom[0] = zbottom[1] = floorz;
|
zbottom[0] = zbottom[1] = floorz;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
PutWall(di, trans);
|
||||||
}
|
}
|
Loading…
Reference in a new issue