diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index b5690bb81..d3fdefb22 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -533,7 +533,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, else { clipmove_tweak_pos(pos, diff.X, diff.Y, p1.X, p1.Y, p2.X, p2.Y, &v.X, &v.Y); - clipyou = cliptestsector(dasect, wal->nextsector, flordist, ceildist, v, pos->z); + clipyou = cliptestsector(dasect, wal->nextsector, flordist, ceildist, v, pos->Z); } // We're not interested in any sector reached by portal traversal that we're "inside" of. @@ -609,7 +609,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, { int32_t height, daz = spr->z+spriteheightofsptr(spr, &height, 1); - if (pos->z > daz-height-flordist && pos->z < daz+ceildist) + if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist) { int32_t bsz = (spr->clipdist << 2)+walldist; if (diff.X < 0) bsz = -bsz; @@ -625,7 +625,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, { int32_t height, daz = spr->z+spriteheightofsptr(spr, &height, 1); - if (pos->z > daz-height-flordist && pos->z < daz+ceildist) + if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist) { vec2_t p2; @@ -671,10 +671,10 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, sz = spr->z; } - if (pos->z > sz - flordist && pos->z < sz + ceildist) + if (pos->Z > sz - flordist && pos->Z < sz + ceildist) { if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0) - if ((pos->z > sz) == ((cstat & CSTAT_SPRITE_YFLIP)==0)) + if ((pos->Z > sz) == ((cstat & CSTAT_SPRITE_YFLIP)==0)) continue; rxi[0] = p1.X; @@ -731,7 +731,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, int32_t const rspanx = span.X * repeat.X; int32_t const rspany = span.Y * repeat.Y; int32_t const ratio = ksqrt(heinum * heinum + 4096 * 4096); - int32_t zz[3] = { pos->z, pos->z + flordist, pos->z - ceildist }; + int32_t zz[3] = { pos->Z, pos->Z + flordist, pos->Z - ceildist }; for (int k = 0; k < 3; k++) { int32_t jj = DivScale(spr->z - zz[k], heinum, 18); @@ -868,9 +868,9 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, if (inside(pos->X, pos->Y, sect) == 1) { if (enginecompatibility_mode != ENGINECOMPATIBILITY_19950829 && (sect->ceilingstat & CSTAT_SECTOR_SLOPE)) - tempint2 = getceilzofslopeptr(sect, pos->X, pos->Y) - pos->z; + tempint2 = getceilzofslopeptr(sect, pos->X, pos->Y) - pos->Z; else - tempint2 = sect->ceilingz - pos->z; + tempint2 = sect->ceilingz - pos->Z; if (tempint2 > 0) { @@ -883,9 +883,9 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, else { if (enginecompatibility_mode != ENGINECOMPATIBILITY_19950829 && (sect->ceilingstat & CSTAT_SECTOR_SLOPE)) - tempint2 = pos->z - getflorzofslopeptr(sect, pos->X, pos->Y); + tempint2 = pos->Z - getflorzofslopeptr(sect, pos->X, pos->Y); else - tempint2 = pos->z - sect->floorz; + tempint2 = pos->Z - sect->floorz; if (tempint2 <= 0) { @@ -985,7 +985,7 @@ int pushmove_(vec3_t *const vect, int *const sectnum, closest = { dax, day }; } - j = cliptestsector(clipsectorlist[clipsectcnt], wal->nextsector, flordist, ceildist, closest, vect->z); + j = cliptestsector(clipsectorlist[clipsectcnt], wal->nextsector, flordist, ceildist, closest, vect->Z); } if (j != 0) @@ -1085,8 +1085,8 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas if (wal.cstat & EWallFlags::FromInt(dawalclipmask)) continue; // XXX? - if (((nextsect->ceilingstat & CSTAT_SECTOR_SKY) == 0) && (pos.z <= nextsect->ceilingz+(3<<8))) continue; - if (((nextsect->floorstat & CSTAT_SECTOR_SKY) == 0) && (pos.z >= nextsect->floorz-(3<<8))) continue; + if (((nextsect->ceilingstat & CSTAT_SECTOR_SKY) == 0) && (pos.Z <= nextsect->ceilingz+(3<<8))) continue; + if (((nextsect->floorstat & CSTAT_SECTOR_SKY) == 0) && (pos.Z >= nextsect->floorz-(3<<8))) continue; int nextsectno = ::sectnum(nextsect); if (!clipsectormap[nextsectno]) @@ -1178,7 +1178,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas if ((cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR) daz = spr->z; else daz = spriteGetZOfSlope(spr, pos.X, pos.Y); - if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0 && (pos.z > daz) == ((cstat & CSTAT_SPRITE_YFLIP)==0)) + if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0 && (pos.Z > daz) == ((cstat & CSTAT_SPRITE_YFLIP)==0)) continue; vec2_t v2, v3, v4; @@ -1198,13 +1198,13 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas if (clipyou != 0) { - if ((pos.z > daz) && (daz > *ceilz)) + if ((pos.Z > daz) && (daz > *ceilz)) { *ceilz = daz; ceilhit.setSprite(actor); } - if ((pos.z < daz2) && (daz2 < *florz)) + if ((pos.Z < daz2) && (daz2 < *florz)) { *florz = daz2; florhit.setSprite(actor); @@ -1232,11 +1232,11 @@ int32_t try_facespr_intersect(uspriteptr_t const spr, vec3_t const in, if (!bot) return 0; - vec3_t newpos = { 0, 0, in.z + Scale(vz, topt, bot) }; + vec3_t newpos = { 0, 0, in.Z + Scale(vz, topt, bot) }; int32_t siz; - int32_t const z1 = sprpos.z + spriteheightofsptr(spr, &siz, 1); + int32_t const z1 = sprpos.Z + spriteheightofsptr(spr, &siz, 1); - if (newpos.z < z1 - siz || newpos.z > z1) + if (newpos.Z < z1 - siz || newpos.Z > z1) return 0; int32_t const topu = vx * (sprpos.Y - in.Y) - vy * (sprpos.X - in.X); @@ -1264,7 +1264,7 @@ static inline void hit_set(HitInfoBase *hit, sectortype* sect, walltype* wal, DC hit->hitActor = actor; hit->hitpos.X = x; hit->hitpos.Y = y; - hit->hitpos.z = z; + hit->hitpos.Z = z; } static int32_t hitscan_hitsectcf=-1; @@ -1291,19 +1291,19 @@ static int32_t hitscan_trysector(const vec3_t *sv, sectortype* sec, HitInfoBase j = (vz<<8)-DMulScale(dax,vy,-day,vx, 15); if (j != 0) { - i = ((z - sv->z)<<8)+DMulScale(dax,sv->Y-wal->y,-day,sv->X-wal->x, 15); + i = ((z - sv->Z)<<8)+DMulScale(dax,sv->Y-wal->y,-day,sv->X-wal->x, 15); if (((i^j) >= 0) && ((abs(i)>>1) < abs(j))) { i = DivScale(i,j, 30); x1 = sv->X + MulScale(vx,i, 30); y1 = sv->Y + MulScale(vy,i, 30); - z1 = sv->z + MulScale(vz,i, 30); + z1 = sv->Z + MulScale(vz,i, 30); } } } - else if ((how*vz > 0) && (how*sv->z <= how*z)) + else if ((how*vz > 0) && (how*sv->Z <= how*z)) { - z1 = z; i = z1-sv->z; + z1 = z; i = z1-sv->Z; if ((abs(i)>>1) < vz*how) { i = DivScale(i,vz, 30); @@ -1332,7 +1332,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, sectortype* sec, HitInfoBase int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& direction, HitInfoBase& hitinfo, unsigned cliptype) { auto const sv = &start; - int const vx = direction.X, vy = direction.Y, vz = direction.z; + int const vx = direction.X, vy = direction.Y, vz = direction.Z; int32_t x1, y1=0, z1=0, x2, y2, intx, inty, intz; int32_t i, k, daz; @@ -1370,7 +1370,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire 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; - if (rintersect(sv->X,sv->Y,sv->z, vx,vy,vz, x1,y1, x2,y2, &intx,&inty,&intz) == -1) continue; + if (rintersect(sv->X,sv->Y,sv->Z, vx,vy,vz, x1,y1, x2,y2, &intx,&inty,&intz) == -1) continue; if (abs(intx-sv->X)+abs(inty-sv->Y) >= abs((hitinfo.hitpos.X)-sv->X)+abs((hitinfo.hitpos.Y)-sv->Y)) continue; @@ -1440,7 +1440,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire 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; - ucoefup16 = rintersect(sv->X,sv->Y,sv->z,vx,vy,vz,x1,y1,x2,y2,&intx,&inty,&intz); + ucoefup16 = rintersect(sv->X,sv->Y,sv->Z,vx,vy,vz,x1,y1,x2,y2,&intx,&inty,&intz); if (ucoefup16 == -1) continue; if (abs(intx-sv->X)+abs(inty-sv->Y) > abs((hitinfo.hitpos.X)-sv->X)+abs((hitinfo.hitpos.Y)-sv->Y)) @@ -1476,14 +1476,14 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire int32_t x3, y3, x4, y4; intz = z1; - if (vz == 0 || ((intz-sv->z)^vz) < 0) continue; + if (vz == 0 || ((intz-sv->Z)^vz) < 0) continue; if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0) - if ((sv->z > intz) == ((cstat & CSTAT_SPRITE_YFLIP)==0)) continue; + 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); - inty = int(sv->Y + (int64_t(intz) - sv->z) * vy / vz); + intx = int(sv->X + (int64_t(intz) - sv->Z) * vx / vz); + inty = int(sv->Y + (int64_t(intz) - sv->Z) * vy / vz); if (abs(intx-sv->X)+abs(inty-sv->Y) > abs((hitinfo.hitpos.X)-sv->X)+abs((hitinfo.hitpos.Y)-sv->Y)) continue; @@ -1507,13 +1507,13 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire if (j == 0) continue; if ((cstat & 64) != 0) if ((j < 0) == ((cstat & 8) == 0)) continue; - int32_t i = ((spr->z - sv->z) << 8) + DMulScale(dax, sv->Y - spr->y, -day, sv->X - spr->x, 15); + int32_t i = ((spr->z - sv->Z) << 8) + DMulScale(dax, sv->Y - spr->y, -day, sv->X - spr->x, 15); if ((i ^ j) < 0 || (abs(i) >> 1) >= abs(j)) continue; i = DivScale(i, j, 30); intx = sv->X + MulScale(vx, i, 30); inty = sv->Y + MulScale(vy, i, 30); - intz = sv->z + MulScale(vz, i, 30); + intz = sv->Z + MulScale(vz, i, 30); if (abs(intx - sv->X) + abs(inty - sv->Y) > abs((hitinfo.hitpos.X) - sv->X) + abs((hitinfo.hitpos.Y) - sv->Y)) continue; diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index ff1a64a71..fe753b733 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -569,14 +569,14 @@ void neartag(const vec3_t& sv, sectortype* sect, int ange, HitInfoBase& result, if ((good == 0) && (!wal->twoSided())) continue; if ((coord_t)(x1 - sv.X) * (y2 - sv.Y) < (coord_t)(x2 - sv.X) * (y1 - sv.Y)) continue; - if (lintersect(sv.X, sv.Y, sv.z, hitv.X, hitv.Y, hitv.z, x1, y1, x2, y2, &intx, &inty, &intz) == 1) + if (lintersect(sv.X, sv.Y, sv.Z, hitv.X, hitv.Y, hitv.Z, x1, y1, x2, y2, &intx, &inty, &intz) == 1) { if (good != 0) { if (good & 1) result.hitSector = nextsect; if (good & 2) result.hitWall = wal; result.hitpos.X = DMulScale(intx - sv.X, bcos(ange), inty - sv.Y, bsin(ange), 14); - hitv.X = intx; hitv.Y = inty; hitv.z = intz; + hitv.X = intx; hitv.Y = inty; hitv.Z = intz; } if (wal->twoSided()) diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index cd30659cb..6910aa79f 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -1180,7 +1180,7 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr) a0.Z = m->zadd * m->scale; // Parkar: Moved up to be able to use k0 for the y-flipping code - k0 = (float)tspr->z+sext->position_offset.z; + k0 = (float)tspr->z+sext->position_offset.Z; f = ((globalorientation & 8) && (spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FACING) ? -4.f : 4.f; k0 -= (tspr->yoffset*tspr->yrepeat)*f; if ((globalorientation&128) && !((globalorientation & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR)) @@ -1286,8 +1286,8 @@ static int32_t polymost_md3draw(md3model_t *m, tspriteptr_t tspr) if (sext->pivot_offset.Y) // Compare with SCREEN_FACTORS above a0.Y = (float) sext->pivot_offset.Y * f; - if ((sext->pivot_offset.z) && !(tspr->clipdist & TSPR_FLAGS_MDHACK)) // Compare with SCREEN_FACTORS above - a0.Z = (float)sext->pivot_offset.z / (gxyaspect * fxdimen * (65536.f/128.f) * (m0.Z+m1.Z)); + if ((sext->pivot_offset.Z) && !(tspr->clipdist & TSPR_FLAGS_MDHACK)) // Compare with SCREEN_FACTORS above + a0.Z = (float)sext->pivot_offset.Z / (gxyaspect * fxdimen * (65536.f/128.f) * (m0.Z+m1.Z)); k0 = bcosf(sext->pitch, -14); k1 = bsinf(sext->pitch, -14); diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index f72bb9e67..0f4b8fd44 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -2779,7 +2779,7 @@ void polymost_drawsprite(int32_t snum) goto _drawsprite_return; float const ryp0 = 1.f / p0.Y; - s0 = { ghalfx * p0.X * ryp0 + ghalfx, ((float)(pos.z - globalposz)) * gyxscale * ryp0 + ghoriz }; + s0 = { ghalfx * p0.X * ryp0 + ghalfx, ((float)(pos.Z - globalposz)) * gyxscale * ryp0 + ghoriz }; float const f = ryp0 * fxdimen * (1.0f / 160.f); @@ -2940,14 +2940,14 @@ void polymost_drawsprite(int32_t snum) const float ryp1 = f * gyxscale; float sx1 = ghalfx * p1.X * f + ghalfx; - pos.z -= ((off.Y * tspr->yrepeat) << 2); + pos.Z -= ((off.Y * tspr->yrepeat) << 2); if (globalorientation & 128) { - pos.z += ((tsiz.Y * tspr->yrepeat) << 1); + pos.Z += ((tsiz.Y * tspr->yrepeat) << 1); if (tsiz.Y & 1) - pos.z += (tspr->yrepeat << 1); // Odd yspans + pos.Z += (tspr->yrepeat << 1); // Odd yspans } xtex.d = (ryp0 - ryp1) * gxyaspect / (sx0 - sx1); @@ -2966,10 +2966,10 @@ void polymost_drawsprite(int32_t snum) f = ((float) tspr->yrepeat) * ftsiz.Y * 4; - float sc0 = ((float) (pos.z - globalposz - f)) * ryp0 + ghoriz; - float sc1 = ((float) (pos.z - globalposz - f)) * ryp1 + ghoriz; - float sf0 = ((float) (pos.z - globalposz)) * ryp0 + ghoriz; - float sf1 = ((float) (pos.z - globalposz)) * ryp1 + ghoriz; + float sc0 = ((float) (pos.Z - globalposz - f)) * ryp0 + ghoriz; + float sc1 = ((float) (pos.Z - globalposz - f)) * ryp1 + ghoriz; + float sf0 = ((float) (pos.Z - globalposz)) * ryp0 + ghoriz; + float sf1 = ((float) (pos.Z - globalposz)) * ryp1 + ghoriz; // gvx*sx0 + gvy*sc0 + gvo = 0 // gvx*sx1 + gvy*sc1 + gvo = 0 @@ -2992,7 +2992,7 @@ void polymost_drawsprite(int32_t snum) // Clip sprites to ceilings/floors when no parallaxing if (!(tspr->sector()->ceilingstat & CSTAT_SECTOR_SKY)) { - if (tspr->sector()->ceilingz > pos.z - (float)((tspr->yrepeat * tsiz.Y) << 2)) + if (tspr->sector()->ceilingz > pos.Z - (float)((tspr->yrepeat * tsiz.Y) << 2)) { sc0 = (float)(tspr->sector()->ceilingz - globalposz) * ryp0 + ghoriz; sc1 = (float)(tspr->sector()->ceilingz - globalposz) * ryp1 + ghoriz; @@ -3000,7 +3000,7 @@ void polymost_drawsprite(int32_t snum) } if (!(tspr->sector()->floorstat & CSTAT_SECTOR_SKY)) { - if (tspr->sector()->floorz < pos.z) + if (tspr->sector()->floorz < pos.Z) { sf0 = (float)(tspr->sector()->floorz - globalposz) * ryp0 + ghoriz; sf1 = (float)(tspr->sector()->floorz - globalposz) * ryp1 + ghoriz; @@ -3120,11 +3120,11 @@ void polymost_drawsprite(int32_t snum) if (heinum == 0) { // unfortunately, offsetting by only 1 isn't enough on most Android devices - if (pos.z == sec->ceilingz || pos.z == sec->ceilingz + 1) - pos.z = sec->ceilingz + 2, fadjust = (tspr->ownerActor->GetIndex() & 31); + if (pos.Z == sec->ceilingz || pos.Z == sec->ceilingz + 1) + pos.Z = sec->ceilingz + 2, fadjust = (tspr->ownerActor->GetIndex() & 31); - if (pos.z == sec->floorz || pos.z == sec->floorz - 1) - pos.z = sec->floorz - 2, fadjust = -((tspr->ownerActor->GetIndex() & 31)); + if (pos.Z == sec->floorz || pos.Z == sec->floorz - 1) + pos.Z = sec->floorz - 2, fadjust = -((tspr->ownerActor->GetIndex() & 31)); } FVector2 pxy2[6]; @@ -3143,7 +3143,7 @@ void polymost_drawsprite(int32_t snum) xtex.d = 0; ytex.d = gxyaspect; if (heinum == 0) - ytex.d /= (double)(pos.z - globalposz + fadjust); + ytex.d /= (double)(pos.Z - globalposz + fadjust); otex.d = -ghoriz * ytex.d; // copied&modified from relative alignment @@ -3386,8 +3386,8 @@ static inline int comparetsprites(int const k, int const l) tspriteptr[k]->ownerActor != tspriteptr[l]->ownerActor) return tspriteptr[k]->ownerActor->GetIndex() - tspriteptr[l]->ownerActor->GetIndex(); - if (abs(spritesxyz[k].z - globalposz) != abs(spritesxyz[l].z - globalposz)) - return abs(spritesxyz[k].z - globalposz) - abs(spritesxyz[l].z - globalposz); + if (abs(spritesxyz[k].Z - globalposz) != abs(spritesxyz[l].Z - globalposz)) + return abs(spritesxyz[k].Z - globalposz) - abs(spritesxyz[l].Z - globalposz); return 0; } @@ -3428,18 +3428,18 @@ static void sortsprites(int const start, int const end) { auto const s = tspriteptr[k]; - spritesxyz[k].z = s->z; + spritesxyz[k].Z = s->z; if ((s->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR) { int32_t yoff = tileTopOffset(s->picnum) + s->yoffset; int32_t yspan = (tileHeight(s->picnum) * s->yrepeat << 2); - spritesxyz[k].z -= (yoff * s->yrepeat) << 2; + spritesxyz[k].Z -= (yoff * s->yrepeat) << 2; if (!(s->cstat & CSTAT_SPRITE_YCENTER)) - spritesxyz[k].z -= (yspan >> 1); - if (abs(spritesxyz[k].z - globalposz) < (yspan >> 1)) - spritesxyz[k].z = globalposz; + spritesxyz[k].Z -= (yspan >> 1); + if (abs(spritesxyz[k].Z - globalposz) < (yspan >> 1)) + spritesxyz[k].Z = globalposz; } } @@ -3826,18 +3826,18 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate) f = (float)tspr->yrepeat * k0; m0.Z *= f; a0.Z *= f; - k0 = (float)(tspr->z + tspr->ownerActor->sx().position_offset.z); + k0 = (float)(tspr->z + tspr->ownerActor->sx().position_offset.Z); f = ((globalorientation & 8) && (tspr->ownerActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 0) ? -4.f : 4.f; k0 -= (tspr->yoffset * tspr->yrepeat) * f * m->bscale; - zoff = m->siz.z * .5f; + zoff = m->siz.Z * .5f; if (!(tspr->cstat & CSTAT_SPRITE_YCENTER)) zoff += m->piv.Z; else if ((tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 48) { zoff += m->piv.Z; - zoff -= m->siz.z * .5f; + zoff -= m->siz.Z * .5f; } - if (globalorientation & 8) zoff = m->siz.z - zoff; + if (globalorientation & 8) zoff = m->siz.Z - zoff; f = (65536.f * 512.f) / ((float)xdimen * viewingrange); g = 32.f / ((float)xdimen * Polymost::gxyaspect); diff --git a/source/core/actorlist.cpp b/source/core/actorlist.cpp index 9698b88f0..0d49fb403 100644 --- a/source/core/actorlist.cpp +++ b/source/core/actorlist.cpp @@ -459,7 +459,7 @@ void SetActorZ(DCoreActor* actor, const vec3_t* newpos) { auto tempsector = actor->sector(); actor->spr.setpos(*newpos); - updatesectorz(newpos->X, newpos->Y, newpos->z, &tempsector); + updatesectorz(newpos->X, newpos->Y, newpos->Z, &tempsector); if (tempsector && tempsector != actor->sector()) ChangeActorSect(actor, tempsector); diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index 64d925e42..a041b24ca 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -410,7 +410,7 @@ FSerializer& Serialize(FSerializer& arc, const char* key, vec3_t& c, vec3_t* def { arc("x", c.X, def ? &def->X : nullptr) ("y", c.Y, def ? &def->Y : nullptr) - ("z", c.z, def ? &def->z : nullptr) + ("z", c.Z, def ? &def->Z : nullptr) .EndObject(); } return arc; diff --git a/source/core/gameinput.h b/source/core/gameinput.h index 153af752d..8fe42a878 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -267,13 +267,13 @@ struct PlayerPosition // Interpolation helpers. void backupx() { opos.X = pos.X; } void backupy() { opos.Y = pos.Y; } - void backupz() { opos.z = pos.z; } + void backupz() { opos.Z = pos.Z; } void backuppos() { opos = pos; } // Interpolated points. int32_t interpolatedx(double const smoothratio, int const scale = 16) { return interpolatedvalue(opos.X, pos.X, smoothratio, scale); } int32_t interpolatedy(double const smoothratio, int const scale = 16) { return interpolatedvalue(opos.Y, pos.Y, smoothratio, scale); } - int32_t interpolatedz(double const smoothratio, int const scale = 16) { return interpolatedvalue(opos.z, pos.z, smoothratio, scale); } + int32_t interpolatedz(double const smoothratio, int const scale = 16) { return interpolatedvalue(opos.Z, pos.Z, smoothratio, scale); } // Interpolated vectors. vec2_t interpolatedvec2(double const smoothratio, int const scale = 16) diff --git a/source/core/intvec.h b/source/core/intvec.h index 04a4208de..aa4cc2e76 100644 --- a/source/core/intvec.h +++ b/source/core/intvec.h @@ -29,18 +29,18 @@ struct vec3_t { struct { - int32_t X, Y, z; + int32_t X, Y, Z; }; vec2_t vec2; }; vec3_t() = default; vec3_t(const vec3_t&) = default; - vec3_t(int x, int y, int z_) : X(x), Y(y), z(z_) {} - vec3_t operator+(const vec3_t& other) const { return { X + other.X, Y + other.Y, z + other.z }; } - vec3_t operator-(const vec3_t& other) const { return { X - other.X, Y - other.Y, z - other.z }; } - vec3_t& operator+=(const vec3_t& other) { X += other.X; Y += other.Y; z += other.z; return *this; }; - vec3_t& operator-=(const vec3_t& other) { X -= other.X; Y -= other.Y; z += other.z; return *this; }; + vec3_t(int x, int y, int z) : X(x), Y(y), Z(z) {} + vec3_t operator+(const vec3_t& other) const { return { X + other.X, Y + other.Y, Z + other.Z }; } + vec3_t operator-(const vec3_t& other) const { return { X - other.X, Y - other.Y, Z - other.Z }; } + vec3_t& operator+=(const vec3_t& other) { X += other.X; Y += other.Y; Z += other.Z; return *this; }; + vec3_t& operator-=(const vec3_t& other) { X -= other.X; Y -= other.Y; Z += other.Z; return *this; }; }; diff --git a/source/core/maphack.cpp b/source/core/maphack.cpp index 28f498541..dee679645 100644 --- a/source/core/maphack.cpp +++ b/source/core/maphack.cpp @@ -288,7 +288,7 @@ static int32_t LoadMapHack(const char *filename, SpawnSpriteDef& sprites) else if (sc.Compare("mdzoff") || sc.Compare("mdpivzoff") || sc.Compare("mdpivotzoff")) { if (sc.CheckNumber() && validateSprite()) - sprites.sprext[currentsprite].pivot_offset.z = sc.Number; + sprites.sprext[currentsprite].pivot_offset.Z = sc.Number; } else if (sc.Compare("mdposxoff") || sc.Compare("mdpositionxoff")) { diff --git a/source/core/maploader.cpp b/source/core/maploader.cpp index e598753c4..860d2eb3c 100644 --- a/source/core/maploader.cpp +++ b/source/core/maploader.cpp @@ -291,7 +291,7 @@ static void ReadSpriteV7(FileReader& fr, spritetype& spr, int& secno) { spr.pos.X = fr.ReadInt32(); spr.pos.Y = fr.ReadInt32(); - spr.pos.z = fr.ReadInt32(); + spr.pos.Z = fr.ReadInt32(); spr.cstat = ESpriteFlags::FromInt(fr.ReadUInt16()); spr.picnum = fr.ReadInt16(); spr.shade = fr.ReadInt8(); @@ -319,7 +319,7 @@ static void ReadSpriteV6(FileReader& fr, spritetype& spr, int& secno) { spr.pos.X = fr.ReadInt32(); spr.pos.Y = fr.ReadInt32(); - spr.pos.z = fr.ReadInt32(); + spr.pos.Z = fr.ReadInt32(); spr.cstat = ESpriteFlags::FromInt(fr.ReadUInt16()); spr.shade = fr.ReadInt8(); spr.pal = fr.ReadUInt8(); @@ -347,7 +347,7 @@ static void ReadSpriteV5(FileReader& fr, spritetype& spr, int& secno) { spr.pos.X = fr.ReadInt32(); spr.pos.Y = fr.ReadInt32(); - spr.pos.z = fr.ReadInt32(); + spr.pos.Z = fr.ReadInt32(); spr.cstat = ESpriteFlags::FromInt(fr.ReadUInt16()); spr.shade = fr.ReadInt8(); spr.xrepeat = fr.ReadUInt8(); @@ -428,7 +428,7 @@ void loadMap(const char* filename, int flags, vec3_t* pos, int16_t* ang, int* cu pos->X = fr.ReadInt32(); pos->Y = fr.ReadInt32(); - pos->z = fr.ReadInt32(); + pos->Z = fr.ReadInt32(); *ang = fr.ReadInt16() & 2047; *cursectnum = fr.ReadUInt16(); diff --git a/source/core/maptypes.h b/source/core/maptypes.h index 3d123efa8..d1dc01964 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -479,7 +479,7 @@ struct spritetypebase void backupz() { - opos.z = pos.z; + opos.Z = pos.Z; } void backupvec2() diff --git a/source/core/raze_sound.h b/source/core/raze_sound.h index 043eb140e..0b8a267a9 100644 --- a/source/core/raze_sound.h +++ b/source/core/raze_sound.h @@ -10,7 +10,7 @@ inline FVector3 GetSoundPos(const vec3_t *pos) const float xmul = 1 / 16.f; const float ymul = -1 / 16.f; const float zmul = -1 / 256.f; - return { pos->X* xmul, pos->z* zmul, pos->Y* ymul }; + return { pos->X* xmul, pos->Z* zmul, pos->Y* ymul }; } diff --git a/source/core/rendering/hw_entrypoint.cpp b/source/core/rendering/hw_entrypoint.cpp index 061ed3954..6115d5d12 100644 --- a/source/core/rendering/hw_entrypoint.cpp +++ b/source/core/rendering/hw_entrypoint.cpp @@ -182,7 +182,7 @@ FRenderViewpoint SetupViewpoint(spritetype* cam, const vec3_t& position, int sec r_viewpoint.CameraSprite = cam; r_viewpoint.SectNums = nullptr; r_viewpoint.SectCount = sectnum; - r_viewpoint.Pos = { position.X / 16.f, position.Y / -16.f, position.z / -256.f }; + r_viewpoint.Pos = { position.X / 16.f, position.Y / -16.f, position.Z / -256.f }; r_viewpoint.HWAngles.Yaw = -90.f + angle.asdeg(); r_viewpoint.HWAngles.Pitch = -horizon.aspitch(); r_viewpoint.HWAngles.Roll = -rollang.asdeg(); diff --git a/source/core/rendering/hw_voxels.cpp b/source/core/rendering/hw_voxels.cpp index dd65bd6d0..9b10f0f7d 100644 --- a/source/core/rendering/hw_voxels.cpp +++ b/source/core/rendering/hw_voxels.cpp @@ -79,7 +79,7 @@ static voxmodel_t* voxload(int lumpnum) vm->piv.Z = float(pivot.Z); vm->siz.X = voxel->Mips[0].SizeX; vm->siz.Y = voxel->Mips[0].SizeY; - vm->siz.z = voxel->Mips[0].SizeZ; + vm->siz.Z = voxel->Mips[0].SizeZ; vm->is8bit = true; voxel->Mips[0].Pivot.Zero(); // Needs to be taken out of the voxel data because it gets baked into the vertex buffer which we cannot use here. vm->model = new FVoxelModel(voxel, true); diff --git a/source/core/rendering/scene/hw_sprites.cpp b/source/core/rendering/scene/hw_sprites.cpp index 6eeb5a11b..29cc57854 100644 --- a/source/core/rendering/scene/hw_sprites.cpp +++ b/source/core/rendering/scene/hw_sprites.cpp @@ -504,7 +504,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s scalevec.Z *= sprzscale; translatevec.Z *= sprzscale; - float zpos = (float)(spr->z + sprext->position_offset.z); + float zpos = (float)(spr->z + sprext->position_offset.Z); float zscale = ((spr->cstat & CSTAT_SPRITE_YFLIP) && (spr->ownerActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 0) ? -4.f : 4.f; zpos -= (spr->yoffset * spr->yrepeat) * zscale * voxel->bscale; @@ -512,15 +512,15 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s z = zpos * (1 / -256.f); y = (spr->y + sprext->position_offset.Y) * (1 / -16.f); - float zoff = voxel->siz.z * .5f; + float zoff = voxel->siz.Z * .5f; if (!(spr->cstat & CSTAT_SPRITE_YCENTER)) zoff += voxel->piv.Z; else if ((spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_SLAB) { zoff += voxel->piv.Z; - zoff -= voxel->siz.z * .5f; + zoff -= voxel->siz.Z * .5f; } - if (spr->cstat & CSTAT_SPRITE_YFLIP) zoff = voxel->siz.z - zoff; + if (spr->cstat & CSTAT_SPRITE_YFLIP) zoff = voxel->siz.Z - zoff; rotmat.loadIdentity(); rotmat.translate(x + translatevec.X, z - translatevec.Z, y - translatevec.Y); diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index 0a828e733..95c85e199 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -1133,7 +1133,7 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, tspritetype* spr, sectortype* sec seg = nullptr; Sprite = spr; vec2_t pos[2]; - int sprz = spr->pos.z; + int sprz = spr->pos.Z; GetWallSpritePosition(spr, spr->pos.vec2, pos, true); glseg.x1 = pos[0].X * (1 / 16.f); diff --git a/source/core/savegamehelp.h b/source/core/savegamehelp.h index 901d5e97a..c71503020 100644 --- a/source/core/savegamehelp.h +++ b/source/core/savegamehelp.h @@ -48,7 +48,7 @@ inline FSerializer& Serialize(FSerializer& arc, const char* keyname, THitInfo ("wall", w.hitWall) ("x", w.hitpos.X) ("y", w.hitpos.Y) - ("z", w.hitpos.z) + ("z", w.hitpos.Z) .EndObject(); } return arc; diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 4674567c8..6f4bcc6f4 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -5349,7 +5349,7 @@ int MoveMissile(DBloodActor* actor) pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL; // remove self collisions for accurate clipmove } Collision clipmoveresult; - ClipMove(pos, &pSector2, vx, vy, pSprite->clipdist << 2, (pos.z - top) / 4, (bottom - pos.z) / 4, CLIPMASK0, clipmoveresult, 1); + ClipMove(pos, &pSector2, vx, vy, pSprite->clipdist << 2, (pos.Z - top) / 4, (bottom - pos.Z) / 4, CLIPMASK0, clipmoveresult, 1); enginecompatibility_mode = bakCompat; // restore pSprite->cstat = bakSpriteCstat; auto pSector = pSector2; @@ -5371,7 +5371,7 @@ int MoveMissile(DBloodActor* actor) { int32_t fz, cz; getzsofslopeptr(clipmoveresult.hitWall->nextSector(), pos.X, pos.Y, &cz, &fz); - if (pos.z <= cz || pos.z >= fz) cliptype = 0; + if (pos.Z <= cz || pos.Z >= fz) cliptype = 0; else cliptype = 4; } } @@ -5407,7 +5407,7 @@ int MoveMissile(DBloodActor* actor) } int ceilZ, floorZ; Collision ceilColl, floorColl; - GetZRangeAtXYZ(pos.X, pos.Y, pos.z, pSector2, &ceilZ, &ceilColl, &floorZ, &floorColl, pSprite->clipdist << 2, CLIPMASK0); + GetZRangeAtXYZ(pos.X, pos.Y, pos.Z, pSector2, &ceilZ, &ceilColl, &floorZ, &floorColl, pSprite->clipdist << 2, CLIPMASK0); GetActorExtents(actor, &top, &bottom); top += vz; bottom += vz; @@ -5435,7 +5435,7 @@ int MoveMissile(DBloodActor* actor) gHitInfo.hitSector = pSprite->sector(); gHitInfo.hitpos.X = pSprite->x; gHitInfo.hitpos.Y = pSprite->y; - gHitInfo.hitpos.z = pSprite->z; + gHitInfo.hitpos.Z = pSprite->z; break; } if (pOwner) pOwner->cstat = bakCstat; @@ -6854,13 +6854,13 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, gHitInfo.hitActor = shooter; gHitInfo.hitpos.X = pShooter->x; gHitInfo.hitpos.Y = pShooter->y; - gHitInfo.hitpos.z = pShooter->z; + gHitInfo.hitpos.Z = pShooter->z; } } } int x = gHitInfo.hitpos.X - MulScale(a4, 16, 14); int y = gHitInfo.hitpos.Y - MulScale(a5, 16, 14); - int z = gHitInfo.hitpos.z - MulScale(a6, 256, 14); + int z = gHitInfo.hitpos.Z - MulScale(a6, 256, 14); auto pSector = gHitInfo.hitSector; uint8_t nSurf = kSurfNone; if (nRange == 0 || approxDist(gHitInfo.hitpos.X - pShooter->x, gHitInfo.hitpos.Y - pShooter->y) < nRange) @@ -6891,7 +6891,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, { int x = gHitInfo.hitpos.X - MulScale(a4, 16, 14); int y = gHitInfo.hitpos.Y - MulScale(a5, 16, 14); - int z = gHitInfo.hitpos.z - MulScale(a6, 256, 14); + int z = gHitInfo.hitpos.Z - MulScale(a6, 256, 14); int nSurf = surfType[pWall->picnum]; assert(nSurf < kSurfMax); if (pVectorData->surfHit[nSurf].fx1 >= 0) @@ -6982,7 +6982,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, a4 += Random3(4000); a5 += Random3(4000); a6 += Random3(4000); - if (HitScan(actor, gHitInfo.hitpos.z, a4, a5, a6, CLIPMASK1, t) == 0) + if (HitScan(actor, gHitInfo.hitpos.Z, a4, a5, a6, CLIPMASK1, t) == 0) { if (approxDist(gHitInfo.hitpos.X - pSprite->x, gHitInfo.hitpos.Y - pSprite->y) <= t) { @@ -6992,7 +6992,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, { int x = gHitInfo.hitpos.X - MulScale(a4, 16, 14); int y = gHitInfo.hitpos.Y - MulScale(a5, 16, 14); - int z = gHitInfo.hitpos.z - MulScale(a6, 16 << 4, 14); + int z = gHitInfo.hitpos.Z - MulScale(a6, 16 << 4, 14); int nSurf = surfType[pWall->picnum]; const VECTORDATA* pVectorData = &gVectorData[19]; FX_ID t2 = pVectorData->surfHit[nSurf].fx2; diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index 2d854a936..fb1539ada 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -87,7 +87,7 @@ static void batThinkTarget(DBloodActor* actor) pDudeExtraE->thinkTime = 0; actor->xspr.goalAng += 256; POINT3D* pTarget = &actor->basePoint; - aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->z); + aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z); aiNewState(actor, &batTurn); return; } diff --git a/source/games/blood/src/aiboneel.cpp b/source/games/blood/src/aiboneel.cpp index 54349d91f..342c5cfd4 100644 --- a/source/games/blood/src/aiboneel.cpp +++ b/source/games/blood/src/aiboneel.cpp @@ -103,7 +103,7 @@ static void eelThinkTarget(DBloodActor* actor) pDudeExtraE->thinkTime = 0; pXSprite->goalAng += 256; POINT3D* pTarget = &actor->basePoint; - aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->z); + aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z); aiNewState(actor, &eelTurn); return; } diff --git a/source/games/blood/src/aicerber.cpp b/source/games/blood/src/aicerber.cpp index 3f77904e5..8ec6d89b1 100644 --- a/source/games/blood/src/aicerber.cpp +++ b/source/games/blood/src/aicerber.cpp @@ -255,7 +255,7 @@ static void cerberusThinkTarget(DBloodActor* actor) { pXSprite->goalAng += 256; POINT3D* pTarget = &actor->basePoint; - aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->z); + aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z); if (pSprite->type == kDudeCerberusTwoHead) aiNewState(actor, &cerberus139890); else diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index 9d734deb0..d48843230 100644 --- a/source/games/blood/src/aigarg.cpp +++ b/source/games/blood/src/aigarg.cpp @@ -215,7 +215,7 @@ static void gargThinkTarget(DBloodActor* actor) { pXSprite->goalAng += 256; POINT3D* pTarget = &actor->basePoint; - aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->z); + aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z); aiNewState(actor, &gargoyleTurn); return; } diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index 89e218ab8..ab39ff9b9 100644 --- a/source/games/blood/src/aighost.cpp +++ b/source/games/blood/src/aighost.cpp @@ -195,7 +195,7 @@ static void ghostThinkTarget(DBloodActor* actor) { pXSprite->goalAng += 256; POINT3D* pTarget = &actor->basePoint; - aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->z); + aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z); aiNewState(actor, &ghostTurn); return; } diff --git a/source/games/blood/src/aitchern.cpp b/source/games/blood/src/aitchern.cpp index 50261063d..1bf5dc9e7 100644 --- a/source/games/blood/src/aitchern.cpp +++ b/source/games/blood/src/aitchern.cpp @@ -223,7 +223,7 @@ static void sub_725A4(DBloodActor* actor) { pXSprite->goalAng += 256; POINT3D* pTarget = &actor->basePoint; - aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->z); + aiSetTarget(actor, pTarget->X, pTarget->Y, pTarget->Z); aiNewState(actor, &tcherno13AA28); return; } diff --git a/source/games/blood/src/blood.cpp b/source/games/blood/src/blood.cpp index 1390c5da8..64fe63edf 100644 --- a/source/games/blood/src/blood.cpp +++ b/source/games/blood/src/blood.cpp @@ -218,7 +218,7 @@ void StartLevel(MapRecord* level, bool newgame) #endif //drawLoadingScreen(); BloodSpawnSpriteDef sprites; - dbLoadMap(currentLevel->fileName, (int*)&startpos.X, (int*)&startpos.Y, (int*)&startpos.z, &startang, &startsector, nullptr, sprites); + dbLoadMap(currentLevel->fileName, (int*)&startpos.X, (int*)&startpos.Y, (int*)&startpos.Z, &startang, &startsector, nullptr, sprites); SECRET_SetMapName(currentLevel->DisplayName(), currentLevel->name); STAT_NewLevel(currentLevel->fileName); wsrand(dbReadMapCRC(currentLevel->LabelName())); @@ -259,11 +259,11 @@ void StartLevel(MapRecord* level, bool newgame) Printf(PRINT_NONOTIFY, "> Modern types erased: %d.\n", modernTypesErased); #endif - startpos.z = getflorzofslopeptr(startsector, startpos.X, startpos.Y); + startpos.Z = getflorzofslopeptr(startsector, startpos.X, startpos.Y); for (int i = 0; i < kMaxPlayers; i++) { gStartZone[i].x = startpos.X; gStartZone[i].y = startpos.Y; - gStartZone[i].z = startpos.z; + gStartZone[i].z = startpos.Z; gStartZone[i].sector = startsector; gStartZone[i].ang = startang; @@ -272,13 +272,13 @@ void StartLevel(MapRecord* level, bool newgame) if (gModernMap && i <= kMaxPlayers / 2) { gStartZoneTeam1[i].x = startpos.X; gStartZoneTeam1[i].y = startpos.Y; - gStartZoneTeam1[i].z = startpos.z; + gStartZoneTeam1[i].z = startpos.Z; gStartZoneTeam1[i].sector = startsector; gStartZoneTeam1[i].ang = startang; gStartZoneTeam2[i].x = startpos.X; gStartZoneTeam2[i].y = startpos.Y; - gStartZoneTeam2[i].z = startpos.z; + gStartZoneTeam2[i].z = startpos.Z; gStartZoneTeam2[i].sector = startsector; gStartZoneTeam2[i].ang = startang; } diff --git a/source/games/blood/src/db.cpp b/source/games/blood/src/db.cpp index b3b1ce7c3..c920c037b 100644 --- a/source/games/blood/src/db.cpp +++ b/source/games/blood/src/db.cpp @@ -735,6 +735,6 @@ void qloadboard(const char* filename, char flags, vec3_t* dapos, int16_t* daang) { Blood::BloodSpawnSpriteDef sprites; sectortype* sp; - Blood::dbLoadMap(filename, &dapos->X, &dapos->Y, &dapos->z, daang, &sp, nullptr, sprites); + Blood::dbLoadMap(filename, &dapos->X, &dapos->Y, &dapos->Z, daang, &sp, nullptr, sprites); } \ No newline at end of file diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index fb4b4d71e..8feb54548 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -368,12 +368,12 @@ int HitScan(DBloodActor *actor, int z, int dx, int dy, int dz, unsigned int nMas return 0; int nZCeil, nZFloor; getzsofslopeptr(pWall->nextSector(), gHitInfo.hitpos.X, gHitInfo.hitpos.Y, &nZCeil, &nZFloor); - if (gHitInfo.hitpos.z <= nZCeil || gHitInfo.hitpos.z >= nZFloor) + if (gHitInfo.hitpos.Z <= nZCeil || gHitInfo.hitpos.Z >= nZFloor) return 0; return 4; } if (gHitInfo.hitSector != nullptr) - return 1 + (z < gHitInfo.hitpos.z); + return 1 + (z < gHitInfo.hitpos.Z); return -1; } @@ -426,7 +426,7 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in if (nOffset) otherZ -= (nOffset*pOther->yrepeat)<<2; assert(height > 0); - int height2 = scale(otherZ-gHitInfo.hitpos.z, tileHeight(nPicnum), height); + int height2 = scale(otherZ-gHitInfo.hitpos.Z, tileHeight(nPicnum), height); if (!(pOther->cstat & CSTAT_SPRITE_YFLIP)) height2 = tileHeight(nPicnum)-height2; if (height2 >= 0 && height2 < tileHeight(nPicnum)) @@ -462,9 +462,9 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in sectortype *pSectorNext = pWall->nextSector(); int nZCeil, nZFloor; getzsofslopeptr(pWall->nextSector(), gHitInfo.hitpos.X, gHitInfo.hitpos.Y, &nZCeil, &nZFloor); - if (gHitInfo.hitpos.z <= nZCeil) + if (gHitInfo.hitpos.Z <= nZCeil) return 0; - if (gHitInfo.hitpos.z >= nZFloor) + if (gHitInfo.hitpos.Z >= nZFloor) { if (!(pSector->floorstat & CSTAT_SECTOR_SKY) || !(pSectorNext->floorstat & CSTAT_SECTOR_SKY)) return 0; @@ -477,7 +477,7 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in nOffset = ClipHigh(pSector->floorz, pSectorNext->floorz); else nOffset = ClipLow(pSector->ceilingz, pSectorNext->ceilingz); - nOffset = (gHitInfo.hitpos.z - nOffset) >> 8; + nOffset = (gHitInfo.hitpos.Z - nOffset) >> 8; if (pWall->cstat & CSTAT_WALL_YFLIP) nOffset = -nOffset; @@ -529,7 +529,7 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in gHitInfo.clearObj(); x1 = gHitInfo.hitpos.X + link->spr.x - actor->spr.x; y1 = gHitInfo.hitpos.Y + link->spr.y - actor->spr.y; - z1 = gHitInfo.hitpos.z + link->spr.z - actor->spr.z; + z1 = gHitInfo.hitpos.Z + link->spr.z - actor->spr.z; pos = { x1, y1, z1 }; hitscan(pos, link->spr.sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); @@ -543,7 +543,7 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in gHitInfo.clearObj(); x1 = gHitInfo.hitpos.X + link->spr.x - actor->spr.x; y1 = gHitInfo.hitpos.Y + link->spr.y - actor->spr.y; - z1 = gHitInfo.hitpos.z + link->spr.z - actor->spr.z; + z1 = gHitInfo.hitpos.Z + link->spr.z - actor->spr.z; pos = { x1, y1, z1 }; hitscan(pos, link->spr.sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); continue; diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 802ec6dfb..c9092971e 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -598,8 +598,8 @@ void playerResetInertia(PLAYER *pPlayer) void playerCorrectInertia(PLAYER* pPlayer, vec3_t const *oldpos) { - pPlayer->zView += pPlayer->pSprite->z-oldpos->z; - pPlayer->zWeapon += pPlayer->pSprite->z-oldpos->z; + pPlayer->zView += pPlayer->pSprite->z-oldpos->Z; + pPlayer->zWeapon += pPlayer->pSprite->z-oldpos->Z; viewCorrectViewOffsets(pPlayer->nPlayer, oldpos); } diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 0bb68232c..c0ff304d5 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -1071,7 +1071,7 @@ int VSpriteBusy(sectortype* pSector, unsigned int a2) if (pSprite->cstat & CSTAT_SPRITE_MOVE_FORWARD) { viewBackupSpriteLoc(actor); - pSprite->z = actor->basePoint.z+MulScale(dz1, GetWaveValue(a2, nWave), 16); + pSprite->z = actor->basePoint.Z+MulScale(dz1, GetWaveValue(a2, nWave), 16); } } } @@ -1085,7 +1085,7 @@ int VSpriteBusy(sectortype* pSector, unsigned int a2) if (pSprite->cstat & CSTAT_SPRITE_MOVE_REVERSE) { viewBackupSpriteLoc(actor); - pSprite->z = actor->basePoint.z + MulScale(dz2, GetWaveValue(a2, nWave), 16); + pSprite->z = actor->basePoint.Z + MulScale(dz2, GetWaveValue(a2, nWave), 16); } } } diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index 95c4e199d..a85beb58b 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -84,7 +84,7 @@ void viewCorrectViewOffsets(int nPlayer, vec3_t const *oldpos) VIEW *pView = &gPrevView[nPlayer]; pView->x += pPlayer->pSprite->x-oldpos->X; pView->y += pPlayer->pSprite->y-oldpos->Y; - pView->viewz += pPlayer->pSprite->z-oldpos->z; + pView->viewz += pPlayer->pSprite->z-oldpos->Z; } void viewDrawText(FFont* pFont, const char *pString, int x, int y, int nShade, int nPalette, int position, bool shadow) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 35fdb10e0..b10c382c0 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -204,7 +204,7 @@ void clearcamera(player_struct* ps) ps->newOwner = nullptr; ps->pos.X = ps->oposx; ps->pos.Y = ps->oposy; - ps->pos.z = ps->oposz; + ps->pos.Z = ps->oposz; ps->angle.restore(); updatesector(ps->pos.X, ps->pos.Y, &ps->cursector); @@ -463,7 +463,7 @@ void moveplayers(void) { p->pos.X = act->spr.x; p->pos.Y = act->spr.y; - p->pos.z = act->spr.z - (20 << 8); + p->pos.Z = act->spr.z - (20 << 8); p->newOwner = nullptr; @@ -799,10 +799,10 @@ void movecrane(DDukeActor *actor, int crane) auto ang = ps[p].angle.ang.asbuild(); ps[p].oposx = ps[p].pos.X; ps[p].oposy = ps[p].pos.Y; - ps[p].oposz = ps[p].pos.z; + ps[p].oposz = ps[p].pos.Z; ps[p].pos.X = actor->spr.x - bcos(ang, -6); ps[p].pos.Y = actor->spr.y - bsin(ang, -6); - ps[p].pos.z = actor->spr.z + (2 << 8); + ps[p].pos.Z = actor->spr.z + (2 << 8); SetActor(ps[p].GetActor(), ps[p].pos); ps[p].setCursector(ps[p].GetActor()->spr.sector()); } @@ -1107,7 +1107,7 @@ void movetouchplate(DDukeActor* actor, int plate) { sectp->floorz += sectp->extra; p = checkcursectnums(actor->spr.sector()); - if (p >= 0) ps[p].pos.z += sectp->extra; + if (p >= 0) ps[p].pos.Z += sectp->extra; } } else @@ -1122,7 +1122,7 @@ void movetouchplate(DDukeActor* actor, int plate) sectp->floorz -= sectp->extra; p = checkcursectnums(actor->spr.sector()); if (p >= 0) - ps[p].pos.z -= sectp->extra; + ps[p].pos.Z -= sectp->extra; } } return; @@ -1690,7 +1690,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p fi.shoot(actor, firelaser); actor->spr.ang = a; } - if (t[2] > (26 * 3) || !cansee(actor->spr.x, actor->spr.y, actor->spr.z - (16 << 8), actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.z, ps[p].cursector)) + if (t[2] > (26 * 3) || !cansee(actor->spr.x, actor->spr.y, actor->spr.z - (16 << 8), actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z, ps[p].cursector)) { t[0] = 0; t[2] = 0; @@ -1706,14 +1706,14 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p if (t[0] == 2) { - int l = ps[p].pos.z - actor->spr.z; + int l = ps[p].pos.Z - actor->spr.z; if (abs(l) < (48 << 8)) t[0] = 3; - else actor->spr.z += Sgn(ps[p].pos.z - actor->spr.z) << shift; // The shift here differs between Duke and RR. + else actor->spr.z += Sgn(ps[p].pos.Z - actor->spr.z) << shift; // The shift here differs between Duke and RR. } else { t[2]++; - if (t[2] > (26 * 3) || !cansee(actor->spr.x, actor->spr.y, actor->spr.z - (16 << 8), actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.z, ps[p].cursector)) + if (t[2] > (26 * 3) || !cansee(actor->spr.x, actor->spr.y, actor->spr.z - (16 << 8), actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z, ps[p].cursector)) { t[0] = 1; t[2] = 0; @@ -2709,7 +2709,7 @@ void handle_se00(DDukeActor* actor, int LASERLINE) { ps[p].angle.addadjustment(l * q); - ps[p].pos.z += zchange; + ps[p].pos.Z += zchange; vec2_t res; rotatepoint(Owner->spr.pos.vec2, ps[p].pos.vec2, (q * l), &res); @@ -3874,11 +3874,11 @@ void handle_se17(DDukeActor* actor) if (act1->spr.statnum == STAT_PLAYER && act1->GetOwner()) { int p = act1->spr.yvel; - if (numplayers < 2) ps[p].oposz = ps[p].pos.z; - ps[p].pos.z += q; + if (numplayers < 2) ps[p].oposz = ps[p].pos.Z; + ps[p].pos.Z += q; ps[p].truefz += q; ps[p].truecz += q; - if (numplayers > 1) ps[p].oposz = ps[p].pos.z; + if (numplayers > 1) ps[p].oposz = ps[p].pos.Z; } if (act1->spr.statnum != STAT_EFFECTOR) { @@ -3928,14 +3928,14 @@ void handle_se17(DDukeActor* actor) ps[p].pos.X += act2->spr.x - actor->spr.x; ps[p].pos.Y += act2->spr.y - actor->spr.y; - ps[p].pos.z = act2->spr.sector()->floorz - (sc->floorz - ps[p].pos.z); + ps[p].pos.Z = act2->spr.sector()->floorz - (sc->floorz - ps[p].pos.Z); act3->floorz = act2->spr.sector()->floorz; act3->ceilingz = act2->spr.sector()->ceilingz; ps[p].bobposx = ps[p].oposx = ps[p].pos.X; ps[p].bobposy = ps[p].oposy = ps[p].pos.Y; - ps[p].oposz = ps[p].pos.z; + ps[p].oposz = ps[p].pos.Z; ps[p].truefz = act3->floorz; ps[p].truecz = act3->ceilingz; @@ -3997,7 +3997,7 @@ void handle_se18(DDukeActor *actor, bool morecheck) while (auto a2 = it.Next()) { if (a2->spr.picnum == TILE_APLAYER && a2->GetOwner()) - if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].pos.z += sc->extra; + if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].pos.Z += sc->extra; if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE) { a2->spr.z += sc->extra; @@ -4034,7 +4034,7 @@ void handle_se18(DDukeActor *actor, bool morecheck) while (auto a2 = it.Next()) { if (a2->spr.picnum == TILE_APLAYER && a2->GetOwner()) - if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].pos.z -= sc->extra; + if (ps[a2->PlayerIndex()].on_ground == 1) ps[a2->PlayerIndex()].pos.Z -= sc->extra; if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE) { a2->spr.z -= sc->extra; @@ -4217,7 +4217,7 @@ void handle_se20(DDukeActor* actor) ps[p].oposx = ps[p].pos.X; ps[p].oposy = ps[p].pos.Y; - SetActor(ps[p].GetActor(), { ps[p].pos.X, ps[p].pos.Y, ps[p].pos.z + gs.playerheight }); + SetActor(ps[p].GetActor(), { ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z + gs.playerheight }); } sc->addfloorxpan(-x / 8.f); @@ -4328,7 +4328,7 @@ void handle_se26(DDukeActor* actor) { ps[p].fric.X += l << 5; ps[p].fric.Y += x << 5; - ps[p].pos.z += actor->spr.zvel; + ps[p].pos.Z += actor->spr.zvel; } ms(actor); @@ -4361,14 +4361,14 @@ void handle_se27(DDukeActor* actor) } else if (ud.recstat == 2 && ps[p].newOwner == nullptr) { - if (cansee(actor->spr.x, actor->spr.y, actor->spr.z, actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.z, ps[p].cursector)) + if (cansee(actor->spr.x, actor->spr.y, actor->spr.z, actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z, ps[p].cursector)) { if (x < sh) { ud.cameraactor = actor; t[0] = 999; actor->spr.ang += getincangle(actor->spr.ang, getangle(ps[p].pos.X - actor->spr.x, ps[p].pos.Y - actor->spr.y)) >> 3; - actor->spr.yvel = 100 + ((actor->spr.z - ps[p].pos.z) / 257); + actor->spr.yvel = 100 + ((actor->spr.z - ps[p].pos.Z) / 257); } else if (t[0] == 999) @@ -4464,7 +4464,7 @@ void handle_se24(DDukeActor *actor, const int16_t *list1, const int16_t *list2, { if (ps[p].cursector == actor->spr.sector() && ps[p].on_ground) { - if (abs(ps[p].pos.z - ps[p].truefz) < gs.playerheight + (9 << 8)) + if (abs(ps[p].pos.Z - ps[p].truefz) < gs.playerheight + (9 << 8)) { ps[p].fric.X += x << 3; ps[p].fric.Y += l << 3; @@ -4742,7 +4742,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) { if (a2->spr.picnum == TILE_APLAYER && a2->GetOwner()) if (ps[a2->PlayerIndex()].on_ground == 1) - ps[a2->PlayerIndex()].pos.z += l; + ps[a2->PlayerIndex()].pos.Z += l; if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE)) { a2->spr.z += l; @@ -4771,7 +4771,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) { if (a2->spr.picnum == TILE_APLAYER && a2->GetOwner()) if (ps[a2->PlayerIndex()].on_ground == 1) - ps[a2->PlayerIndex()].pos.z += l; + ps[a2->PlayerIndex()].pos.Z += l; if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE)) { a2->spr.z += l; @@ -4802,7 +4802,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) { if (a2->spr.picnum == TILE_APLAYER && a2->GetOwner()) if (ps[a2->PlayerIndex()].on_ground == 1) - ps[a2->PlayerIndex()].pos.z += l; + ps[a2->PlayerIndex()].pos.Z += l; if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE)) { a2->spr.z += l; @@ -4830,7 +4830,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) { if (a2->spr.picnum ==TILE_APLAYER && a2->GetOwner()) if (ps[a2->PlayerIndex()].on_ground == 1) - ps[a2->PlayerIndex()].pos.z -= l; + ps[a2->PlayerIndex()].pos.Z -= l; if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE)) { a2->spr.z -= l; @@ -5045,7 +5045,7 @@ int furthestcanseepoint(DDukeActor *actor, DDukeActor* tosee, int* dax, int* day da = abs(hit.hitpos.X - actor->spr.x) + abs(hit.hitpos.Y - actor->spr.y); if (d < da && hit.hitSector) - if (cansee(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, hit.hitSector, actor->spr.x, actor->spr.y, actor->spr.z - (16 << 8), actor->spr.sector())) + if (cansee(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, hit.hitSector, actor->spr.x, actor->spr.y, actor->spr.z - (16 << 8), actor->spr.sector())) { *dax = hit.hitpos.X; *day = hit.hitpos.Y; diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 157a3c988..bbe50f30f 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -458,7 +458,7 @@ int movesprite_ex_d(DDukeActor* actor, int xchange, int ychange, int zchange, un auto dasectp = actor->spr.sector(); vec3_t pos = actor->spr.pos; - pos.z -= ((tileHeight(actor->spr.picnum) * actor->spr.yrepeat) << 1); + pos.Z -= ((tileHeight(actor->spr.picnum) * actor->spr.yrepeat) << 1); if (bg) { @@ -1942,7 +1942,7 @@ void movetransports_d(void) ps[p].bobposx = ps[p].oposx = ps[p].pos.X = Owner->spr.x; ps[p].bobposy = ps[p].oposy = ps[p].pos.Y = Owner->spr.y; - ps[p].oposz = ps[p].pos.z = Owner->spr.z - gs.playerheight; + ps[p].oposz = ps[p].pos.Z = Owner->spr.z - gs.playerheight; ChangeActorSect(act2, Owner->sector()); ps[p].setCursector(act2->spr.sector()); @@ -1958,7 +1958,7 @@ void movetransports_d(void) } else if (!(sectlotag == 1 && ps[p].on_ground == 1)) break; - if (onfloorz == 0 && abs(act->spr.z - ps[p].pos.z) < 6144) + if (onfloorz == 0 && abs(act->spr.z - ps[p].pos.Z) < 6144) if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP))) || (ps[p].jetpack_on && PlayerInput(p, SB_CROUCH))) { @@ -1966,9 +1966,9 @@ void movetransports_d(void) ps[p].oposy = ps[p].pos.Y += Owner->spr.y - act->spr.y; if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11)) - ps[p].pos.z = Owner->spr.z - 6144; - else ps[p].pos.z = Owner->spr.z + 6144; - ps[p].oposz = ps[p].pos.z; + ps[p].pos.Z = Owner->spr.z - 6144; + else ps[p].pos.Z = Owner->spr.z + 6144; + ps[p].oposz = ps[p].pos.Z; auto pa = ps[p].GetActor(); pa->spr.opos = ps[p].pos; @@ -1981,7 +1981,7 @@ void movetransports_d(void) int k = 0; - if (onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].on_ground && ps[p].pos.z > (sectp->floorz - (16 << 8)) && (PlayerInput(p, SB_CROUCH) || ps[p].poszv > 2048)) + if (onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].on_ground && ps[p].pos.Z > (sectp->floorz - (16 << 8)) && (PlayerInput(p, SB_CROUCH) || ps[p].poszv > 2048)) // if( onfloorz && sectlotag == 1 && ps[p].pos.z > (sectp->floorz-(6<<8)) ) { k = 1; @@ -1991,7 +1991,7 @@ void movetransports_d(void) } if (ps[p].GetActor()->spr.extra > 0) S_PlayActorSound(DUKE_UNDERWATER, act2); - ps[p].oposz = ps[p].pos.z = + ps[p].oposz = ps[p].pos.Z = Owner->sector()->ceilingz + (7 << 8); ps[p].posxv = 4096 - (krand() & 8192); @@ -1999,7 +1999,7 @@ void movetransports_d(void) } - if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].pos.z < (sectp->ceilingz + (6 << 8))) + if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].pos.Z < (sectp->ceilingz + (6 << 8))) { k = 1; // if( act2->spr.extra <= 0) break; @@ -2009,7 +2009,7 @@ void movetransports_d(void) } S_PlayActorSound(DUKE_GASP, act2); - ps[p].oposz = ps[p].pos.z = + ps[p].oposz = ps[p].pos.Z = Owner->sector()->floorz - (7 << 8); ps[p].jumping_toggle = 1; @@ -2026,7 +2026,7 @@ void movetransports_d(void) ps[p].setCursector(Owner->sector()); ChangeActorSect(act2, Owner->sector()); - SetActor(ps[p].GetActor(), { ps[p].pos.X, ps[p].pos.Y, ps[p].pos.z + gs.playerheight }); + SetActor(ps[p].GetActor(), { ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z + gs.playerheight }); if ((krand() & 255) < 32) spawn(act2, WATERSPLASH2); @@ -2325,7 +2325,7 @@ static void greenslime(DDukeActor *actor) return; } - actor->spr.z = ps[p].pos.z + ps[p].pyoff - t[2] + (8 << 8); + actor->spr.z = ps[p].pos.Z + ps[p].pyoff - t[2] + (8 << 8); actor->spr.z += -ps[p].horizon.horiz.asq16() >> 12; @@ -2340,7 +2340,7 @@ static void greenslime(DDukeActor *actor) ps[p].newOwner = nullptr; ps[p].pos.X = ps[p].oposx; ps[p].pos.Y = ps[p].oposy; - ps[p].pos.z = ps[p].oposz; + ps[p].pos.Z = ps[p].oposz; ps[p].angle.restore(); updatesector(ps[p].pos.X, ps[p].pos.Y, &ps[p].cursector); @@ -2874,7 +2874,7 @@ DETONATEB: } } else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && t[0] > 7 && actor->spr.xvel == 0) - if (cansee(actor->spr.x, actor->spr.y, actor->spr.z - (8 << 8), actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.z, ps[p].cursector)) + if (cansee(actor->spr.x, actor->spr.y, actor->spr.z - (8 << 8), actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z, ps[p].cursector)) if (ps[p].ammo_amount[HANDBOMB_WEAPON] < gs.max_ammo_amount[HANDBOMB_WEAPON]) { if (ud.coop >= 1 && Owner == actor) @@ -3427,7 +3427,7 @@ static void handle_se28(DDukeActor* actor) } else if (t[2] > (t[1] >> 3) && t[2] < (t[1] >> 2)) { - int j = !!cansee(actor->spr.x, actor->spr.y, actor->spr.z, actor->spr.sector(), ps[screenpeek].pos.X, ps[screenpeek].pos.Y, ps[screenpeek].pos.z, ps[screenpeek].cursector); + int j = !!cansee(actor->spr.x, actor->spr.y, actor->spr.z, actor->spr.sector(), ps[screenpeek].pos.X, ps[screenpeek].pos.Y, ps[screenpeek].pos.Z, ps[screenpeek].cursector); if (rnd(192) && (t[2] & 1)) { diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 35d300f88..df8dca7f6 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -382,7 +382,7 @@ int movesprite_ex_r(DDukeActor* actor, int xchange, int ychange, int zchange, un auto dasectp = actor->spr.sector(); vec3_t pos = actor->spr.pos; - pos.z -= ((tileHeight(actor->spr.picnum) * actor->spr.yrepeat) << 1); + pos.Z -= ((tileHeight(actor->spr.picnum) * actor->spr.yrepeat) << 1); if (bg) { @@ -1606,7 +1606,7 @@ void movetransports_r(void) ps[p].bobposx = ps[p].oposx = ps[p].pos.X = Owner->spr.x; ps[p].bobposy = ps[p].oposy = ps[p].pos.Y = Owner->spr.y; - ps[p].oposz = ps[p].pos.z = Owner->spr.z - (gs.playerheight - (4 << 8)); + ps[p].oposz = ps[p].pos.Z = Owner->spr.z - (gs.playerheight - (4 << 8)); ChangeActorSect(act2, Owner->sector()); ps[p].setCursector(act2->spr.sector()); @@ -1619,7 +1619,7 @@ void movetransports_r(void) } else break; - if (onfloorz == 0 && abs(act->spr.z - ps[p].pos.z) < 6144) + if (onfloorz == 0 && abs(act->spr.z - ps[p].pos.Z) < 6144) if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && PlayerInput(p, SB_JUMP)) || (ps[p].jetpack_on && PlayerInput(p, SB_CROUCH))) { @@ -1627,9 +1627,9 @@ void movetransports_r(void) ps[p].oposy = ps[p].pos.Y += Owner->spr.y - act->spr.y; if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11)) - ps[p].pos.z = Owner->spr.z - 6144; - else ps[p].pos.z = Owner->spr.z + 6144; - ps[p].oposz = ps[p].pos.z; + ps[p].pos.Z = Owner->spr.z - 6144; + else ps[p].pos.Z = Owner->spr.z + 6144; + ps[p].oposz = ps[p].pos.Z; ChangeActorSect(act2, Owner->sector()); ps[p].setCursector(Owner->sector()); @@ -1641,23 +1641,23 @@ void movetransports_r(void) if (isRRRA()) { - if (onfloorz && sectlotag == 160 && ps[p].pos.z > (sectp->floorz - (48 << 8))) + if (onfloorz && sectlotag == 160 && ps[p].pos.Z > (sectp->floorz - (48 << 8))) { k = 2; - ps[p].oposz = ps[p].pos.z = + ps[p].oposz = ps[p].pos.Z = Owner->sector()->ceilingz + (7 << 8); } - if (onfloorz && sectlotag == 161 && ps[p].pos.z < (sectp->ceilingz + (6 << 8))) + if (onfloorz && sectlotag == 161 && ps[p].pos.Z < (sectp->ceilingz + (6 << 8))) { k = 2; if (ps[p].GetActor()->spr.extra <= 0) break; - ps[p].oposz = ps[p].pos.z = + ps[p].oposz = ps[p].pos.Z = Owner->sector()->floorz - (49 << 8); } } - if ((onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].pos.z > (sectp->floorz - (6 << 8))) || + if ((onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].pos.Z > (sectp->floorz - (6 << 8))) || (onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].OnMotorcycle)) { if (ps[p].OnBoat) break; @@ -1667,13 +1667,13 @@ void movetransports_r(void) FX_StopAllSounds(); } S_PlayActorSound(DUKE_UNDERWATER, ps[p].GetActor()); - ps[p].oposz = ps[p].pos.z = + ps[p].oposz = ps[p].pos.Z = Owner->sector()->ceilingz + (7 << 8); if (ps[p].OnMotorcycle) ps[p].moto_underwater = 1; } - if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].pos.z < (sectp->ceilingz + (6 << 8))) + if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].pos.Z < (sectp->ceilingz + (6 << 8))) { k = 1; if (ps[p].GetActor()->spr.extra <= 0) break; @@ -1683,7 +1683,7 @@ void movetransports_r(void) } S_PlayActorSound(DUKE_GASP, ps[p].GetActor()); - ps[p].oposz = ps[p].pos.z = + ps[p].oposz = ps[p].pos.Z = Owner->sector()->floorz - (7 << 8); } @@ -2451,7 +2451,7 @@ void rr_specialstats() ps[p].angle.ang = buildang(act2->spr.ang); ps[p].bobposx = ps[p].oposx = ps[p].pos.X = act2->spr.x; ps[p].bobposy = ps[p].oposy = ps[p].pos.Y = act2->spr.y; - ps[p].oposz = ps[p].pos.z = act2->spr.z - (36 << 8); + ps[p].oposz = ps[p].pos.Z = act2->spr.z - (36 << 8); auto pact = ps[p].GetActor(); ChangeActorSect(pact, act2->sector()); ps[p].setCursector(pact->sector()); @@ -2655,7 +2655,7 @@ DETONATEB: } } else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && t[0] > 7 && actor->spr.xvel == 0) - if (cansee(actor->spr.x, actor->spr.y, actor->spr.z - (8 << 8), actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.z, ps[p].cursector)) + if (cansee(actor->spr.x, actor->spr.y, actor->spr.z - (8 << 8), actor->spr.sector(), ps[p].pos.X, ps[p].pos.Y, ps[p].pos.Z, ps[p].cursector)) if (ps[p].ammo_amount[DYNAMITE_WEAPON] < gs.max_ammo_amount[DYNAMITE_WEAPON]) if (actor->spr.pal == 0) { diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 87d6769fd..23c72497b 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -167,7 +167,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in { t->x -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.X - ps[h->spr.yvel].oposx, 16); t->y -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.Y - ps[h->spr.yvel].oposy, 16); - t->z = interpolatedvalue(ps[h->spr.yvel].oposz, ps[h->spr.yvel].pos.z, smoothratio); + t->z = interpolatedvalue(ps[h->spr.yvel].oposz, ps[h->spr.yvel].pos.Z, smoothratio); t->z += PHEIGHT_DUKE; } else if (h->spr.picnum != CRANEPOLE) @@ -359,7 +359,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in } if (h->GetOwner()) - newtspr->z = ps[p].pos.z - (12 << 8); + newtspr->z = ps[p].pos.Z - (12 << 8); else newtspr->z = h->spr.z - (51 << 8); if (ps[p].curr_weapon == HANDBOMB_WEAPON) { @@ -583,7 +583,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in daz = h->floorz; - if ((h->spr.z - daz) < (8 << 8) && ps[screenpeek].pos.z < daz) + if ((h->spr.z - daz) < (8 << 8) && ps[screenpeek].pos.Z < daz) { auto shadowspr = &tsprite[spritesortcnt++]; *shadowspr = *t; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 4c344e900..bf3c0ac92 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -148,7 +148,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in { t->x -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.X - ps[h->spr.yvel].oposx, 16); t->y -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.Y - ps[h->spr.yvel].oposy, 16); - t->z = interpolatedvalue(ps[h->spr.yvel].oposz, ps[h->spr.yvel].pos.z, smoothratio); + t->z = interpolatedvalue(ps[h->spr.yvel].oposz, ps[h->spr.yvel].pos.Z, smoothratio); t->z += PHEIGHT_RR; h->spr.xrepeat = 24; h->spr.yrepeat = 17; @@ -398,7 +398,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in } if (h->GetOwner()) - newtspr->z = ps[p].pos.z - (12 << 8); + newtspr->z = ps[p].pos.Z - (12 << 8); else newtspr->z = h->spr.z - (51 << 8); if (ps[p].curr_weapon == HANDBOMB_WEAPON) { @@ -738,7 +738,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in daz = h->floorz; if ((h->spr.z - daz) < (8 << 8)) - if (ps[screenpeek].pos.z < daz) + if (ps[screenpeek].pos.Z < daz) { auto shadowspr = &tsprite[spritesortcnt++]; *shadowspr = *t; diff --git a/source/games/duke/src/ccmds.cpp b/source/games/duke/src/ccmds.cpp index 80e3df208..830fc7224 100644 --- a/source/games/duke/src/ccmds.cpp +++ b/source/games/duke/src/ccmds.cpp @@ -117,7 +117,7 @@ void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz) p->oposx = p->pos.X = x; p->oposy = p->pos.Y = y; - p->oposz = p->pos.z = z; + p->oposz = p->pos.Z = z; if (ang != INT_MIN) { diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 5c6e310eb..888c5df81 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -60,7 +60,7 @@ FString GameInterface::GetCoordString() FString out; out.Format("pos= %d, %d, %d - angle = %2.3f - sector = %d, lotag = %d, hitag = %d", - ps[snum].pos.X, ps[snum].pos.Y, ps[snum].pos.z, ps[snum].angle.ang.asdeg(), sectnum(ps[snum].cursector), + ps[snum].pos.X, ps[snum].pos.Y, ps[snum].pos.Z, ps[snum].angle.ang.asdeg(), sectnum(ps[snum].cursector), ps[snum].cursector->lotag, ps[snum].cursector->hitag); return out; @@ -568,7 +568,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int else i = TILE_APLAYERTOP; - j = abs(pp.truefz - pp.pos.z) >> 8; + j = abs(pp.truefz - pp.pos.Z) >> 8; j = czoom * (act->spr.yrepeat + j); if (j < 22000) j = 22000; diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index ee59c7511..0fdd211c1 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -334,7 +334,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, break; case PLAYER_POSZ: - if (!bSet) SetGameVarID(lVar2, ps[iPlayer].pos.z, sActor, sPlayer); + if (!bSet) SetGameVarID(lVar2, ps[iPlayer].pos.Z, sActor, sPlayer); break; case PLAYER_HORIZ: @@ -1541,12 +1541,12 @@ int ParseState::parse(void) parseifelse(ifcanshoottarget(g_ac, g_p, g_x)); break; case concmd_ifcanseetarget: - j = cansee(g_ac->spr.x, g_ac->spr.y, g_ac->spr.z - ((krand() & 41) << 8), g_ac->spr.sector(), ps[g_p].pos.X, ps[g_p].pos.Y, ps[g_p].pos.z/*-((krand()&41)<<8)*/, ps[g_p].GetActor()->sector()); + j = cansee(g_ac->spr.x, g_ac->spr.y, g_ac->spr.z - ((krand() & 41) << 8), g_ac->spr.sector(), ps[g_p].pos.X, ps[g_p].pos.Y, ps[g_p].pos.Z/*-((krand()&41)<<8)*/, ps[g_p].GetActor()->sector()); parseifelse(j); if (j) g_ac->timetosleep = SLEEPTIME; break; case concmd_ifnocover: - j = cansee(g_ac->spr.x, g_ac->spr.y, g_ac->spr.z, g_ac->spr.sector(), ps[g_p].pos.X, ps[g_p].pos.Y, ps[g_p].pos.z, ps[g_p].GetActor()->sector()); + j = cansee(g_ac->spr.x, g_ac->spr.y, g_ac->spr.z, g_ac->spr.sector(), ps[g_p].pos.X, ps[g_p].pos.Y, ps[g_p].pos.Z, ps[g_p].GetActor()->sector()); parseifelse(j); if (j) g_ac->timetosleep = SLEEPTIME; break; @@ -2000,8 +2000,8 @@ int ParseState::parse(void) break; case concmd_larrybird: insptr++; - ps[g_p].pos.z = ps[g_p].GetActor()->sector()->ceilingz; - ps[g_p].GetActor()->spr.z = ps[g_p].pos.z; + ps[g_p].pos.Z = ps[g_p].GetActor()->sector()->ceilingz; + ps[g_p].GetActor()->spr.z = ps[g_p].pos.Z; break; case concmd_destroyit: insptr++; @@ -2068,7 +2068,7 @@ int ParseState::parse(void) ps[g_p].newOwner = nullptr; ps[g_p].pos.X = ps[g_p].oposx; ps[g_p].pos.Y = ps[g_p].oposy; - ps[g_p].pos.z = ps[g_p].oposz; + ps[g_p].pos.Z = ps[g_p].oposz; ps[g_p].angle.restore(); updatesector(ps[g_p].pos.X,ps[g_p].pos.Y,&ps[g_p].cursector); @@ -2247,10 +2247,10 @@ int ParseState::parse(void) pickrandomspot(g_p); g_ac->spr.x = ps[g_p].bobposx = ps[g_p].oposx = ps[g_p].pos.X; g_ac->spr.y = ps[g_p].bobposy = ps[g_p].oposy = ps[g_p].pos.Y; - g_ac->spr.z = ps[g_p].oposz = ps[g_p].pos.z; + g_ac->spr.z = ps[g_p].oposz = ps[g_p].pos.Z; g_ac->spr.backuppos(); updatesector(ps[g_p].pos.X, ps[g_p].pos.Y, &ps[g_p].cursector); - SetActor(ps[g_p].GetActor(), { ps[g_p].pos.X, ps[g_p].pos.Y, ps[g_p].pos.z + gs.playerheight }); + SetActor(ps[g_p].GetActor(), { ps[g_p].pos.X, ps[g_p].pos.Y, ps[g_p].pos.Z + gs.playerheight }); g_ac->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; g_ac->spr.shade = -12; @@ -2424,7 +2424,7 @@ int ParseState::parse(void) j = 1; else if( (l& prunning) && s >= 8 && PlayerInput(g_p, SB_RUN) ) j = 1; - else if( (l& phigher) && ps[g_p].pos.z < (g_ac->spr.z-(48<<8)) ) + else if( (l& phigher) && ps[g_p].pos.Z < (g_ac->spr.z-(48<<8)) ) j = 1; else if( (l& pwalkingback) && s <= -8 && !(PlayerInput(g_p, SB_RUN)) ) j = 1; @@ -2813,7 +2813,7 @@ int ParseState::parse(void) case concmd_pstomp: insptr++; if( ps[g_p].knee_incs == 0 && ps[g_p].GetActor()->spr.xrepeat >= (isRR()? 9: 40) ) - if( cansee(g_ac->spr.x,g_ac->spr.y,g_ac->spr.z-(4<<8),g_ac->spr.sector(),ps[g_p].pos.X,ps[g_p].pos.Y,ps[g_p].pos.z+(16<<8),ps[g_p].GetActor()->spr.sector()) ) + if( cansee(g_ac->spr.x,g_ac->spr.y,g_ac->spr.z-(4<<8),g_ac->spr.sector(),ps[g_p].pos.X,ps[g_p].pos.Y,ps[g_p].pos.Z+(16<<8),ps[g_p].GetActor()->spr.sector()) ) { ps[g_p].knee_incs = 1; if(ps[g_p].weapon_pos == 0) diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 18fcb520b..03ba3f159 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -287,7 +287,7 @@ void hud_input(int plnum) EGS(p->cursector, p->pos.X, p->pos.Y, - p->pos.z + (30 << 8), TILE_APLAYER, -64, 0, 0, p->angle.ang.asbuild(), 0, 0, nullptr, 10); + p->pos.Z + (30 << 8), TILE_APLAYER, -64, 0, 0, p->angle.ang.asbuild(), 0, 0, nullptr, 10); pactor->temp_data[3] = pactor->temp_data[4] = 0; p->holoduke_on = pactor; pactor->spr.yvel = plnum; diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 7279f3890..23e0ee115 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -541,7 +541,7 @@ void playerisdead(int snum, int psectlotag, int fz, int cz) if (actor->spr.pal != 1) { SetPlayerPal(p, PalEntry(63, 63, 0, 0)); - p->pos.z -= (16 << 8); + p->pos.Z -= (16 << 8); actor->spr.z -= (16 << 8); } #if 0 @@ -589,8 +589,8 @@ void playerisdead(int snum, int psectlotag, int fz, int cz) { if (p->on_warping_sector == 0) { - if (abs(p->pos.z - fz) > (gs.playerheight >> 1)) - p->pos.z += 348; + if (abs(p->pos.Z - fz) > (gs.playerheight >> 1)) + p->pos.Z += 348; } else { @@ -611,7 +611,7 @@ void playerisdead(int snum, int psectlotag, int fz, int cz) pushmove(&p->pos, &p->cursector, 128L, (4 << 8), (20 << 8), CLIPMASK0); if (fz > cz + (16 << 8) && actor->spr.pal != 1) - p->angle.rotscrnang = buildang(p->dead_flag + ((fz + p->pos.z) >> 7)); + p->angle.rotscrnang = buildang(p->dead_flag + ((fz + p->pos.Z) >> 7)); p->on_warping_sector = 0; @@ -686,7 +686,7 @@ void playerCrouch(int snum) OnEvent(EVENT_CROUCH, snum, p->GetActor(), -1); if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0) { - p->pos.z += (2048 + 768); + p->pos.Z += (2048 + 768); p->crack_time = CRACK_TIME; } } @@ -754,7 +754,7 @@ void player_struct::backuppos(bool noclipping) pos.Y = oposy; } - oposz = pos.z; + oposz = pos.Z; bobposx = pos.X; bobposy = pos.Y; opyoff = pyoff; @@ -1030,7 +1030,7 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i spawned->spr.ang = getangle(-delta.X, -delta.Y) + 512; // note the '-' sign here! spawned->spr.x = hit.hitpos.X; spawned->spr.y = hit.hitpos.Y; - spawned->spr.z = hit.hitpos.z; + spawned->spr.z = hit.hitpos.Z; spawned->spr.cstat |= randomXFlip(); ssp(spawned, CLIPMASK0); SetActor(spawned, spawned->spr.pos); diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 5c7a447b7..1685fabe9 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -257,7 +257,7 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) { if (hit.hitWall || hit.actor()) { - auto knee = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4); + auto knee = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4); if (knee) { knee->spr.extra += (krand() & 7); @@ -281,12 +281,12 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) { if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP) if (hit.hitWall->twoSided()) - if (hit.hitpos.z >= (hit.hitWall->nextSector()->floorz)) + if (hit.hitpos.Z >= (hit.hitWall->nextSector()->floorz)) hit.hitWall =hit.hitWall->nextWall(); if (hit.hitWall->picnum != ACCESSSWITCH && hit.hitWall->picnum != ACCESSSWITCH2) { - fi.checkhitwall(knee, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, KNEE); + fi.checkhitwall(knee, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, KNEE); if (p >= 0) fi.checkhitswitch(p, hit.hitWall, nullptr); } } @@ -386,7 +386,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa int x; int j = findplayer(actor, &x); sz -= (4 << 8); - zvel = ((ps[j].pos.z - sz) << 8) / (ldist(ps[j].GetActor(), actor)); + zvel = ((ps[j].pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor)); if (actor->spr.picnum != BOSS1) { zvel += 128 - (krand() & 255); @@ -407,12 +407,12 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa if (hit.hitSector == nullptr) return; if ((krand() & 15) == 0 && hit.hitSector->lotag == 2) - tracers(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, sx, sy, sz, 8 - (ud.multimode >> 1)); + tracers(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, sx, sy, sz, 8 - (ud.multimode >> 1)); DDukeActor* spark; if (p >= 0) { - spark = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4); + spark = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4); if (!spark) return; spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress]; @@ -525,15 +525,15 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP) if (hit.hitWall->twoSided()) - if (hit.hitpos.z >= (hit.hitWall->nextSector()->floorz)) + if (hit.hitpos.Z >= (hit.hitWall->nextSector()->floorz)) hit.hitWall = hit.hitWall->nextWall(); - fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SHOTSPARK1); + fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTSPARK1); } } else { - spark = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4); + spark = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4); if (spark) { spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress]; @@ -546,13 +546,13 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa else spark->spr.xrepeat = spark->spr.yrepeat = 0; } else if (hit.hitWall) - fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SHOTSPARK1); + fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTSPARK1); } } if ((krand() & 255) < 4) { - vec3_t v{ hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z }; + vec3_t v{ hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z }; S_PlaySound3D(PISTOL_RICOCHET, spark, &v); } } @@ -871,7 +871,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) if (j == 1) { - auto bomb = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, TRIPBOMB, -16, 4, 5, sa, 0, 0, actor, 6); + auto bomb = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, TRIPBOMB, -16, 4, 5, sa, 0, 0, actor, 6); if (!bomb) return; if (isWW2GI()) { @@ -954,7 +954,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int int x; int j = findplayer(actor, &x); sz -= (4 << 8); - zvel = ((ps[j].pos.z - sz) << 8) / (ldist(ps[j].GetActor(), actor)); + zvel = ((ps[j].pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor)); zvel += 128 - (krand() & 255); sa += 32 - (krand() & 63); } @@ -968,7 +968,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int actor->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; - auto spark = EGS(sect, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, GROWSPARK, -16, 28, 28, sa, 0, 0, actor, 1); + auto spark = EGS(sect, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, GROWSPARK, -16, 28, 28, sa, 0, 0, actor, 1); if (!spark) return; spark->spr.pal = 2; @@ -985,7 +985,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int { if (hit.hitWall->picnum != ACCESSSWITCH && hit.hitWall->picnum != ACCESSSWITCH2) { - fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, GROWSPARK); + fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, GROWSPARK); } } } @@ -1025,7 +1025,7 @@ void shoot_d(DDukeActor* actor, int atwith) { sx = ps[p].pos.X; sy = ps[p].pos.Y; - sz = ps[p].pos.z + ps[p].pyoff + (4 << 8); + sz = ps[p].pos.Z + ps[p].pyoff + (4 << 8); sa = ps[p].angle.ang.asbuild(); ps[p].crack_time = CRACK_TIME; @@ -1691,7 +1691,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz, if (p->jetpack_on < 11) { p->jetpack_on++; - p->pos.z -= (p->jetpack_on << 7); //Goin up + p->pos.Z -= (p->jetpack_on << 7); //Goin up } else if (p->jetpack_on == 11 && !S_CheckActorSoundPlaying(pact, DUKE_JETPACK_IDLE)) S_PlayActorSound(DUKE_JETPACK_IDLE, pact); @@ -1706,7 +1706,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz, OnEvent(EVENT_SOARUP, snum, p->GetActor(), -1); if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0) { - p->pos.z -= j; + p->pos.Z -= j; p->crack_time = CRACK_TIME; } } @@ -1718,7 +1718,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz, OnEvent(EVENT_SOARDOWN, snum, p->GetActor(), -1); if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0) { - p->pos.z += j; + p->pos.Z += j; p->crack_time = CRACK_TIME; } } @@ -1730,10 +1730,10 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz, if (psectlotag != 2 && p->scuba_on == 1) p->scuba_on = 0; - if (p->pos.z > (fz - (k << 8))) - p->pos.z += ((fz - (k << 8)) - p->pos.z) >> 1; - if (p->pos.z < (pact->ceilingz + (18 << 8))) - p->pos.z = pact->ceilingz + (18 << 8); + if (p->pos.Z > (fz - (k << 8))) + p->pos.Z += ((fz - (k << 8)) - p->pos.Z) >> 1; + if (p->pos.Z < (pact->ceilingz + (18 << 8))) + p->pos.Z = pact->ceilingz + (18 << 8); } @@ -1787,12 +1787,12 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int footprints(snum); } - if (p->pos.z < (fz - (i << 8))) //falling + if (p->pos.Z < (fz - (i << 8))) //falling { // not jumping or crouching - if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->pos.z >= (fz - (i << 8) - (16 << 8))) - p->pos.z = fz - (i << 8); + if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->pos.Z >= (fz - (i << 8) - (16 << 8))) + p->pos.Z = fz - (i << 8); else { p->on_ground = 0; @@ -1805,7 +1805,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int S_PlayActorSound(DUKE_SCREAM, pact); } - if ((p->pos.z + p->poszv) >= (fz - (i << 8))) // hit the ground + if ((p->pos.Z + p->poszv) >= (fz - (i << 8))) // hit the ground { S_StopSound(DUKE_SCREAM, pact); if (!p->insector() || p->cursector->lotag != 1) @@ -1849,18 +1849,18 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int { //Smooth on the ground - int k = ((fz - (i << 8)) - p->pos.z) >> 1; + int k = ((fz - (i << 8)) - p->pos.Z) >> 1; if (abs(k) < 256) k = 0; - p->pos.z += k; + p->pos.Z += k; p->poszv -= 768; if (p->poszv < 0) p->poszv = 0; } else if (p->jumping_counter == 0) { - p->pos.z += ((fz - (i << 7)) - p->pos.z) >> 1; //Smooth on the water - if (p->on_warping_sector == 0 && p->pos.z > fz - (16 << 8)) + p->pos.Z += ((fz - (i << 7)) - p->pos.Z) >> 1; //Smooth on the water + if (p->on_warping_sector == 0 && p->pos.Z > fz - (16 << 8)) { - p->pos.z = fz - (16 << 8); + p->pos.Z = fz - (16 << 8); p->poszv >>= 1; } } @@ -1911,15 +1911,15 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int } } - p->pos.z += p->poszv; + p->pos.Z += p->poszv; - if (p->pos.z < (cz + (4 << 8))) + if (p->pos.Z < (cz + (4 << 8))) { p->jumping_counter = 0; if (p->poszv < 0) p->posxv = p->posyv = 0; p->poszv = 128; - p->pos.z = cz + (4 << 8); + p->pos.Z = cz + (4 << 8); } } @@ -1978,14 +1978,14 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz) if (p->poszv > 2048) p->poszv >>= 1; - p->pos.z += p->poszv; + p->pos.Z += p->poszv; - if (p->pos.z > (fz - (15 << 8))) - p->pos.z += ((fz - (15 << 8)) - p->pos.z) >> 1; + if (p->pos.Z > (fz - (15 << 8))) + p->pos.Z += ((fz - (15 << 8)) - p->pos.Z) >> 1; - if (p->pos.z < (cz + (4 << 8))) + if (p->pos.Z < (cz + (4 << 8))) { - p->pos.z = cz + (4 << 8); + p->pos.Z = cz + (4 << 8); p->poszv = 0; } @@ -1998,7 +1998,7 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz) j->spr.y += bsin(p->angle.ang.asbuild() + 64 - (global_random & 128), -6); j->spr.xrepeat = 3; j->spr.yrepeat = 2; - j->spr.z = p->pos.z + (8 << 8); + j->spr.z = p->pos.Z + (8 << 8); } } } @@ -2031,7 +2031,7 @@ int operateTripbomb(int snum) while ((act = it.Next())) { if (act->spr.picnum == TRIPBOMB && - abs(act->spr.z - hit.hitpos.z) < (12 << 8) && ((act->spr.x - hit.hitpos.X) * (act->spr.x - hit.hitpos.X) + (act->spr.y - hit.hitpos.Y) * (act->spr.y - hit.hitpos.Y)) < (290 * 290)) + abs(act->spr.z - hit.hitpos.Z) < (12 << 8) && ((act->spr.x - hit.hitpos.X) * (act->spr.x - hit.hitpos.X) + (act->spr.y - hit.hitpos.Y) * (act->spr.y - hit.hitpos.Y)) < (290 * 290)) return 0; } @@ -2039,7 +2039,7 @@ int operateTripbomb(int snum) if ((hit.hitWall->twoSided() && hit.hitWall->nextSector()->lotag <= 2) || (!hit.hitWall->twoSided() && hit.hitSector->lotag <= 2)) if (((hit.hitpos.X - p->pos.X) * (hit.hitpos.X - p->pos.X) + (hit.hitpos.Y - p->pos.Y) * (hit.hitpos.Y - p->pos.Y)) < (290 * 290)) { - p->pos.z = p->oposz; + p->pos.Z = p->oposz; p->poszv = 0; return 1; } @@ -2206,7 +2206,7 @@ static void operateweapon(int snum, ESyncBits actions) auto spawned = EGS(p->cursector, p->pos.X + p->angle.ang.bcos(-6), p->pos.Y + p->angle.ang.bsin(-6), - p->pos.z, HEAVYHBOMB, -16, 9, 9, + p->pos.Z, HEAVYHBOMB, -16, 9, 9, p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, pact, 1); if (isNam()) @@ -2579,7 +2579,7 @@ static void operateweapon(int snum, ESyncBits actions) case TRIPBOMB_WEAPON: // Claymore in NAM if (p->kickback_pic < 4) { - p->pos.z = p->oposz; + p->pos.Z = p->oposz; p->poszv = 0; if (p->kickback_pic == 3) fi.shoot(pact, HANDHOLDINGLASER); @@ -2750,7 +2750,7 @@ void processinput_d(int snum) p->truefz = j; p->truecz = getceilzofslopeptr(psectp, p->pos.X, p->pos.Y); - truefdist = abs(p->pos.z - j); + truefdist = abs(p->pos.Z - j); if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8)) psectlotag = 0; @@ -3028,7 +3028,7 @@ HORIZONLY: clipmove(p->pos, &p->cursector, p->posxv, p->posyv, 164, (4 << 8), ii, CLIPMASK0, clip); if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk) - p->pos.z += 32 << 8; + p->pos.Z += 32 << 8; if (clip.type != kHitNone) checkplayerhurt_d(p, clip); @@ -3049,7 +3049,7 @@ HORIZONLY: } // RBG*** - SetActor(pact, { p->pos.X, p->pos.Y, p->pos.z + gs.playerheight }); + SetActor(pact, { p->pos.X, p->pos.Y, p->pos.Z + gs.playerheight }); if (psectlotag < 3) { diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 3f5f5c100..67e82c6fd 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -140,13 +140,13 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, DDukeActor* wpn; if (isRRRA() && atwith == SLINGBLADE) { - wpn = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SLINGBLADE, -15, 0, 0, sa, 32, 0, actor, 4); + wpn = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SLINGBLADE, -15, 0, 0, sa, 32, 0, actor, 4); if (!wpn) return; wpn->spr.extra += 50; } else { - wpn = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4); + wpn = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4); if (!wpn) return; wpn->spr.extra += (krand() & 7); } @@ -170,12 +170,12 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, { if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP) if (hit.hitWall->twoSided()) - if (hit.hitpos.z >= (hit.hitWall->nextSector()->floorz)) + if (hit.hitpos.Z >= (hit.hitWall->nextSector()->floorz)) hit.hitWall = hit.hitWall->nextWall(); if (hit.hitWall->picnum != ACCESSSWITCH && hit.hitWall->picnum != ACCESSSWITCH2) { - fi.checkhitwall(wpn, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, atwith); + fi.checkhitwall(wpn, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, atwith); if (p >= 0) fi.checkhitswitch(p, hit.hitWall, nullptr); } } @@ -245,7 +245,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa int x; int j = findplayer(actor, &x); sz -= (4 << 8); - zvel = ((ps[j].pos.z - sz) << 8) / (ldist(ps[j].GetActor(), actor)); + zvel = ((ps[j].pos.Z - sz) << 8) / (ldist(ps[j].GetActor(), actor)); if (actor->spr.picnum != BOSS1) { zvel += 128 - (krand() & 255); @@ -297,12 +297,12 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa return; if ((krand() & 15) == 0 && hit.hitSector->lotag == 2) - tracers(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, sx, sy, sz, 8 - (ud.multimode >> 1)); + tracers(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, sx, sy, sz, 8 - (ud.multimode >> 1)); DDukeActor* spark; if (p >= 0) { - spark = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4); + spark = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4); if (!spark) return; spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress]; spark->spr.extra += (krand() % 6); @@ -421,15 +421,15 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP) if (hit.hitWall->twoSided()) - if (hit.hitpos.z >= (hit.hitWall->nextSector()->floorz)) + if (hit.hitpos.Z >= (hit.hitWall->nextSector()->floorz)) hit.hitWall = hit.hitWall->nextWall(); - fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SHOTSPARK1); + fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTSPARK1); } } else { - spark = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4); + spark = EGS(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4); if (!spark) return; spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress]; @@ -441,12 +441,12 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa else spark->spr.xrepeat = spark->spr.yrepeat = 0; } else if (hit.hitWall != nullptr) - fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SHOTSPARK1); + fi.checkhitwall(spark, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTSPARK1); } if ((krand() & 255) < 10) { - vec3_t v{ hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z }; + vec3_t v{ hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z }; S_PlaySound3D(PISTOL_RICOCHET, spark, &v); } } @@ -839,7 +839,7 @@ void shoot_r(DDukeActor* actor, int atwith) sx = ps[p].pos.X; sy = ps[p].pos.Y; - sz = ps[p].pos.z + ps[p].pyoff + (4 << 8); + sz = ps[p].pos.Z + ps[p].pyoff + (4 << 8); sa = ps[p].angle.ang.asbuild(); if (isRRRA()) ps[p].crack_time = CRACK_TIME; @@ -2112,15 +2112,15 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int footprints(snum); } - if (p->pos.z < (fz - (i << 8))) //falling + if (p->pos.Z < (fz - (i << 8))) //falling { - if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->pos.z >= (fz - (i << 8) - (16 << 8))) - p->pos.z = fz - (i << 8); + if ((actions & (SB_JUMP|SB_CROUCH)) == 0 && p->on_ground && (psect->floorstat & CSTAT_SECTOR_SLOPE) && p->pos.Z >= (fz - (i << 8) - (16 << 8))) + p->pos.Z = fz - (i << 8); else { p->on_ground = 0; - if ((p->OnMotorcycle || p->OnBoat) && fz - (i << 8) * 2 > p->pos.z) + if ((p->OnMotorcycle || p->OnBoat) && fz - (i << 8) * 2 > p->pos.Z) { if (p->MotoOnGround) { @@ -2150,7 +2150,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int S_PlayActorSound(DUKE_SCREAM, pact); } - if ((p->pos.z + p->poszv) >= (fz - (i << 8))) // hit the ground + if ((p->pos.Z + p->poszv) >= (fz - (i << 8))) // hit the ground { S_StopSound(DUKE_SCREAM, pact); if (!p->insector() || p->cursector->lotag != 1) @@ -2210,18 +2210,18 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int { //Smooth on the ground - int k = ((fz - (i << 8)) - p->pos.z) >> 1; + int k = ((fz - (i << 8)) - p->pos.Z) >> 1; if (abs(k) < 256) k = 0; - p->pos.z += k; + p->pos.Z += k; p->poszv -= 768; if (p->poszv < 0) p->poszv = 0; } else if (p->jumping_counter == 0) { - p->pos.z += ((fz - (i << 7)) - p->pos.z) >> 1; //Smooth on the water - if (p->on_warping_sector == 0 && p->pos.z > fz - (16 << 8)) + p->pos.Z += ((fz - (i << 7)) - p->pos.Z) >> 1; //Smooth on the water + if (p->on_warping_sector == 0 && p->pos.Z > fz - (16 << 8)) { - p->pos.z = fz - (16 << 8); + p->pos.Z = fz - (16 << 8); p->poszv >>= 1; } } @@ -2268,15 +2268,15 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, int fz, int } } - p->pos.z += p->poszv; + p->pos.Z += p->poszv; - if (p->pos.z < (cz + (4 << 8))) + if (p->pos.Z < (cz + (4 << 8))) { p->jumping_counter = 0; if (p->poszv < 0) p->posxv = p->posyv = 0; p->poszv = 128; - p->pos.z = cz + (4 << 8); + p->pos.Z = cz + (4 << 8); } } @@ -2331,14 +2331,14 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz) if (p->poszv > 2048) p->poszv >>= 1; - p->pos.z += p->poszv; + p->pos.Z += p->poszv; - if (p->pos.z > (fz - (15 << 8))) - p->pos.z += ((fz - (15 << 8)) - p->pos.z) >> 1; + if (p->pos.Z > (fz - (15 << 8))) + p->pos.Z += ((fz - (15 << 8)) - p->pos.Z) >> 1; - if (p->pos.z < (cz + (4 << 8))) + if (p->pos.Z < (cz + (4 << 8))) { - p->pos.z = cz + (4 << 8); + p->pos.Z = cz + (4 << 8); p->poszv = 0; } @@ -2351,7 +2351,7 @@ static void underwater(int snum, ESyncBits actions, int fz, int cz) j->spr.y += bsin(p->angle.ang.asbuild() + 64 - (global_random & 128) + 128, -6); j->spr.xrepeat = 3; j->spr.yrepeat = 2; - j->spr.z = p->pos.z + (8 << 8); + j->spr.z = p->pos.Z + (8 << 8); j->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT; } } @@ -2745,7 +2745,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp) auto spawned = EGS(p->cursector, p->pos.X + p->angle.ang.bcos(-6), p->pos.Y + p->angle.ang.bsin(-6), - p->pos.z, HEAVYHBOMB, -16, 9, 9, + p->pos.Z, HEAVYHBOMB, -16, 9, 9, p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)) * 2, i, pact, 1); if (spawned) @@ -3161,7 +3161,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp) EGS(p->cursector, p->pos.X + p->angle.ang.bcos(-6), p->pos.Y + p->angle.ang.bsin(-6), - p->pos.z, TRIPBOMBSPRITE, -16, 9, 9, + p->pos.Z, TRIPBOMBSPRITE, -16, 9, 9, p->angle.ang.asbuild(), k * 2, i, pact, 1); } p->kickback_pic++; @@ -3378,7 +3378,7 @@ void processinput_r(int snum) while (auto act2 = it.Next()) { if (act2->spr.picnum == RRTILE380) - if (act2->spr.z - (8 << 8) < p->pos.z) + if (act2->spr.z - (8 << 8) < p->pos.Z) psectlotag = 2; } } @@ -3411,7 +3411,7 @@ void processinput_r(int snum) p->truefz = tempfz; p->truecz = getceilzofslopeptr(psectp, p->pos.X, p->pos.Y); - truefdist = abs(p->pos.z - tempfz); + truefdist = abs(p->pos.Z - tempfz); if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8)) psectlotag = 0; @@ -3787,7 +3787,7 @@ HORIZONLY: clipmove(p->pos, &p->cursector, p->posxv, p->posyv, 164, (4 << 8), i, CLIPMASK0, clip); if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk) - p->pos.z += 32 << 8; + p->pos.Z += 32 << 8; if (clip.type != kHitNone) checkplayerhurt_r(p, clip); @@ -3881,7 +3881,7 @@ HORIZONLY: } // RBG*** - SetActor(pact, { p->pos.X, p->pos.Y, p->pos.z + gs.playerheight }); + SetActor(pact, { p->pos.X, p->pos.Y, p->pos.Z + gs.playerheight }); if (psectlotag == 800 && (!isRRRA() || !p->lotag800kill)) { diff --git a/source/games/duke/src/player_w.cpp b/source/games/duke/src/player_w.cpp index d505ecb56..3b71c32b0 100644 --- a/source/games/duke/src/player_w.cpp +++ b/source/games/duke/src/player_w.cpp @@ -344,7 +344,7 @@ void operateweapon_ww(int snum, ESyncBits actions) auto j = EGS(p->cursector, p->pos.X + p->angle.ang.bcos(-6), p->pos.Y + p->angle.ang.bsin(-6), - p->pos.z, HEAVYHBOMB, -16, 9, 9, + p->pos.Z, HEAVYHBOMB, -16, 9, 9, p->angle.ang.asbuild(), (k + (p->hbomb_hold_delay << 5)), i, p->GetActor(), 1); if (j) @@ -439,7 +439,7 @@ void operateweapon_ww(int snum, ESyncBits actions) if (aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_STANDSTILL && p->kickback_pic < (aplWeaponFireDelay(p->curr_weapon, snum) + 1)) { - p->pos.z = p->oposz; + p->pos.Z = p->oposz; p->poszv = 0; } if (p->kickback_pic == aplWeaponSound2Time(p->curr_weapon, snum)) diff --git a/source/games/duke/src/prediction.cpp b/source/games/duke/src/prediction.cpp index 63d80f086..0f4682319 100644 --- a/source/games/duke/src/prediction.cpp +++ b/source/games/duke/src/prediction.cpp @@ -52,7 +52,7 @@ void resetmys() { myx = omyx = ps[myconnectindex].pos.X; myy = omyy = ps[myconnectindex].pos.Y; - myz = omyz = ps[myconnectindex].pos.z; + myz = omyz = ps[myconnectindex].pos.Z; myxvel = myyvel = myzvel = 0; myang = ps[myconnectindex].angle.ang; myhoriz = omyhoriz = ps[myconnectindex].horizon.horiz; diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index aa99d38aa..343c9a710 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -62,7 +62,7 @@ void pickrandomspot(int snum) p->bobposx = p->oposx = p->pos.X = po[i].ox; p->bobposy = p->oposy = p->pos.Y = po[i].oy; - p->oposz = p->pos.z = po[i].oz; + p->oposz = p->pos.Z = po[i].oz; p->angle.oang = p->angle.ang = buildang(po[i].oa); p->setCursector(po[i].os); } @@ -507,7 +507,7 @@ void resetpspritevars(int g) int aimmode[MAXPLAYERS]; STATUSBARTYPE tsbar[MAXPLAYERS]; - EGS(ps[0].cursector, ps[0].pos.X, ps[0].pos.Y, ps[0].pos.z, + EGS(ps[0].cursector, ps[0].pos.X, ps[0].pos.Y, ps[0].pos.Z, TILE_APLAYER, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, nullptr, 10); if (ud.recstat != 2) for (i = 0; i < MAXPLAYERS; i++) @@ -627,7 +627,7 @@ void resetpspritevars(int g) ps[j].bobposx = ps[j].oposx = ps[j].pos.X = act->spr.x; ps[j].bobposy = ps[j].oposy = ps[j].pos.Y = act->spr.y; - ps[j].oposz = ps[j].pos.z = act->spr.z; + ps[j].oposz = ps[j].pos.Z = act->spr.z; act->spr.backuppos(); ps[j].angle.oang = ps[j].angle.ang = buildang(act->spr.ang); diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 59ccdf945..1c31dac4c 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -329,7 +329,7 @@ void displayrooms(int snum, double smoothratio) { cposx = interpolatedvalue(p->oposx, p->pos.X, smoothratio); cposy = interpolatedvalue(p->oposy, p->pos.Y, smoothratio); - cposz = interpolatedvalue(p->oposz, p->pos.z, smoothratio);; + cposz = interpolatedvalue(p->oposz, p->pos.Z, smoothratio);; if (SyncInput()) { // Original code for when the values are passed through the sync struct @@ -352,7 +352,7 @@ void displayrooms(int snum, double smoothratio) choriz = buildhoriz(spr->shade); cposx = spr->pos.X; cposy = spr->pos.Y; - cposz = spr->pos.z; + cposz = spr->pos.Z; sect = spr->sector(); rotscrnang = buildang(0); smoothratio = MaxSmoothRatio; diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index ff02fd547..e7d721f24 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -109,7 +109,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w, { arc("posx", w.pos.X) ("posy", w.pos.Y) - ("posz", w.pos.z) + ("posz", w.pos.Z) ("angle", w.angle) ("horizon", w.horizon) .Array("gotweapon", w.gotweapon, MAX_WEAPONS) @@ -279,7 +279,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w, w.invdisptime = 0; w.oposx = w.pos.X; w.oposy = w.pos.Y; - w.oposz = w.pos.z; + w.oposz = w.pos.Z; w.opyoff = w.pyoff; w.oweapon_sway = w.weapon_sway; w.oweapon_pos = w.weapon_pos; diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index 03ff98635..cad6fdc2a 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -220,7 +220,7 @@ int findplayer(const DDukeActor* actor, int* d) if (ud.multimode < 2) { - if (d) *d = abs(ps[myconnectindex].oposx - s->X) + abs(ps[myconnectindex].oposy - s->Y) + ((abs(ps[myconnectindex].oposz - s->z + (28 << 8))) >> 4); + if (d) *d = abs(ps[myconnectindex].oposx - s->X) + abs(ps[myconnectindex].oposy - s->Y) + ((abs(ps[myconnectindex].oposz - s->Z + (28 << 8))) >> 4); return myconnectindex; } @@ -229,7 +229,7 @@ int findplayer(const DDukeActor* actor, int* d) for (j = connecthead; j >= 0; j = connectpoint2[j]) { - x = abs(ps[j].oposx - s->X) + abs(ps[j].oposy - s->Y) + ((abs(ps[j].oposz - s->z + (28 << 8))) >> 4); + x = abs(ps[j].oposx - s->X) + abs(ps[j].oposy - s->Y) + ((abs(ps[j].oposz - s->Z + (28 << 8))) >> 4); if (x < closest && ps[j].GetActor()->spr.extra > 0) { closest_player = j; @@ -258,7 +258,7 @@ int findotherplayer(int p, int* d) for (j = connecthead; j >= 0; j = connectpoint2[j]) if (p != j && ps[j].GetActor()->spr.extra > 0) { - x = abs(ps[j].oposx - ps[p].pos.X) + abs(ps[j].oposy - ps[p].pos.Y) + (abs(ps[j].oposz - ps[p].pos.z) >> 4); + x = abs(ps[j].oposx - ps[p].pos.X) + abs(ps[j].oposy - ps[p].pos.Y) + (abs(ps[j].oposz - ps[p].pos.Z) >> 4); if (x < closest) { @@ -347,10 +347,10 @@ void doanimations(void) { for (p = connecthead; p >= 0; p = connectpoint2[p]) if (ps[p].cursector == dasectp) - if ((dasectp->floorz - ps[p].pos.z) < (64 << 8)) + if ((dasectp->floorz - ps[p].pos.Z) < (64 << 8)) if (ps[p].GetActor()->GetOwner() != nullptr) { - ps[p].pos.z += v; + ps[p].pos.Z += v; ps[p].poszv = 0; } diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index d91e10edc..9685bce9f 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -482,7 +482,7 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act) return 1; } - vec3_t v = { sx, sy, ps[snum].pos.z }; + vec3_t v = { sx, sy, ps[snum].pos.Z }; switch (picnum) { default: @@ -934,7 +934,7 @@ void checkplayerhurt_d(struct player_struct* p, const Collision& coll) fi.checkhitwall(p->GetActor(), wal, p->pos.X + p->angle.ang.bcos(-9), p->pos.Y + p->angle.ang.bsin(-9), - p->pos.z, -1); + p->pos.Z, -1); break; @@ -943,7 +943,7 @@ void checkplayerhurt_d(struct player_struct* p, const Collision& coll) fi.checkhitwall(p->GetActor(), wal, p->pos.X + p->angle.ang.bcos(-9), p->pos.Y + p->angle.ang.bsin(-9), - p->pos.z, -1); + p->pos.Z, -1); break; } @@ -1466,7 +1466,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj) ps[p].newOwner = nullptr; ps[p].pos.X = ps[p].oposx; ps[p].pos.Y = ps[p].oposy; - ps[p].pos.z = ps[p].oposz; + ps[p].pos.Z = ps[p].oposz; ps[p].angle.restore(); updatesector(ps[p].pos.X, ps[p].pos.Y, &ps[p].cursector); @@ -1504,7 +1504,7 @@ void clearcameras(int i, player_struct* p) { p->pos.X = p->oposx; p->pos.Y = p->oposy; - p->pos.z = p->oposz; + p->pos.Z = p->oposz; p->newOwner = nullptr; updatesector(p->pos.X, p->pos.Y, &p->cursector); @@ -1621,12 +1621,12 @@ void checksectors_d(int snum) { neartag(p->pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr) - neartag({ p->pos.X, p->pos.Y, p->pos.z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); + neartag({ p->pos.X, p->pos.Y, p->pos.Z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr) - neartag({ p->pos.X, p->pos.Y, p->pos.z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); + neartag({ p->pos.X, p->pos.Y, p->pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr) { - neartag({ p->pos.X, p->pos.Y, p->pos.z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3); + neartag({ p->pos.X, p->pos.Y, p->pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3); if (near.actor() != nullptr) { switch (near.actor()->spr.picnum) diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 564868775..865a6d1f7 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -681,7 +681,7 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act) setnextmap(false); } - vec3_t v = { sx, sy, ps[snum].pos.z }; + vec3_t v = { sx, sy, ps[snum].pos.Z }; switch (picnum) { default: @@ -1424,7 +1424,7 @@ void checkplayerhurt_r(struct player_struct* p, const Collision &coll) fi.checkhitwall(p->GetActor(), wal, p->pos.X + p->angle.ang.bcos(-9), p->pos.Y + p->angle.ang.bsin(-9), - p->pos.z, -1); + p->pos.Z, -1); break; } @@ -2414,7 +2414,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj) ps[p].newOwner = nullptr; ps[p].pos.X = ps[p].oposx; ps[p].pos.Y = ps[p].oposy; - ps[p].pos.z = ps[p].oposz; + ps[p].pos.Z = ps[p].oposz; updatesector(ps[p].pos.X, ps[p].pos.Y, &ps[p].cursector); @@ -2574,12 +2574,12 @@ void checksectors_r(int snum) { neartag(p->pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr) - neartag({ p->pos.X, p->pos.Y, p->pos.z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); + neartag({ p->pos.X, p->pos.Y, p->pos.Z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr) - neartag({ p->pos.X, p->pos.Y, p->pos.z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); + neartag({ p->pos.X, p->pos.Y, p->pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1); if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr) { - neartag({ p->pos.X, p->pos.Y, p->pos.z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3); + neartag({ p->pos.X, p->pos.Y, p->pos.Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 3); if (near.actor() != nullptr) { switch (near.actor()->spr.picnum) diff --git a/source/games/duke/src/sounds.cpp b/source/games/duke/src/sounds.cpp index 01c501848..2007f5c64 100644 --- a/source/games/duke/src/sounds.cpp +++ b/source/games/duke/src/sounds.cpp @@ -276,7 +276,7 @@ static int GetPositionInfo(DDukeActor* actor, int soundNum, sectortype* sect, sndist += dist_adjust; if (sndist < 0) sndist = 0; - if (sect!= nullptr && sndist && actor->spr.picnum != MUSICANDSFX && !cansee(cam->X, cam->Y, cam->z - (24 << 8), sect, actor->spr.x, actor->spr.y, actor->spr.z - (24 << 8), actor->spr.sector())) + if (sect!= nullptr && sndist && actor->spr.picnum != MUSICANDSFX && !cansee(cam->X, cam->Y, cam->Z - (24 << 8), sect, actor->spr.x, actor->spr.y, actor->spr.z - (24 << 8), actor->spr.sector())) sndist += sndist >> (isRR() ? 2 : 5); // Here the sound distance was clamped to a minimum of 144*4. @@ -369,7 +369,7 @@ void DukeSoundEngine::CalcPosVel(int type, const void* source, const float pt[3] } if ((chanflags & CHANF_LISTENERZ) && campos != nullptr && type != SOURCE_None) { - pos->Y = campos->z / 256.f; + pos->Y = campos->Z / 256.f; } } } diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index f38798467..54c19eb9a 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -437,7 +437,7 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell) a = ps[snum].angle.ang.asbuild() - (krand() & 63) + 8; //Fine tune t[0] = krand() & 1; - act->spr.z = (3 << 8) + ps[snum].pyoff + ps[snum].pos.z - (ps[snum].horizon.sum().asq16() >> 12) + (!isshell ? (3 << 8) : 0); + act->spr.z = (3 << 8) + ps[snum].pyoff + ps[snum].pos.Z - (ps[snum].horizon.sum().asq16() >> 12) + (!isshell ? (3 << 8) : 0); act->spr.zvel = -(krand() & 255); } else diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 48dbb7f00..dd0721371 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -464,7 +464,7 @@ MOVEEND: hitscan(startPos, pSprite->sector(), { bcos(pSprite->ang), bsin(pSprite->ang), dz }, hit, CLIPMASK1); x2 = hit.hitpos.X; y2 = hit.hitpos.Y; - z2 = hit.hitpos.z; + z2 = hit.hitpos.Z; hitactor = hit.actor(); pHitSect = hit.hitSector; pHitWall = hit.hitWall; diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index 2f5f15f06..882c8ab70 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -272,7 +272,7 @@ Collision CheckCloseRange(int nPlayer, int *x, int *y, int *z, sectortype* *ppSe *x = hit.hitpos.X; *y = hit.hitpos.Y; - *z = hit.hitpos.z; + *z = hit.hitpos.Z; *ppSector = hit.hitSector; if (hit.actor()) { diff --git a/source/games/exhumed/src/init.cpp b/source/games/exhumed/src/init.cpp index 5246a7c86..7797bf94f 100644 --- a/source/games/exhumed/src/init.cpp +++ b/source/games/exhumed/src/init.cpp @@ -144,7 +144,7 @@ uint8_t LoadLevel(MapRecord* map) loadMap(currentLevel->fileName, 0, &startPos, &inita, &initsect, spawned); initx = startPos.X; inity = startPos.Y; - initz = startPos.z; + initz = startPos.Z; initsectp = §or[initsect]; auto actors = spawnactors(spawned); diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index edc3a01ce..8d462fe60 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -374,7 +374,7 @@ Collision movespritez(DExhumedActor* pActor, int z, int height, int, int clipdis // This function will keep the player from falling off cliffs when you're too close to the edge. // This function finds the highest and lowest z coordinates that your clipping BOX can get to. vec3_t pos = pSprite->pos; - pos.z -= 256; + pos.Z -= 256; getzrange(pos, pSprite->sector(), &sprceiling, hiHit, &sprfloor, loHit, 128, CLIPMASK0); int mySprfloor = sprfloor; @@ -915,14 +915,14 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) if (nSectFlag & kSectUnderwater) { nZVal = pSector->ceilingz; - pos.z = pNextSector->ceilingz + 256; + pos.Z = pNextSector->ceilingz + 256; pSector->ceilingz = pNextSector->ceilingz; } else { nZVal = pSector->floorz; - pos.z = pNextSector->floorz - 256; + pos.Z = pNextSector->floorz - 256; pSector->floorz = pNextSector->floorz; } @@ -1004,9 +1004,9 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) } else { - pos.z = sp->z; + pos.Z = sp->z; - if ((nSectFlag & kSectUnderwater) || pos.z != nZVal || sp->cstat & CSTAT_SPRITE_INVISIBLE) + if ((nSectFlag & kSectUnderwater) || pos.Z != nZVal || sp->cstat & CSTAT_SPRITE_INVISIBLE) { pos.X = sp->x; pos.Y = sp->y; @@ -1272,7 +1272,7 @@ void WheresMyMouth(int nPlayer, vec3_t* pos, sectortype **sectnum) *sectnum = pSprite->sector(); *pos = pSprite->pos; - pos->z -= height; + pos->Z -= height; Collision scratch; clipmove(*pos, sectnum, diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index e053cbef7..918f0c1f0 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -164,7 +164,7 @@ void BuildSnake(int nPlayer, int zVal) auto pSprite = &pActor->s(); pSprite->x = hit.hitpos.X; pSprite->y = hit.hitpos.Y; - pSprite->z = hit.hitpos.z; + pSprite->z = hit.hitpos.Z; ExplodeSnakeSprite(pActor, nPlayer); DeleteActor(pActor); diff --git a/source/games/sw/src/mclip.cpp b/source/games/sw/src/mclip.cpp index 9e93d51f0..9557c1c67 100644 --- a/source/games/sw/src/mclip.cpp +++ b/source/games/sw/src/mclip.cpp @@ -94,7 +94,7 @@ Collision MultiClipMove(PLAYERp pp, int z, int floor_dist) { // save off the start position opos[i] = pos[i] = spos; - pos[i].z = z; + pos[i].Z = z; // move the box clipmove(pos[i], &pp->cursector, pp->xvect, pp->yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER, coll); diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index ffa3212fc..293615f23 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1286,7 +1286,7 @@ void DoPlayerTeleportToSprite(PLAYERp pp, vec3_t* sp, int ang) //getzsofslopeptr(sp->sector(), pp->posx, pp->posy, &cz, &fz); //pp->posz = pp->oposz = fz - PLAYER_HEIGHT; - pp->posz = pp->oposz = sp->z - PLAYER_HEIGHT; + pp->posz = pp->oposz = sp->Z - PLAYER_HEIGHT; updatesector(pp->posx, pp->posy, &pp->cursector); SET(pp->Flags2, PF2_TELEPORTED); @@ -1868,7 +1868,7 @@ void DoPlayerZrange(PLAYERp pp) auto bakcstat = sp->cstat; RESET(sp->cstat, CSTAT_SPRITE_BLOCK); vec3_t pos = pp->pos; - pos.z += Z(8); + pos.Z += Z(8); FAFgetzrange(pos, pp->cursector, &pp->hiz, &ceilhit, &pp->loz, &florhit, ((int)sp->clipdist<<2) - GETZRANGE_CLIP_ADJ, CLIPMASK_PLAYER); sp->cstat = bakcstat; diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index a13a9f2bc..7c7cd67e5 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -162,7 +162,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect, // warp to new x,y,z, sectnum sectortype* newsect = nullptr; - if (Warp(&hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.z, &newsect)) + if (Warp(&hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.Z, &newsect)) { // hitscan needs to pass through dest sect ResetWallWarpHitscan(newsect); @@ -192,7 +192,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect, { // hit the floor of a sector that is a warping sector sectortype* newsect = nullptr; - if (Warp(&hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.z, &newsect)) + if (Warp(&hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.Z, &newsect)) { auto pos = hit.hitpos; hitscan(pos, newsect, { xvect, yvect, zvect }, hit, clipmask); @@ -202,7 +202,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect, else { sectortype* newsect = nullptr; - if (WarpPlane(&hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.z, &newsect)) + if (WarpPlane(&hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.Z, &newsect)) { auto pos = hit.hitpos; hitscan(pos, newsect, { xvect, yvect, zvect }, hit, clipmask); @@ -212,19 +212,19 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect, } getzsofslopeptr(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, &hiz, &loz); - if (abs(hit.hitpos.z - loz) < Z(4)) + if (abs(hit.hitpos.Z - loz) < Z(4)) { if (FAF_ConnectFloor(hit.hitSector) && !TEST(hit.hitSector->floorstat, CSTAT_SECTOR_FAF_BLOCK_HITSCAN)) { - updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z + Z(12), &newsector); + updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z + Z(12), &newsector); plax_found = true; } } - else if (labs(hit.hitpos.z - hiz) < Z(4)) + else if (labs(hit.hitpos.Z - hiz) < Z(4)) { if (FAF_ConnectCeiling(hit.hitSector) && !TEST(hit.hitSector->floorstat, CSTAT_SECTOR_FAF_BLOCK_HITSCAN)) { - updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z - Z(12), &newsector); + updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z - Z(12), &newsector); plax_found = true; } } @@ -288,19 +288,19 @@ bool FAFcansee(int32_t xs, int32_t ys, int32_t zs, sectortype* sects, if (hit.hitWall == nullptr && hit.actor() == nullptr) { getzsofslopeptr(hit.hitSector, hit.hitpos.X, hit.hitpos.Y, &hiz, &loz); - if (labs(hit.hitpos.z - loz) < Z(4)) + if (labs(hit.hitpos.Z - loz) < Z(4)) { if (FAF_ConnectFloor(hit.hitSector)) { - updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z + Z(12), &newsect); + updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z + Z(12), &newsect); plax_found = true; } } - else if (labs(hit.hitpos.z - hiz) < Z(4)) + else if (labs(hit.hitpos.Z - hiz) < Z(4)) { if (FAF_ConnectCeiling(hit.hitSector)) { - updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z - Z(12), &newsect); + updatesectorz(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z - Z(12), &newsect); plax_found = true; } } @@ -311,7 +311,7 @@ bool FAFcansee(int32_t xs, int32_t ys, int32_t zs, sectortype* sects, } if (plax_found) - return !!cansee(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, newsect, xe, ye, ze, secte); + return !!cansee(hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, newsect, xe, ye, ze, secte); return false; } @@ -502,7 +502,7 @@ void FAFgetzrange(vec3_t pos, sectortype* sect, int32_t* hiz, Collision* ceilhit if (uppersect == nullptr) return; vec3_t npos = pos; - npos.z = newz; + npos.Z = newz; getzrange(npos, uppersect, hiz, *ceilhit, &foo1, foo2, clipdist, clipmask); SectorZadjust(*ceilhit, hiz, trash, nullptr); } @@ -517,7 +517,7 @@ void FAFgetzrange(vec3_t pos, sectortype* sect, int32_t* hiz, Collision* ceilhit if (lowersect == nullptr) return; // _ErrMsg(ERR_STD_ARG, "Did not find a sector at %d, %d, %d", x, y, newz); vec3_t npos = pos; - npos.z = newz; + npos.Z = newz; getzrange(npos, lowersect, &foo1, foo2, loz, *florhit, clipdist, clipmask); SectorZadjust(trash, nullptr, *florhit, loz); WaterAdjust(*florhit, loz); diff --git a/source/games/sw/src/sounds.cpp b/source/games/sw/src/sounds.cpp index e0273c670..68e143794 100644 --- a/source/games/sw/src/sounds.cpp +++ b/source/games/sw/src/sounds.cpp @@ -377,12 +377,12 @@ static void UpdateAmbients() for (auto& amb : ambients) { auto sp = amb->sp; - auto sdist = SoundDist(sp->pos.X, sp->pos.Y, sp->pos.z, voc[amb->vocIndex].voc_distance); + auto sdist = SoundDist(sp->pos.X, sp->pos.Y, sp->pos.Z, voc[amb->vocIndex].voc_distance); if (sdist < 255 && amb->vocIndex == DIGI_WHIPME) { PLAYERp pp = Player + screenpeek; - if (!FAFcansee(sp->pos.X, sp->pos.Y, sp->pos.z, sp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector)) + if (!FAFcansee(sp->pos.X, sp->pos.Y, sp->pos.Z, sp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector)) { sdist = 255; } @@ -560,7 +560,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], // Can the ambient sound see the player? If not, tone it down some. if ((chanflags & CHANF_LOOP)) { - if (!FAFcansee(vpos->X, vpos->Y, vpos->z, sp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector)) + if (!FAFcansee(vpos->X, vpos->Y, vpos->Z, sp->sector(), pp->posx, pp->posy, pp->posz, pp->cursector)) { auto distvec = npos - campos; npos = campos + distvec * 1.75f; // Play more quietly @@ -573,7 +573,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], { // For unpanned sounds the volume must be set directly and the position taken from the listener. *pos = campos; - auto sdist = SoundDist(vpos->X, vpos->Y, vpos->z, voc[chanSound].voc_distance); + auto sdist = SoundDist(vpos->X, vpos->Y, vpos->Z, voc[chanSound].voc_distance); if (chan) SetVolume(chan, (255 - sdist) * (1 / 255.f)); } diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 7ed31cd67..2e11a4299 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -4585,7 +4585,7 @@ void DoActorZrange(DSWActor* actor) auto save_cstat = sp->cstat & CSTAT_SPRITE_BLOCK; RESET(sp->cstat, CSTAT_SPRITE_BLOCK); vec3_t pos = sp->pos; - pos.z -= DIV2(SPRITEp_SIZE_Z(sp)); + pos.Z -= DIV2(SPRITEp_SIZE_Z(sp)); FAFgetzrange(pos, sp->sector(), &u->hiz, &ceilhit, &u->loz, &florhit, (((int) sp->clipdist) << 2) - GETZRANGE_CLIP_ADJ, CLIPMASK_ACTOR); sp->cstat |= save_cstat; @@ -6449,7 +6449,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in { // move the center point up for moving zh = u->zclip; - clippos.z -= zh; + clippos.Z -= zh; } @@ -6479,7 +6479,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in // ledges they were not supposed to go up on. Did the same for the // player. Seems to work ok! vec3_t pos = spr->pos; - pos.z -= zh + 1; + pos.Z -= zh + 1; FAFgetzrange(pos, spr->sector(), &globhiz, &globhihit, &globloz, &globlohit, (((int) spr->clipdist) << 2) - GETZRANGE_CLIP_ADJ, cliptype); @@ -6490,16 +6490,16 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in // Takes info from global variables DoActorGlobZ(actor); - clippos.z = spr->z + ((zchange * numtics) >> 3); + clippos.Z = spr->z + ((zchange * numtics) >> 3); // test for hitting ceiling or floor - if ((clippos.z - zh <= globhiz) || (clippos.z - zh > globloz)) + if ((clippos.Z - zh <= globhiz) || (clippos.Z - zh > globloz)) { if (retval.type == kHitNone) { if (TEST(u->Flags, SPR_CLIMBING)) { - spr->z = clippos.z; + spr->z = clippos.Z; return retval; } @@ -6508,7 +6508,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in } else { - spr->z = clippos.z; + spr->z = clippos.Z; } // extra processing for Stacks and warping @@ -6652,7 +6652,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i else { zh = u->zclip; - clippos.z -= zh; + clippos.Z -= zh; } @@ -6687,20 +6687,20 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i // missiles don't need the water to be down MissileWaterAdjust(actor); - clippos.z = sp->z + ((zchange * numtics) >> 3); + clippos.Z = sp->z + ((zchange * numtics) >> 3); // NOTE: this does not tell you when you hit a floor sprite // this case is currently treated like it hit a sector // test for hitting ceiling or floor - if (clippos.z - zh <= u->hiz + ceildist) + if (clippos.Z - zh <= u->hiz + ceildist) { // normal code sp->z = u->hiz + zh + ceildist; if (retval.type == kHitNone) retval.setSector(dasect); } - else if (clippos.z - zh > u->loz - flordist) + else if (clippos.Z - zh > u->loz - flordist) { sp->z = u->loz + zh - flordist; if (retval.type == kHitNone) @@ -6708,7 +6708,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i } else { - sp->z = clippos.z; + sp->z = clippos.Z; } if (FAF_ConnectArea(sp->sector())) @@ -6803,7 +6803,7 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei dasect = sp->sector(); lastsect = dasect; opos = sp->pos; - opos.z = daz; + opos.Z = daz; clipmove(opos, &dasect, ((xchange * numtics) << 11), ((ychange * numtics) << 11), (((int) sp->clipdist) << 2), ceildist, flordist, cliptype, retval, 1); diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 7e181335b..c08e54c18 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -2821,7 +2821,7 @@ void DoTornadoObject(SECTOR_OBJECTp sop) floor_dist = (abs(cursect->ceilingz - cursect->floorz)) >> 2; pos.X = sop->xmid; pos.Y = sop->ymid; - pos.z = floor_dist; + pos.Z = floor_dist; PlaceSectorObject(sop, MAXSO, MAXSO); Collision coll; diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 05775ec2e..f76509d77 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -9671,7 +9671,7 @@ int DoRocket(DSWActor* actor) auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, sp->sector(), - pos.X, pos.Y, pos.z, sp->ang, 100); + pos.X, pos.Y, pos.Z, sp->ang, 100); np = &actorNew->s(); nu = actorNew->u(); @@ -12540,7 +12540,7 @@ int InitSwordAttack(PLAYERp pp) if (hit.hitSector == nullptr) return 0; - if (FindDistance3D(pp->posx - hit.hitpos.X, pp->posy - hit.hitpos.Y, pp->posz - hit.hitpos.z) < 700) + if (FindDistance3D(pp->posx - hit.hitpos.X, pp->posy - hit.hitpos.Y, pp->posz - hit.hitpos.Z) < 700) { if (hit.actor() != nullptr) @@ -12555,7 +12555,7 @@ int InitSwordAttack(PLAYERp pp) switch (tu->ID) { case ZILLA_RUN_R0: - SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); PlaySound(DIGI_SWORDCLANK, &hit.hitpos, v3df_none); break; case TRASHCAN: @@ -12564,7 +12564,7 @@ int InitSwordAttack(PLAYERp pp) tu->WaitTics = SEC(2); ChangeState(hitActor, s_TrashCanPain); } - SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); PlaySound(DIGI_SWORDCLANK, &hit.hitpos, v3df_none); PlaySound(DIGI_TRASHLID, hitActor, v3df_none); break; @@ -12573,7 +12573,7 @@ int InitSwordAttack(PLAYERp pp) case PACHINKO3: case PACHINKO4: case 623: - SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); PlaySound(DIGI_SWORDCLANK, &hit.hitpos, v3df_none); break; } @@ -12604,7 +12604,7 @@ int InitSwordAttack(PLAYERp pp) { if (TEST(hit.hitWall->nextSector()->ceilingstat, CSTAT_SECTOR_SKY)) { - if (hit.hitpos.z < hit.hitWall->nextSector()->ceilingz) + if (hit.hitpos.Z < hit.hitWall->nextSector()->ceilingz) { return 0; } @@ -12613,12 +12613,12 @@ int InitSwordAttack(PLAYERp pp) if (hit.hitWall->lotag == TAG_WALL_BREAK) { - HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, u->ID); + HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, u->ID); } // hit non breakable wall - do sound and puff else { - SpawnSwordSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + SpawnSwordSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); PlaySound(DIGI_SWORDCLANK, &hit.hitpos, v3df_none); } } @@ -12730,7 +12730,7 @@ int InitFistAttack(PLAYERp pp) if (hit.hitSector == nullptr) return 0; - if (FindDistance3D(pp->posx - hit.hitpos.X, pp->posy - hit.hitpos.Y, pp->posz - hit.hitpos.z) < 700) + if (FindDistance3D(pp->posx - hit.hitpos.X, pp->posy - hit.hitpos.Y, pp->posz - hit.hitpos.Z) < 700) { if (hit.actor() != nullptr) @@ -12745,7 +12745,7 @@ int InitFistAttack(PLAYERp pp) switch (tu->ID) { case ZILLA_RUN_R0: - SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); PlaySound(DIGI_ARMORHIT, &hit.hitpos, v3df_none); break; case TRASHCAN: @@ -12754,7 +12754,7 @@ int InitFistAttack(PLAYERp pp) tu->WaitTics = SEC(2); ChangeState(hitActor, s_TrashCanPain); } - SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); PlaySound(DIGI_ARMORHIT, &hit.hitpos, v3df_none); PlaySound(DIGI_TRASHLID, hitActor, v3df_none); break; @@ -12763,7 +12763,7 @@ int InitFistAttack(PLAYERp pp) case PACHINKO3: case PACHINKO4: case 623: - SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); PlaySound(DIGI_ARMORHIT, &hit.hitpos, v3df_none); break; } @@ -12791,7 +12791,7 @@ int InitFistAttack(PLAYERp pp) case 5062: case 5063: case 4947: - SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); PlaySound(DIGI_ARMORHIT, &hit.hitpos, v3df_none); if (RandomRange(1000) > 700) PlayerUpdateHealth(pp,1); // Give some health @@ -12807,7 +12807,7 @@ int InitFistAttack(PLAYERp pp) { if (TEST(hit.hitWall->nextSector()->ceilingstat, CSTAT_SECTOR_SKY)) { - if (hit.hitpos.z < hit.hitWall->nextSector()->ceilingz) + if (hit.hitpos.Z < hit.hitWall->nextSector()->ceilingz) { return 0; } @@ -12816,12 +12816,12 @@ int InitFistAttack(PLAYERp pp) if (hit.hitWall->lotag == TAG_WALL_BREAK) { - HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, u->ID); + HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, u->ID); } // hit non breakable wall - do sound and puff else { - SpawnSwordSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + SpawnSwordSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); PlaySound(DIGI_ARMORHIT, &hit.hitpos, v3df_none); if (PlayerTakeDamage(pp, nullptr)) { @@ -13502,13 +13502,13 @@ int ContinueHitscan(PLAYERp pp, sectortype* sect, int x, int y, int z, short ang if (hit.actor() == nullptr && hit.hitWall == nullptr) { - if (labs(hit.hitpos.z - hit.hitSector->ceilingz) <= Z(1)) + if (labs(hit.hitpos.Z - hit.hitSector->ceilingz) <= Z(1)) { - hit.hitpos.z += Z(16); + hit.hitpos.Z += Z(16); if (TEST(hit.hitSector->ceilingstat, CSTAT_SECTOR_SKY)) return 0; } - else if (labs(hit.hitpos.z - hit.hitSector->floorz) <= Z(1)) + else if (labs(hit.hitpos.Z - hit.hitSector->floorz) <= Z(1)) { } } @@ -13519,7 +13519,7 @@ int ContinueHitscan(PLAYERp pp, sectortype* sect, int x, int y, int z, short ang { if (TEST(hit.hitWall->nextSector()->ceilingstat, CSTAT_SECTOR_SKY)) { - if (hit.hitpos.z < hit.hitWall->nextSector()->ceilingz) + if (hit.hitpos.Z < hit.hitWall->nextSector()->ceilingz) { return 0; } @@ -13528,11 +13528,11 @@ int ContinueHitscan(PLAYERp pp, sectortype* sect, int x, int y, int z, short ang if (hit.hitWall->lotag == TAG_WALL_BREAK) { - HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ang, u->ID); + HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ang, u->ID); return 0; } - QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z); + QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z); } // hit a sprite? @@ -13552,7 +13552,7 @@ int ContinueHitscan(PLAYERp pp, sectortype* sect, int x, int y, int z, short ang return 0; } - if (BulletHitSprite(pp->Actor(), hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, 0)) + if (BulletHitSprite(pp->Actor(), hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0)) return 0; // hit a switch? @@ -13562,7 +13562,7 @@ int ContinueHitscan(PLAYERp pp, sectortype* sect, int x, int y, int z, short ang } } - auto j = SpawnShotgunSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ang); + auto j = SpawnShotgunSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ang); DoHitscanDamage(j, hit.actor()); return 0; @@ -13636,9 +13636,9 @@ int InitShotgun(PLAYERp pp) if (hit.actor() == nullptr && hit.hitWall == nullptr) { - if (labs(hit.hitpos.z - hit.hitSector->ceilingz) <= Z(1)) + if (labs(hit.hitpos.Z - hit.hitSector->ceilingz) <= Z(1)) { - hit.hitpos.z += Z(16); + hit.hitpos.Z += Z(16); SET(cstat, CSTAT_SPRITE_YFLIP); if (TEST(hit.hitSector->ceilingstat, CSTAT_SECTOR_SKY)) @@ -13646,21 +13646,21 @@ int InitShotgun(PLAYERp pp) if (SectorIsUnderwaterArea(hit.hitSector)) { - WarpToSurface(&hit.hitSector, &hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.z); - ContinueHitscan(pp, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ndaang, xvect, yvect, zvect); + WarpToSurface(&hit.hitSector, &hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.Z); + ContinueHitscan(pp, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ndaang, xvect, yvect, zvect); continue; } } - else if (labs(hit.hitpos.z - hit.hitSector->floorz) <= Z(1)) + else if (labs(hit.hitpos.Z - hit.hitSector->floorz) <= Z(1)) { if (TEST(hit.hitSector->extra, SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE) { - SpawnSplashXY(hit.hitpos.X,hit.hitpos.Y,hit.hitpos.z,hit.hitSector); + SpawnSplashXY(hit.hitpos.X,hit.hitpos.Y,hit.hitpos.Z,hit.hitSector); if (SectorIsDiveArea(hit.hitSector)) { - WarpToUnderwater(&hit.hitSector, &hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.z); - ContinueHitscan(pp, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ndaang, xvect, yvect, zvect); + WarpToUnderwater(&hit.hitSector, &hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.Z); + ContinueHitscan(pp, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ndaang, xvect, yvect, zvect); } continue; @@ -13674,7 +13674,7 @@ int InitShotgun(PLAYERp pp) { if (TEST(hit.hitWall->nextSector()->ceilingstat, CSTAT_SECTOR_SKY)) { - if (hit.hitpos.z < hit.hitWall->nextSector()->ceilingz) + if (hit.hitpos.Z < hit.hitWall->nextSector()->ceilingz) { continue; } @@ -13683,11 +13683,11 @@ int InitShotgun(PLAYERp pp) if (hit.hitWall->lotag == TAG_WALL_BREAK) { - HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ndaang, u->ID); + HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ndaang, u->ID); continue; } - QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z); + QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z); } // hit a sprite? @@ -13721,7 +13721,7 @@ int InitShotgun(PLAYERp pp) continue; } - if (BulletHitSprite(pp->Actor(), hitActor, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, SHOTGUN_SMOKE)) + if (BulletHitSprite(pp->Actor(), hitActor, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, SHOTGUN_SMOKE)) continue; // hit a switch? @@ -13731,7 +13731,7 @@ int InitShotgun(PLAYERp pp) } } - auto j = SpawnShotgunSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ndaang); + auto j = SpawnShotgunSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ndaang); DoHitscanDamage(j, hit.actor()); } @@ -16199,9 +16199,9 @@ int InitUzi(PLAYERp pp) // check to see what you hit if (hit.actor() == nullptr && hit.hitWall == nullptr) { - if (labs(hit.hitpos.z - hit.hitSector->ceilingz) <= Z(1)) + if (labs(hit.hitpos.Z - hit.hitSector->ceilingz) <= Z(1)) { - hit.hitpos.z += Z(16); + hit.hitpos.Z += Z(16); SET(cstat, CSTAT_SPRITE_YFLIP); if (TEST(hit.hitSector->ceilingstat, CSTAT_SECTOR_SKY)) @@ -16209,21 +16209,21 @@ int InitUzi(PLAYERp pp) if (SectorIsUnderwaterArea(hit.hitSector)) { - WarpToSurface(&hit.hitSector, &hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.z); - ContinueHitscan(pp, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, xvect, yvect, zvect); + WarpToSurface(&hit.hitSector, &hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.Z); + ContinueHitscan(pp, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, xvect, yvect, zvect); return 0; } } - else if (labs(hit.hitpos.z - hit.hitSector->floorz) <= Z(1)) + else if (labs(hit.hitpos.Z - hit.hitSector->floorz) <= Z(1)) { if (TEST(hit.hitSector->extra, SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE) { - SpawnSplashXY(hit.hitpos.X,hit.hitpos.Y,hit.hitpos.z,hit.hitSector); + SpawnSplashXY(hit.hitpos.X,hit.hitpos.Y,hit.hitpos.Z,hit.hitSector); if (SectorIsDiveArea(hit.hitSector)) { - WarpToUnderwater(&hit.hitSector, &hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.z); - ContinueHitscan(pp, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, xvect, yvect, zvect); + WarpToUnderwater(&hit.hitSector, &hit.hitpos.X, &hit.hitpos.Y, &hit.hitpos.Z); + ContinueHitscan(pp, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, xvect, yvect, zvect); return 0; } @@ -16238,7 +16238,7 @@ int InitUzi(PLAYERp pp) { if (TEST(hit.hitWall->nextSector()->ceilingstat, CSTAT_SECTOR_SKY)) { - if (hit.hitpos.z < hit.hitWall->nextSector()->ceilingz) + if (hit.hitpos.Z < hit.hitWall->nextSector()->ceilingz) { return 0; } @@ -16248,11 +16248,11 @@ int InitUzi(PLAYERp pp) if (hit.hitWall->lotag == TAG_WALL_BREAK) { - HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, u->ID); + HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, u->ID); return 0; } - QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z); + QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z); } // hit a sprite? @@ -16286,7 +16286,7 @@ int InitUzi(PLAYERp pp) return 0; } - if (BulletHitSprite(pp->Actor(), hitActor, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, 0)) + if (BulletHitSprite(pp->Actor(), hitActor, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0)) return 0; // hit a switch? @@ -16297,7 +16297,7 @@ int InitUzi(PLAYERp pp) } - auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, 0); + auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, 0); wp = &actorNew->s(); wp->shade = -40; wp->xrepeat = UZI_SMOKE_REPEAT; @@ -16309,7 +16309,7 @@ int InitUzi(PLAYERp pp) HitscanSpriteAdjust(actorNew, hit.hitWall); DoHitscanDamage(actorNew, hit.actor()); - actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, 0); + actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, 0); wp = &actorNew->s(); wu = actorNew->u(); wp->shade = -40; @@ -16742,19 +16742,19 @@ int InitSobjMachineGun(DSWActor* actor, PLAYERp pp) if (hit.actor() == nullptr && hit.hitWall == nullptr) { - if (labs(hit.hitpos.z - hit.hitSector->ceilingz) <= Z(1)) + if (labs(hit.hitpos.Z - hit.hitSector->ceilingz) <= Z(1)) { - hit.hitpos.z += Z(16); + hit.hitpos.Z += Z(16); SET(cstat, CSTAT_SPRITE_YFLIP); if (TEST(hit.hitSector->ceilingstat, CSTAT_SECTOR_SKY)) return 0; } - else if (labs(hit.hitpos.z - hit.hitSector->floorz) <= Z(1)) + else if (labs(hit.hitpos.Z - hit.hitSector->floorz) <= Z(1)) { if (TEST(hit.hitSector->extra, SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE) { - SpawnSplashXY(hit.hitpos.X,hit.hitpos.Y,hit.hitpos.z,hit.hitSector); + SpawnSplashXY(hit.hitpos.X,hit.hitpos.Y,hit.hitpos.Z,hit.hitSector); return 0; } } @@ -16769,7 +16769,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYERp pp) if (hsp->lotag == TAG_SPRITE_HIT_MATCH) { // spawn sparks here and pass the sprite as SO_MISSILE - spark = SpawnBoatSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + spark = SpawnBoatSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); SET(spark->u()->Flags2, SPR2_SO_MISSILE); if (MissileHitMatch(spark, -1, hit.actor())) return 0; @@ -16782,7 +16782,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYERp pp) return 0; } - if (BulletHitSprite(pp->Actor(), hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, 0)) + if (BulletHitSprite(pp->Actor(), hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0)) return 0; // hit a switch? @@ -16792,7 +16792,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYERp pp) } } - spark = SpawnBoatSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + spark = SpawnBoatSparks(pp, hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); DoHitscanDamage(spark, hit.actor()); return 0; @@ -17149,19 +17149,19 @@ int InitTurretMgun(SECTOR_OBJECTp sop) if (hit.actor() == nullptr && hit.hitWall == nullptr) { - if (labs(hit.hitpos.z - hit.hitSector->ceilingz) <= Z(1)) + if (labs(hit.hitpos.Z - hit.hitSector->ceilingz) <= Z(1)) { - hit.hitpos.z += Z(16); + hit.hitpos.Z += Z(16); SET(cstat, CSTAT_SPRITE_YFLIP); if (TEST(hit.hitSector->ceilingstat, CSTAT_SECTOR_SKY)) continue; } - else if (labs(hit.hitpos.z - hit.hitSector->floorz) <= Z(1)) + else if (labs(hit.hitpos.Z - hit.hitSector->floorz) <= Z(1)) { if (TEST(hit.hitSector->extra, SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE) { - SpawnSplashXY(hit.hitpos.X,hit.hitpos.Y,hit.hitpos.z,hit.hitSector); + SpawnSplashXY(hit.hitpos.X,hit.hitpos.Y,hit.hitpos.Z,hit.hitSector); continue; } } @@ -17174,7 +17174,7 @@ int InitTurretMgun(SECTOR_OBJECTp sop) { if (TEST(hit.hitWall->nextSector()->ceilingstat, CSTAT_SECTOR_SKY)) { - if (hit.hitpos.z < hit.hitWall->nextSector()->ceilingz) + if (hit.hitpos.Z < hit.hitWall->nextSector()->ceilingz) { return 0; } @@ -17183,11 +17183,11 @@ int InitTurretMgun(SECTOR_OBJECTp sop) if (hit.hitWall->lotag == TAG_WALL_BREAK) { - HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, 0); + HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, 0); continue; } - QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z); + QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z); } // hit a sprite? @@ -17207,7 +17207,7 @@ int InitTurretMgun(SECTOR_OBJECTp sop) continue; } - if (BulletHitSprite(actor, hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, 0)) + if (BulletHitSprite(actor, hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0)) continue; // hit a switch? @@ -17218,7 +17218,7 @@ int InitTurretMgun(SECTOR_OBJECTp sop) } - auto j = SpawnTurretSparks(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang); + auto j = SpawnTurretSparks(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang); DoHitscanDamage(j, hit.actor()); } } @@ -17310,7 +17310,7 @@ int InitEnemyUzi(DSWActor* actor) { if (TEST(hit.hitWall->nextSector()->ceilingstat, CSTAT_SECTOR_SKY)) { - if (hit.hitpos.z < hit.hitWall->nextSector()->ceilingz) + if (hit.hitpos.Z < hit.hitWall->nextSector()->ceilingz) { return 0; } @@ -17319,20 +17319,20 @@ int InitEnemyUzi(DSWActor* actor) if (hit.hitWall->lotag == TAG_WALL_BREAK) { - HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, u->ID); + HitBreakWall(hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, u->ID); return 0; } - QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z); + QueueHole(hit.hitSector, hit.hitWall, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z); } if (hit.actor() != nullptr) { - if (BulletHitSprite(actor, hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, 0)) + if (BulletHitSprite(actor, hit.actor(), hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, 0)) return 0; } - auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE+2, s_UziSmoke, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, 0); + auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE+2, s_UziSmoke, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, 0); wu = actorNew->u(); wp = &actorNew->s(); wp->shade = -40; @@ -17349,7 +17349,7 @@ int InitEnemyUzi(DSWActor* actor) wp->clipdist = 32L >> 2; - actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, 0); + actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, 0); wp = &actorNew->s(); wp->shade = -40; wp->xrepeat = UZI_SMOKE_REPEAT; @@ -17361,7 +17361,7 @@ int InitEnemyUzi(DSWActor* actor) HitscanSpriteAdjust(actorNew, hit.hitWall); DoHitscanDamage(actorNew, hit.actor()); - actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, daang, 0); + actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, daang, 0); wu = actorNew->u(); wp = &actorNew->s(); wp->shade = -40; @@ -18919,22 +18919,22 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang) if (rndnum > 768) { WallBloodQueue[WallBloodQueueHead] = spawnedActor = - SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD1, s_WallBlood1, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ang, 0); + SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD1, s_WallBlood1, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ang, 0); } else if (rndnum > 512) { WallBloodQueue[WallBloodQueueHead] = spawnedActor = - SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD2, s_WallBlood2, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ang, 0); + SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD2, s_WallBlood2, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ang, 0); } else if (rndnum > 128) { WallBloodQueue[WallBloodQueueHead] = spawnedActor = - SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD3, s_WallBlood3, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ang, 0); + SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD3, s_WallBlood3, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ang, 0); } else { WallBloodQueue[WallBloodQueueHead] = spawnedActor = - SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD4, s_WallBlood4, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.z, ang, 0); + SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD4, s_WallBlood4, hit.hitSector, hit.hitpos.X, hit.hitpos.Y, hit.hitpos.Z, ang, 0); } WallBloodQueueHead = (WallBloodQueueHead+1) & (MAX_WALLBLOOD_QUEUE-1); @@ -18950,7 +18950,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang) sp->xoffset = sp->yoffset = 0; sp->x = hit.hitpos.X; sp->y = hit.hitpos.Y; - sp->z = hit.hitpos.z; + sp->z = hit.hitpos.Z; sp->shade -= 5; // Brighten it up just a bit spawnedActor->tempwall = hit.hitWall; // pass hitinfo.wall