mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 04:20:42 +00:00
- another batch of search&replace, with smaller results.
This commit is contained in:
parent
c5ae454207
commit
82fb03e399
24 changed files with 86 additions and 87 deletions
|
@ -628,7 +628,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
addclipline(p1.x+v.x, p1.y+v.y, p2.x+v.y, p2.y-v.x, obj, false);
|
||||
else
|
||||
{
|
||||
if ((cstat & 64) != 0)
|
||||
if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0)
|
||||
continue;
|
||||
addclipline(p2.x-v.x, p2.y-v.y, p1.x-v.y, p1.y+v.x, obj, false);
|
||||
}
|
||||
|
@ -647,8 +647,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
{
|
||||
if (pos->z > spr->z-flordist && pos->z < spr->z+ceildist)
|
||||
{
|
||||
if ((cstat&64) != 0)
|
||||
if ((pos->z > spr->z) == ((cstat&8)==0))
|
||||
if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0)
|
||||
if ((pos->z > spr->z) == ((cstat & CSTAT_SPRITE_YFLIP)==0))
|
||||
continue;
|
||||
|
||||
rxi[0] = p1.x;
|
||||
|
@ -1098,7 +1098,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
|
|||
{
|
||||
daz = spr->z; daz2 = daz;
|
||||
|
||||
if ((cstat&64) != 0 && (pos.z > daz) == ((cstat&8)==0))
|
||||
if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0 && (pos.z > daz) == ((cstat & CSTAT_SPRITE_YFLIP)==0))
|
||||
continue;
|
||||
|
||||
vec2_t v2, v3, v4;
|
||||
|
@ -1335,7 +1335,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire
|
|||
continue;
|
||||
|
||||
x1 = spr->x; y1 = spr->y; z1 = spr->z;
|
||||
switch (cstat&CSTAT_SPRITE_ALIGNMENT)
|
||||
switch (cstat&CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
|
@ -1356,7 +1356,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire
|
|||
|
||||
get_wallspr_points(spr, &x1, &x2, &y1, &y2);
|
||||
|
||||
if ((cstat&64) != 0) //back side of 1-way sprite
|
||||
if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0) //back side of 1-way sprite
|
||||
if (compat_maybe_truncate_to_int32((coord_t)(x1-sv->x)*(y2-sv->y))
|
||||
< compat_maybe_truncate_to_int32((coord_t)(x2-sv->x)*(y1-sv->y))) continue;
|
||||
|
||||
|
@ -1398,8 +1398,8 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire
|
|||
|
||||
if (vz == 0 || ((intz-sv->z)^vz) < 0) continue;
|
||||
|
||||
if ((cstat&64) != 0)
|
||||
if ((sv->z > intz) == ((cstat&8)==0)) continue;
|
||||
if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0)
|
||||
if ((sv->z > intz) == ((cstat & CSTAT_SPRITE_YFLIP)==0)) continue;
|
||||
|
||||
// avoid overflow errors by using 64 bit math.
|
||||
intx = int(sv->x + (int64_t(intz) - sv->z) * vx / vz);
|
||||
|
|
|
@ -1194,7 +1194,7 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr)
|
|||
}
|
||||
if (globalorientation&4) { m0.Y = -m0.Y; m1.Y = -m1.Y; a0.Y = -a0.Y; } //x-flipping
|
||||
|
||||
// yoffset differs from zadd in that it does not follow cstat&8 y-flipping
|
||||
// yoffset differs from zadd in that it does not follow cstat & CSTAT_SPRITE_YFLIP y-flipping
|
||||
a0.Z += m->yoffset*m->scale;
|
||||
|
||||
f = ((float)tspr->xrepeat) * (1.f/64.f) * m->bscale;
|
||||
|
@ -1252,10 +1252,10 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr)
|
|||
// tinting
|
||||
pc[0] = pc[1] = pc[2] = ((float)numshades - min(max((globalshade * hw_shadescale) + m->shadeoff, 0.f), (float)numshades)) / (float)numshades;
|
||||
|
||||
pc[3] = (tspr->cstat&2) ? glblend[tspr->blend].def[!!(tspr->cstat&512)].alpha : 1.0f;
|
||||
pc[3] = (tspr->cstat & CSTAT_SPRITE_TRANSLUCENT) ? glblend[tspr->blend].def[!!(tspr->cstat&512)].alpha : 1.0f;
|
||||
pc[3] *= 1.0f - sext->alpha;
|
||||
|
||||
SetRenderStyleFromBlend(!!(tspr->cstat & 2), tspr->blend, !!(tspr->cstat & 512));
|
||||
SetRenderStyleFromBlend(!!(tspr->cstat & CSTAT_SPRITE_TRANSLUCENT), tspr->blend, !!(tspr->cstat & CSTAT_SPRITE_TRANS_FLIP));
|
||||
|
||||
if (m->usesalpha) //Sprites with alpha in texture
|
||||
{
|
||||
|
@ -1266,7 +1266,7 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr)
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((tspr->cstat&2) || sext->alpha > 0.f || pc[3] < 1.0f)
|
||||
if ((tspr->cstat & CSTAT_SPRITE_TRANSLUCENT) || sext->alpha > 0.f || pc[3] < 1.0f)
|
||||
GLInterface.EnableBlend(true); //else GLInterface.EnableBlend(false);
|
||||
}
|
||||
GLInterface.SetColor(pc[0],pc[1],pc[2],pc[3]);
|
||||
|
|
|
@ -1683,7 +1683,7 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
float const ocy1 = (cz-globalposz)*ryp1 + ghoriz;
|
||||
float const ofy1 = (fz-globalposz)*ryp1 + ghoriz;
|
||||
|
||||
if ((wal->cstat& (CSTAT_WALL_MASKED | CSTAT_WALL_1WAY)) == CSTAT_WALL_MASKED) maskwall[maskwallcnt++] = z;
|
||||
if ((wal->cstat & (CSTAT_WALL_MASKED | CSTAT_WALL_1WAY)) == CSTAT_WALL_MASKED) maskwall[maskwallcnt++] = z;
|
||||
|
||||
if (((cy0 < ocy0) || (cy1 < ocy1)) && (!((sec->ceilingstat§or[nextsectnum].ceilingstat) & CSTAT_SECTOR_SKY)))
|
||||
{
|
||||
|
@ -1692,29 +1692,29 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
globalorientation = wal->cstat;
|
||||
tileUpdatePicnum(&globalpicnum, wallnum+16384);
|
||||
|
||||
int i = (!(wal->cstat& CSTAT_WALL_ALIGN_BOTTOM)) ? sector[nextsectnum].ceilingz : sec->ceilingz;
|
||||
int i = (!(wal->cstat & CSTAT_WALL_ALIGN_BOTTOM)) ? sector[nextsectnum].ceilingz : sec->ceilingz;
|
||||
|
||||
// over
|
||||
calc_ypanning(i, ryp0, ryp1, x0, x1, wal->ypan_, wal->yrepeat, wal->cstat& CSTAT_WALL_ALIGN_BOTTOM, tileSize(globalpicnum));
|
||||
calc_ypanning(i, ryp0, ryp1, x0, x1, wal->ypan_, wal->yrepeat, wal->cstat & CSTAT_WALL_ALIGN_BOTTOM, tileSize(globalpicnum));
|
||||
|
||||
if (wal->cstat& CSTAT_WALL_XFLIP) //xflip
|
||||
if (wal->cstat & CSTAT_WALL_XFLIP) //xflip
|
||||
{
|
||||
float const t = (float)(wal->xrepeat*8 + wal->xpan_*2);
|
||||
xtex.u = xtex.d*t - xtex.u;
|
||||
ytex.u = ytex.d*t - ytex.u;
|
||||
otex.u = otex.d*t - otex.u;
|
||||
}
|
||||
if (wal->cstat& CSTAT_WALL_YFLIP) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
if (wal->cstat & CSTAT_WALL_YFLIP) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
|
||||
pow2xsplit = 1;
|
||||
polymost_domost(x1,ocy1,x0,ocy0,cy1,ocy1,cy0,ocy0);
|
||||
if (wal->cstat& CSTAT_WALL_XFLIP) { xtex.u = ogux; ytex.u = oguy; otex.u = oguo; }
|
||||
if (wal->cstat & CSTAT_WALL_XFLIP) { xtex.u = ogux; ytex.u = oguy; otex.u = oguo; }
|
||||
}
|
||||
if (((ofy0 < fy0) || (ofy1 < fy1)) && (!((sec->floorstat§or[nextsectnum].floorstat) & CSTAT_SECTOR_SKY)))
|
||||
{
|
||||
uwallptr_t nwal;
|
||||
|
||||
if (!(wal->cstat& CSTAT_WALL_BOTTOM_SWAP)) nwal = wal;
|
||||
if (!(wal->cstat & CSTAT_WALL_BOTTOM_SWAP)) nwal = wal;
|
||||
else
|
||||
{
|
||||
nwal = (uwallptr_t)&wall[wal->nextwall];
|
||||
|
@ -1730,16 +1730,16 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
int i = (!(nwal->cstat&CSTAT_WALL_ALIGN_BOTTOM)) ? sector[nextsectnum].floorz : sec->ceilingz;
|
||||
|
||||
// under
|
||||
calc_ypanning(i, ryp0, ryp1, x0, x1, nwal->ypan_, wal->yrepeat, !(nwal->cstat& CSTAT_WALL_ALIGN_BOTTOM), tileSize(globalpicnum));
|
||||
calc_ypanning(i, ryp0, ryp1, x0, x1, nwal->ypan_, wal->yrepeat, !(nwal->cstat & CSTAT_WALL_ALIGN_BOTTOM), tileSize(globalpicnum));
|
||||
|
||||
if (wal->cstat& CSTAT_WALL_XFLIP) //xflip
|
||||
if (wal->cstat & CSTAT_WALL_XFLIP) //xflip
|
||||
{
|
||||
float const t = (float)(wal->xrepeat*8 + nwal->xpan_*2);
|
||||
xtex.u = xtex.d*t - xtex.u;
|
||||
ytex.u = ytex.d*t - ytex.u;
|
||||
otex.u = otex.d*t - otex.u;
|
||||
}
|
||||
if (nwal->cstat& CSTAT_WALL_YFLIP) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
if (nwal->cstat & CSTAT_WALL_YFLIP) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
|
||||
pow2xsplit = 1;
|
||||
polymost_domost(x0,ofy0,x1,ofy1,ofy0,fy0,ofy1,fy1);
|
||||
|
@ -1747,11 +1747,11 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
}
|
||||
}
|
||||
|
||||
if ((nextsectnum < 0) || (wal->cstat& CSTAT_WALL_1WAY)) //White/1-way wall
|
||||
if ((nextsectnum < 0) || (wal->cstat & CSTAT_WALL_1WAY)) //White/1-way wall
|
||||
{
|
||||
do
|
||||
{
|
||||
const int maskingOneWay = (nextsectnum >= 0 && (wal->cstat& CSTAT_WALL_1WAY));
|
||||
const int maskingOneWay = (nextsectnum >= 0 && (wal->cstat & CSTAT_WALL_1WAY));
|
||||
|
||||
if (maskingOneWay)
|
||||
{
|
||||
|
@ -1777,14 +1777,14 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
// white / 1-way
|
||||
calc_ypanning(i, ryp0, ryp1, x0, x1, wal->ypan_, wal->yrepeat, nwcs4 && !maskingOneWay, tileSize(globalpicnum));
|
||||
|
||||
if (wal->cstat& CSTAT_WALL_XFLIP) //xflip
|
||||
if (wal->cstat & CSTAT_WALL_XFLIP) //xflip
|
||||
{
|
||||
float const t = (float) (wal->xrepeat*8 + wal->xpan_*2);
|
||||
xtex.u = xtex.d*t - xtex.u;
|
||||
ytex.u = ytex.d*t - ytex.u;
|
||||
otex.u = otex.d*t - otex.u;
|
||||
}
|
||||
if (wal->cstat& CSTAT_WALL_YFLIP) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
if (wal->cstat & CSTAT_WALL_YFLIP) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
|
||||
pow2xsplit = 1;
|
||||
|
||||
|
@ -1882,7 +1882,7 @@ void polymost_scansector(int32_t sectnum)
|
|||
|
||||
vec2_t const s = { spr->x-globalposx, spr->y-globalposy };
|
||||
|
||||
if ((spr->cstat&48) ||
|
||||
if ((spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) ||
|
||||
(hw_models && tile2model[spr->picnum].modelid>=0) ||
|
||||
((s.x * gcosang) + (s.y * gsinang) > 0))
|
||||
{
|
||||
|
@ -1918,7 +1918,7 @@ void polymost_scansector(int32_t sectnum)
|
|||
|
||||
int const nextsectnum = wal->nextsector; //Scan close sectors
|
||||
|
||||
if (nextsectnum >= 0 && !(wal->cstat& CSTAT_WALL_1WAY) && sectorbordercnt < (int)countof(sectorborder))
|
||||
if (nextsectnum >= 0 && !(wal->cstat & CSTAT_WALL_1WAY) && sectorbordercnt < (int)countof(sectorborder))
|
||||
if (gotsector[nextsectnum] == 0)
|
||||
{
|
||||
double const d = fp1.X* fp2.Y - fp2.X * fp1.Y;
|
||||
|
@ -2378,14 +2378,14 @@ static void polymost_drawmaskwallinternal(int32_t wallIndex)
|
|||
calc_ypanning((!(wal->cstat & CSTAT_WALL_ALIGN_BOTTOM)) ? max(nsec->ceilingz, sec->ceilingz) : min(nsec->floorz, sec->floorz), ryp0, ryp1,
|
||||
x0, x1, wal->ypan_, wal->yrepeat, 0, tileSize(globalpicnum));
|
||||
|
||||
if (wal->cstat& CSTAT_WALL_XFLIP) //xflip
|
||||
if (wal->cstat & CSTAT_WALL_XFLIP) //xflip
|
||||
{
|
||||
float const t = (float)(wal->xrepeat*8 + wal->xpan_*2);
|
||||
xtex.u = xtex.d*t - xtex.u;
|
||||
ytex.u = ytex.d*t - ytex.u;
|
||||
otex.u = otex.d*t - otex.u;
|
||||
}
|
||||
if (wal->cstat& CSTAT_WALL_YFLIP) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
if (wal->cstat & CSTAT_WALL_YFLIP) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
|
||||
int method = DAMETH_MASK | DAMETH_WALL;
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ bool calcChaseCamPos(int* px, int* py, int* pz, spritetype* pspr, sectortype** p
|
|||
{
|
||||
HitInfoBase hitinfo;
|
||||
binangle daang;
|
||||
short bakcstat;
|
||||
int newdist;
|
||||
|
||||
if (!*psect) return false;
|
||||
|
@ -46,8 +45,8 @@ bool calcChaseCamPos(int* px, int* py, int* pz, spritetype* pspr, sectortype** p
|
|||
int ny = gi->chaseCamY(ang);
|
||||
int nz = gi->chaseCamZ(horiz);
|
||||
|
||||
bakcstat = pspr->cstat;
|
||||
pspr->cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
auto bakcstat = pspr->cstat;
|
||||
pspr->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
updatesectorz(*px, *py, *pz, psect);
|
||||
hitscan({ *px, *py, *pz }, *psect, { nx, ny, nz }, hitinfo, CLIPMASK1);
|
||||
pspr->cstat = bakcstat;
|
||||
|
|
|
@ -297,14 +297,14 @@ void HWDrawInfo::DispatchSprites()
|
|||
}
|
||||
if (r_voxels)
|
||||
{
|
||||
if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT) != CSTAT_SPRITE_ALIGNMENT_SLAB && tiletovox[tilenum] >= 0 && voxmodels[tiletovox[tilenum]])
|
||||
if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB && tiletovox[tilenum] >= 0 && voxmodels[tiletovox[tilenum]])
|
||||
{
|
||||
HWSprite hwsprite;
|
||||
int num = tiletovox[tilenum];
|
||||
if (hwsprite.ProcessVoxel(this, voxmodels[num], tspr, tspr->sector(), voxrotate[num]))
|
||||
continue;
|
||||
}
|
||||
else if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT) == CSTAT_SPRITE_ALIGNMENT_SLAB && tspr->picnum < MAXVOXELS && voxmodels[tilenum])
|
||||
else if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_SLAB && tspr->picnum < MAXVOXELS && voxmodels[tilenum])
|
||||
{
|
||||
HWSprite hwsprite;
|
||||
int num = tilenum;
|
||||
|
@ -325,7 +325,7 @@ void HWDrawInfo::DispatchSprites()
|
|||
tspr->pos.y -= bsin(tspr->ang, -13);
|
||||
}
|
||||
|
||||
switch (tspr->cstat & CSTAT_SPRITE_ALIGNMENT)
|
||||
switch (tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
{
|
||||
case CSTAT_SPRITE_ALIGNMENT_FACING:
|
||||
{
|
||||
|
|
|
@ -467,7 +467,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s
|
|||
}
|
||||
|
||||
|
||||
if (!vox || (spr->cstat & CSTAT_SPRITE_ALIGNMENT) == CSTAT_SPRITE_ALIGNMENT_FLOOR) return false;
|
||||
if (!vox || (spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR) return false;
|
||||
|
||||
SetSpriteTranslucency(spr, alpha, RenderStyle);
|
||||
|
||||
|
@ -477,7 +477,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s
|
|||
|
||||
float basescale = voxel->bscale / 64.f;
|
||||
float sprxscale = (float)spr->xrepeat * (256.f / 320.f) * basescale;
|
||||
if ((spr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT) == CSTAT_SPRITE_ALIGNMENT_WALL)
|
||||
if ((spr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_WALL)
|
||||
{
|
||||
sprxscale *= 1.25f;
|
||||
translatevec.Y -= spr->xoffset * bcosf(sprext->angoff, -20);
|
||||
|
@ -505,7 +505,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s
|
|||
translatevec.Z *= sprzscale;
|
||||
|
||||
float zpos = (float)(spr->z + sprext->position_offset.z);
|
||||
float zscale = ((spr->cstat & CSTAT_SPRITE_YFLIP) && (spr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT) != 0) ? -4.f : 4.f;
|
||||
float zscale = ((spr->cstat & CSTAT_SPRITE_YFLIP) && (spr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 0) ? -4.f : 4.f;
|
||||
zpos -= (spr->yoffset * spr->yrepeat) * zscale * voxel->bscale;
|
||||
|
||||
x = (spr->x + sprext->position_offset.x) * (1 / 16.f);
|
||||
|
@ -515,7 +515,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s
|
|||
float zoff = voxel->siz.z * .5f;
|
||||
if (!(spr->cstat & CSTAT_SPRITE_YCENTER))
|
||||
zoff += voxel->piv.Z;
|
||||
else if ((spr->cstat & CSTAT_SPRITE_ALIGNMENT) != CSTAT_SPRITE_ALIGNMENT_SLAB)
|
||||
else if ((spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB)
|
||||
{
|
||||
zoff += voxel->piv.Z;
|
||||
zoff -= voxel->siz.z * .5f;
|
||||
|
|
|
@ -807,7 +807,7 @@ void aiActivateDude(DBloodActor* actor)
|
|||
case kDudeSpiderRed:
|
||||
case kDudeSpiderBlack:
|
||||
pSprite->flags |= 2;
|
||||
pSprite->cstat &= ~8;
|
||||
pSprite->cstat &= ~CSTAT_SPRITE_YFLIP;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
aiNewState(actor, &spidSearch);
|
||||
else
|
||||
|
@ -821,7 +821,7 @@ void aiActivateDude(DBloodActor* actor)
|
|||
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
|
||||
pDudeExtraE->active = 1;
|
||||
pSprite->flags |= 2;
|
||||
pSprite->cstat &= ~8;
|
||||
pSprite->cstat &= ~CSTAT_SPRITE_YFLIP;
|
||||
if (actor->GetTarget() == nullptr)
|
||||
aiNewState(actor, &spidSearch);
|
||||
else
|
||||
|
|
|
@ -6288,7 +6288,7 @@ void useUniMissileGen(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
if (pXSource->data1 < kMissileBase || pXSource->data1 >= kMissileMax)
|
||||
return;
|
||||
|
||||
if (pSprite->cstat & 32)
|
||||
if (pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)
|
||||
{
|
||||
if (pSprite->cstat & CSTAT_SPRITE_YFLIP) dz = 0x4000;
|
||||
else dz = -0x4000;
|
||||
|
|
|
@ -786,7 +786,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a
|
|||
double y = ydim / 2. + y1 / double(1 << 12);
|
||||
// This very likely needs fixing later
|
||||
DrawTexture(twod, tileGetTexture(nTile, true), xx, yy, DTA_ClipLeft, windowxy1.x, DTA_ClipTop, windowxy1.y, DTA_ScaleX, z/1536., DTA_ScaleY, z/1536., DTA_CenterOffset, true,
|
||||
DTA_ClipRight, windowxy2.x + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & 2 ? 0.5 : 1.), TAG_DONE);
|
||||
DTA_ClipRight, windowxy2.x + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1521,8 +1521,8 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
|
|||
if (s->picnum == stripeball)
|
||||
{
|
||||
s->cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
s->cstat |= 4 & s->xvel;
|
||||
s->cstat |= 8 & s->xvel;
|
||||
s->cstat |= CSTAT_SPRITE_XFLIP & s->xvel;
|
||||
s->cstat |= CSTAT_SPRITE_YFLIP & s->xvel;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -869,7 +869,7 @@ void movefallers_d(void)
|
|||
if (a2->s->hitag == s->hitag)
|
||||
{
|
||||
a2->temp_data[0] = 1;
|
||||
a2->s->cstat &= (65535 - 64);
|
||||
a2->s->cstat &= ~CSTAT_SPRITE_ONE_SIDE;
|
||||
if (a2->s->picnum == CEILINGSTEAM || a2->s->picnum == STEAM)
|
||||
a2->s->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
|
@ -1297,7 +1297,7 @@ CLEAR_THE_BOLT:
|
|||
int l = global_random & 7;
|
||||
s->xrepeat = l + 8;
|
||||
|
||||
if (l & 1) s->cstat ^= 2;
|
||||
if (l & 1) s->cstat ^= CSTAT_SPRITE_TRANSLUCENT;
|
||||
|
||||
if (s->picnum == (BOLT1+1) && (krand()&7) == 0 && sectp->floorpicnum == HURTRAIL)
|
||||
S_PlayActorSound(SHORT_CIRCUIT,actor);
|
||||
|
@ -2455,7 +2455,7 @@ static void greenslime(DDukeActor *actor)
|
|||
{
|
||||
makeitfall(actor);
|
||||
|
||||
s->cstat &= 65535 - 8;
|
||||
s->cstat &= ~CSTAT_SPRITE_YFLIP;
|
||||
s->picnum = GREENSLIME + 4;
|
||||
|
||||
if (s->xrepeat > 32) s->xrepeat -= krand() & 7;
|
||||
|
@ -2536,7 +2536,7 @@ static void greenslime(DDukeActor *actor)
|
|||
if (t[0] == 2)
|
||||
{
|
||||
s->zvel = 0;
|
||||
s->cstat &= (65535 - 8);
|
||||
s->cstat &= ~CSTAT_SPRITE_YFLIP;
|
||||
|
||||
if ((sectp->ceilingstat & CSTAT_SECTOR_SKY) || (actor->ceilingz + 6144) < s->z)
|
||||
{
|
||||
|
@ -2826,7 +2826,7 @@ static void heavyhbomb(DDukeActor *actor)
|
|||
|
||||
if (s->xvel < 0)
|
||||
s->xvel = 0;
|
||||
if (s->xvel & 8) s->cstat ^= 4;
|
||||
if (s->xvel & 8) s->cstat ^= CSTAT_SPRITE_XFLIP;
|
||||
}
|
||||
|
||||
if (coll.type== kHitWall)
|
||||
|
@ -2982,7 +2982,7 @@ void moveactors_d(void)
|
|||
if (t[0] > 60)
|
||||
{
|
||||
t[0] = 0;
|
||||
s->cstat = 128 + 257 + 16;
|
||||
s->cstat = CSTAT_SPRITE_YCENTER + 257 + 16;
|
||||
s->extra = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -805,7 +805,7 @@ void movefallers_r(void)
|
|||
if (ac2->s->hitag == s->hitag)
|
||||
{
|
||||
ac2->temp_data[0] = 1;
|
||||
ac2->s->cstat &= (65535 - 64);
|
||||
ac2->s->cstat &= ~CSTAT_SPRITE_ONE_SIDE;
|
||||
if (ac2->s->picnum == CEILINGSTEAM || ac2->s->picnum == STEAM)
|
||||
ac2->s->cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
|
@ -951,7 +951,7 @@ CLEAR_THE_BOLT:
|
|||
int l = global_random & 7;
|
||||
s->xrepeat = l + 8;
|
||||
|
||||
if (l & 1) s->cstat ^= 2;
|
||||
if (l & 1) s->cstat ^= CSTAT_SPRITE_TRANSLUCENT;
|
||||
|
||||
if (s->picnum == (BOLT1 + 1) && (krand() & 1) && sectp->floorpicnum == HURTRAIL)
|
||||
S_PlayActorSound(SHORT_CIRCUIT, actor);
|
||||
|
@ -1260,7 +1260,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos)
|
|||
{
|
||||
j->s->xrepeat = 8;
|
||||
j->s->yrepeat = 8;
|
||||
j->s->cstat = 16;
|
||||
j->s->cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
j->s->ang = (j->s->ang + 512) & 2047;
|
||||
j->s->clipdist = MulScale(s->xrepeat, tileWidth(s->picnum), 7);
|
||||
}
|
||||
|
@ -2614,7 +2614,7 @@ static void heavyhbomb(DDukeActor *actor)
|
|||
|
||||
if (s->xvel < 0)
|
||||
s->xvel = 0;
|
||||
if (s->xvel & 8) s->cstat ^= 4;
|
||||
if (s->xvel & 8) s->cstat ^= CSTAT_SPRITE_XFLIP;
|
||||
}
|
||||
|
||||
if (coll.type == kHitWall)
|
||||
|
|
|
@ -903,7 +903,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
|
|||
S_PlayActorSound(LASERTRIP_ONWALL, bomb);
|
||||
bomb->s->xvel = -20;
|
||||
ssp(bomb, CLIPMASK0);
|
||||
bomb->s->cstat = 16;
|
||||
bomb->s->cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
auto delta = hit.hitWall->delta();
|
||||
bomb->temp_data[5] = bomb->s->ang = getangle(-delta.x, -delta.y) - 512;
|
||||
|
||||
|
|
|
@ -394,7 +394,7 @@ void cacheit_r(void)
|
|||
DukeSectIterator it(§);
|
||||
while (auto j = it.Next())
|
||||
{
|
||||
if(j->s->xrepeat != 0 && j->s->yrepeat != 0 && (j->s->cstat&32768) == 0)
|
||||
if(j->s->xrepeat != 0 && j->s->yrepeat != 0 && (j->s->cstat & CSTAT_SPRITE_INVISIBLE) == 0)
|
||||
cachespritenum(j->s);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1136,7 +1136,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
|
||||
case FANSPRITE:
|
||||
s->picnum = FANSPRITEBROKE;
|
||||
s->cstat &= (65535 - 257);
|
||||
s->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
if (s->sector()->floorpicnum == FANSHADOW)
|
||||
s->sector()->floorpicnum = FANSHADOWBROKE;
|
||||
|
||||
|
@ -1244,7 +1244,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
break;
|
||||
|
||||
case BROKEHYDROPLANT:
|
||||
if (s->cstat & 1)
|
||||
if (s->cstat & CSTAT_SPRITE_BLOCK)
|
||||
{
|
||||
S_PlayActorSound(GLASS_BREAKING, targ);
|
||||
s->z += 16 << 8;
|
||||
|
@ -1277,24 +1277,24 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
|
||||
case GRATE1:
|
||||
s->picnum = BGRATE1;
|
||||
s->cstat &= (65535 - 256 - 1);
|
||||
s->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
case CIRCLEPANNEL:
|
||||
s->picnum = CIRCLEPANNELBROKE;
|
||||
s->cstat &= (65535 - 256 - 1);
|
||||
s->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case PANNEL1:
|
||||
case PANNEL2:
|
||||
s->picnum = BPANNEL1;
|
||||
s->cstat &= (65535 - 256 - 1);
|
||||
s->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case PANNEL3:
|
||||
s->picnum = BPANNEL3;
|
||||
s->cstat &= (65535 - 256 - 1);
|
||||
s->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
case PIPE1:
|
||||
|
@ -1421,7 +1421,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
|
||||
if (s->picnum != TANK && !bossguy(targ) && s->picnum != RECON && s->picnum != ROTATEGUN)
|
||||
{
|
||||
if ((s->cstat & 48) == 0)
|
||||
if ((s->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0)
|
||||
s->ang = (pspr->ang + 1024) & 2047;
|
||||
s->xvel = -(pspr->extra << 2);
|
||||
auto sp = s->sector();
|
||||
|
|
|
@ -2187,7 +2187,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
|
||||
case FANSPRITE:
|
||||
s->picnum = FANSPRITEBROKE;
|
||||
s->cstat &= (65535 - 257);
|
||||
s->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
||||
for (j = 0; j < 16; j++) RANDOMSCRAP(targ);
|
||||
|
||||
|
@ -2304,13 +2304,13 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
|
||||
case GRATE1:
|
||||
s->picnum = BGRATE1;
|
||||
s->cstat &= (65535 - 256 - 1);
|
||||
s->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
case CIRCLEPANNEL:
|
||||
s->picnum = CIRCLEPANNELBROKE;
|
||||
s->cstat &= (65535 - 256 - 1);
|
||||
s->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
S_PlayActorSound(VENT_BUST, targ);
|
||||
break;
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ bool initspriteforspawn(DDukeActor* act, const std::initializer_list<int> &exclu
|
|||
|
||||
int s = sp->picnum;
|
||||
|
||||
if (sp->cstat & 1) sp->cstat |= 256;
|
||||
if (sp->cstat & CSTAT_SPRITE_BLOCK) sp->cstat |= 256;
|
||||
|
||||
if (gs.actorinfo[s].scriptaddress)
|
||||
{
|
||||
|
@ -330,7 +330,7 @@ void spawntransporter(DDukeActor *actj, DDukeActor* acti, bool beam)
|
|||
}
|
||||
|
||||
sp->shade = -127;
|
||||
sp->cstat = 128 | 2;
|
||||
sp->cstat = CSTAT_SPRITE_YCENTER | 2;
|
||||
sp->ang = spj->ang;
|
||||
|
||||
sp->xvel = 128;
|
||||
|
|
|
@ -240,9 +240,9 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
sp->xrepeat = 32;
|
||||
|
||||
if (gs.lasermode == 1)
|
||||
sp->cstat = 16 + 2;
|
||||
sp->cstat = CSTAT_SPRITE_ALIGNMENT_WALL + 2;
|
||||
else if (gs.lasermode == 0 || gs.lasermode == 2)
|
||||
sp->cstat = 16;
|
||||
sp->cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
else
|
||||
{
|
||||
sp->xrepeat = 0;
|
||||
|
@ -555,7 +555,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
break;
|
||||
case BULLETHOLE:
|
||||
sp->xrepeat = sp->yrepeat = 3;
|
||||
sp->cstat = 16 + (krand() & 12);
|
||||
sp->cstat = CSTAT_SPRITE_ALIGNMENT_WALL + (krand() & 12);
|
||||
insertspriteq(act);
|
||||
[[fallthrough]];
|
||||
case MONEY:
|
||||
|
@ -615,7 +615,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
{
|
||||
sp->ang = spj->ang;
|
||||
sp->shade = -64;
|
||||
sp->cstat = 128 | (krand() & 4);
|
||||
sp->cstat = CSTAT_SPRITE_YCENTER | (krand() & 4);
|
||||
}
|
||||
|
||||
if (sp->picnum == EXPLOSION2 || sp->picnum == EXPLOSION2BOT)
|
||||
|
@ -1114,7 +1114,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
if (spj)
|
||||
{
|
||||
sp->ang = spj->ang;
|
||||
sp->cstat = 16 + 128 + 2;
|
||||
sp->cstat = CSTAT_SPRITE_ALIGNMENT_WALL + 128 + 2;
|
||||
sp->xrepeat = sp->yrepeat = 1;
|
||||
sp->xvel = -8;
|
||||
ssp(act, CLIPMASK0);
|
||||
|
@ -1157,7 +1157,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
}
|
||||
else
|
||||
{
|
||||
sp->cstat |= (sp->cstat & 48) ? 1 : 17;
|
||||
sp->cstat |= (sp->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) ? 1 : 17;
|
||||
sp->extra = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -577,7 +577,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
break;
|
||||
case BULLETHOLE:
|
||||
sp->xrepeat = sp->yrepeat = 3;
|
||||
sp->cstat = 16 + (krand() & 12);
|
||||
sp->cstat = CSTAT_SPRITE_ALIGNMENT_WALL + (krand() & 12);
|
||||
insertspriteq(act);
|
||||
[[fallthrough]];
|
||||
case MONEY:
|
||||
|
@ -622,7 +622,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
{
|
||||
sp->ang = spj->ang;
|
||||
sp->shade = -64;
|
||||
sp->cstat = 128 | (krand() & 4);
|
||||
sp->cstat = CSTAT_SPRITE_YCENTER | (krand() & 4);
|
||||
}
|
||||
|
||||
if (sp->picnum == EXPLOSION2)
|
||||
|
@ -1361,7 +1361,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
if (spj)
|
||||
{
|
||||
sp->ang = spj->ang;
|
||||
sp->cstat = 16 + 128 + 2;
|
||||
sp->cstat = CSTAT_SPRITE_ALIGNMENT_WALL + 128 + 2;
|
||||
sp->xrepeat = sp->yrepeat = 1;
|
||||
sp->xvel = -8;
|
||||
ssp(act, CLIPMASK0);
|
||||
|
|
|
@ -101,7 +101,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a
|
|||
double y = ydim / 2. + y1 / double(1 << 12);
|
||||
// This very likely needs fixing later
|
||||
DrawTexture(twod, tileGetTexture(nTile /*+ ((PlayClock >> 4) & 3)*/, true), xx, yy, DTA_ClipLeft, windowxy1.x, DTA_ClipTop, windowxy1.y, DTA_ScaleX, z / 1536., DTA_ScaleY, z / 1536., DTA_CenterOffset, true,
|
||||
DTA_ClipRight, windowxy2.x + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & 2 ? 0.5 : 1.), TAG_DONE);
|
||||
DTA_ClipRight, windowxy2.x + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -644,7 +644,7 @@ void PlayFX2(int nSound, DExhumedActor* pActor, int sectf, EChanFlags chanflags,
|
|||
}
|
||||
|
||||
// Nuke: added nSprite >= 0 check
|
||||
if (pActor != PlayerList[nLocalPlayer].Actor() && pActor != nullptr && (pActor->s().cstat&257))
|
||||
if (pActor != PlayerList[nLocalPlayer].Actor() && pActor != nullptr && (pActor->s().cstat & CSTAT_SPRITE_BLOCK_ALL))
|
||||
nCreepyTimer = kCreepyCount;
|
||||
}
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ void AISpider::Tick(RunListEvent* ev)
|
|||
|
||||
if (pSector->ceilingstat & CSTAT_SECTOR_SKY)
|
||||
{
|
||||
sp->cstat ^= 8;
|
||||
sp->cstat ^= CSTAT_SPRITE_YFLIP;
|
||||
sp->zvel = 1;
|
||||
|
||||
spp->nAction = 3;
|
||||
|
@ -214,7 +214,7 @@ void AISpider::Tick(RunListEvent* ev)
|
|||
{
|
||||
if (sp->cstat & CSTAT_SPRITE_YFLIP)
|
||||
{
|
||||
sp->cstat ^= 8;
|
||||
sp->cstat ^= CSTAT_SPRITE_YFLIP;
|
||||
sp->zvel = 1;
|
||||
sp->z = pSector->ceilingz + GetActorHeight(spp);
|
||||
}
|
||||
|
|
|
@ -1718,7 +1718,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
|
|||
spry = spr->interpolatedy(smoothratio);
|
||||
}
|
||||
|
||||
switch (spr->cstat & 48)
|
||||
switch (spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK)
|
||||
{
|
||||
case 0: // Regular sprite
|
||||
if (Player[p].Actor() == actor)
|
||||
|
@ -1750,7 +1750,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int
|
|||
{
|
||||
DrawTexture(twod, tileGetTexture(1196 + pspr_ndx[myconnectindex], true), xx, yy, DTA_ScaleX, sc, DTA_ScaleY, sc, DTA_Rotate, daang * -BAngToDegree,
|
||||
DTA_CenterOffsetRel, 2, DTA_TranslationIndex, TRANSLATION(Translation_Remap, spr->pal), DTA_Color, shadeToLight(spr->shade),
|
||||
DTA_Alpha, (spr->cstat & 2) ? 0.33 : 1., TAG_DONE);
|
||||
DTA_Alpha, (spr->cstat & CSTAT_SPRITE_TRANSLUCENT) ? 0.33 : 1., TAG_DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1635,7 +1635,7 @@ void SpriteSetup(void)
|
|||
}
|
||||
|
||||
// CSTAT_SPIN is insupported - get rid of it
|
||||
if (TEST(sp->cstat, CSTAT_SPRITE_ALIGNMENT) == CSTAT_SPRITE_ALIGNMENT_SLAB)
|
||||
if (TEST(sp->cstat, CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_SLAB)
|
||||
RESET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_SLAB);
|
||||
|
||||
// if BLOCK is set set BLOCK_HITSCAN
|
||||
|
@ -4481,7 +4481,7 @@ void getzrangepoint(int x, int y, int z, sectortype* sect,
|
|||
daz = spr->z;
|
||||
|
||||
// Only check if sprite's 2-sided or your on the 1-sided side
|
||||
if (((cstat & 64) != 0) && ((z > daz) == ((cstat & CSTAT_SPRITE_YFLIP) == 0)))
|
||||
if (((cstat & CSTAT_SPRITE_ONE_SIDE) != 0) && ((z > daz) == ((cstat & CSTAT_SPRITE_YFLIP) == 0)))
|
||||
continue;
|
||||
|
||||
// Calculate and store centering offset information into xoff&yoff
|
||||
|
|
Loading…
Reference in a new issue