diff --git a/src/am_map.cpp b/src/am_map.cpp index bb0215242..a091cfc29 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -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