Commit 437e61ef authored by nukeykt's avatar nukeykt

engine: enable xoffset for face sprite voxel replacements

parent b3f0866a
......@@ -6481,14 +6481,12 @@ next_most:
if ((cstat & 8) && (tspr->cstat&48) != 0) off.y = -off.y;
tspr->z -= off.y * tspr->yrepeat << 2;
if ((sprite[spritenum].cstat&CSTAT_SPRITE_ALIGNMENT) == CSTAT_SPRITE_ALIGNMENT_WALL)
{
const int32_t xv = tspr->xrepeat*sintable[(tspr->ang+2560+1536)&2047];
const int32_t yv = tspr->xrepeat*sintable[(tspr->ang+2048+1536)&2047];
const float xfactor = (tspr->cstat&48) != 16 ? (256.f/320.f) : 1.f;
const int32_t xv = (int32_t)(tspr->xrepeat*sintable[(tspr->ang+2560+1536)&2047]*xfactor);
const int32_t yv = (int32_t)(tspr->xrepeat*sintable[(tspr->ang+2048+1536)&2047]*xfactor);
tspr->x -= mulscale16(xv, off.x);
tspr->y -= mulscale16(yv, off.x);
}
tspr->x -= mulscale16(xv, off.x);
tspr->y -= mulscale16(yv, off.x);
globvis = globalvisibility;
if (sec->visibility != 0) globvis = mulscale4(globvis, (uint8_t)(sec->visibility+16));
......
......@@ -1015,11 +1015,9 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr)
k0 = m->bscale / 64.f;
f = (float) tspr->xrepeat * (256.f/320.f) * k0;
if ((sprite[tspr->owner].cstat&48)==16)
{
f *= 1.25f;
a0.y -= tspr->xoffset*sintable[(spriteext[tspr->owner].angoff+512)&2047]*(1.f/(64.f*16384.f));
a0.x += tspr->xoffset*sintable[spriteext[tspr->owner].angoff&2047]*(1.f/(64.f*16384.f));
}
a0.y -= tspr->xoffset*sintable[(spriteext[tspr->owner].angoff+512)&2047]*(1.f/(64.f*16384.f));
a0.x += tspr->xoffset*sintable[spriteext[tspr->owner].angoff&2047]*(1.f/(64.f*16384.f));
if (globalorientation&8) { m0.z = -m0.z; a0.z = -a0.z; } //y-flipping
if (globalorientation&4) { m0.x = -m0.x; a0.x = -a0.x; a0.y = -a0.y; } //x-flipping
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment