mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 14:41:55 +00:00
- Capitalise vec2_t
y
variable.
This commit is contained in:
parent
3c9cd926ba
commit
118ceb18ca
46 changed files with 352 additions and 352 deletions
|
@ -308,7 +308,7 @@ inline int32_t ksqrt(uint64_t num)
|
|||
int32_t getangle(int32_t xvect, int32_t yvect);
|
||||
inline int32_t getangle(const vec2_t& vec)
|
||||
{
|
||||
return getangle(vec.X, vec.y);
|
||||
return getangle(vec.X, vec.Y);
|
||||
}
|
||||
|
||||
inline constexpr uint32_t uhypsq(int32_t const dx, int32_t const dy)
|
||||
|
@ -334,7 +334,7 @@ inline void getcorrectzsofslope(int sectnum, int32_t dax, int32_t day, int32_t *
|
|||
{
|
||||
vec2_t closest = { dax, day };
|
||||
getsectordist(closest, sectnum, &closest);
|
||||
getzsofslopeptr((usectorptr_t)§or[sectnum], closest.X, closest.y, ceilz, florz);
|
||||
getzsofslopeptr((usectorptr_t)§or[sectnum], closest.X, closest.Y, ceilz, florz);
|
||||
}
|
||||
|
||||
void alignceilslope(sectortype* dasect, int32_t x, int32_t y, int32_t z);
|
||||
|
|
|
@ -86,21 +86,21 @@ static inline void get_floorspr_points(spritetype const * const spr, int32_t px,
|
|||
adjofs.X = -adjofs.X;
|
||||
|
||||
if (spr->cstat & CSTAT_SPRITE_YFLIP)
|
||||
adjofs.y = -adjofs.y;
|
||||
adjofs.Y = -adjofs.Y;
|
||||
|
||||
vec2_t const center = { ((span.X >> 1) + adjofs.X) * repeat.X, ((span.y >> 1) + adjofs.y) * repeat.y };
|
||||
vec2_t const rspan = { span.X * repeat.X, span.y * repeat.y };
|
||||
vec2_t const ofs = { -DivScale(MulScale(cosang, rspan.y, 16), ratio, 12), -DivScale(MulScale(sinang, rspan.y, 16), ratio, 12) };
|
||||
vec2_t const center = { ((span.X >> 1) + adjofs.X) * repeat.X, ((span.Y >> 1) + adjofs.Y) * repeat.Y };
|
||||
vec2_t const rspan = { span.X * repeat.X, span.Y * repeat.Y };
|
||||
vec2_t const ofs = { -DivScale(MulScale(cosang, rspan.Y, 16), ratio, 12), -DivScale(MulScale(sinang, rspan.Y, 16), ratio, 12) };
|
||||
vec2_t const cossinslope = { DivScale(cosang, ratio, 12), DivScale(sinang, ratio, 12) };
|
||||
|
||||
*x1 += DMulScale(sinang, center.X, cossinslope.X, center.y, 16) - px;
|
||||
*y1 += DMulScale(cossinslope.y, center.y, -cosang, center.X, 16) - py;
|
||||
*x1 += DMulScale(sinang, center.X, cossinslope.X, center.Y, 16) - px;
|
||||
*y1 += DMulScale(cossinslope.Y, center.Y, -cosang, center.X, 16) - py;
|
||||
|
||||
*x2 = *x1 - MulScale(sinang, rspan.X, 16);
|
||||
*y2 = *y1 + MulScale(cosang, rspan.X, 16);
|
||||
|
||||
*x3 = *x2 + ofs.X, *x4 = *x1 + ofs.X;
|
||||
*y3 = *y2 + ofs.y, *y4 = *y1 + ofs.y;
|
||||
*y3 = *y2 + ofs.Y, *y4 = *y1 + ofs.Y;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -113,24 +113,24 @@ int clipinsidebox(vec2_t *vect, int wallnum, int walldist)
|
|||
auto const wal1 = (uwallptr_t)&wall[wallnum];
|
||||
auto const wal2 = (uwallptr_t)wal1->point2Wall();
|
||||
|
||||
vec2_t const v1 = { wal1->x + walldist - vect->X, wal1->y + walldist - vect->y };
|
||||
vec2_t v2 = { wal2->x + walldist - vect->X, wal2->y + walldist - vect->y };
|
||||
vec2_t const v1 = { wal1->x + walldist - vect->X, wal1->y + walldist - vect->Y };
|
||||
vec2_t v2 = { wal2->x + walldist - vect->X, wal2->y + walldist - vect->Y };
|
||||
|
||||
if (((v1.X < 0) && (v2.X < 0)) || ((v1.y < 0) && (v2.y < 0)) || ((v1.X >= r) && (v2.X >= r)) || ((v1.y >= r) && (v2.y >= r)))
|
||||
if (((v1.X < 0) && (v2.X < 0)) || ((v1.Y < 0) && (v2.Y < 0)) || ((v1.X >= r) && (v2.X >= r)) || ((v1.Y >= r) && (v2.Y >= r)))
|
||||
return 0;
|
||||
|
||||
v2.X -= v1.X; v2.y -= v1.y;
|
||||
v2.X -= v1.X; v2.Y -= v1.Y;
|
||||
|
||||
if (v2.X * (walldist - v1.y) >= v2.y * (walldist - v1.X)) // Front
|
||||
if (v2.X * (walldist - v1.Y) >= v2.Y * (walldist - v1.X)) // Front
|
||||
{
|
||||
v2.X *= ((v2.X > 0) ? (0 - v1.y) : (r - v1.y));
|
||||
v2.y *= ((v2.y > 0) ? (r - v1.X) : (0 - v1.X));
|
||||
return v2.X < v2.y;
|
||||
v2.X *= ((v2.X > 0) ? (0 - v1.Y) : (r - v1.Y));
|
||||
v2.Y *= ((v2.Y > 0) ? (r - v1.X) : (0 - v1.X));
|
||||
return v2.X < v2.Y;
|
||||
}
|
||||
|
||||
v2.X *= ((v2.X > 0) ? (r - v1.y) : (0 - v1.y));
|
||||
v2.y *= ((v2.y > 0) ? (0 - v1.X) : (r - v1.X));
|
||||
return (v2.X >= v2.y) << 1;
|
||||
v2.X *= ((v2.X > 0) ? (r - v1.Y) : (0 - v1.Y));
|
||||
v2.Y *= ((v2.Y > 0) ? (0 - v1.X) : (r - v1.X));
|
||||
return (v2.X >= v2.Y) << 1;
|
||||
}
|
||||
|
||||
static int32_t spriteGetZOfSlope(const spritetype* spr, int32_t dax, int32_t day)
|
||||
|
@ -237,13 +237,13 @@ static int cliptestsector(int const dasect, int const nextsect, int32_t const fl
|
|||
break;
|
||||
default:
|
||||
{
|
||||
int32_t daz = getflorzofslopeptr(§or[dasect], pos.X, pos.y);
|
||||
int32_t daz2 = getflorzofslopeptr(sec2, pos.X, pos.y);
|
||||
int32_t daz = getflorzofslopeptr(§or[dasect], pos.X, pos.Y);
|
||||
int32_t daz2 = getflorzofslopeptr(sec2, pos.X, pos.Y);
|
||||
|
||||
if (daz2 < daz-(1<<8) && (sec2->floorstat & CSTAT_SECTOR_SKY) == 0)
|
||||
if (posz >= daz2-(flordist-1)) return 1;
|
||||
daz = getceilzofslopeptr(§or[dasect], pos.X, pos.y);
|
||||
daz2 = getceilzofslopeptr(sec2, pos.X, pos.y);
|
||||
daz = getceilzofslopeptr(§or[dasect], pos.X, pos.Y);
|
||||
daz2 = getceilzofslopeptr(sec2, pos.X, pos.Y);
|
||||
if (daz2 > daz+(1<<8) && (sec2->ceilingstat & CSTAT_SECTOR_SKY) == 0)
|
||||
if (posz <= daz2+(ceildist-1)) return 1;
|
||||
|
||||
|
@ -255,7 +255,7 @@ static int cliptestsector(int const dasect, int const nextsect, int32_t const fl
|
|||
int32_t dacz2 = sec2->ceilingz;
|
||||
|
||||
if ((sec2->floorstat|sec2->ceilingstat) & CSTAT_SECTOR_SLOPE)
|
||||
getcorrectzsofslope(nextsect, pos.X, pos.y, &dacz2, &daz2);
|
||||
getcorrectzsofslope(nextsect, pos.X, pos.Y, &dacz2, &daz2);
|
||||
|
||||
if (daz2 <= dacz2)
|
||||
return 1;
|
||||
|
@ -266,7 +266,7 @@ static int cliptestsector(int const dasect, int const nextsect, int32_t const fl
|
|||
int32_t dacz = sec->ceilingz;
|
||||
|
||||
if ((sec->floorstat|sec->ceilingstat) & CSTAT_SECTOR_SLOPE)
|
||||
getcorrectzsofslope(dasect, pos.X, pos.y, &dacz, &daz);
|
||||
getcorrectzsofslope(dasect, pos.X, pos.Y, &dacz, &daz);
|
||||
|
||||
int32_t const sec2height = abs(daz2-dacz2);
|
||||
|
||||
|
@ -293,19 +293,19 @@ static inline int32_t cliptrace(vec2_t const pos, vec2_t * const goal)
|
|||
{
|
||||
vec2_t const p1 = { clipit[z].x1, clipit[z].y1 };
|
||||
vec2_t const p2 = { clipit[z].x2, clipit[z].y2 };
|
||||
vec2_t const area = { p2.X-p1.X, p2.y-p1.y };
|
||||
vec2_t const area = { p2.X-p1.X, p2.Y-p1.Y };
|
||||
|
||||
int32_t topu = area.X*(pos.y-p1.y) - (pos.X-p1.X)*area.y;
|
||||
int32_t topu = area.X*(pos.Y-p1.Y) - (pos.X-p1.X)*area.Y;
|
||||
|
||||
if (topu <= 0 || area.X*(goal->y-p1.y) > (goal->X-p1.X)*area.y)
|
||||
if (topu <= 0 || area.X*(goal->Y-p1.Y) > (goal->X-p1.X)*area.Y)
|
||||
continue;
|
||||
|
||||
vec2_t const diff = { goal->X-pos.X, goal->y-pos.y };
|
||||
vec2_t const diff = { goal->X-pos.X, goal->Y-pos.Y };
|
||||
|
||||
if (diff.X*(p1.y-pos.y) > (p1.X-pos.X)*diff.y || diff.X*(p2.y-pos.y) <= (p2.X-pos.X)*diff.y)
|
||||
if (diff.X*(p1.Y-pos.Y) > (p1.X-pos.X)*diff.Y || diff.X*(p2.Y-pos.Y) <= (p2.X-pos.X)*diff.Y)
|
||||
continue;
|
||||
|
||||
int32_t const bot = diff.X*area.y - area.X*diff.y;
|
||||
int32_t const bot = diff.X*area.Y - area.X*diff.Y;
|
||||
int cnt = 256;
|
||||
|
||||
if (!bot)
|
||||
|
@ -321,11 +321,11 @@ static inline int32_t cliptrace(vec2_t const pos, vec2_t * const goal)
|
|||
return z;
|
||||
}
|
||||
|
||||
n = { pos.X+Scale(diff.X, topu, bot), pos.y+Scale(diff.y, topu, bot) };
|
||||
n = { pos.X+Scale(diff.X, topu, bot), pos.Y+Scale(diff.Y, topu, bot) };
|
||||
topu--;
|
||||
} while (area.X*(n.y-p1.y) <= (n.X-p1.X)*area.y);
|
||||
} while (area.X*(n.Y-p1.Y) <= (n.X-p1.X)*area.Y);
|
||||
|
||||
if (abs(pos.X-n.X)+abs(pos.y-n.y) < abs(pos.X-goal->X)+abs(pos.y-goal->y))
|
||||
if (abs(pos.X-n.X)+abs(pos.Y-n.Y) < abs(pos.X-goal->X)+abs(pos.Y-goal->Y))
|
||||
{
|
||||
*goal = n;
|
||||
hitwall = z;
|
||||
|
@ -364,24 +364,24 @@ static int get_floorspr_clipyou(vec2_t const v1, vec2_t const v2, vec2_t const v
|
|||
{
|
||||
int clipyou = 0;
|
||||
|
||||
if ((v1.y^v2.y) < 0)
|
||||
if ((v1.Y^v2.Y) < 0)
|
||||
{
|
||||
if ((v1.X^v2.X) < 0) clipyou ^= (v1.X*v2.y < v2.X*v1.y)^(v1.y<v2.y);
|
||||
if ((v1.X^v2.X) < 0) clipyou ^= (v1.X*v2.Y < v2.X*v1.Y)^(v1.Y<v2.Y);
|
||||
else if (v1.X >= 0) clipyou ^= 1;
|
||||
}
|
||||
if ((v2.y^v3.y) < 0)
|
||||
if ((v2.Y^v3.Y) < 0)
|
||||
{
|
||||
if ((v2.X^v3.X) < 0) clipyou ^= (v2.X*v3.y < v3.X*v2.y)^(v2.y<v3.y);
|
||||
if ((v2.X^v3.X) < 0) clipyou ^= (v2.X*v3.Y < v3.X*v2.Y)^(v2.Y<v3.Y);
|
||||
else if (v2.X >= 0) clipyou ^= 1;
|
||||
}
|
||||
if ((v3.y^v4.y) < 0)
|
||||
if ((v3.Y^v4.Y) < 0)
|
||||
{
|
||||
if ((v3.X^v4.X) < 0) clipyou ^= (v3.X*v4.y < v4.X*v3.y)^(v3.y<v4.y);
|
||||
if ((v3.X^v4.X) < 0) clipyou ^= (v3.X*v4.Y < v4.X*v3.Y)^(v3.Y<v4.Y);
|
||||
else if (v3.X >= 0) clipyou ^= 1;
|
||||
}
|
||||
if ((v4.y^v1.y) < 0)
|
||||
if ((v4.Y^v1.Y) < 0)
|
||||
{
|
||||
if ((v4.X^v1.X) < 0) clipyou ^= (v4.X*v1.y < v1.X*v4.y)^(v4.y<v1.y);
|
||||
if ((v4.X^v1.X) < 0) clipyou ^= (v4.X*v1.Y < v1.X*v4.Y)^(v4.Y<v1.Y);
|
||||
else if (v4.X >= 0) clipyou ^= 1;
|
||||
}
|
||||
|
||||
|
@ -398,14 +398,14 @@ static void clipupdatesector(vec2_t const pos, int * const sectnum, int walldist
|
|||
}
|
||||
#endif
|
||||
|
||||
if (inside_p(pos.X, pos.y, *sectnum))
|
||||
if (inside_p(pos.X, pos.Y, *sectnum))
|
||||
return;
|
||||
|
||||
int16_t nsecs = min<int16_t>(getsectordist(pos, *sectnum), INT16_MAX);
|
||||
|
||||
if (nsecs > (walldist + 8))
|
||||
{
|
||||
Printf("%s(): initial position (%d, %d) not within initial sector %d; shortest distance %d.\n", __func__, pos.X, pos.y, *sectnum, nsecs);
|
||||
Printf("%s(): initial position (%d, %d) not within initial sector %d; shortest distance %d.\n", __func__, pos.X, pos.Y, *sectnum, nsecs);
|
||||
walldist = 0x7fff;
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,7 @@ static void clipupdatesector(vec2_t const pos, int * const sectnum, int walldist
|
|||
|
||||
for (unsigned listsectnum; (listsectnum = search.GetNext()) != BFSSearch::EOL;)
|
||||
{
|
||||
if (inside_p(pos.X, pos.y, listsectnum))
|
||||
if (inside_p(pos.X, pos.Y, listsectnum))
|
||||
{
|
||||
*sectnum = listsectnum;
|
||||
return;
|
||||
|
@ -433,7 +433,7 @@ static void clipupdatesector(vec2_t const pos, int * const sectnum, int walldist
|
|||
|
||||
for (unsigned listsectnum; (listsectnum = search.GetNext()) != BFSSearch::EOL;)
|
||||
{
|
||||
if (inside_p(pos.X, pos.y, listsectnum))
|
||||
if (inside_p(pos.X, pos.Y, listsectnum))
|
||||
{
|
||||
*sectnum = listsectnum;
|
||||
return;
|
||||
|
@ -468,13 +468,13 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
|
||||
vec2_t const move = { xvect, yvect };
|
||||
vec2_t goal = { pos->x + (xvect >> 14), pos->y + (yvect >> 14) };
|
||||
vec2_t const cent = { (pos->x + goal.X) >> 1, (pos->y + goal.y) >> 1 };
|
||||
vec2_t const cent = { (pos->x + goal.X) >> 1, (pos->y + goal.Y) >> 1 };
|
||||
|
||||
//Extra walldist for sprites on sector lines
|
||||
vec2_t const diff = { goal.X - (pos->x), goal.y - (pos->y) };
|
||||
int32_t const rad = ksqrt(compat_maybe_truncate_to_int32(uhypsq(diff.X, diff.y))) + MAXCLIPDIST + walldist + 8;
|
||||
vec2_t const clipMin = { cent.X - rad, cent.y - rad };
|
||||
vec2_t const clipMax = { cent.X + rad, cent.y + rad };
|
||||
vec2_t const diff = { goal.X - (pos->x), goal.Y - (pos->y) };
|
||||
int32_t const rad = ksqrt(compat_maybe_truncate_to_int32(uhypsq(diff.X, diff.Y))) + MAXCLIPDIST + walldist + 8;
|
||||
vec2_t const clipMin = { cent.X - rad, cent.Y - rad };
|
||||
vec2_t const clipMax = { cent.X + rad, cent.Y + rad };
|
||||
|
||||
int clipsectcnt = 0;
|
||||
int clipspritecnt = 0;
|
||||
|
@ -508,20 +508,20 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
auto const wal2 = (uwallptr_t)wal->point2Wall();
|
||||
|
||||
if ((wal->x < clipMin.X && wal2->x < clipMin.X) || (wal->x > clipMax.X && wal2->x > clipMax.X) ||
|
||||
(wal->y < clipMin.y && wal2->y < clipMin.y) || (wal->y > clipMax.y && wal2->y > clipMax.y))
|
||||
(wal->y < clipMin.Y && wal2->y < clipMin.Y) || (wal->y > clipMax.Y && wal2->y > clipMax.Y))
|
||||
continue;
|
||||
|
||||
vec2_t p1 = wal->pos;
|
||||
vec2_t p2 = wal2->pos;
|
||||
vec2_t d = { p2.X-p1.X, p2.y-p1.y };
|
||||
vec2_t d = { p2.X-p1.X, p2.Y-p1.Y };
|
||||
|
||||
if (d.X * (pos->y-p1.y) < (pos->x-p1.X) * d.y)
|
||||
if (d.X * (pos->y-p1.Y) < (pos->x-p1.X) * d.Y)
|
||||
continue; //If wall's not facing you
|
||||
|
||||
vec2_t const r = { (d.y > 0) ? clipMax.X : clipMin.X, (d.X > 0) ? clipMin.y : clipMax.y };
|
||||
vec2_t v = { d.X * (r.y - p1.y), d.y * (r.X - p1.X) };
|
||||
vec2_t const r = { (d.Y > 0) ? clipMax.X : clipMin.X, (d.X > 0) ? clipMin.Y : clipMax.Y };
|
||||
vec2_t v = { d.X * (r.Y - p1.Y), d.Y * (r.X - p1.X) };
|
||||
|
||||
if (v.X >= v.y)
|
||||
if (v.X >= v.Y)
|
||||
continue;
|
||||
|
||||
int clipyou = 0;
|
||||
|
@ -532,7 +532,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);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -556,19 +556,19 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
|
||||
//Add 2 boxes at endpoints
|
||||
int32_t bsz = walldist; if (diff.X < 0) bsz = -bsz;
|
||||
addclipline(p1.X-bsz, p1.y-bsz, p1.X-bsz, p1.y+bsz, objtype, false);
|
||||
addclipline(p2.X-bsz, p2.y-bsz, p2.X-bsz, p2.y+bsz, objtype, false);
|
||||
bsz = walldist; if (diff.y < 0) bsz = -bsz;
|
||||
addclipline(p1.X+bsz, p1.y-bsz, p1.X-bsz, p1.y-bsz, objtype, false);
|
||||
addclipline(p2.X+bsz, p2.y-bsz, p2.X-bsz, p2.y-bsz, objtype, false);
|
||||
addclipline(p1.X-bsz, p1.Y-bsz, p1.X-bsz, p1.Y+bsz, objtype, false);
|
||||
addclipline(p2.X-bsz, p2.Y-bsz, p2.X-bsz, p2.Y+bsz, objtype, false);
|
||||
bsz = walldist; if (diff.Y < 0) bsz = -bsz;
|
||||
addclipline(p1.X+bsz, p1.Y-bsz, p1.X-bsz, p1.Y-bsz, objtype, false);
|
||||
addclipline(p2.X+bsz, p2.Y-bsz, p2.X-bsz, p2.Y-bsz, objtype, false);
|
||||
|
||||
v.X = walldist; if (d.y > 0) v.X = -v.X;
|
||||
v.y = walldist; if (d.X < 0) v.y = -v.y;
|
||||
v.X = walldist; if (d.Y > 0) v.X = -v.X;
|
||||
v.Y = walldist; if (d.X < 0) v.Y = -v.Y;
|
||||
|
||||
if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE && d.X * (pos->y-p1.y-v.y) < (pos->x-p1.X-v.X) * d.y)
|
||||
v.X >>= 1, v.y >>= 1;
|
||||
if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE && d.X * (pos->y-p1.Y-v.Y) < (pos->x-p1.X-v.X) * d.Y)
|
||||
v.X >>= 1, v.Y >>= 1;
|
||||
|
||||
addclipline(p1.X+v.X, p1.y+v.y, p2.X+v.X, p2.y+v.y, objtype, false);
|
||||
addclipline(p1.X+v.X, p1.Y+v.Y, p2.X+v.X, p2.Y+v.Y, objtype, false);
|
||||
}
|
||||
else if (wal->nextsector>=0)
|
||||
{
|
||||
|
@ -605,7 +605,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
switch (cstat & (CSTAT_SPRITE_ALIGNMENT_MASK))
|
||||
{
|
||||
case CSTAT_SPRITE_ALIGNMENT_FACING:
|
||||
if (p1.X >= clipMin.X && p1.X <= clipMax.X && p1.y >= clipMin.y && p1.y <= clipMax.y)
|
||||
if (p1.X >= clipMin.X && p1.X <= clipMax.X && p1.Y >= clipMin.Y && p1.Y <= clipMax.Y)
|
||||
{
|
||||
int32_t height, daz = spr->z+spriteheightofsptr(spr, &height, 1);
|
||||
|
||||
|
@ -613,10 +613,10 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
{
|
||||
int32_t bsz = (spr->clipdist << 2)+walldist;
|
||||
if (diff.X < 0) bsz = -bsz;
|
||||
addclipline(p1.X-bsz, p1.y-bsz, p1.X-bsz, p1.y+bsz, obj, false);
|
||||
addclipline(p1.X-bsz, p1.Y-bsz, p1.X-bsz, p1.Y+bsz, obj, false);
|
||||
bsz = (spr->clipdist << 2)+walldist;
|
||||
if (diff.y < 0) bsz = -bsz;
|
||||
addclipline(p1.X+bsz, p1.y-bsz, p1.X-bsz, p1.y-bsz, obj, false);
|
||||
if (diff.Y < 0) bsz = -bsz;
|
||||
addclipline(p1.X+bsz, p1.Y-bsz, p1.X-bsz, p1.Y-bsz, obj, false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -629,27 +629,27 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
{
|
||||
vec2_t p2;
|
||||
|
||||
get_wallspr_points(spr, &p1.X, &p2.X, &p1.y, &p2.y);
|
||||
get_wallspr_points(spr, &p1.X, &p2.X, &p1.Y, &p2.Y);
|
||||
|
||||
if (clipinsideboxline(cent.X, cent.y, p1.X, p1.y, p2.X, p2.y, rad) != 0)
|
||||
if (clipinsideboxline(cent.X, cent.Y, p1.X, p1.Y, p2.X, p2.Y, rad) != 0)
|
||||
{
|
||||
vec2_t v = { MulScale(bcos(spr->ang + 256), walldist, 14),
|
||||
MulScale(bsin(spr->ang + 256), walldist, 14) };
|
||||
|
||||
if ((p1.X-pos->x) * (p2.y-pos->y) >= (p2.X-pos->x) * (p1.y-pos->y)) // Front
|
||||
addclipline(p1.X+v.X, p1.y+v.y, p2.X+v.y, p2.y-v.X, obj, false);
|
||||
if ((p1.X-pos->x) * (p2.Y-pos->y) >= (p2.X-pos->x) * (p1.Y-pos->y)) // Front
|
||||
addclipline(p1.X+v.X, p1.Y+v.Y, p2.X+v.Y, p2.Y-v.X, obj, false);
|
||||
else
|
||||
{
|
||||
if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0)
|
||||
continue;
|
||||
addclipline(p2.X-v.X, p2.y-v.y, p1.X-v.y, p1.y+v.X, obj, false);
|
||||
addclipline(p2.X-v.X, p2.Y-v.Y, p1.X-v.Y, p1.Y+v.X, obj, false);
|
||||
}
|
||||
|
||||
//Side blocker
|
||||
if ((p2.X-p1.X) * (pos->x-p1.X)+(p2.y-p1.y) * (pos->y-p1.y) < 0)
|
||||
addclipline(p1.X-v.y, p1.y+v.X, p1.X+v.X, p1.y+v.y, obj, true);
|
||||
else if ((p1.X-p2.X) * (pos->x-p2.X)+(p1.y-p2.y) * (pos->y-p2.y) < 0)
|
||||
addclipline(p2.X+v.y, p2.y-v.X, p2.X-v.X, p2.y-v.y, obj, true);
|
||||
if ((p2.X-p1.X) * (pos->x-p1.X)+(p2.Y-p1.Y) * (pos->y-p1.Y) < 0)
|
||||
addclipline(p1.X-v.Y, p1.Y+v.X, p1.X+v.X, p1.Y+v.Y, obj, true);
|
||||
else if ((p1.X-p2.X) * (pos->x-p2.X)+(p1.Y-p2.Y) * (pos->y-p2.Y) < 0)
|
||||
addclipline(p2.X+v.Y, p2.Y-v.X, p2.X-v.X, p2.Y-v.Y, obj, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -678,7 +678,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
continue;
|
||||
|
||||
rxi[0] = p1.X;
|
||||
ryi[0] = p1.y;
|
||||
ryi[0] = p1.Y;
|
||||
|
||||
get_floorspr_points(spr, 0, 0, &rxi[0], &rxi[1], &rxi[2], &rxi[3],
|
||||
&ryi[0], &ryi[1], &ryi[2], &ryi[3], heinum);
|
||||
|
@ -688,24 +688,24 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
|
||||
if ((rxi[0]-pos->x) * (ryi[1]-pos->y) < (rxi[1]-pos->x) * (ryi[0]-pos->y))
|
||||
{
|
||||
if (clipinsideboxline(cent.X, cent.y, rxi[1], ryi[1], rxi[0], ryi[0], rad) != 0)
|
||||
addclipline(rxi[1]-v.y, ryi[1]+v.X, rxi[0]+v.X, ryi[0]+v.y, obj, false);
|
||||
if (clipinsideboxline(cent.X, cent.Y, rxi[1], ryi[1], rxi[0], ryi[0], rad) != 0)
|
||||
addclipline(rxi[1]-v.Y, ryi[1]+v.X, rxi[0]+v.X, ryi[0]+v.Y, obj, false);
|
||||
}
|
||||
else if ((rxi[2]-pos->x) * (ryi[3]-pos->y) < (rxi[3]-pos->x) * (ryi[2]-pos->y))
|
||||
{
|
||||
if (clipinsideboxline(cent.X, cent.y, rxi[3], ryi[3], rxi[2], ryi[2], rad) != 0)
|
||||
addclipline(rxi[3]+v.y, ryi[3]-v.X, rxi[2]-v.X, ryi[2]-v.y, obj, false);
|
||||
if (clipinsideboxline(cent.X, cent.Y, rxi[3], ryi[3], rxi[2], ryi[2], rad) != 0)
|
||||
addclipline(rxi[3]+v.Y, ryi[3]-v.X, rxi[2]-v.X, ryi[2]-v.Y, obj, false);
|
||||
}
|
||||
|
||||
if ((rxi[1]-pos->x) * (ryi[2]-pos->y) < (rxi[2]-pos->x) * (ryi[1]-pos->y))
|
||||
{
|
||||
if (clipinsideboxline(cent.X, cent.y, rxi[2], ryi[2], rxi[1], ryi[1], rad) != 0)
|
||||
addclipline(rxi[2]-v.X, ryi[2]-v.y, rxi[1]-v.y, ryi[1]+v.X, obj, false);
|
||||
if (clipinsideboxline(cent.X, cent.Y, rxi[2], ryi[2], rxi[1], ryi[1], rad) != 0)
|
||||
addclipline(rxi[2]-v.X, ryi[2]-v.Y, rxi[1]-v.Y, ryi[1]+v.X, obj, false);
|
||||
}
|
||||
else if ((rxi[3]-pos->x) * (ryi[0]-pos->y) < (rxi[0]-pos->x) * (ryi[3]-pos->y))
|
||||
{
|
||||
if (clipinsideboxline(cent.X, cent.y, rxi[0], ryi[0], rxi[3], ryi[3], rad) != 0)
|
||||
addclipline(rxi[0]+v.X, ryi[0]+v.y, rxi[3]+v.y, ryi[3]-v.X, obj, false);
|
||||
if (clipinsideboxline(cent.X, cent.Y, rxi[0], ryi[0], rxi[3], ryi[3], rad) != 0)
|
||||
addclipline(rxi[0]+v.X, ryi[0]+v.Y, rxi[3]+v.Y, ryi[3]-v.X, obj, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -724,12 +724,12 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
adjofs.X = -adjofs.X;
|
||||
|
||||
if (spr->cstat & CSTAT_SPRITE_YFLIP)
|
||||
adjofs.y = -adjofs.y;
|
||||
adjofs.Y = -adjofs.Y;
|
||||
|
||||
int32_t const centerx = ((span.X >> 1) + adjofs.X) * repeat.X;
|
||||
int32_t const centery = ((span.y >> 1) + adjofs.y) * repeat.y;
|
||||
int32_t const centery = ((span.Y >> 1) + adjofs.Y) * repeat.Y;
|
||||
int32_t const rspanx = span.X * repeat.X;
|
||||
int32_t const rspany = span.y * repeat.y;
|
||||
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 };
|
||||
for (int k = 0; k < 3; k++)
|
||||
|
@ -746,17 +746,17 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
vec2_t const v = { MulScale(bcos(spr->ang - 256), walldist, 14),
|
||||
MulScale(bsin(spr->ang - 256), walldist, 14) };
|
||||
|
||||
if (clipinsideboxline(cent.X, cent.y, x1, y1, x2, y2, rad) != 0)
|
||||
if (clipinsideboxline(cent.X, cent.Y, x1, y1, x2, y2, rad) != 0)
|
||||
{
|
||||
if ((x1 - pos->x) * (y2 - pos->y) >= (x2 - pos->x) * (y1 - pos->y))
|
||||
{
|
||||
addclipline(x1 + v.X, y1 + v.y, x2 + v.y, y2 - v.X, obj, false);
|
||||
addclipline(x1 + v.X, y1 + v.Y, x2 + v.Y, y2 - v.X, obj, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((cstat & CSTAT_SPRITE_ONE_SIDE) != 0)
|
||||
continue;
|
||||
addclipline(x2 - v.X, y2 - v.y, x1 - v.y, y1 + v.X, obj, false);
|
||||
addclipline(x2 - v.X, y2 - v.Y, x1 - v.Y, y1 + v.X, obj, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -795,24 +795,24 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
vec2_t const clipr = { clipit[hitwall].x2 - clipit[hitwall].x1, clipit[hitwall].y2 - clipit[hitwall].y1 };
|
||||
// clamp to the max value we can utilize without reworking the scaling below
|
||||
// this works around the overflow issue that affects dukedc2.map
|
||||
int32_t const templl = (int32_t)clamp<int64_t>(compat_maybe_truncate_to_int32((int64_t)clipr.X * clipr.X + (int64_t)clipr.y * clipr.y), INT32_MIN, INT32_MAX);
|
||||
int32_t const templl = (int32_t)clamp<int64_t>(compat_maybe_truncate_to_int32((int64_t)clipr.X * clipr.X + (int64_t)clipr.Y * clipr.Y), INT32_MIN, INT32_MAX);
|
||||
|
||||
if (templl > 0)
|
||||
{
|
||||
// I don't know if this one actually overflows or not, but I highly doubt it hurts to check
|
||||
int32_t const templl2
|
||||
= (int32_t)clamp<int64_t>(compat_maybe_truncate_to_int32((int64_t)(goal.X - vec.X) * clipr.X + (int64_t)(goal.y - vec.y) * clipr.y), INT32_MIN, INT32_MAX);
|
||||
= (int32_t)clamp<int64_t>(compat_maybe_truncate_to_int32((int64_t)(goal.X - vec.X) * clipr.X + (int64_t)(goal.Y - vec.Y) * clipr.Y), INT32_MIN, INT32_MAX);
|
||||
int32_t const i = (enginecompatibility_mode == ENGINECOMPATIBILITY_19950829 || (abs(templl2)>>11) < templl) ?
|
||||
(int)DivScaleL(templl2, templl, 20) : 0;
|
||||
|
||||
goal = { MulScale(clipr.X, i, 20)+vec.X, MulScale(clipr.y, i, 20)+vec.y };
|
||||
goal = { MulScale(clipr.X, i, 20)+vec.X, MulScale(clipr.Y, i, 20)+vec.Y };
|
||||
}
|
||||
|
||||
int32_t tempint;
|
||||
if (enginecompatibility_mode == ENGINECOMPATIBILITY_19950829)
|
||||
tempint = clipr.X*(move.X>>6)+clipr.y*(move.y>>6);
|
||||
tempint = clipr.X*(move.X>>6)+clipr.Y*(move.Y>>6);
|
||||
else
|
||||
tempint = DMulScale(clipr.X, move.X, clipr.y, move.y, 6);
|
||||
tempint = DMulScale(clipr.X, move.X, clipr.Y, move.Y, 6);
|
||||
|
||||
for (int i=cnt+1, j; i<=clipmoveboxtracenum; ++i)
|
||||
{
|
||||
|
@ -820,9 +820,9 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
|
||||
int32_t tempint2;
|
||||
if (enginecompatibility_mode == ENGINECOMPATIBILITY_19950829)
|
||||
tempint2 = (clipit[j].x2-clipit[j].x1)*(move.X>>6)+(clipit[j].y2-clipit[j].y1)*(move.y>>6);
|
||||
tempint2 = (clipit[j].x2-clipit[j].x1)*(move.X>>6)+(clipit[j].y2-clipit[j].y1)*(move.Y>>6);
|
||||
else
|
||||
tempint2 = DMulScale(clipit[j].x2-clipit[j].x1, move.X, clipit[j].y2-clipit[j].y1, move.y, 6);
|
||||
tempint2 = DMulScale(clipit[j].x2-clipit[j].x1, move.X, clipit[j].y2-clipit[j].y1, move.Y, 6);
|
||||
|
||||
if ((tempint ^ tempint2) < 0)
|
||||
{
|
||||
|
@ -832,9 +832,9 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
}
|
||||
}
|
||||
|
||||
keepaway(&goal.X, &goal.y, hitwall);
|
||||
keepaway(&goal.X, &goal.Y, hitwall);
|
||||
xvect = (goal.X-vec.X)<<14;
|
||||
yvect = (goal.y-vec.y)<<14;
|
||||
yvect = (goal.Y-vec.Y)<<14;
|
||||
|
||||
if (cnt == clipmoveboxtracenum)
|
||||
clipReturn = clipobjectval[hitwall];
|
||||
|
@ -847,7 +847,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
|
|||
}
|
||||
|
||||
pos->x = vec.X;
|
||||
pos->y = vec.y;
|
||||
pos->y = vec.Y;
|
||||
cnt--;
|
||||
} while ((xvect|yvect) != 0 && hitwall >= 0 && cnt > 0);
|
||||
|
||||
|
@ -1046,7 +1046,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
|
|||
if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE)
|
||||
getsectordist(closest, sectnum, &closest);
|
||||
else
|
||||
getzsofslopeptr(sect,closest.X,closest.y,ceilz,florz);
|
||||
getzsofslopeptr(sect,closest.X,closest.Y,ceilz,florz);
|
||||
ceilhit.setSector(sect);
|
||||
florhit.setSector(sect);
|
||||
|
||||
|
@ -1071,16 +1071,16 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
|
|||
vec2_t const v2 = wal.point2Wall()->pos;
|
||||
|
||||
if ((v1.X < xmin && (v2.X < xmin)) || (v1.X > xmax && v2.X > xmax) ||
|
||||
(v1.y < ymin && (v2.y < ymin)) || (v1.y > ymax && v2.y > ymax))
|
||||
(v1.Y < ymin && (v2.Y < ymin)) || (v1.Y > ymax && v2.Y > ymax))
|
||||
continue;
|
||||
|
||||
vec2_t const d = { v2.X-v1.X, v2.y-v1.y };
|
||||
if (d.X*(pos.y-v1.y) < (pos.x-v1.X)*d.y) continue; //back
|
||||
vec2_t const d = { v2.X-v1.X, v2.Y-v1.Y };
|
||||
if (d.X*(pos.y-v1.Y) < (pos.x-v1.X)*d.Y) continue; //back
|
||||
|
||||
vec2_t da = { (d.X > 0) ? d.X*(ymin-v1.y) : d.X*(ymax-v1.y),
|
||||
(d.y > 0) ? d.y*(xmax-v1.X) : d.y*(xmin-v1.X) };
|
||||
vec2_t da = { (d.X > 0) ? d.X*(ymin-v1.Y) : d.X*(ymax-v1.Y),
|
||||
(d.Y > 0) ? d.Y*(xmax-v1.X) : d.Y*(xmin-v1.X) };
|
||||
|
||||
if (da.X >= da.y)
|
||||
if (da.X >= da.Y)
|
||||
continue;
|
||||
|
||||
if (wal.cstat & EWallFlags::FromInt(dawalclipmask)) continue; // XXX?
|
||||
|
@ -1094,13 +1094,13 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
|
|||
|
||||
if (((v1.X < xmin + MAXCLIPDIST) && (v2.X < xmin + MAXCLIPDIST)) ||
|
||||
((v1.X > xmax - MAXCLIPDIST) && (v2.X > xmax - MAXCLIPDIST)) ||
|
||||
((v1.y < ymin + MAXCLIPDIST) && (v2.y < ymin + MAXCLIPDIST)) ||
|
||||
((v1.y > ymax - MAXCLIPDIST) && (v2.y > ymax - MAXCLIPDIST)))
|
||||
((v1.Y < ymin + MAXCLIPDIST) && (v2.Y < ymin + MAXCLIPDIST)) ||
|
||||
((v1.Y > ymax - MAXCLIPDIST) && (v2.Y > ymax - MAXCLIPDIST)))
|
||||
continue;
|
||||
|
||||
if (d.X > 0) da.X += d.X*MAXCLIPDIST; else da.X -= d.X*MAXCLIPDIST;
|
||||
if (d.y > 0) da.y -= d.y*MAXCLIPDIST; else da.y += d.y*MAXCLIPDIST;
|
||||
if (da.X >= da.y)
|
||||
if (d.Y > 0) da.Y -= d.Y*MAXCLIPDIST; else da.Y += d.Y*MAXCLIPDIST;
|
||||
if (da.X >= da.Y)
|
||||
continue;
|
||||
//It actually got here, through all the continue's!!!
|
||||
int32_t daz = 0, daz2 = 0;
|
||||
|
@ -1108,7 +1108,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
|
|||
if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE)
|
||||
getsectordist(closest, nextsectno, &closest);
|
||||
else
|
||||
getzsofslopeptr(nextsect, closest.X,closest.y, &daz,&daz2);
|
||||
getzsofslopeptr(nextsect, closest.X,closest.Y, &daz,&daz2);
|
||||
|
||||
{
|
||||
if (daz > *ceilz)
|
||||
|
@ -1148,7 +1148,7 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
|
|||
case CSTAT_SPRITE_ALIGNMENT_FACING:
|
||||
{
|
||||
int32_t k = walldist+(spr->clipdist<<2)+1;
|
||||
if ((abs(v1.X-pos.x) <= k) && (abs(v1.y-pos.y) <= k))
|
||||
if ((abs(v1.X-pos.x) <= k) && (abs(v1.Y-pos.y) <= k))
|
||||
{
|
||||
daz = spr->z + spriteheightofsptr(spr, &k, 1);
|
||||
daz2 = daz - k;
|
||||
|
@ -1160,9 +1160,9 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
|
|||
case CSTAT_SPRITE_ALIGNMENT_WALL:
|
||||
{
|
||||
vec2_t v2;
|
||||
get_wallspr_points(spr, &v1.X, &v2.X, &v1.y, &v2.y);
|
||||
get_wallspr_points(spr, &v1.X, &v2.X, &v1.Y, &v2.Y);
|
||||
|
||||
if (clipinsideboxline(pos.x,pos.y,v1.X,v1.y,v2.X,v2.y,walldist+1) != 0)
|
||||
if (clipinsideboxline(pos.x,pos.y,v1.X,v1.Y,v2.X,v2.Y,walldist+1) != 0)
|
||||
{
|
||||
int32_t k;
|
||||
daz = spr->z + spriteheightofsptr(spr, &k, 1);
|
||||
|
@ -1183,13 +1183,13 @@ void getzrange(const vec3_t& pos, sectortype* sect, int32_t* ceilz, CollisionBas
|
|||
|
||||
vec2_t v2, v3, v4;
|
||||
get_floorspr_points((uspriteptr_t) spr, pos.x, pos.y, &v1.X, &v2.X, &v3.X, &v4.X,
|
||||
&v1.y, &v2.y, &v3.y, &v4.y, spriteGetSlope(spr));
|
||||
&v1.Y, &v2.Y, &v3.Y, &v4.Y, spriteGetSlope(spr));
|
||||
|
||||
vec2_t const da = { MulScale(bcos(spr->ang - 256), walldist + 4, 14),
|
||||
MulScale(bsin(spr->ang - 256), walldist + 4, 14) };
|
||||
|
||||
v1.X += da.X; v2.X -= da.y; v3.X -= da.X; v4.X += da.y;
|
||||
v1.y += da.y; v2.y += da.X; v3.y -= da.y; v4.y -= da.X;
|
||||
v1.X += da.X; v2.X -= da.Y; v3.X -= da.X; v4.X += da.Y;
|
||||
v1.Y += da.Y; v2.Y += da.X; v3.Y -= da.Y; v4.Y -= da.X;
|
||||
|
||||
clipyou = get_floorspr_clipyou(v1, v2, v3, v4);
|
||||
break;
|
||||
|
@ -1241,7 +1241,7 @@ int32_t try_facespr_intersect(uspriteptr_t const spr, vec3_t const in,
|
|||
|
||||
int32_t const topu = vx * (sprpos.y - in.y) - vy * (sprpos.x - in.x);
|
||||
vec2_t const off = { Scale(vx, topu, bot), Scale(vy, topu, bot) };
|
||||
int32_t const dist = off.X * off.X + off.y * off.y;
|
||||
int32_t const dist = off.X * off.X + off.Y * off.Y;
|
||||
|
||||
siz = tileWidth(spr->picnum) * spr->xrepeat;
|
||||
|
||||
|
|
|
@ -56,9 +56,9 @@ static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall,
|
|||
{
|
||||
vec2_t const w = wall[dawall].pos;
|
||||
vec2_t const w2 = wall[dawall].point2Wall()->pos;
|
||||
vec2_t const d = { w2.X - w.X, w2.y - w.y };
|
||||
vec2_t const d = { w2.X - w.X, w2.Y - w.Y };
|
||||
|
||||
int64_t i = d.X * ((int64_t)p.X - w.X) + d.y * ((int64_t)p.y - w.y);
|
||||
int64_t i = d.X * ((int64_t)p.X - w.X) + d.Y * ((int64_t)p.Y - w.Y);
|
||||
|
||||
if (i <= 0)
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall,
|
|||
return;
|
||||
}
|
||||
|
||||
int64_t const j = (int64_t)d.X * d.X + (int64_t)d.y * d.y;
|
||||
int64_t const j = (int64_t)d.X * d.X + (int64_t)d.Y * d.Y;
|
||||
|
||||
if (i >= j)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall,
|
|||
|
||||
i = ((i << 15) / j) << 15;
|
||||
|
||||
*closest = { (int32_t)(w.X + ((d.X * i) >> 30)), (int32_t)(w.y + ((d.y * i) >> 30)) };
|
||||
*closest = { (int32_t)(w.X + ((d.X * i) >> 30)), (int32_t)(w.Y + ((d.Y * i) >> 30)) };
|
||||
}
|
||||
|
||||
int32_t xdimen = -1, xdimenscale, xdimscale;
|
||||
|
@ -187,8 +187,8 @@ int32_t lintersect(const int32_t originX, const int32_t originY, const int32_t o
|
|||
const vec2_t originDiff = { lineStartX-originX,
|
||||
lineStartY-originY };
|
||||
|
||||
const int32_t rayCrossLineVec = ray.X*lineVec.y - ray.y*lineVec.X;
|
||||
const int32_t originDiffCrossRay = originDiff.X*ray.y - originDiff.y*ray.X;
|
||||
const int32_t rayCrossLineVec = ray.X*lineVec.Y - ray.Y*lineVec.X;
|
||||
const int32_t originDiffCrossRay = originDiff.X*ray.Y - originDiff.Y*ray.X;
|
||||
|
||||
if (rayCrossLineVec == 0)
|
||||
{
|
||||
|
@ -199,9 +199,9 @@ int32_t lintersect(const int32_t originX, const int32_t originY, const int32_t o
|
|||
}
|
||||
|
||||
// line segments are collinear
|
||||
const int32_t rayLengthSquared = ray.X*ray.X + ray.y*ray.y;
|
||||
const int32_t rayDotOriginDiff = ray.X*originDiff.X + ray.y*originDiff.y;
|
||||
const int32_t rayDotLineEndDiff = rayDotOriginDiff + ray.X*lineVec.X + ray.y*lineVec.y;
|
||||
const int32_t rayLengthSquared = ray.X*ray.X + ray.Y*ray.Y;
|
||||
const int32_t rayDotOriginDiff = ray.X*originDiff.X + ray.Y*originDiff.Y;
|
||||
const int32_t rayDotLineEndDiff = rayDotOriginDiff + ray.X*lineVec.X + ray.Y*lineVec.Y;
|
||||
int64_t t = min(rayDotOriginDiff, rayDotLineEndDiff);
|
||||
if (rayDotOriginDiff < 0)
|
||||
{
|
||||
|
@ -220,13 +220,13 @@ int32_t lintersect(const int32_t originX, const int32_t originY, const int32_t o
|
|||
t = (t << 24) / rayLengthSquared;
|
||||
|
||||
*intersectionX = originX + MulScale(ray.X, t, 24);
|
||||
*intersectionY = originY + MulScale(ray.y, t, 24);
|
||||
*intersectionY = originY + MulScale(ray.Y, t, 24);
|
||||
*intersectionZ = originZ + MulScale(destZ-originZ, t, 24);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
const int32_t originDiffCrossLineVec = originDiff.X*lineVec.y - originDiff.y*lineVec.X;
|
||||
const int32_t originDiffCrossLineVec = originDiff.X*lineVec.Y - originDiff.Y*lineVec.X;
|
||||
static const int32_t signBit = 1u<<31u;
|
||||
// Any point on either line can be expressed as p+t*r and q+u*s
|
||||
// The two line segments intersect when we can find a t & u such that p+t*r = q+u*s
|
||||
|
@ -249,7 +249,7 @@ int32_t lintersect(const int32_t originX, const int32_t originY, const int32_t o
|
|||
// For sake of completeness/readability, alternative to the above approach for an early out & avoidance of an extra division:
|
||||
|
||||
*intersectionX = originX + MulScale(ray.X, t, 24);
|
||||
*intersectionY = originY + MulScale(ray.y, t, 24);
|
||||
*intersectionY = originY + MulScale(ray.Y, t, 24);
|
||||
*intersectionZ = originZ + MulScale(destZ-originZ, t, 24);
|
||||
|
||||
return 1;
|
||||
|
@ -377,8 +377,8 @@ int32_t inside(int32_t x, int32_t y, const sectortype* sect)
|
|||
// Equivalently, the branch is taken iff
|
||||
// y1 != y2 AND y_m <= y < y_M,
|
||||
// where y_m := min(y1, y2) and y_M := max(y1, y2).
|
||||
if ((v1.y^v2.y) < 0)
|
||||
cnt ^= (((v1.X^v2.X) >= 0) ? v1.X : (v1.X*v2.y-v2.X*v1.y)^v2.y);
|
||||
if ((v1.Y^v2.Y) < 0)
|
||||
cnt ^= (((v1.X^v2.X) >= 0) ? v1.X : (v1.X*v2.Y-v2.X*v1.Y)^v2.Y);
|
||||
}
|
||||
return cnt>>31;
|
||||
}
|
||||
|
@ -683,19 +683,19 @@ int32_t getwalldist(vec2_t const in, int const wallnum)
|
|||
{
|
||||
vec2_t closest;
|
||||
getclosestpointonwall_internal(in, wallnum, &closest);
|
||||
return abs(closest.X - in.X) + abs(closest.y - in.y);
|
||||
return abs(closest.X - in.X) + abs(closest.Y - in.Y);
|
||||
}
|
||||
|
||||
int32_t getwalldist(vec2_t const in, int const wallnum, vec2_t * const out)
|
||||
{
|
||||
getclosestpointonwall_internal(in, wallnum, out);
|
||||
return abs(out->X - in.X) + abs(out->y - in.y);
|
||||
return abs(out->X - in.X) + abs(out->Y - in.Y);
|
||||
}
|
||||
|
||||
|
||||
int32_t getsectordist(vec2_t const in, int const sectnum, vec2_t * const out /*= nullptr*/)
|
||||
{
|
||||
if (inside_p(in.X, in.y, sectnum))
|
||||
if (inside_p(in.X, in.Y, sectnum))
|
||||
{
|
||||
if (out)
|
||||
*out = in;
|
||||
|
@ -811,9 +811,9 @@ void rotatepoint(vec2_t const pivot, vec2_t p, int16_t const daang, vec2_t * con
|
|||
int const dacos = bcos(daang);
|
||||
int const dasin = bsin(daang);
|
||||
p.X -= pivot.X;
|
||||
p.y -= pivot.y;
|
||||
p2->X = DMulScale(p.X, dacos, -p.y, dasin, 14) + pivot.X;
|
||||
p2->y = DMulScale(p.y, dacos, p.X, dasin, 14) + pivot.y;
|
||||
p.Y -= pivot.Y;
|
||||
p2->X = DMulScale(p.X, dacos, -p.Y, dasin, 14) + pivot.X;
|
||||
p2->Y = DMulScale(p.Y, dacos, p.X, dasin, 14) + pivot.Y;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -822,9 +822,9 @@ void rotatepoint(vec2_t const pivot, vec2_t p, int16_t const daang, vec2_t * con
|
|||
void videoSetViewableArea(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
|
||||
{
|
||||
windowxy1.X = x1;
|
||||
windowxy1.y = y1;
|
||||
windowxy1.Y = y1;
|
||||
windowxy2.X = x2;
|
||||
windowxy2.y = y2;
|
||||
windowxy2.Y = y2;
|
||||
|
||||
xdimen = (x2-x1)+1;
|
||||
ydimen = (y2-y1)+1;
|
||||
|
@ -884,8 +884,8 @@ void renderRestoreTarget()
|
|||
|
||||
xdim = bakxsiz;
|
||||
ydim = bakysiz;
|
||||
videoSetViewableArea(bakwindowxy1.X,bakwindowxy1.y,
|
||||
bakwindowxy2.X,bakwindowxy2.y);
|
||||
videoSetViewableArea(bakwindowxy1.X,bakwindowxy1.Y,
|
||||
bakwindowxy2.X,bakwindowxy2.Y);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -249,8 +249,8 @@ static void resizeglcheck(void)
|
|||
|
||||
ratio = 1.f/ratio;
|
||||
|
||||
GLInterface.SetViewport(windowxy1.X-(fovcorrect/2), ydim-(windowxy2.y+1),
|
||||
ourxdimen+fovcorrect, windowxy2.y-windowxy1.y+1);
|
||||
GLInterface.SetViewport(windowxy1.X-(fovcorrect/2), ydim-(windowxy2.Y+1),
|
||||
ourxdimen+fovcorrect, windowxy2.Y-windowxy1.Y+1);
|
||||
|
||||
float m[4][4]{};
|
||||
|
||||
|
@ -406,7 +406,7 @@ static void polymost_drawpoly(FVector2 const * const dpxy, int32_t const n, int3
|
|||
bool success = GLInterface.SetTexture(globalskytex? globalskytex : tileGetTexture(globalpicnum), !hw_int_useindexedcolortextures && globalskytex ? 0 : palid, sampleroverride);
|
||||
if (!success)
|
||||
{
|
||||
tsiz.X = tsiz.y = 1;
|
||||
tsiz.X = tsiz.Y = 1;
|
||||
GLInterface.SetColorMask(false); //Hack to update Z-buffer for invalid mirror textures
|
||||
}
|
||||
|
||||
|
@ -454,7 +454,7 @@ static void polymost_drawpoly(FVector2 const * const dpxy, int32_t const n, int3
|
|||
|
||||
GLInterface.SetColor(pc[0], pc[1], pc[2], pc[3]);
|
||||
|
||||
FVector2 const scale = { 1.f / tsiz2.X, 1.f / tsiz2.y };
|
||||
FVector2 const scale = { 1.f / tsiz2.X, 1.f / tsiz2.Y };
|
||||
auto data = screen->mVertexData->AllocVertices(npoints);
|
||||
auto vt = data.first;
|
||||
for (intptr_t i = 0; i < npoints; ++i, vt++)
|
||||
|
@ -1005,7 +1005,7 @@ static void polymost_internal_nonparallaxed(FVector2 n0, FVector2 n1, float ryp0
|
|||
|
||||
float r;
|
||||
|
||||
int length = ksqrt(uhypsq(xy.X, xy.y));
|
||||
int length = ksqrt(uhypsq(xy.X, xy.Y));
|
||||
if (globalorientation & 2)
|
||||
{
|
||||
r = 1.f / length;
|
||||
|
@ -1016,7 +1016,7 @@ static void polymost_internal_nonparallaxed(FVector2 n0, FVector2 n1, float ryp0
|
|||
r = i * (1.f/1048576.f);
|
||||
}
|
||||
|
||||
FVector2 const fxy = { xy.X*r, xy.y*r };
|
||||
FVector2 const fxy = { xy.X*r, xy.Y*r };
|
||||
|
||||
ft[0] = ((float)(globalposx - sec->firstWall()->x)) * fxy.X + ((float)(globalposy - sec->firstWall()->y)) * fxy.Y;
|
||||
ft[1] = ((float)(globalposy - sec->firstWall()->y)) * fxy.X - ((float)(globalposx - sec->firstWall()->x)) * fxy.Y;
|
||||
|
@ -1219,10 +1219,10 @@ static inline int32_t testvisiblemost(float const x0, float const x1)
|
|||
static inline int polymost_getclosestpointonwall(vec2_t const * const pos, int32_t dawall, vec2_t * const n)
|
||||
{
|
||||
vec2_t const w = { wall[dawall].x, wall[dawall].y };
|
||||
vec2_t const d = { POINT2(dawall).x - w.X, POINT2(dawall).y - w.y };
|
||||
int64_t i = d.X * ((int64_t)pos->X - w.X) + d.y * ((int64_t)pos->y - w.y);
|
||||
vec2_t const d = { POINT2(dawall).x - w.X, POINT2(dawall).y - w.Y };
|
||||
int64_t i = d.X * ((int64_t)pos->X - w.X) + d.Y * ((int64_t)pos->Y - w.Y);
|
||||
|
||||
if (d.X == 0 && d.y == 0)
|
||||
if (d.X == 0 && d.Y == 0)
|
||||
{
|
||||
// In Blood's E1M1 this gets triggered for wall 522.
|
||||
return 1;
|
||||
|
@ -1231,7 +1231,7 @@ static inline int polymost_getclosestpointonwall(vec2_t const * const pos, int32
|
|||
if (i < 0)
|
||||
return 1;
|
||||
|
||||
int64_t const j = (int64_t)d.X * d.X + (int64_t)d.y * d.y;
|
||||
int64_t const j = (int64_t)d.X * d.X + (int64_t)d.Y * d.Y;
|
||||
|
||||
if (i > j)
|
||||
return 1;
|
||||
|
@ -1239,7 +1239,7 @@ static inline int polymost_getclosestpointonwall(vec2_t const * const pos, int32
|
|||
i = ((i << 15) / j) << 15;
|
||||
|
||||
n->X = w.X + ((d.X * i) >> 30);
|
||||
n->y = w.y + ((d.y * i) >> 30);
|
||||
n->Y = w.Y + ((d.Y * i) >> 30);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1756,7 +1756,7 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
if (maskingOneWay)
|
||||
{
|
||||
vec2_t n, pos = { globalposx, globalposy };
|
||||
if (!polymost_getclosestpointonwall(&pos, wallnum, &n) && abs(pos.X - n.X) + abs(pos.y - n.y) <= 128)
|
||||
if (!polymost_getclosestpointonwall(&pos, wallnum, &n) && abs(pos.X - n.X) + abs(pos.Y - n.Y) <= 128)
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1809,27 +1809,27 @@ int32_t wallfront(int32_t l1, int32_t l2)
|
|||
vec2_t const l1p2vect = wall[thewall[l1]].point2Wall()->pos;
|
||||
vec2_t const l2vect = wall[thewall[l2]].pos;
|
||||
vec2_t const l2p2vect = wall[thewall[l2]].point2Wall()->pos;
|
||||
vec2_t d = { l1p2vect.X - l1vect.X, l1p2vect.y - l1vect.y };
|
||||
int32_t t1 = DMulScale(l2vect.X - l1vect.X, d.y, -d.X, l2vect.y - l1vect.y, 2); //p1(l2) vs. l1
|
||||
int32_t t2 = DMulScale(l2p2vect.X - l1vect.X, d.y, -d.X, l2p2vect.y - l1vect.y, 2); //p2(l2) vs. l1
|
||||
vec2_t d = { l1p2vect.X - l1vect.X, l1p2vect.Y - l1vect.Y };
|
||||
int32_t t1 = DMulScale(l2vect.X - l1vect.X, d.Y, -d.X, l2vect.Y - l1vect.Y, 2); //p1(l2) vs. l1
|
||||
int32_t t2 = DMulScale(l2p2vect.X - l1vect.X, d.Y, -d.X, l2p2vect.Y - l1vect.Y, 2); //p2(l2) vs. l1
|
||||
|
||||
if (t1 == 0) { if (t2 == 0) return -1; t1 = t2; }
|
||||
if (t2 == 0) t2 = t1;
|
||||
|
||||
if ((t1 ^ t2) >= 0) //pos vs. l1
|
||||
return (DMulScale(globalposx - l1vect.X, d.y, -d.X, globalposy - l1vect.y, 2) ^ t1) >= 0;
|
||||
return (DMulScale(globalposx - l1vect.X, d.Y, -d.X, globalposy - l1vect.Y, 2) ^ t1) >= 0;
|
||||
|
||||
d.X = l2p2vect.X - l2vect.X;
|
||||
d.y = l2p2vect.y - l2vect.y;
|
||||
d.Y = l2p2vect.Y - l2vect.Y;
|
||||
|
||||
t1 = DMulScale(l1vect.X - l2vect.X, d.y, -d.X, l1vect.y - l2vect.y, 2); //p1(l1) vs. l2
|
||||
t2 = DMulScale(l1p2vect.X - l2vect.X, d.y, -d.X, l1p2vect.y - l2vect.y, 2); //p2(l1) vs. l2
|
||||
t1 = DMulScale(l1vect.X - l2vect.X, d.Y, -d.X, l1vect.Y - l2vect.Y, 2); //p1(l1) vs. l2
|
||||
t2 = DMulScale(l1p2vect.X - l2vect.X, d.Y, -d.X, l1p2vect.Y - l2vect.Y, 2); //p2(l1) vs. l2
|
||||
|
||||
if (t1 == 0) { if (t2 == 0) return -1; t1 = t2; }
|
||||
if (t2 == 0) t2 = t1;
|
||||
|
||||
if ((t1 ^ t2) >= 0) //pos vs. l2
|
||||
return (DMulScale(globalposx - l2vect.X, d.y, -d.X, globalposy - l2vect.y, 2) ^ t1) < 0;
|
||||
return (DMulScale(globalposx - l2vect.X, d.Y, -d.X, globalposy - l2vect.Y, 2) ^ t1) < 0;
|
||||
|
||||
return -2;
|
||||
}
|
||||
|
@ -1884,12 +1884,12 @@ void polymost_scansector(int32_t sectnum)
|
|||
|
||||
if ((spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) ||
|
||||
(hw_models && tile2model[spr->picnum].modelid>=0) ||
|
||||
((s.X * gcosang) + (s.y * gsinang) > 0))
|
||||
((s.X * gcosang) + (s.Y * gsinang) > 0))
|
||||
{
|
||||
if ((spr->cstat&(CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_MASK))!=(CSTAT_SPRITE_ONE_SIDE | CSTAT_SPRITE_ALIGNMENT_WALL) ||
|
||||
(r_voxels && tiletovox[spr->picnum] >= 0 && voxmodels[tiletovox[spr->picnum]]) ||
|
||||
(r_voxels && gi->Voxelize(spr->picnum) > -1) ||
|
||||
DMulScale(bcos(spr->ang), -s.X, bsin(spr->ang), -s.y, 6) > 0)
|
||||
DMulScale(bcos(spr->ang), -s.X, bsin(spr->ang), -s.Y, 6) > 0)
|
||||
if (!renderAddTsprite(pm_tsprite, pm_spritesortcnt, act))
|
||||
break;
|
||||
}
|
||||
|
@ -2111,7 +2111,7 @@ void polymost_drawrooms()
|
|||
//if (glprojectionhacks == 2)
|
||||
{
|
||||
// calculates the extend of the zenith glitch
|
||||
float verticalfovtan = (fviewingrange * (windowxy2.y-windowxy1.y) * 5.f) / ((float)yxaspect * (windowxy2.X-windowxy1.X) * 4.f);
|
||||
float verticalfovtan = (fviewingrange * (windowxy2.Y-windowxy1.Y) * 5.f) / ((float)yxaspect * (windowxy2.X-windowxy1.X) * 4.f);
|
||||
float verticalfov = atanf(verticalfovtan) * (2.f / pi::pi());
|
||||
static constexpr float const maxhorizangle = 0.6361136f; // horiz of 199 in degrees
|
||||
float zenglitch = verticalfov + maxhorizangle - 0.95f; // less than 1 because the zenith glitch extends a bit
|
||||
|
@ -2170,8 +2170,8 @@ void polymost_drawrooms()
|
|||
//Generate viewport trapezoid (for handling screen up/down)
|
||||
FVector3 p[4] = { { 0-1, 0-1+ghorizcorrect, 0 },
|
||||
{ (float)(windowxy2.X + 1 - windowxy1.X + 2), 0-1+ghorizcorrect, 0 },
|
||||
{ (float)(windowxy2.X + 1 - windowxy1.X + 2), (float)(windowxy2.y + 1 - windowxy1.y + 2)+ghorizcorrect, 0 },
|
||||
{ 0-1, (float)(windowxy2.y + 1 - windowxy1.y + 2)+ghorizcorrect, 0 } };
|
||||
{ (float)(windowxy2.X + 1 - windowxy1.X + 2), (float)(windowxy2.Y + 1 - windowxy1.Y + 2)+ghorizcorrect, 0 },
|
||||
{ 0-1, (float)(windowxy2.Y + 1 - windowxy1.Y + 2)+ghorizcorrect, 0 } };
|
||||
|
||||
for (auto & v : p)
|
||||
{
|
||||
|
@ -2499,7 +2499,7 @@ void polymost_prepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang
|
|||
//if (glprojectionhacks == 2)
|
||||
{
|
||||
// calculates the extent of the zenith glitch
|
||||
float verticalfovtan = (fviewingrange * (windowxy2.y-windowxy1.y) * 5.f) / ((float)yxaspect * (windowxy2.X-windowxy1.X) * 4.f);
|
||||
float verticalfovtan = (fviewingrange * (windowxy2.Y-windowxy1.Y) * 5.f) / ((float)yxaspect * (windowxy2.X-windowxy1.X) * 4.f);
|
||||
float verticalfov = atanf(verticalfovtan) * (2.f / pi::pi());
|
||||
static constexpr float const maxhorizangle = 0.6361136f; // horiz of 199 in degrees
|
||||
float zenglitch = verticalfov + maxhorizangle - 0.95f; // less than 1 because the zenith glitch extends a bit
|
||||
|
@ -2577,10 +2577,10 @@ static inline int32_t polymost_findwall(tspritetype const * const tspr, vec2_t c
|
|||
|
||||
for(auto& wal : wallsofsector(sect))
|
||||
{
|
||||
if ((!wal.twoSided() || ((wal.nextSector()->ceilingz > (tspr->z - ((tsiz->y * tspr->yrepeat) << 2))) ||
|
||||
if ((!wal.twoSided() || ((wal.nextSector()->ceilingz > (tspr->z - ((tsiz->Y * tspr->yrepeat) << 2))) ||
|
||||
wal.nextSector()->floorz < tspr->z)) && !polymost_getclosestpointonwall((const vec2_t *) tspr, wallnum(&wal), &n))
|
||||
{
|
||||
int const dst = abs(tspr->x - n.X) + abs(tspr->y - n.y);
|
||||
int const dst = abs(tspr->x - n.X) + abs(tspr->y - n.Y);
|
||||
|
||||
if (dst <= dist)
|
||||
{
|
||||
|
@ -2682,7 +2682,7 @@ void polymost_drawsprite(int32_t snum)
|
|||
if (!(tspr->cstat2 & CSTAT2_SPRITE_SLOPE))
|
||||
{
|
||||
off.X += tspr->xoffset;
|
||||
off.y += tspr->yoffset;
|
||||
off.Y += tspr->yoffset;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2749,10 +2749,10 @@ void polymost_drawsprite(int32_t snum)
|
|||
else
|
||||
tsiz = { tileWidth(globalpicnum), tileHeight(globalpicnum) };
|
||||
|
||||
if (tsiz.X <= 0 || tsiz.y <= 0)
|
||||
if (tsiz.X <= 0 || tsiz.Y <= 0)
|
||||
return;
|
||||
|
||||
FVector2 const ftsiz = { (float) tsiz.X, (float) tsiz.y };
|
||||
FVector2 const ftsiz = { (float) tsiz.X, (float) tsiz.Y };
|
||||
|
||||
switch ((globalorientation >> 4) & 3)
|
||||
{
|
||||
|
@ -2788,11 +2788,11 @@ void polymost_drawsprite(int32_t snum)
|
|||
|
||||
if (tsiz.X & 1)
|
||||
s0.X += ff.X * 0.5f;
|
||||
if (globalorientation & 128 && tsiz.y & 1)
|
||||
if (globalorientation & 128 && tsiz.Y & 1)
|
||||
s0.Y += ff.Y * 0.5f;
|
||||
|
||||
s0.X -= ff.X * (float) off.X;
|
||||
s0.Y -= ff.Y * (float) off.y;
|
||||
s0.Y -= ff.Y * (float) off.Y;
|
||||
|
||||
ff.X *= ftsiz.X;
|
||||
ff.Y *= ftsiz.Y;
|
||||
|
@ -2852,7 +2852,7 @@ void polymost_drawsprite(int32_t snum)
|
|||
pxy[2].Y = pxy[3].Y = s0.Y;
|
||||
}
|
||||
|
||||
vec2_16_t tempsiz = { (int16_t)tsiz.X, (int16_t)tsiz.y };
|
||||
vec2_16_t tempsiz = { (int16_t)tsiz.X, (int16_t)tsiz.Y };
|
||||
pow2xsplit = 0;
|
||||
if (globalshade > 63) globalshade = 63; // debug
|
||||
polymost_drawpoly(pxy, 4, method, tempsiz);
|
||||
|
@ -2869,7 +2869,7 @@ void polymost_drawsprite(int32_t snum)
|
|||
off.X = -off.X;
|
||||
|
||||
if (globalorientation & 8)
|
||||
off.y = -off.y;
|
||||
off.Y = -off.Y;
|
||||
|
||||
FVector2 const extent = { float(tspr->xrepeat * bsinf(tspr->ang, -16)),
|
||||
float(tspr->xrepeat * -bcosf(tspr->ang, -16)) };
|
||||
|
@ -2890,8 +2890,8 @@ void polymost_drawsprite(int32_t snum)
|
|||
vec2_t v = { /*Blrintf(vf.x)*/(int)vf.X, /*Blrintf(vf.y)*/(int)vf.Y };
|
||||
|
||||
if (walldist <= 2 || ((pos.x - v.X) + (pos.x + v.X)) == (wall[w].x + POINT2(w).x) ||
|
||||
((pos.y - v.y) + (pos.y + v.y)) == (wall[w].y + POINT2(w).y) ||
|
||||
polymost_lintersect(pos.x - v.X, pos.y - v.y, pos.x + v.X, pos.y + v.y, wall[w].x, wall[w].y,
|
||||
((pos.y - v.Y) + (pos.y + v.Y)) == (wall[w].y + POINT2(w).y) ||
|
||||
polymost_lintersect(pos.x - v.X, pos.y - v.Y, pos.x + v.X, pos.y + v.Y, wall[w].x, wall[w].y,
|
||||
POINT2(w).x, POINT2(w).y))
|
||||
{
|
||||
int32_t const ang = getangle(wall[w].x - POINT2(w).x, wall[w].y - POINT2(w).y);
|
||||
|
@ -2940,13 +2940,13 @@ 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)
|
||||
if (tsiz.Y & 1)
|
||||
pos.z += (tspr->yrepeat << 1); // Odd yspans
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -3019,7 +3019,7 @@ void polymost_drawsprite(int32_t snum)
|
|||
|
||||
FVector2 const pxy[4] = { { sx0, sc0 }, { sx1, sc1 }, { sx1, sf1 }, { sx0, sf0 } };
|
||||
|
||||
vec2_16_t tempsiz = { (int16_t)tsiz.X, (int16_t)tsiz.y };
|
||||
vec2_16_t tempsiz = { (int16_t)tsiz.X, (int16_t)tsiz.Y };
|
||||
pow2xsplit = 0;
|
||||
polymost_drawpoly(pxy, 4, method, tempsiz);
|
||||
|
||||
|
@ -3043,12 +3043,12 @@ void polymost_drawsprite(int32_t snum)
|
|||
if ((globalorientation & 4) > 0)
|
||||
off.X = -off.X;
|
||||
if ((globalorientation & 8) > 0)
|
||||
off.y = -off.y;
|
||||
off.Y = -off.Y;
|
||||
|
||||
FVector2 const p0 = { (float)(((tsiz.X + 1) >> 1) - off.X) * tspr->xrepeat,
|
||||
(float)(((tsiz.y + 1) >> 1) - off.y) * tspr->yrepeat * ratio },
|
||||
(float)(((tsiz.Y + 1) >> 1) - off.Y) * tspr->yrepeat * ratio },
|
||||
p1 = { (float)((tsiz.X >> 1) + off.X) * tspr->xrepeat,
|
||||
(float)((tsiz.y >> 1) + off.y) * tspr->yrepeat * ratio };
|
||||
(float)((tsiz.Y >> 1) + off.Y) * tspr->yrepeat * ratio };
|
||||
|
||||
float const c = bcosf(tspr->ang, -16);
|
||||
float const s = bsinf(tspr->ang, -16);
|
||||
|
@ -3225,7 +3225,7 @@ void polymost_drawsprite(int32_t snum)
|
|||
xtex.v *= rr; ytex.v *= rr; otex.v *= rr;
|
||||
}
|
||||
|
||||
vec2_16_t tempsiz = { (int16_t)tsiz.X, (int16_t)tsiz.y };
|
||||
vec2_16_t tempsiz = { (int16_t)tsiz.X, (int16_t)tsiz.Y };
|
||||
pow2xsplit = 0;
|
||||
|
||||
polymost_drawpoly(pxy2, npoints, method, tempsiz);
|
||||
|
@ -3703,7 +3703,7 @@ void renderDrawMasks(void)
|
|||
for (jj = 0; jj < numpts; jj++)
|
||||
{
|
||||
spr.X = (float)pp[jj].X;
|
||||
spr.Y = (float)pp[jj].y;
|
||||
spr.Y = (float)pp[jj].Y;
|
||||
|
||||
if (!sameside(&maskeq, &spr, &pos)) // behind the maskwall,
|
||||
if ((sameside(&p1eq, &middle, &spr) && // inside the 'cone',
|
||||
|
|
|
@ -324,7 +324,7 @@ void drawlinergb(int32_t x1, int32_t y1, int32_t x2, int32_t y2, PalEntry p)
|
|||
twod->AddThickLine(x1 / 4096, y1 / 4096, x2 / 4096, y2 / 4096, am_linethickness, p, uint8_t(am_linealpha * 255));
|
||||
} else {
|
||||
// Use more efficient thin line drawing routine.
|
||||
twod->AddLine(x1 / 4096.f, y1 / 4096.f, x2 / 4096.f, y2 / 4096.f, windowxy1.X, windowxy1.y, windowxy2.X, windowxy2.y, p, uint8_t(am_linealpha * 255));
|
||||
twod->AddLine(x1 / 4096.f, y1 / 4096.f, x2 / 4096.f, y2 / 4096.f, windowxy1.X, windowxy1.Y, windowxy2.X, windowxy2.Y, p, uint8_t(am_linealpha * 255));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -601,7 +601,7 @@ void renderDrawMapView(int cposx, int cposy, int czoom, int cang)
|
|||
}
|
||||
|
||||
twod->AddPoly(tileGetTexture(picnum, true), vertices.Data(), vertices.Size(), (unsigned*)indices->Data(), indices->Size(), translation, light,
|
||||
LegacyRenderStyles[STYLE_Translucent], windowxy1.X, windowxy1.y, windowxy2.X + 1, windowxy2.y + 1);
|
||||
LegacyRenderStyles[STYLE_Translucent], windowxy1.X, windowxy1.Y, windowxy2.X + 1, windowxy2.Y + 1);
|
||||
}
|
||||
}
|
||||
qsort(floorsprites.Data(), floorsprites.Size(), sizeof(spritetype*), [](const void* a, const void* b)
|
||||
|
@ -622,7 +622,7 @@ void renderDrawMapView(int cposx, int cposy, int czoom, int cang)
|
|||
for (unsigned j = 0; j < 4; j++)
|
||||
{
|
||||
int ox = pp[j].X - cposx;
|
||||
int oy = pp[j].y - cposy;
|
||||
int oy = pp[j].Y - cposy;
|
||||
int x1 = DMulScale(ox, xvect, -oy, yvect, 16) + (width << 11);
|
||||
int y1 = DMulScale(oy, xvect, ox, yvect, 16) + (height << 11);
|
||||
vertices[j] = { x1 / 4096.f, y1 / 4096.f, j == 1 || j == 2 ? 1.f : 0.f, j == 2 || j == 3 ? 1.f : 0.f };
|
||||
|
@ -646,7 +646,7 @@ void renderDrawMapView(int cposx, int cposy, int czoom, int cang)
|
|||
gotpic.Set(picnum);
|
||||
const static unsigned indices[] = { 0, 1, 2, 0, 2, 3 };
|
||||
twod->AddPoly(tileGetTexture(picnum, true), vertices.Data(), vertices.Size(), indices, 6, translation, color, rs,
|
||||
windowxy1.X, windowxy1.y, windowxy2.X + 1, windowxy2.y + 1);
|
||||
windowxy1.X, windowxy1.Y, windowxy2.X + 1, windowxy2.Y + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -236,8 +236,8 @@ static bool System_DisableTextureFilter()
|
|||
|
||||
static IntRect System_GetSceneRect()
|
||||
{
|
||||
int viewbottom = windowxy2.y + 1;
|
||||
int viewheight = viewbottom - windowxy1.y;
|
||||
int viewbottom = windowxy2.Y + 1;
|
||||
int viewheight = viewbottom - windowxy1.Y;
|
||||
int viewright = windowxy2.X + 1;
|
||||
int viewwidth = viewright - windowxy1.X;
|
||||
|
||||
|
@ -248,7 +248,7 @@ static IntRect System_GetSceneRect()
|
|||
|
||||
IntRect mSceneViewport;
|
||||
mSceneViewport.left = windowxy1.X;
|
||||
mSceneViewport.top = screen->GetHeight() - (renderheight + windowxy1.y - ((renderheight - viewheight) / 2));
|
||||
mSceneViewport.top = screen->GetHeight() - (renderheight + windowxy1.Y - ((renderheight - viewheight) / 2));
|
||||
mSceneViewport.width = viewwidth;
|
||||
mSceneViewport.height = renderheight;
|
||||
return mSceneViewport;
|
||||
|
@ -1411,7 +1411,7 @@ void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double
|
|||
double crosshair_scale = crosshairscale * scale;
|
||||
DrawTexture(twod, tile, 160 + xdelta, 100 + ydelta, DTA_Color, color,
|
||||
DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, crosshair_scale, DTA_ScaleY, crosshair_scale, DTA_CenterOffsetRel, true,
|
||||
DTA_ViewportX, windowxy1.X, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.X - windowxy1.X + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, TAG_DONE);
|
||||
DTA_ViewportX, windowxy1.X, DTA_ViewportY, windowxy1.Y, DTA_ViewportWidth, windowxy2.X - windowxy1.X + 1, DTA_ViewportHeight, windowxy2.Y - windowxy1.Y + 1, TAG_DONE);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1419,8 +1419,8 @@ void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double
|
|||
// 0 means 'game provided crosshair' - use type 2 as fallback.
|
||||
ST_LoadCrosshair(crosshair == 0 ? 2 : *crosshair, false);
|
||||
|
||||
double xpos = (windowxy1.X + windowxy2.X) / 2 + xdelta * (windowxy2.y - windowxy1.y) / 240.;
|
||||
double ypos = (windowxy1.y + windowxy2.y) / 2;
|
||||
double xpos = (windowxy1.X + windowxy2.X) / 2 + xdelta * (windowxy2.Y - windowxy1.Y) / 240.;
|
||||
double ypos = (windowxy1.Y + windowxy2.Y) / 2;
|
||||
ST_DrawCrosshair(health, xpos, ypos, 1);
|
||||
}
|
||||
}
|
||||
|
@ -1525,9 +1525,9 @@ DEFINE_ACTION_FUNCTION(_Screen, GetViewWindow)
|
|||
{
|
||||
PARAM_PROLOGUE;
|
||||
if (numret > 0) ret[0].SetInt(windowxy1.X);
|
||||
if (numret > 1) ret[1].SetInt(windowxy1.y);
|
||||
if (numret > 1) ret[1].SetInt(windowxy1.Y);
|
||||
if (numret > 2) ret[2].SetInt(windowxy2.X - windowxy1.X + 1);
|
||||
if (numret > 3) ret[3].SetInt(windowxy2.y - windowxy1.y + 1);
|
||||
if (numret > 3) ret[3].SetInt(windowxy2.Y - windowxy1.Y + 1);
|
||||
return min(numret, 4);
|
||||
}
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ int getslopeval(sectortype* sect, int x, int y, int z, int basez)
|
|||
{
|
||||
auto wal = sect->firstWall();
|
||||
auto delta = wal->delta();
|
||||
int i = (y - wal->y) * delta.X - (x - wal->x) * delta.y;
|
||||
int i = (y - wal->y) * delta.X - (x - wal->x) * delta.Y;
|
||||
return i == 0? 0 : Scale((z - basez) << 8, wal->Length(), i);
|
||||
}
|
||||
|
||||
|
@ -262,9 +262,9 @@ void GetWallSpritePosition(const tspritetype* spr, vec2_t pos, vec2_t* out, bool
|
|||
int origin = (width >> 1) + xoff;
|
||||
|
||||
out[0].X = pos.X - MulScale(x, origin, 16);
|
||||
out[0].y = pos.y - MulScale(y, origin, 16);
|
||||
out[0].Y = pos.Y - MulScale(y, origin, 16);
|
||||
out[1].X = out[0].X + MulScale(x, width, 16);
|
||||
out[1].y = out[0].y + MulScale(y, width, 16);
|
||||
out[1].Y = out[0].Y + MulScale(y, width, 16);
|
||||
}
|
||||
|
||||
|
||||
|
@ -308,10 +308,10 @@ void TGetFlatSpritePosition(const spritetypebase* spr, vec2_t pos, vec2_t* out,
|
|||
int sinangslope = DivScale(sinang, ratio, 12);
|
||||
|
||||
out[0].X = pos.X + DMulScale(sinang, sprcenterx, cosangslope, sprcentery, 16);
|
||||
out[0].y = pos.y + DMulScale(sinangslope, sprcentery, -cosang, sprcenterx, 16);
|
||||
out[0].Y = pos.Y + DMulScale(sinangslope, sprcentery, -cosang, sprcenterx, 16);
|
||||
|
||||
out[1].X = out[0].X - MulScale(sinang, width, 16);
|
||||
out[1].y = out[0].y + MulScale(cosang, width, 16);
|
||||
out[1].Y = out[0].Y + MulScale(cosang, width, 16);
|
||||
|
||||
vec2_t sub = { MulScale(cosangslope, height, 16), MulScale(sinangslope, height, 16) };
|
||||
out[2] = out[1] - sub;
|
||||
|
@ -323,7 +323,7 @@ void TGetFlatSpritePosition(const spritetypebase* spr, vec2_t pos, vec2_t* out,
|
|||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int spos = DMulScale(-sinang, out[i].y - spr->y, -cosang, out[i].X - spr->x, 4);
|
||||
int spos = DMulScale(-sinang, out[i].Y - spr->y, -cosang, out[i].X - spr->x, 4);
|
||||
outz[i] = MulScale(heinum, spos, 18);
|
||||
}
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ FSerializer& Serialize(FSerializer& arc, const char* key, vec2_t& c, vec2_t* def
|
|||
if (arc.BeginObject(key))
|
||||
{
|
||||
arc("x", c.X, def ? &def->X : nullptr)
|
||||
("y", c.y, def ? &def->y : nullptr)
|
||||
("y", c.Y, def ? &def->Y : nullptr)
|
||||
.EndObject();
|
||||
}
|
||||
return arc;
|
||||
|
|
|
@ -65,8 +65,8 @@ void hud_drawsprite(double sx, double sy, double sz, double a, int picnum, int d
|
|||
DTA_ScaleX, sz, DTA_ScaleY, sz,
|
||||
DTA_Color, shadeToLight(dashade),
|
||||
DTA_TranslationIndex, palid,
|
||||
DTA_ViewportX, windowxy1.X, DTA_ViewportY, windowxy1.y,
|
||||
DTA_ViewportWidth, windowxy2.X - windowxy1.X + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1,
|
||||
DTA_ViewportX, windowxy1.X, DTA_ViewportY, windowxy1.Y,
|
||||
DTA_ViewportWidth, windowxy2.X - windowxy1.X + 1, DTA_ViewportHeight, windowxy2.Y - windowxy1.Y + 1,
|
||||
DTA_FullscreenScale, (dastat & RS_STRETCH)? FSMode_ScaleToScreen: FSMode_ScaleToHeight, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200,
|
||||
DTA_CenterOffsetRel, (dastat & (RS_TOPLEFT | RS_CENTER))? 0:2,
|
||||
DTA_TopLeft, !!(dastat & RS_TOPLEFT),
|
||||
|
|
|
@ -454,7 +454,7 @@ void PlayerHorizon::calcviewpitch(vec2_t const pos, binangle const ang, bool con
|
|||
// Get a point, 512 (64 for Blood) units ahead of player's position
|
||||
int const shift = -(isBlood() ? BLOODSINSHIFT : DEFSINSHIFT);
|
||||
int const x = pos.X + ang.bcos(shift);
|
||||
int const y = pos.y + ang.bsin(shift);
|
||||
int const y = pos.Y + ang.bsin(shift);
|
||||
auto tempsect = cursectnum;
|
||||
updatesector(x, y, &tempsect);
|
||||
|
||||
|
@ -462,7 +462,7 @@ void PlayerHorizon::calcviewpitch(vec2_t const pos, binangle const ang, bool con
|
|||
{
|
||||
// Get the floorz as if the new (x,y) point was still in
|
||||
// your sector
|
||||
int const j = getflorzofslopeptr(cursectnum, pos.X, pos.y);
|
||||
int const j = getflorzofslopeptr(cursectnum, pos.X, pos.Y);
|
||||
int const k = getflorzofslopeptr(tempsect, x, y);
|
||||
|
||||
// If extended point is in same sector as you or the slopes
|
||||
|
|
|
@ -9,19 +9,19 @@ struct vec2_16_t
|
|||
|
||||
struct vec2_t
|
||||
{
|
||||
int32_t X, y;
|
||||
int32_t X, Y;
|
||||
|
||||
vec2_t() = default;
|
||||
vec2_t(const vec2_t&) = default;
|
||||
vec2_t(int x, int y_) : X(x), y(y_) {}
|
||||
vec2_t operator+(const vec2_t& other) const { return { X + other.X, y + other.y }; }
|
||||
vec2_t operator-(const vec2_t& other) const { return { X - other.X, y - other.y }; }
|
||||
vec2_t& operator+=(const vec2_t& other) { X += other.X; y += other.y; return *this; };
|
||||
vec2_t& operator-=(const vec2_t& other) { X -= other.X; y -= other.y; return *this; };
|
||||
vec2_t& operator/= (int other) { X /= other; y /= other; return *this; }
|
||||
bool operator == (const vec2_t& other) const { return X == other.X && y == other.y; };
|
||||
vec2_t(int x, int y) : X(x), Y(y) {}
|
||||
vec2_t operator+(const vec2_t& other) const { return { X + other.X, Y + other.Y }; }
|
||||
vec2_t operator-(const vec2_t& other) const { return { X - other.X, Y - other.Y }; }
|
||||
vec2_t& operator+=(const vec2_t& other) { X += other.X; Y += other.Y; return *this; };
|
||||
vec2_t& operator-=(const vec2_t& other) { X -= other.X; Y -= other.Y; return *this; };
|
||||
vec2_t& operator/= (int other) { X /= other; Y /= other; return *this; }
|
||||
bool operator == (const vec2_t& other) const { return X == other.X && Y == other.Y; };
|
||||
};
|
||||
inline vec2_t operator/ (const vec2_t& vec, int other) { return { vec.X / other, vec.y / other }; }
|
||||
inline vec2_t operator/ (const vec2_t& vec, int other) { return { vec.X / other, vec.Y / other }; }
|
||||
|
||||
struct vec3_t
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ void walltype::calcLength()
|
|||
lengthflags &= ~1;
|
||||
point2Wall()->lengthflags &= ~2;
|
||||
auto d = delta();
|
||||
length = (int)sqrt(d.X * d.X + d.y * d.y);
|
||||
length = (int)sqrt(d.X * d.X + d.Y * d.Y);
|
||||
}
|
||||
|
||||
// needed for skipping over to get the map size first.
|
||||
|
@ -179,7 +179,7 @@ static void ReadSectorV5(FileReader& fr, sectortype& sect)
|
|||
static void ReadWallV7(FileReader& fr, walltype& wall)
|
||||
{
|
||||
wall.pos.X = fr.ReadInt32();
|
||||
wall.pos.y = fr.ReadInt32();
|
||||
wall.pos.Y = fr.ReadInt32();
|
||||
wall.point2 = fr.ReadInt16();
|
||||
wall.nextwall = fr.ReadInt16();
|
||||
wall.nextsector = fr.ReadInt16();
|
||||
|
@ -200,7 +200,7 @@ static void ReadWallV7(FileReader& fr, walltype& wall)
|
|||
static void ReadWallV6(FileReader& fr, walltype& wall)
|
||||
{
|
||||
wall.pos.X = fr.ReadInt32();
|
||||
wall.pos.y = fr.ReadInt32();
|
||||
wall.pos.Y = fr.ReadInt32();
|
||||
wall.point2 = fr.ReadInt16();
|
||||
wall.nextsector = fr.ReadInt16();
|
||||
wall.nextwall = fr.ReadInt16();
|
||||
|
@ -221,7 +221,7 @@ static void ReadWallV6(FileReader& fr, walltype& wall)
|
|||
static void ReadWallV5(FileReader& fr, walltype& wall)
|
||||
{
|
||||
wall.pos.X = fr.ReadInt32();
|
||||
wall.pos.y = fr.ReadInt32();
|
||||
wall.pos.Y = fr.ReadInt32();
|
||||
wall.point2 = fr.ReadInt16();
|
||||
wall.picnum = fr.ReadInt16();
|
||||
wall.overpicnum = fr.ReadInt16();
|
||||
|
|
|
@ -686,7 +686,7 @@ inline void walltype::moved()
|
|||
inline void walltype::move(int newx, int newy)
|
||||
{
|
||||
pos.X = newx;
|
||||
pos.y = newy;
|
||||
pos.Y = newy;
|
||||
lengthflags = 3;
|
||||
sectorp()->dirty = EDirty::AllDirty;
|
||||
}
|
||||
|
|
|
@ -249,7 +249,7 @@ void WriteSavePic(FileWriter* file, int width, int height)
|
|||
writingsavepic = false;
|
||||
xdim = oldx;
|
||||
ydim = oldy;
|
||||
videoSetViewableArea(oldwindowxy1.X, oldwindowxy1.y, oldwindowxy2.X, oldwindowxy2.y);
|
||||
videoSetViewableArea(oldwindowxy1.X, oldwindowxy1.Y, oldwindowxy2.X, oldwindowxy2.Y);
|
||||
}
|
||||
|
||||
void RenderToSavePic(FRenderViewpoint& vp, FileWriter* file, int width, int height)
|
||||
|
|
|
@ -89,7 +89,7 @@ static int sgn(int v)
|
|||
static int dist(const vec2_t& a, const vec2_t& b)
|
||||
{
|
||||
// We only need to know if it's 1 or higher, so this is enough.
|
||||
return abs(a.X - b.X) + abs(a.y - b.y);
|
||||
return abs(a.X - b.X) + abs(a.Y - b.Y);
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,8 +122,8 @@ void StripLoop(TArray<vec2_t>& points)
|
|||
}
|
||||
if (p > 0) p--; // backtrack one point more to ensure we can check the newly formed connection as well.
|
||||
}
|
||||
else if ((points[prev].X == points[p].X && points[next].X == points[p].X && sgn(points[next].y - points[p].y) == sgn(points[prev].y - points[p].y)) ||
|
||||
(points[prev].y == points[p].y && points[next].y == points[p].y && sgn(points[next].X - points[p].X) == sgn(points[prev].X - points[p].X)) ||
|
||||
else if ((points[prev].X == points[p].X && points[next].X == points[p].X && sgn(points[next].Y - points[p].Y) == sgn(points[prev].Y - points[p].Y)) ||
|
||||
(points[prev].Y == points[p].Y && points[next].Y == points[p].Y && sgn(points[next].X - points[p].X) == sgn(points[prev].X - points[p].X)) ||
|
||||
dist(points[prev], points[next]) <= 1) // if the two points are extremely close together, we may also ignore the intermediate point.
|
||||
{
|
||||
// both connections exit the point into the same direction. Here it is sufficient to just delete it so that the neighboring ones connect directly.
|
||||
|
@ -146,16 +146,16 @@ int GetWindingOrder(TArray<vec2_t>& poly, cmp comp1 = cmpLess, cmp comp2 = cmpGr
|
|||
{
|
||||
int n = poly.Size();
|
||||
int minx = poly[0].X;
|
||||
int miny = poly[0].y;
|
||||
int miny = poly[0].Y;
|
||||
int m = 0;
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
if ((comp1(poly[i].y, miny)) || ((poly[i].y == miny) && (comp2(poly[i].X, minx))))
|
||||
if ((comp1(poly[i].Y, miny)) || ((poly[i].Y == miny) && (comp2(poly[i].X, minx))))
|
||||
{
|
||||
m = i;
|
||||
minx = poly[m].X;
|
||||
miny = poly[m].y;
|
||||
miny = poly[m].Y;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,9 +168,9 @@ int GetWindingOrder(TArray<vec2_t>& poly, cmp comp1 = cmpLess, cmp comp2 = cmpGr
|
|||
b[0] = poly[m].X;
|
||||
c[0] = poly[m2].X;
|
||||
|
||||
a[1] = poly[m1].y;
|
||||
b[1] = poly[m].y;
|
||||
c[1] = poly[m2].y;
|
||||
a[1] = poly[m1].Y;
|
||||
b[1] = poly[m].Y;
|
||||
c[1] = poly[m2].Y;
|
||||
|
||||
auto area =
|
||||
a[0] * b[1] - a[1] * b[0] +
|
||||
|
@ -308,13 +308,13 @@ static int insideLoop(int vertex, TArray<int>& loop)
|
|||
auto& pt1 = wal.pos;
|
||||
auto& pt2 = wal.point2Wall()->pos;
|
||||
|
||||
if ((pt1.y >pt.y) != (pt2.y > pt.y)) // skip if both are on the same side.
|
||||
if ((pt1.Y >pt.Y) != (pt2.Y > pt.Y)) // skip if both are on the same side.
|
||||
{
|
||||
// use 64 bit values to avoid overflows in the multiplications below.
|
||||
int64_t deltatx = int64_t(pt.X) - pt1.X;
|
||||
int64_t deltaty = int64_t(pt.y) - pt1.y;
|
||||
int64_t deltaty = int64_t(pt.Y) - pt1.Y;
|
||||
int64_t deltax = int64_t(pt2.X) - pt1.X;
|
||||
int64_t deltay = int64_t(pt2.y) - pt1.y;
|
||||
int64_t deltay = int64_t(pt2.Y) - pt1.Y;
|
||||
//if (x < deltax * (deltaty) / deltay + pt1.x)
|
||||
// reformatted to avoid the division - for nagative deltay the sign needs to be flipped to give the correct result.
|
||||
int64_t result = ((deltay * deltatx - deltax * deltaty) ^ deltay);
|
||||
|
|
|
@ -60,7 +60,7 @@ void BunchDrawer::Init(HWDrawInfo *_di, Clipper* c, vec2_t& view, binangle a1, b
|
|||
di = _di;
|
||||
clipper = c;
|
||||
viewx = view.X * (1/ 16.f);
|
||||
viewy = view.y * -(1/ 16.f);
|
||||
viewy = view.Y * -(1/ 16.f);
|
||||
viewz = (float)di->Viewpoint.Pos.Z;
|
||||
iview = view;
|
||||
StartScene();
|
||||
|
@ -72,7 +72,7 @@ void BunchDrawer::Init(HWDrawInfo *_di, Clipper* c, vec2_t& view, binangle a1, b
|
|||
{
|
||||
// Precalculate the clip angles to avoid doing this repeatedly during level traversal.
|
||||
auto vv = w.pos - view;
|
||||
w.clipangle = bvectangbam(vv.X, vv.y);
|
||||
w.clipangle = bvectangbam(vv.X, vv.Y);
|
||||
}
|
||||
memset(sectionstartang.Data(), -1, sectionstartang.Size() * sizeof(sectionstartang[0]));
|
||||
memset(sectionendang.Data(), -1, sectionendang.Size() * sizeof(sectionendang[0]));
|
||||
|
@ -607,7 +607,7 @@ void BunchDrawer::ProcessSection(int sectionnum, bool portal)
|
|||
if ((spr->cstat & CSTAT_SPRITE_INVISIBLE) || spr->xrepeat == 0 || spr->yrepeat == 0) // skip invisible sprites
|
||||
continue;
|
||||
|
||||
int sx = spr->x - iview.X, sy = spr->y - int(iview.y);
|
||||
int sx = spr->x - iview.X, sy = spr->y - int(iview.Y);
|
||||
|
||||
// this checks if the sprite is it behind the camera, which will not work if the pitch is high enough to necessitate a FOV of more than 180°.
|
||||
//if ((spr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) || (hw_models && tile2model[spr->picnum].modelid >= 0) || ((sx * gcosang) + (sy * gsinang) > 0))
|
||||
|
|
|
@ -393,7 +393,7 @@ void HWDrawInfo::CreateScene(bool portal)
|
|||
mDrawer.RenderScene(&vp.SectCount, 1, portal);
|
||||
|
||||
SetupSprite.Clock();
|
||||
gi->processSprites(tsprite, spritesortcnt, view.X, view.y, vp.Pos.Z * -256, bamang(vp.RotAngle), vp.TicFrac * 65536);
|
||||
gi->processSprites(tsprite, spritesortcnt, view.X, view.Y, vp.Pos.Z * -256, bamang(vp.RotAngle), vp.TicFrac * 65536);
|
||||
DispatchSprites();
|
||||
SetupSprite.Unclock();
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ void HWFlat::MakeVertices(HWDrawInfo* di)
|
|||
float maxofs = -FLT_MAX, minofs = FLT_MAX;
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
float vz = getceilzofslopeptr(Sprite->sectp, pos[i].X, pos[i].y) * (1 / -256.f);
|
||||
float vz = getceilzofslopeptr(Sprite->sectp, pos[i].X, pos[i].Y) * (1 / -256.f);
|
||||
float sz = z + ofsz[i] * (1 / -256.f);
|
||||
int diff = vz - sz;
|
||||
if (diff > maxofs) maxofs = diff;
|
||||
|
@ -154,7 +154,7 @@ void HWFlat::MakeVertices(HWDrawInfo* di)
|
|||
float maxofs = -FLT_MAX, minofs = FLT_MAX;
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
float vz = getflorzofslopeptr(Sprite->sectp, pos[i].X, pos[i].y) * (1 / -256.f);
|
||||
float vz = getflorzofslopeptr(Sprite->sectp, pos[i].X, pos[i].Y) * (1 / -256.f);
|
||||
float sz = z + ofsz[i] * (1 / -256.f);
|
||||
int diff = vz - sz;
|
||||
if (diff > maxofs) maxofs = diff;
|
||||
|
@ -167,7 +167,7 @@ void HWFlat::MakeVertices(HWDrawInfo* di)
|
|||
{
|
||||
const static unsigned indices[] = { 0, 1, 2, 0, 2, 3 };
|
||||
int j = indices[i];
|
||||
vp->SetVertex(pos[j].X * (1 / 16.f), z + ofsz[j] * (1 / -256.f), pos[j].y * (1 / -16.f));
|
||||
vp->SetVertex(pos[j].X * (1 / 16.f), z + ofsz[j] * (1 / -256.f), pos[j].Y * (1 / -16.f));
|
||||
if (!canvas) vp->SetTexCoord(j == 1 || j == 2 ? 1.f - x : x, j == 2 || j == 3 ? 1.f - y : y);
|
||||
else vp->SetTexCoord(j == 1 || j == 2 ? 1.f - x : x, j == 2 || j == 3 ? y : 1.f - y);
|
||||
vp++;
|
||||
|
|
|
@ -536,10 +536,10 @@ bool HWMirrorPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *clippe
|
|||
|
||||
vec2_t view = { int(vp.Pos.X * 16), int(vp.Pos.Y * -16) };
|
||||
|
||||
int64_t i = ((int64_t(view.X) - x) * dx + (int64_t(view.y) - y) * dy) << 1;
|
||||
int64_t i = ((int64_t(view.X) - x) * dx + (int64_t(view.Y) - y) * dy) << 1;
|
||||
|
||||
int newx = int((x << 1) + Scale(dx, i, j) - view.X);
|
||||
int newy = int((y << 1) + Scale(dy, i, j) - view.y);
|
||||
int newy = int((y << 1) + Scale(dy, i, j) - view.Y);
|
||||
|
||||
auto myan = bvectangbam(dx, dy);
|
||||
auto newan = myan + myan - bamang(vp.RotAngle);
|
||||
|
|
|
@ -54,7 +54,7 @@ static int GetClosestPointOnWall(tspritetype* spr, walltype* wal, vec2_t* const
|
|||
auto pos = spr->pos;
|
||||
|
||||
// avoid the math below for orthogonal walls. Here we allow only sprites that exactly match the line's coordinate and orientation
|
||||
if (d.X == 0 && d.y == 0)
|
||||
if (d.X == 0 && d.Y == 0)
|
||||
{
|
||||
// line has no length.
|
||||
// In Blood's E1M1 this gets triggered for wall 522.
|
||||
|
@ -70,10 +70,10 @@ static int GetClosestPointOnWall(tspritetype* spr, walltype* wal, vec2_t* const
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
else if (d.y == 0)
|
||||
else if (d.Y == 0)
|
||||
{
|
||||
// line is horizontal.
|
||||
if (abs(pos.y - w.y) <= 1 && (spr->ang & 0x3ff) == 0x200)
|
||||
if (abs(pos.y - w.Y) <= 1 && (spr->ang & 0x3ff) == 0x200)
|
||||
{
|
||||
*n = pos.vec2;
|
||||
return 0;
|
||||
|
@ -82,13 +82,13 @@ static int GetClosestPointOnWall(tspritetype* spr, walltype* wal, vec2_t* const
|
|||
}
|
||||
|
||||
|
||||
int64_t i = d.X * ((int64_t)pos.x - w.X) + d.y * ((int64_t)pos.y - w.y);
|
||||
int64_t i = d.X * ((int64_t)pos.x - w.X) + d.Y * ((int64_t)pos.y - w.Y);
|
||||
|
||||
|
||||
if (i < 0)
|
||||
return 1;
|
||||
|
||||
int64_t j = (int64_t)d.X * d.X + (int64_t)d.y * d.y;
|
||||
int64_t j = (int64_t)d.X * d.X + (int64_t)d.Y * d.Y;
|
||||
|
||||
if (i > j)
|
||||
return 1;
|
||||
|
@ -96,7 +96,7 @@ static int GetClosestPointOnWall(tspritetype* spr, walltype* wal, vec2_t* const
|
|||
i = ((i << 15) / j) << 15;
|
||||
|
||||
n->X = w.X + ((d.X * i) >> 30);
|
||||
n->y = w.y + ((d.y * i) >> 30);
|
||||
n->Y = w.Y + ((d.Y * i) >> 30);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ static int IsOnWall(tspritetype* tspr, int height)
|
|||
if ((wal.nextsector == -1 || ((wal.nextSector()->ceilingz > topz) ||
|
||||
wal.nextSector()->floorz < tspr->z)) && !GetClosestPointOnWall(tspr, &wal, &n))
|
||||
{
|
||||
int const dst = abs(tspr->x - n.X) + abs(tspr->y - n.y);
|
||||
int const dst = abs(tspr->x - n.X) + abs(tspr->y - n.Y);
|
||||
|
||||
if (dst <= dist)
|
||||
{
|
||||
|
@ -1137,9 +1137,9 @@ void HWWall::ProcessWallSprite(HWDrawInfo* di, tspritetype* spr, sectortype* sec
|
|||
|
||||
GetWallSpritePosition(spr, spr->pos.vec2, pos, true);
|
||||
glseg.x1 = pos[0].X * (1 / 16.f);
|
||||
glseg.y1 = pos[0].y * (1 / -16.f);
|
||||
glseg.y1 = pos[0].Y * (1 / -16.f);
|
||||
glseg.x2 = pos[1].X * (1 / 16.f);
|
||||
glseg.y2 = pos[1].y * (1 / -16.f);
|
||||
glseg.y2 = pos[1].Y * (1 / -16.f);
|
||||
|
||||
if (spr->cstat & CSTAT_SPRITE_ONE_SIDE)
|
||||
{
|
||||
|
|
|
@ -231,7 +231,7 @@ static int OutlineToFloat(Outline& outl, FOutline& polygon)
|
|||
for (unsigned j = 0; j < outl[i].Size(); j++)
|
||||
{
|
||||
float X = RenderX(outl[i][j].X);
|
||||
float Y = RenderY(outl[i][j].y);
|
||||
float Y = RenderY(outl[i][j].Y);
|
||||
if (fabs(X) > 32768.f || fabs(Y) > 32768.f)
|
||||
{
|
||||
// If we get here there's some fuckery going around with the coordinates. Let's better abort and wait for things to realign.
|
||||
|
|
|
@ -285,14 +285,14 @@ bool CheckProximityWall(walltype* pWall, int x, int y, int nDist)
|
|||
int GetWallAngle(walltype* pWall)
|
||||
{
|
||||
auto delta = pWall->delta();
|
||||
return getangle(delta.X, delta.y);
|
||||
return getangle(delta.X, delta.Y);
|
||||
}
|
||||
|
||||
void GetWallNormal(walltype* pWall, int *pX, int *pY)
|
||||
{
|
||||
|
||||
auto delta = pWall->delta();
|
||||
int dX = -delta.y >> 4;
|
||||
int dX = -delta.Y >> 4;
|
||||
int dY = delta.X >> 4;
|
||||
|
||||
int nLength = ksqrt(dX*dX+dY*dY);
|
||||
|
@ -348,15 +348,15 @@ int HitScan(DBloodActor *actor, int z, int dx, int dy, int dz, unsigned int nMas
|
|||
if (nRange)
|
||||
{
|
||||
hitscangoal.X = x + MulScale(nRange << 4, Cos(pSprite->ang), 30);
|
||||
hitscangoal.y = y + MulScale(nRange << 4, Sin(pSprite->ang), 30);
|
||||
hitscangoal.Y = y + MulScale(nRange << 4, Sin(pSprite->ang), 30);
|
||||
}
|
||||
else
|
||||
{
|
||||
hitscangoal.X = hitscangoal.y = 0x1ffffff;
|
||||
hitscangoal.X = hitscangoal.Y = 0x1ffffff;
|
||||
}
|
||||
hitscan({ x, y, z }, pSprite->sector(), { dx, dy, dz << 4 }, gHitInfo, nMask);
|
||||
|
||||
hitscangoal.X = hitscangoal.y = 0x1ffffff;
|
||||
hitscangoal.X = hitscangoal.Y = 0x1ffffff;
|
||||
pSprite->cstat = bakCstat;
|
||||
if (gHitInfo.actor() != nullptr)
|
||||
return 3;
|
||||
|
@ -393,16 +393,16 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in
|
|||
if (nRange)
|
||||
{
|
||||
hitscangoal.X = x1+MulScale(nRange<<4, Cos(pSprite->ang), 30);
|
||||
hitscangoal.y = y1+MulScale(nRange<<4, Sin(pSprite->ang), 30);
|
||||
hitscangoal.Y = y1+MulScale(nRange<<4, Sin(pSprite->ang), 30);
|
||||
}
|
||||
else
|
||||
{
|
||||
hitscangoal.X = hitscangoal.y = 0x1fffffff;
|
||||
hitscangoal.X = hitscangoal.Y = 0x1fffffff;
|
||||
}
|
||||
vec3_t pos = { x1, y1, z1 };
|
||||
hitscan(pos, pSprite->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1);
|
||||
|
||||
hitscangoal.X = hitscangoal.y = 0x1ffffff;
|
||||
hitscangoal.X = hitscangoal.Y = 0x1ffffff;
|
||||
pSprite->cstat = bakCstat;
|
||||
while (nNum--)
|
||||
{
|
||||
|
|
|
@ -49,15 +49,15 @@ static void UpdateFrame(void)
|
|||
int width = twod->GetWidth();
|
||||
int height = twod->GetHeight();
|
||||
|
||||
twod->AddFlatFill(0, 0, width, windowxy1.y - 3, tex);
|
||||
twod->AddFlatFill(0, windowxy2.y + 4, width, height, tex);
|
||||
twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.X - 3, windowxy2.y + 4, tex);
|
||||
twod->AddFlatFill(windowxy2.X + 4, windowxy1.y - 3, width, windowxy2.y + 4, tex);
|
||||
twod->AddFlatFill(0, 0, width, windowxy1.Y - 3, tex);
|
||||
twod->AddFlatFill(0, windowxy2.Y + 4, width, height, tex);
|
||||
twod->AddFlatFill(0, windowxy1.Y - 3, windowxy1.X - 3, windowxy2.Y + 4, tex);
|
||||
twod->AddFlatFill(windowxy2.X + 4, windowxy1.Y - 3, width, windowxy2.Y + 4, tex);
|
||||
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy1.y - 3, windowxy1.X, windowxy2.y + 1, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy1.X, windowxy1.y - 3, windowxy2.X + 4, windowxy1.y, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy2.X + 1, windowxy1.y, windowxy2.X + 4, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy2.y + 1, windowxy2.X + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy1.Y - 3, windowxy1.X, windowxy2.Y + 1, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy1.X, windowxy1.Y - 3, windowxy2.X + 4, windowxy1.Y, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy2.X + 1, windowxy1.Y, windowxy2.X + 4, windowxy2.Y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy2.Y + 1, windowxy2.X + 1, windowxy2.Y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
}
|
||||
|
||||
void UpdateStatusBar()
|
||||
|
|
|
@ -812,7 +812,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
|
|||
for (auto& wal : wallsofsector(pSector))
|
||||
{
|
||||
x = wal.baseWall.X;
|
||||
y = wal.baseWall.y;
|
||||
y = wal.baseWall.Y;
|
||||
if (vbp)
|
||||
RotatePoint((int*)&x, (int*)&y, vbp, a4, a5);
|
||||
DragPoint(&wal, x+vc-a4, y+v8-a5);
|
||||
|
@ -824,7 +824,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
|
|||
{
|
||||
auto p2Wall = wal.point2Wall();
|
||||
x = wal.baseWall.X;
|
||||
y = wal.baseWall.y;
|
||||
y = wal.baseWall.Y;
|
||||
if (wal.cstat & CSTAT_WALL_MOVE_FORWARD)
|
||||
{
|
||||
if (vbp)
|
||||
|
@ -833,7 +833,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
|
|||
if ((p2Wall->cstat & CSTAT_WALL_MOVE_MASK) == 0)
|
||||
{
|
||||
x = p2Wall->baseWall.X;
|
||||
y = p2Wall->baseWall.y;
|
||||
y = p2Wall->baseWall.Y;
|
||||
if (vbp)
|
||||
RotatePoint((int*)&x, (int*)&y, vbp, a4, a5);
|
||||
DragPoint(p2Wall, x+vc-a4, y+v8-a5);
|
||||
|
@ -848,7 +848,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
|
|||
if ((p2Wall->cstat & CSTAT_WALL_MOVE_MASK) == 0)
|
||||
{
|
||||
x = p2Wall->baseWall.X;
|
||||
y = p2Wall->baseWall.y;
|
||||
y = p2Wall->baseWall.Y;
|
||||
if (vbp)
|
||||
RotatePoint((int*)&x, (int*)&y, -vbp, a4, a5);
|
||||
DragPoint(p2Wall, x-(vc-a4), y-(v8-a5));
|
||||
|
@ -1967,7 +1967,7 @@ void trInit(TArray<DBloodActor*>& actors)
|
|||
for(auto& wal : wall)
|
||||
{
|
||||
wal.baseWall.X = wal.x;
|
||||
wal.baseWall.y = wal.y;
|
||||
wal.baseWall.Y = wal.y;
|
||||
}
|
||||
for(auto actor : actors)
|
||||
{
|
||||
|
@ -2020,7 +2020,7 @@ void trInit(TArray<DBloodActor*>& actors)
|
|||
for(auto& wal : wallsofsector(pSector))
|
||||
{
|
||||
wal.baseWall.X = wal.x;
|
||||
wal.baseWall.y = wal.y;
|
||||
wal.baseWall.Y = wal.y;
|
||||
}
|
||||
BloodSectIterator it(pSector);
|
||||
while (auto actor = it.Next())
|
||||
|
@ -2039,7 +2039,7 @@ void trInit(TArray<DBloodActor*>& actors)
|
|||
for (auto& wal : wallsofsector(pSector))
|
||||
{
|
||||
wal.baseWall.X = wal.x;
|
||||
wal.baseWall.y = wal.y;
|
||||
wal.baseWall.Y = wal.y;
|
||||
}
|
||||
BloodSectIterator it(pSector);
|
||||
while (auto actor = it.Next())
|
||||
|
|
|
@ -785,8 +785,8 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a
|
|||
double x = xdim / 2. + x1 / double(1 << 12);
|
||||
double y = ydim / 2. + y1 / double(1 << 12);
|
||||
// This very likely needs fixing later
|
||||
DrawTexture(twod, tileGetTexture(nTile, true), xx, yy, DTA_ClipLeft, windowxy1.X, DTA_ClipTop, windowxy1.y, DTA_ScaleX, z/1536., DTA_ScaleY, z/1536., DTA_CenterOffset, true,
|
||||
DTA_ClipRight, windowxy2.X + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE);
|
||||
DrawTexture(twod, tileGetTexture(nTile, true), xx, yy, DTA_ClipLeft, windowxy1.X, DTA_ClipTop, windowxy1.Y, DTA_ScaleX, z/1536., DTA_ScaleY, z/1536., DTA_CenterOffset, true,
|
||||
DTA_ClipRight, windowxy2.X + 1, DTA_ClipBottom, windowxy2.Y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -291,7 +291,7 @@ void ms(DDukeActor* const actor)
|
|||
vec2_t t;
|
||||
rotatepoint({ 0, 0 }, { msx[j], msy[j] }, k & 2047, &t);
|
||||
|
||||
dragpoint(&wal, actor->spr.x + t.X, actor->spr.y + t.y);
|
||||
dragpoint(&wal, actor->spr.x + t.X, actor->spr.y + t.Y);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
@ -2715,7 +2715,7 @@ void handle_se00(DDukeActor* actor, int LASERLINE)
|
|||
rotatepoint(Owner->spr.pos.vec2, ps[p].pos.vec2, (q * l), &res);
|
||||
|
||||
ps[p].bobposx += res.X - ps[p].pos.x;
|
||||
ps[p].bobposy += res.y - ps[p].pos.y;
|
||||
ps[p].bobposy += res.Y - ps[p].pos.y;
|
||||
|
||||
ps[p].pos.vec2 = res;
|
||||
|
||||
|
@ -4327,7 +4327,7 @@ void handle_se26(DDukeActor* actor)
|
|||
if (ps[p].GetActor()->sector() == actor->spr.sector() && ps[p].on_ground)
|
||||
{
|
||||
ps[p].fric.X += l << 5;
|
||||
ps[p].fric.y += x << 5;
|
||||
ps[p].fric.Y += x << 5;
|
||||
ps[p].pos.z += actor->spr.zvel;
|
||||
}
|
||||
|
||||
|
@ -4467,7 +4467,7 @@ void handle_se24(DDukeActor *actor, const int16_t *list1, const int16_t *list2,
|
|||
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;
|
||||
ps[p].fric.Y += l << 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -317,8 +317,8 @@ void cameratext(DDukeActor *cam)
|
|||
{
|
||||
auto drawitem = [=](int tile, double x, double y, bool flipx, bool flipy)
|
||||
{
|
||||
DrawTexture(twod, tileGetTexture(tile), x, y, DTA_ViewportX, windowxy1.X, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.X - windowxy1.X + 1, DTA_CenterOffsetRel, 2,
|
||||
DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, DTA_FlipX, flipx, DTA_FlipY, flipy, DTA_FullscreenScale, FSMode_Fit320x200, TAG_DONE);
|
||||
DrawTexture(twod, tileGetTexture(tile), x, y, DTA_ViewportX, windowxy1.X, DTA_ViewportY, windowxy1.Y, DTA_ViewportWidth, windowxy2.X - windowxy1.X + 1, DTA_CenterOffsetRel, 2,
|
||||
DTA_ViewportHeight, windowxy2.Y - windowxy1.Y + 1, DTA_FlipX, flipx, DTA_FlipY, flipy, DTA_FullscreenScale, FSMode_Fit320x200, TAG_DONE);
|
||||
};
|
||||
if (!cam->temp_data[0])
|
||||
{
|
||||
|
|
|
@ -179,7 +179,7 @@ inline void clearfriction()
|
|||
{
|
||||
for (int i = 0; i != -1; i = connectpoint2[i])
|
||||
{
|
||||
ps[i].fric.X = ps[i].fric.y = 0;
|
||||
ps[i].fric.X = ps[i].fric.Y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -851,7 +851,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
|
|||
{
|
||||
*packet = loc;
|
||||
packet->fvel = MulScale(loc.fvel, p->angle.ang.bcos(), 9) + MulScale(loc.svel, p->angle.ang.bsin(), 9) + p->fric.X;
|
||||
packet->svel = MulScale(loc.fvel, p->angle.ang.bsin(), 9) - MulScale(loc.svel, p->angle.ang.bcos(), 9) + p->fric.y;
|
||||
packet->svel = MulScale(loc.fvel, p->angle.ang.bsin(), 9) - MulScale(loc.svel, p->angle.ang.bcos(), 9) + p->fric.Y;
|
||||
loc = {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1027,7 +1027,7 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
|
|||
{
|
||||
spawned->spr.xvel = -12;
|
||||
auto delta = hit.hitWall->delta();
|
||||
spawned->spr.ang = getangle(-delta.X, -delta.y) + 512; // note the '-' sign here!
|
||||
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;
|
||||
|
|
|
@ -516,7 +516,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
|
|||
{
|
||||
hole->spr.xvel = -1;
|
||||
auto delta = hit.hitWall->delta();
|
||||
hole->spr.ang = getangle(-delta.X, -delta.y) + 512;
|
||||
hole->spr.ang = getangle(-delta.X, -delta.Y) + 512;
|
||||
ssp(hole, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
@ -896,7 +896,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
|
|||
ssp(bomb, CLIPMASK0);
|
||||
bomb->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
||||
auto delta = hit.hitWall->delta();
|
||||
bomb->temp_data[5] = bomb->spr.ang = getangle(-delta.X, -delta.y) - 512;
|
||||
bomb->temp_data[5] = bomb->spr.ang = getangle(-delta.X, -delta.Y) - 512;
|
||||
|
||||
if (p >= 0)
|
||||
ps[p].ammo_amount[TRIPBOMB_WEAPON]--;
|
||||
|
|
|
@ -412,7 +412,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
{
|
||||
l->spr.xvel = -1;
|
||||
auto delta = hit.hitWall->delta();
|
||||
l->spr.ang = getangle(-delta.X, -delta.y) + 512;
|
||||
l->spr.ang = getangle(-delta.X, -delta.Y) + 512;
|
||||
ssp(l, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ void resetplayerstats(int snum)
|
|||
p->posyv = 0;
|
||||
p->poszv = 0;
|
||||
p->fric.X = 0;
|
||||
p->fric.y = 0;
|
||||
p->fric.Y = 0;
|
||||
p->somethingonplayer =nullptr;
|
||||
p->angle.spin = 0;
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
|
|||
.Array("gotweapon", w.gotweapon, MAX_WEAPONS)
|
||||
("pals", w.pals)
|
||||
("fricx", w.fric.X)
|
||||
("fricy", w.fric.y)
|
||||
("fricy", w.fric.Y)
|
||||
("exitx", w.exitx)
|
||||
("exity", w.exity)
|
||||
("numloogs", w.numloogs)
|
||||
|
|
|
@ -53,28 +53,28 @@ void DrawBorder()
|
|||
auto tex = tileGetTexture(TILE_SCREENBORDER);
|
||||
if (tex != nullptr && tex->isValid())
|
||||
{
|
||||
if (windowxy1.y > 0)
|
||||
if (windowxy1.Y > 0)
|
||||
{
|
||||
twod->AddFlatFill(0, 0, twod->GetWidth(), windowxy1.y, tex, false, 1);
|
||||
twod->AddFlatFill(0, 0, twod->GetWidth(), windowxy1.Y, tex, false, 1);
|
||||
}
|
||||
if (windowxy2.y + 1 < twod->GetHeight())
|
||||
if (windowxy2.Y + 1 < twod->GetHeight())
|
||||
{
|
||||
twod->AddFlatFill(0, windowxy2.y + 1, twod->GetWidth(), twod->GetHeight(), tex, false, 1);
|
||||
twod->AddFlatFill(0, windowxy2.Y + 1, twod->GetWidth(), twod->GetHeight(), tex, false, 1);
|
||||
}
|
||||
if (windowxy1.X > 0)
|
||||
{
|
||||
twod->AddFlatFill(0, windowxy1.y, windowxy1.X, windowxy2.y + 1, tex, false, 1);
|
||||
twod->AddFlatFill(0, windowxy1.Y, windowxy1.X, windowxy2.Y + 1, tex, false, 1);
|
||||
}
|
||||
if (windowxy2.X + 1 < twod->GetWidth())
|
||||
{
|
||||
twod->AddFlatFill(windowxy2.X + 1, windowxy1.y, twod->GetWidth(), windowxy2.y + 1, tex, false, 1);
|
||||
twod->AddFlatFill(windowxy2.X + 1, windowxy1.Y, twod->GetWidth(), windowxy2.Y + 1, tex, false, 1);
|
||||
}
|
||||
auto vb = tileGetTexture(TILE_VIEWBORDER);
|
||||
auto ve = tileGetTexture(TILE_VIEWBORDER + 1);
|
||||
int x1 = windowxy1.X - 4;
|
||||
int y1 = windowxy1.y - 4;
|
||||
int y1 = windowxy1.Y - 4;
|
||||
int x2 = windowxy2.X + 5;
|
||||
int y2 = windowxy2.y + 5;
|
||||
int y2 = windowxy2.Y + 5;
|
||||
twod->AddFlatFill(x1, y1, x2, y1 + 4, vb, 5);
|
||||
twod->AddFlatFill(x1, y2 - 4, x2, y2, vb, 6);
|
||||
twod->AddFlatFill(x1, y1, x1 + 4, y2, vb, 1);
|
||||
|
|
|
@ -692,7 +692,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
|
|||
{
|
||||
spawned->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER;
|
||||
auto delta = wal->delta();
|
||||
spawned->spr.ang = getangle(-delta.X, -delta.y) - 512;
|
||||
spawned->spr.ang = getangle(-delta.X, -delta.Y) - 512;
|
||||
|
||||
S_PlayActorSound(SOMETHINGHITFORCE, spawned);
|
||||
}
|
||||
|
|
|
@ -952,15 +952,15 @@ static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n)
|
|||
auto delta = wal->delta();
|
||||
|
||||
x1 -= Sgn(delta.X);
|
||||
y1 += Sgn(delta.y);
|
||||
y1 += Sgn(delta.Y);
|
||||
|
||||
delta.X /= j;
|
||||
delta.y /= j;
|
||||
delta.Y /= j;
|
||||
|
||||
for (j = n; j > 0; j--)
|
||||
{
|
||||
x1 += delta.X;
|
||||
y1 += delta.y;
|
||||
y1 += delta.Y;
|
||||
|
||||
updatesector(x1, y1, §);
|
||||
if (sect)
|
||||
|
|
|
@ -1091,14 +1091,14 @@ void lotsofglass(DDukeActor *actor, walltype* wal, int n)
|
|||
int y1 = wal->y;
|
||||
auto delta = wal->delta() / (n + 1);
|
||||
|
||||
x1 -= Sgn(delta.y);
|
||||
x1 -= Sgn(delta.Y);
|
||||
y1 += Sgn(delta.X);
|
||||
|
||||
|
||||
for (j = n; j > 0; j--)
|
||||
{
|
||||
x1 += delta.X;
|
||||
y1 += delta.y;
|
||||
y1 += delta.Y;
|
||||
|
||||
updatesector(x1, y1, §);
|
||||
if (sect)
|
||||
|
@ -1150,7 +1150,7 @@ void ceilingglass(DDukeActor* actor, sectortype* sectp, int n)
|
|||
for (j = n; j > 0; j--)
|
||||
{
|
||||
x1 += delta.X;
|
||||
y1 += delta.y;
|
||||
y1 += delta.Y;
|
||||
a = krand() & 2047;
|
||||
z = sectp->ceilingz + ((krand() & 15) << 8);
|
||||
EGS(sectp, x1, y1, z, TILE_GLASSPIECES + (j % 3), -32, 36, 36, a, (krand() & 31), 0, actor, 5);
|
||||
|
@ -1189,7 +1189,7 @@ void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n)
|
|||
for (j = n; j > 0; j--)
|
||||
{
|
||||
x1 += delta.X;
|
||||
y1 += delta.y;
|
||||
y1 += delta.Y;
|
||||
|
||||
updatesector(x1, y1, §);
|
||||
z = sect->floorz - (krand() & (abs(sect->ceilingz - sect->floorz)));
|
||||
|
|
|
@ -269,7 +269,7 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val)
|
|||
|
||||
ebx = x2;
|
||||
|
||||
int y2 = y - average.y;
|
||||
int y2 = y - average.Y;
|
||||
if (y2 < 0) {
|
||||
y2 = -y2;
|
||||
}
|
||||
|
|
|
@ -100,8 +100,8 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a
|
|||
double x = xdim / 2. + x1 / double(1 << 12);
|
||||
double y = ydim / 2. + y1 / double(1 << 12);
|
||||
// This very likely needs fixing later
|
||||
DrawTexture(twod, tileGetTexture(nTile /*+ ((PlayClock >> 4) & 3)*/, true), xx, yy, DTA_ClipLeft, windowxy1.X, DTA_ClipTop, windowxy1.y, DTA_ScaleX, z / 1536., DTA_ScaleY, z / 1536., DTA_CenterOffset, true,
|
||||
DTA_ClipRight, windowxy2.X + 1, DTA_ClipBottom, windowxy2.y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE);
|
||||
DrawTexture(twod, tileGetTexture(nTile /*+ ((PlayClock >> 4) & 3)*/, true), xx, yy, DTA_ClipLeft, windowxy1.X, DTA_ClipTop, windowxy1.Y, DTA_ScaleX, z / 1536., DTA_ScaleY, z / 1536., DTA_CenterOffset, true,
|
||||
DTA_ClipRight, windowxy2.X + 1, DTA_ClipBottom, windowxy2.Y + 1, DTA_Alpha, (pSprite->cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1259,7 +1259,7 @@ int GetWallNormal(walltype* pWall)
|
|||
{
|
||||
auto delta = pWall->delta();
|
||||
|
||||
int nAngle = GetMyAngle(delta.X, delta.y);
|
||||
int nAngle = GetMyAngle(delta.X, delta.Y);
|
||||
return (nAngle + 512) & kAngleMask;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,15 +122,15 @@ void UpdateFrame()
|
|||
{
|
||||
auto tex = tileGetTexture(nBackgroundPic);
|
||||
|
||||
twod->AddFlatFill(0, 0, xdim, windowxy1.y - 3, tex);
|
||||
twod->AddFlatFill(0, windowxy2.y + 4, xdim, ydim, tex);
|
||||
twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.X - 3, windowxy2.y + 4, tex);
|
||||
twod->AddFlatFill(windowxy2.X + 4, windowxy1.y - 3, xdim, windowxy2.y + 4, tex);
|
||||
twod->AddFlatFill(0, 0, xdim, windowxy1.Y - 3, tex);
|
||||
twod->AddFlatFill(0, windowxy2.Y + 4, xdim, ydim, tex);
|
||||
twod->AddFlatFill(0, windowxy1.Y - 3, windowxy1.X - 3, windowxy2.Y + 4, tex);
|
||||
twod->AddFlatFill(windowxy2.X + 4, windowxy1.Y - 3, xdim, windowxy2.Y + 4, tex);
|
||||
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy1.y - 3, windowxy1.X, windowxy2.y + 1, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy1.X, windowxy1.y - 3, windowxy2.X + 4, windowxy1.y, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy2.X + 1, windowxy1.y, windowxy2.X + 4, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy2.y + 1, windowxy2.X + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy1.Y - 3, windowxy1.X, windowxy2.Y + 1, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy1.X, windowxy1.Y - 3, windowxy2.X + 4, windowxy1.Y, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy2.X + 1, windowxy1.Y, windowxy2.X + 4, windowxy2.Y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy2.Y + 1, windowxy2.X + 1, windowxy2.Y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
}
|
||||
|
||||
void StatusMessage(int messageTime, const char* fmt, ...)
|
||||
|
|
|
@ -164,7 +164,7 @@ int testquadinsect(int *point_num, vec2_t const * q, sectortype* sect)
|
|||
|
||||
for (i=0; i < 4; i++)
|
||||
{
|
||||
if (!inside(q[i].X, q[i].y, sect))
|
||||
if (!inside(q[i].X, q[i].Y, sect))
|
||||
{
|
||||
*point_num = i;
|
||||
|
||||
|
@ -175,8 +175,8 @@ int testquadinsect(int *point_num, vec2_t const * q, sectortype* sect)
|
|||
for (i=0; i<4; i++)
|
||||
{
|
||||
next_i = (i+1) & 3;
|
||||
if (!cansee(q[i].X, q[i].y,0x3fffffff, sect,
|
||||
q[next_i].X, q[next_i].y,0x3fffffff, sect))
|
||||
if (!cansee(q[i].X, q[i].Y,0x3fffffff, sect,
|
||||
q[next_i].X, q[next_i].Y,0x3fffffff, sect))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
|
|||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
xy[i].X = qx[i] + (pp->xvect>>14);
|
||||
xy[i].y = qy[i] + (pp->yvect>>14);
|
||||
xy[i].Y = qy[i] + (pp->yvect>>14);
|
||||
}
|
||||
|
||||
//Given the 4 points: x[4], y[4]
|
||||
|
@ -215,7 +215,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
|
|||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
xy[i].X = qx[i] - (pp->yvect>>15);
|
||||
xy[i].y = qy[i] + (pp->xvect>>15);
|
||||
xy[i].Y = qy[i] + (pp->xvect>>15);
|
||||
}
|
||||
if (testquadinsect(&point_num, xy, pp->cursector))
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
|
|||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
xy[i].X = qx[i] + (pp->yvect>>15);
|
||||
xy[i].y = qy[i] - (pp->xvect>>15);
|
||||
xy[i].Y = qy[i] - (pp->xvect>>15);
|
||||
}
|
||||
if (testquadinsect(&point_num, xy, pp->cursector))
|
||||
{
|
||||
|
@ -290,7 +290,7 @@ short RectClipTurn(PLAYERp pp, short new_ang, int *qx, int *qy, int *ox, int *oy
|
|||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
qx[i] = xy[i].X;
|
||||
qy[i] = xy[i].y;
|
||||
qy[i] = xy[i].Y;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -373,7 +373,7 @@ int DoRotator(DSWActor* actor)
|
|||
vec2_t const orig = { r->origX[ndx], r->origY[ndx] };
|
||||
rotatepoint(pivot->pos.vec2, orig, r->pos, &nxy);
|
||||
|
||||
dragpoint(&wal, nxy.X, nxy.y);
|
||||
dragpoint(&wal, nxy.X, nxy.Y);
|
||||
ndx++;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,15 +57,15 @@ static void UpdateFrame(void)
|
|||
static const int kBackTile = 51;
|
||||
auto tex = tileGetTexture(kBackTile);
|
||||
|
||||
twod->AddFlatFill(0, 0, xdim, windowxy1.y - 3, tex);
|
||||
twod->AddFlatFill(0, windowxy2.y + 4, xdim, ydim, tex);
|
||||
twod->AddFlatFill(0, windowxy1.y - 3, windowxy1.X - 3, windowxy2.y + 4, tex);
|
||||
twod->AddFlatFill(windowxy2.X + 4, windowxy1.y - 3, xdim, windowxy2.y + 4, tex);
|
||||
twod->AddFlatFill(0, 0, xdim, windowxy1.Y - 3, tex);
|
||||
twod->AddFlatFill(0, windowxy2.Y + 4, xdim, ydim, tex);
|
||||
twod->AddFlatFill(0, windowxy1.Y - 3, windowxy1.X - 3, windowxy2.Y + 4, tex);
|
||||
twod->AddFlatFill(windowxy2.X + 4, windowxy1.Y - 3, xdim, windowxy2.Y + 4, tex);
|
||||
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy1.y - 3, windowxy1.X, windowxy2.y + 1, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy1.X, windowxy1.y - 3, windowxy2.X + 4, windowxy1.y, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy2.X + 1, windowxy1.y, windowxy2.X + 4, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy2.y + 1, windowxy2.X + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy1.Y - 3, windowxy1.X, windowxy2.Y + 1, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy1.X, windowxy1.Y - 3, windowxy2.X + 4, windowxy1.Y, tex, 0, 1, 0xff545454);
|
||||
twod->AddFlatFill(windowxy2.X + 1, windowxy1.Y, windowxy2.X + 4, windowxy2.Y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
twod->AddFlatFill(windowxy1.X - 3, windowxy2.Y + 1, windowxy2.X + 1, windowxy2.Y + 4, tex, 0, 1, 0xff2a2a2a);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -1710,11 +1710,11 @@ void MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny)
|
|||
|
||||
if (wal.extra && TEST(wal.extra, WALLFX_LOOP_OUTER))
|
||||
{
|
||||
dragpoint(&wal, rxy.X, rxy.y);
|
||||
dragpoint(&wal, rxy.X, rxy.Y);
|
||||
}
|
||||
else
|
||||
{
|
||||
wal.move(rxy.X, rxy.y);
|
||||
wal.move(rxy.X, rxy.Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -343,7 +343,7 @@ void PM_WriteSavePic(FileWriter* file, int width, int height)
|
|||
|
||||
xdim = oldx;
|
||||
ydim = oldy;
|
||||
videoSetViewableArea(oldwindowxy1.X, oldwindowxy1.y, oldwindowxy2.X, oldwindowxy2.y);
|
||||
videoSetViewableArea(oldwindowxy1.X, oldwindowxy1.Y, oldwindowxy2.X, oldwindowxy2.Y);
|
||||
|
||||
// The 2D drawers can contain some garbage from the dirty render setup. Get rid of that first.
|
||||
twod->Clear();
|
||||
|
|
Loading…
Reference in a new issue