- 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:
Randy Heit 2012-12-04 03:37:52 +00:00
parent 3a3e9c7063
commit 736c7f093a

View file

@ -1611,10 +1611,10 @@ void AM_drawSubsectors()
angle_t rotation; angle_t rotation;
sector_t tempsec; sector_t tempsec;
int floorlight, ceilinglight; int floorlight, ceilinglight;
fixed_t scalex, scaley;
double originx, originy; double originx, originy;
FDynamicColormap *colormap; FDynamicColormap *colormap;
for (int i = 0; i < numsubsectors; ++i) for (int i = 0; i < numsubsectors; ++i)
{ {
if (subsectors[i].flags & SSECF_POLYORG) if (subsectors[i].flags & SSECF_POLYORG)
@ -1645,17 +1645,6 @@ void AM_drawSubsectors()
mpoint_t originpt = { -sec->GetXOffset(sector_t::floor) >> FRACTOMAPBITS, mpoint_t originpt = { -sec->GetXOffset(sector_t::floor) >> FRACTOMAPBITS,
sec->GetYOffset(sector_t::floor) >> FRACTOMAPBITS }; sec->GetYOffset(sector_t::floor) >> FRACTOMAPBITS };
rotation = 0 - sec->GetAngle(sector_t::floor); 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)); originx = f_x + ((originpt.x - m_x) * scale / float(1 << 24));
originy = f_y + (f_h - (originpt.y - m_y) * scale / float(1 << 24)); originy = f_y + (f_h - (originpt.y - m_y) * scale / float(1 << 24));
// Coloring for the polygon // Coloring for the polygon
@ -1663,6 +1652,9 @@ void AM_drawSubsectors()
FTextureID maptex = sec->GetTexture(sector_t::floor); FTextureID maptex = sec->GetTexture(sector_t::floor);
scalex = sec->GetXScale(sector_t::floor);
scaley = sec->GetYScale(sector_t::floor);
#ifdef _3DFLOORS #ifdef _3DFLOORS
if (sec->e->XFloor.ffloors.Size()) if (sec->e->XFloor.ffloors.Size())
@ -1709,6 +1701,9 @@ void AM_drawSubsectors()
{ {
maptex = *(rover->top.texture); maptex = *(rover->top.texture);
floorplane = rover->top.plane; 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; break;
} }
} }
@ -1718,6 +1713,17 @@ void AM_drawSubsectors()
colormap = light->extra_colormap; colormap = light->extra_colormap;
} }
#endif #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 // If this subsector has not actually been seen yet (because you are cheating
// to see it on the map), tint and desaturate it. // to see it on the map), tint and desaturate it.
@ -1740,8 +1746,8 @@ void AM_drawSubsectors()
screen->FillSimplePoly(TexMan(maptex), screen->FillSimplePoly(TexMan(maptex),
&points[0], points.Size(), &points[0], points.Size(),
originx, originy, originx, originy,
scale / (FIXED2FLOAT(sec->GetXScale(sector_t::floor)) * float(1 << MAPBITS)), scale / (FIXED2DBL(scalex) * float(1 << MAPBITS)),
scale / (FIXED2FLOAT(sec->GetYScale(sector_t::floor)) * float(1 << MAPBITS)), scale / (FIXED2DBL(scaley) * float(1 << MAPBITS)),
rotation, rotation,
colormap, colormap,
floorlight floorlight