mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- fixed alignment of sloped sprites.
The offset fields are not valid for them so thwy may not be used for offsetting.
This commit is contained in:
parent
717dd123e5
commit
1849fe541e
2 changed files with 13 additions and 5 deletions
|
@ -78,7 +78,12 @@ static inline void get_floorspr_points(DCoreActor *spr, int32_t px, int32_t py,
|
|||
vec2_t const span = { tileWidth(tilenum), tileHeight(tilenum)};
|
||||
vec2_t const repeat = { spr->spr.xrepeat, spr->spr.yrepeat };
|
||||
|
||||
vec2_t adjofs = { tileLeftOffset(tilenum) + spr->spr.xoffset, tileTopOffset(tilenum) + spr->spr.yoffset };
|
||||
vec2_t adjofs = { tileLeftOffset(tilenum), tileTopOffset(tilenum) };
|
||||
if (heinum == 0)
|
||||
{
|
||||
adjofs.X += spr->spr.xoffset;
|
||||
adjofs.Y += spr->spr.yoffset;
|
||||
}
|
||||
|
||||
int32_t const ratio = ksqrt(heinum * heinum + 4096 * 4096);
|
||||
|
||||
|
|
|
@ -282,19 +282,22 @@ void TGetFlatSpritePosition(const spritetypebase* spr, vec2_t pos, vec2_t* out,
|
|||
int width, height, leftofs, topofs;
|
||||
int ratio = ksqrt(heinum * heinum + 4096 * 4096);
|
||||
|
||||
int xo = heinum ? 0 : spr->xoffset;
|
||||
int yo = heinum ? 0 : spr->yoffset;
|
||||
|
||||
if (render && hw_hightile && TileFiles.tiledata[spr->picnum].hiofs.xsize)
|
||||
{
|
||||
width = TileFiles.tiledata[spr->picnum].hiofs.xsize * spr->xrepeat;
|
||||
height = TileFiles.tiledata[spr->picnum].hiofs.ysize * spr->yrepeat;
|
||||
leftofs = (TileFiles.tiledata[spr->picnum].hiofs.xoffs + spr->xoffset) * spr->xrepeat;
|
||||
topofs = (TileFiles.tiledata[spr->picnum].hiofs.yoffs + spr->yoffset) * spr->yrepeat;
|
||||
leftofs = (TileFiles.tiledata[spr->picnum].hiofs.xoffs + xo) * spr->xrepeat;
|
||||
topofs = (TileFiles.tiledata[spr->picnum].hiofs.yoffs + yo) * spr->yrepeat;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = (int)tex->GetDisplayWidth() * spr->xrepeat;
|
||||
height = (int)tex->GetDisplayHeight() * spr->yrepeat;
|
||||
leftofs = ((int)tex->GetDisplayLeftOffset() + spr->xoffset) * spr->xrepeat;
|
||||
topofs = ((int)tex->GetDisplayTopOffset() + spr->yoffset) * spr->yrepeat;
|
||||
leftofs = ((int)tex->GetDisplayLeftOffset() + xo) * spr->xrepeat;
|
||||
topofs = ((int)tex->GetDisplayTopOffset() + yo) * spr->yrepeat;
|
||||
}
|
||||
|
||||
if (spr->cstat & CSTAT_SPRITE_XFLIP) leftofs = -leftofs;
|
||||
|
|
Loading…
Reference in a new issue