Commit 23b0d6b3 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: make a few things in clipmove() const that I must have missed the last time I worked on it

Not a particularly exciting set of changes.
parent bb8db7d4
......@@ -1175,9 +1175,9 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int
(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 const p1 = wal->pos;
vec2_t const p2 = wal2->pos;
vec2_t const d = { p2.x-p1.x, p2.y-p1.y };
if (d.x * (pos->y-p1.y) < (pos->x-p1.x) * d.y)
continue; //If wall's not facing you
......@@ -1346,8 +1346,8 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int
if (clipinsideboxline(cent.x, cent.y, p1.x, p1.y, p2.x, p2.y, rad) != 0)
{
vec2_t v = { mulscale14(sintable[(spr->ang+256+512) & 2047], walldist),
mulscale14(sintable[(spr->ang+256) & 2047], walldist) };
vec2_t const v = { mulscale14(sintable[(spr->ang+256+512) & 2047], walldist),
mulscale14(sintable[(spr->ang+256) & 2047], walldist) };
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, (int16_t)j+49152, false);
......@@ -1382,8 +1382,8 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int
get_floorspr_points((uspriteptr_t) spr, 0, 0, &rxi[0], &rxi[1], &rxi[2], &rxi[3],
&ryi[0], &ryi[1], &ryi[2], &ryi[3], spriteGetSlope(j));
vec2_t v = { mulscale14(sintable[(spr->ang-256+512)&2047], walldist),
mulscale14(sintable[(spr->ang-256)&2047], walldist) };
vec2_t const v = { mulscale14(sintable[(spr->ang-256+512)&2047], walldist),
mulscale14(sintable[(spr->ang-256)&2047], walldist) };
if ((rxi[0]-pos->x) * (ryi[1]-pos->y) < (rxi[1]-pos->x) * (ryi[0]-pos->y))
{
......@@ -1427,8 +1427,8 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int
get_floorspr_points((uspriteptr_t) spr, 0, 0, &rxi[0], &rxi[1], &rxi[2], &rxi[3],
&ryi[0], &ryi[1], &ryi[2], &ryi[3], spriteGetSlope(j));
vec2_t v = { mulscale14(sintable[(spr->ang-256+512)&2047], walldist),
mulscale14(sintable[(spr->ang-256)&2047], walldist) };
vec2_t const v = { mulscale14(sintable[(spr->ang-256+512)&2047], walldist),
mulscale14(sintable[(spr->ang-256)&2047], walldist) };
if ((rxi[0]-pos->x) * (ryi[1]-pos->y) < (rxi[1]-pos->x) * (ryi[0]-pos->y))
{
......@@ -1484,8 +1484,8 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int
int32_t x2 = x1 - mulscale16(sinang, rspanx);
int32_t y2 = y1 + mulscale16(cosang, rspanx);
vec2_t v = { mulscale14(sintable[(spr->ang-256+512)&2047], walldist),
mulscale14(sintable[(spr->ang-256)&2047], walldist) };
vec2_t const v = { mulscale14(sintable[(spr->ang-256+512)&2047], walldist),
mulscale14(sintable[(spr->ang-256)&2047], walldist) };
if (clipinsideboxline(cent.x, cent.y, x1, y1, x2, y2, rad) != 0)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment