mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- Fixed: The textured automap used the main sector's floor's rotation and scaling when drawing 3D floors.
SVN r3977 (trunk)
This commit is contained in:
parent
3a3e9c7063
commit
736c7f093a
1 changed files with 20 additions and 14 deletions
|
@ -1611,10 +1611,10 @@ void AM_drawSubsectors()
|
|||
angle_t rotation;
|
||||
sector_t tempsec;
|
||||
int floorlight, ceilinglight;
|
||||
fixed_t scalex, scaley;
|
||||
double originx, originy;
|
||||
FDynamicColormap *colormap;
|
||||
|
||||
|
||||
for (int i = 0; i < numsubsectors; ++i)
|
||||
{
|
||||
if (subsectors[i].flags & SSECF_POLYORG)
|
||||
|
@ -1645,17 +1645,6 @@ void AM_drawSubsectors()
|
|||
mpoint_t originpt = { -sec->GetXOffset(sector_t::floor) >> FRACTOMAPBITS,
|
||||
sec->GetYOffset(sector_t::floor) >> FRACTOMAPBITS };
|
||||
rotation = 0 - sec->GetAngle(sector_t::floor);
|
||||
// Apply the floor's rotation to the texture origin.
|
||||
if (rotation != 0)
|
||||
{
|
||||
AM_rotate(&originpt.x, &originpt.y, rotation);
|
||||
}
|
||||
// Apply the automap's rotation to the texture origin.
|
||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||
{
|
||||
rotation += ANG90 - players[consoleplayer].camera->angle;
|
||||
AM_rotatePoint(&originpt.x, &originpt.y);
|
||||
}
|
||||
originx = f_x + ((originpt.x - m_x) * scale / float(1 << 24));
|
||||
originy = f_y + (f_h - (originpt.y - m_y) * scale / float(1 << 24));
|
||||
// Coloring for the polygon
|
||||
|
@ -1663,6 +1652,9 @@ void AM_drawSubsectors()
|
|||
|
||||
FTextureID maptex = sec->GetTexture(sector_t::floor);
|
||||
|
||||
scalex = sec->GetXScale(sector_t::floor);
|
||||
scaley = sec->GetYScale(sector_t::floor);
|
||||
|
||||
#ifdef _3DFLOORS
|
||||
|
||||
if (sec->e->XFloor.ffloors.Size())
|
||||
|
@ -1709,6 +1701,9 @@ void AM_drawSubsectors()
|
|||
{
|
||||
maptex = *(rover->top.texture);
|
||||
floorplane = rover->top.plane;
|
||||
rotation = 0 - rover->top.model->GetAngle(sector_t::ceiling);
|
||||
scalex = rover->top.model->GetXScale(sector_t::ceiling);
|
||||
scaley = rover->top.model->GetYScale(sector_t::ceiling);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1718,6 +1713,17 @@ void AM_drawSubsectors()
|
|||
colormap = light->extra_colormap;
|
||||
}
|
||||
#endif
|
||||
// Apply the floor's rotation to the texture origin.
|
||||
if (rotation != 0)
|
||||
{
|
||||
AM_rotate(&originpt.x, &originpt.y, rotation);
|
||||
}
|
||||
// Apply the automap's rotation to the texture origin.
|
||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||
{
|
||||
rotation += ANG90 - players[consoleplayer].camera->angle;
|
||||
AM_rotatePoint(&originpt.x, &originpt.y);
|
||||
}
|
||||
|
||||
// If this subsector has not actually been seen yet (because you are cheating
|
||||
// to see it on the map), tint and desaturate it.
|
||||
|
@ -1740,8 +1746,8 @@ void AM_drawSubsectors()
|
|||
screen->FillSimplePoly(TexMan(maptex),
|
||||
&points[0], points.Size(),
|
||||
originx, originy,
|
||||
scale / (FIXED2FLOAT(sec->GetXScale(sector_t::floor)) * float(1 << MAPBITS)),
|
||||
scale / (FIXED2FLOAT(sec->GetYScale(sector_t::floor)) * float(1 << MAPBITS)),
|
||||
scale / (FIXED2DBL(scalex) * float(1 << MAPBITS)),
|
||||
scale / (FIXED2DBL(scaley) * float(1 << MAPBITS)),
|
||||
rotation,
|
||||
colormap,
|
||||
floorlight
|
||||
|
|
Loading…
Reference in a new issue