- fixed screen clearing for the automap.

This should only affect the active window, not the entire screen.
This commit is contained in:
Christoph Oelckers 2019-12-31 19:50:27 +01:00
parent ef5292b4ae
commit 05e381ff6d
6 changed files with 14 additions and 10 deletions

View file

@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "map2d.h"
#include "trig.h"
#include "view.h"
#include "v_2ddrawer.h"
BEGIN_BLD_NS
@ -194,7 +195,8 @@ void CViewMap::sub_25C74(void)
viewResizeView(3);
tm = 1;
}
videoClearScreen(0);
// only clear the actual window.
twod->AddColorOnlyQuad(windowxy1.x, windowxy1.y, windowxy2.x - windowxy1.x + 1, windowxy2.y - windowxy1.y - 1, 0xff000000);
renderDrawMapView(x,y,nZoom>>2,angle);
sub_2541C(x,y,nZoom>>2,angle);
const char *pTitle = levelGetTitle();

View file

@ -8283,7 +8283,7 @@ static void renderFillPolygon(int32_t npoints)
ytex.Y = ((float)y2) * (-1.f / 4294967296.f);
otex.X = (fxdim * xtex.X + fydim * ytex.X) * -0.5f + fglobalposx * (1.f / 4294967296.f);
otex.Y = (fxdim * xtex.Y + fydim * ytex.Y) * -0.5f - fglobalposy * (1.f / 4294967296.f);
twod->FillPolygon(rx1, ry1, xb1, npoints, globalpicnum, globalpal, globalshade, globalorientation, xtex, ytex, otex);
twod->FillPolygon(rx1, ry1, xb1, npoints, globalpicnum, globalpal, globalshade, globalorientation, xtex, ytex, otex, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y);
}
//

View file

@ -716,13 +716,12 @@ void F2DDrawer::rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
//
//==========================================================================
void F2DDrawer::AddPoly(FTexture* img, FVector4* vt, size_t vtcount, unsigned int* ind, size_t idxcount, int palette, int shade, int maskprops)
void F2DDrawer::AddPoly(FTexture* img, FVector4* vt, size_t vtcount, unsigned int* ind, size_t idxcount, int palette, int shade, int maskprops, int clipx1, int clipy1, int clipx2, int clipy2)
{
RenderCommand dg = {};
int method = 0;
dg.mType = DrawTypeRotateSprite;
#if 0
if (clipx1 > 0 || clipy1 > 0 || clipx2 < screen->GetWidth() - 1 || clipy2 < screen->GetHeight() - 1)
{
dg.mScissor[0] = clipx1;
@ -731,7 +730,6 @@ void F2DDrawer::AddPoly(FTexture* img, FVector4* vt, size_t vtcount, unsigned in
dg.mScissor[3] = clipy2 + 1;
dg.mFlags |= DTF_Scissor;
}
#endif
PalEntry p = 0xffffffff;
if (maskprops > DAMETH_MASK)
@ -770,7 +768,8 @@ void F2DDrawer::AddPoly(FTexture* img, FVector4* vt, size_t vtcount, unsigned in
//
//==========================================================================
void F2DDrawer::FillPolygon(int *rx1, int *ry1, int *xb1, int32_t npoints, int picnum, int palette, int shade, int props, const FVector2& xtex, const FVector2& ytex, const FVector2 &otex)
void F2DDrawer::FillPolygon(int *rx1, int *ry1, int *xb1, int32_t npoints, int picnum, int palette, int shade, int props, const FVector2& xtex, const FVector2& ytex, const FVector2 &otex,
int clipx1, int clipy1, int clipx2, int clipy2)
{
//Convert int32_t to float (in-place)
TArray<FVector4> points(npoints, true);
@ -821,7 +820,7 @@ void F2DDrawer::FillPolygon(int *rx1, int *ry1, int *xb1, int32_t npoints, int p
}
}
AddPoly(TileFiles.tiles[picnum], points.Data(), points.Size(), indices.data(), indices.size(), palette, shade, (props >> 7)& DAMETH_MASKPROPS);
AddPoly(TileFiles.tiles[picnum], points.Data(), points.Size(), indices.data(), indices.size(), palette, shade, (props >> 7)& DAMETH_MASKPROPS, clipx1, clipy1, clipx2, clipy2);
}

View file

@ -127,8 +127,9 @@ public:
public:
void AddTexture(FTexture *img, DrawParms &parms);
void AddPoly(FTexture* img, FVector4 *vt, size_t vtcount, unsigned int *ind, size_t idxcount, int palette, int shade, int maskprops);
void FillPolygon(int* rx1, int* ry1, int* xb1, int32_t npoints, int picnum, int palette, int shade, int props, const FVector2& xtex, const FVector2& ytex, const FVector2& otex);
void AddPoly(FTexture* img, FVector4 *vt, size_t vtcount, unsigned int *ind, size_t idxcount, int palette, int shade, int maskprops, int clipx1, int clipy1, int clipx2, int clipy2);
void FillPolygon(int* rx1, int* ry1, int* xb1, int32_t npoints, int picnum, int palette, int shade, int props, const FVector2& xtex, const FVector2& ytex, const FVector2& otex,
int clipx1, int clipy1, int clipx2, int clipy2);
void AddFlatFill(int left, int top, int right, int bottom, FTexture *src, bool local_origin);
void AddColorOnlyQuad(int left, int top, int width, int height, PalEntry color, FRenderStyle *style = nullptr);

View file

@ -929,6 +929,7 @@ void G_DisplayRest(int32_t smoothratio)
if (ud.overhead_on == 2)
{
twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000);
G_DrawBackground();
renderDrawMapView(cposx, cposy, pp->zoom, cang);
}
G_DrawOverheadMap(cposx, cposy, pp->zoom, cang);

View file

@ -2271,7 +2271,8 @@ drawscreen(PLAYERp pp)
if (dimensionmode == 6)
{
twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000);
// only clear the actual window.
twod->AddColorOnlyQuad(windowxy1.x, windowxy1.y, windowxy2.x - windowxy1.x + 1, windowxy2.y - windowxy1.y - 1, 0xff000000);
renderDrawMapView(tx, ty, zoom, tang);
}