mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- Removed automap scroll clamping for rotated maps. If it's going to scroll out of sight,
at least it'll do so at a fixed right. SVN r1407 (trunk)
This commit is contained in:
parent
64b783f4bd
commit
a704043fd2
1 changed files with 32 additions and 19 deletions
|
@ -493,50 +493,63 @@ static void AM_findMinMaxBoundaries ()
|
|||
|
||||
static void AM_ClipRotatedExtents (fixed_t pivotx, fixed_t pivoty)
|
||||
{
|
||||
fixed_t rmin_x, rmin_y, rmax_x, rmax_y;
|
||||
|
||||
if (am_rotate == 0 || (am_rotate == 2 && !viewactive))
|
||||
{
|
||||
rmin_x = min_x;
|
||||
rmin_y = min_y;
|
||||
rmax_x = max_x;
|
||||
rmax_y = max_y;
|
||||
if (m_x + m_w/2 > max_x)
|
||||
m_x = max_x - m_w/2;
|
||||
else if (m_x + m_w/2 < min_x)
|
||||
m_x = min_x - m_w/2;
|
||||
|
||||
if (m_y + m_h/2 > max_y)
|
||||
m_y = max_y - m_h/2;
|
||||
else if (m_y + m_h/2 < min_y)
|
||||
m_y = min_y - m_h/2;
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed_t xs[4], ys[4];
|
||||
#if 0
|
||||
fixed_t rmin_x, rmin_y, rmax_x, rmax_y;
|
||||
fixed_t xs[5], ys[5];
|
||||
int i;
|
||||
|
||||
xs[0] = min_x; ys[0] = min_y;
|
||||
xs[1] = max_x; ys[1] = min_y;
|
||||
xs[2] = max_x; ys[2] = max_y;
|
||||
xs[3] = min_x; ys[3] = max_y;
|
||||
xs[4] = m_x + m_w/2; ys[4] = m_y + m_h/2;
|
||||
rmin_x = rmin_y = FIXED_MAX;
|
||||
rmax_x = rmax_y = FIXED_MIN;
|
||||
|
||||
for (i = 0; i < 4; ++i)
|
||||
for (i = 0; i < 5; ++i)
|
||||
{
|
||||
xs[i] -= pivotx;
|
||||
ys[i] -= pivoty;
|
||||
AM_rotate (&xs[i], &ys[i], ANG90 - players[consoleplayer].camera->angle);
|
||||
xs[i] += pivotx;
|
||||
ys[i] += pivoty;
|
||||
|
||||
if (i == 5)
|
||||
break;
|
||||
// xs[i] += pivotx;
|
||||
// ys[i] += pivoty;
|
||||
|
||||
if (xs[i] < rmin_x) rmin_x = xs[i];
|
||||
if (xs[i] > rmax_x) rmax_x = xs[i];
|
||||
if (ys[i] < rmin_y) rmin_y = ys[i];
|
||||
if (ys[i] > rmax_y) rmax_y = ys[i];
|
||||
}
|
||||
}
|
||||
if (m_x + m_w/2 > rmax_x)
|
||||
m_x = rmax_x - m_w/2;
|
||||
else if (m_x + m_w/2 < rmin_x)
|
||||
m_x = rmin_x - m_w/2;
|
||||
if (rmax_x < 0)
|
||||
xs[4] = -rmax_x;
|
||||
else if (rmin_x > 0)
|
||||
xs[4] = -rmin_x;
|
||||
|
||||
if (m_y + m_h/2 > rmax_y)
|
||||
m_y = rmax_y - m_h/2;
|
||||
else if (m_y + m_h/2 < rmin_y)
|
||||
m_y = rmin_y - m_h/2;
|
||||
// if (ys[4] > rmax_y)
|
||||
// ys[4] = rmax_y;
|
||||
// else if (ys[4] < rmin_y)
|
||||
// ys[4] = rmin_y;
|
||||
AM_rotate (&xs[4], &ys[4], ANG270 - players[consoleplayer].camera->angle);
|
||||
m_x = xs[4] + pivotx - m_w/2;
|
||||
m_y = ys[4] + pivoty - m_h/2;
|
||||
#endif
|
||||
}
|
||||
|
||||
m_x2 = m_x + m_w;
|
||||
m_y2 = m_y + m_h;
|
||||
|
|
Loading…
Reference in a new issue