diff --git a/source/common/2d/v_2ddrawer.cpp b/source/common/2d/v_2ddrawer.cpp index 642887312..b169c36f1 100644 --- a/source/common/2d/v_2ddrawer.cpp +++ b/source/common/2d/v_2ddrawer.cpp @@ -385,6 +385,11 @@ void F2DDrawer::AddColorOnlyQuad(int x1, int y1, int w, int h, PalEntry color, F AddCommand(&dg); } +void F2DDrawer::ClearScreen(PalEntry color) +{ + AddColorOnlyQuad(0, 0, screen->GetWidth(), screen->GetHeight(), color); +} + //========================================================================== // // diff --git a/source/common/2d/v_2ddrawer.h b/source/common/2d/v_2ddrawer.h index 8db1d8e7c..df71a8eec 100644 --- a/source/common/2d/v_2ddrawer.h +++ b/source/common/2d/v_2ddrawer.h @@ -133,7 +133,7 @@ public: 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); - + void ClearScreen(PalEntry color = 0xff000000); void AddLine(float x1, float y1, float x2, float y2, uint32_t color, uint8_t alpha = 255); void AddLine(float x1, float y1, float x2, float y2, int cx, int cy, int cx2, int cy2, uint32_t color, uint8_t alpha = 255); diff --git a/source/common/menu/messagebox.cpp b/source/common/menu/messagebox.cpp index a39127471..7f9bc4423 100644 --- a/source/common/menu/messagebox.cpp +++ b/source/common/menu/messagebox.cpp @@ -227,7 +227,7 @@ void DMessageBoxMenu::Drawer() } else { - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xa0000000); + twod->ClearScreen(0xa0000000); gi->DrawCenteredTextScreen(origin, mFullMessage, 100, false); } } diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index ca2d4ef9b..2f40194a7 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -1288,25 +1288,25 @@ void G_PlayE4Cutscene(void) renderFlushPerms(); videoSetViewableArea(0, 0, xdim-1, ydim-1); - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); if (Anim_Play("vol41a.anm")) goto end_vol4a; - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); if (Anim_Play("vol42a.anm")) goto end_vol4a; - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); Anim_Play("vol43a.anm"); end_vol4a: - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); FX_StopAllSounds(); diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index d8c01f9df..328e87ca5 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -898,7 +898,7 @@ void G_DisplayRest(int32_t smoothratio) if (ud.overhead_on == 2) { - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); G_DrawBackground(); // Necessary GL fills the entire screen with black renderDrawMapView(cposx, cposy, pp->zoom, cang); } diff --git a/source/exhumed/src/map.cpp b/source/exhumed/src/map.cpp index 672441173..20ee6b7ae 100644 --- a/source/exhumed/src/map.cpp +++ b/source/exhumed/src/map.cpp @@ -622,7 +622,7 @@ void DrawMap() //drawoverheadmap(initx, inity, lMapZoom, inita); if (nMapMode == 2) { - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); RefreshBackground(); renderDrawMapView(initx, inity, lMapZoom, inita); } diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index 2f49770ee..ad8b2ee59 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -38,6 +38,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "light.h" #include "cd.h" #include "menu/menu.h" +#include "v_2ddrawer.h" #include #include @@ -672,6 +673,7 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest) while (nIdleSeconds < 12) { HandleAsync(); + twod->ClearScreen(); if (((int)totalclock - startTime) / kTimerTicks) { diff --git a/source/exhumed/src/movie.cpp b/source/exhumed/src/movie.cpp index e405b4300..16177aa77 100644 --- a/source/exhumed/src/movie.cpp +++ b/source/exhumed/src/movie.cpp @@ -256,7 +256,7 @@ void PlayMovie(const char* fileName) } } - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); rotatesprite(160 << 16, 100 << 16, z, angle, kMovieTile, 0, 1, 2, 0, 0, xdim - 1, ydim - 1); if (bDoFade) { diff --git a/source/rr/src/premap.cpp b/source/rr/src/premap.cpp index 33ea91264..73a4ed2db 100644 --- a/source/rr/src/premap.cpp +++ b/source/rr/src/premap.cpp @@ -1907,23 +1907,23 @@ void G_NewGame(int volumeNum, int levelNum, int skillNum) renderFlushPerms(); videoSetViewableArea(0,0,xdim-1,ydim-1); - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); int animReturn = Anim_Play("vol41a.anm"); - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); if (animReturn) goto end_vol4a; animReturn = Anim_Play("vol42a.anm"); - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); if (animReturn) goto end_vol4a; Anim_Play("vol43a.anm"); - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); end_vol4a: diff --git a/source/rr/src/screens.cpp b/source/rr/src/screens.cpp index b9ac73d43..0690b0c73 100644 --- a/source/rr/src/screens.cpp +++ b/source/rr/src/screens.cpp @@ -928,7 +928,7 @@ void G_DisplayRest(int32_t smoothratio) if (ud.overhead_on == 2) { - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); G_DrawBackground(); renderDrawMapView(cposx, cposy, pp->zoom, cang); } diff --git a/source/sw/src/anim.cpp b/source/sw/src/anim.cpp index 7911cb8a1..da13b069a 100644 --- a/source/sw/src/anim.cpp +++ b/source/sw/src/anim.cpp @@ -326,7 +326,7 @@ playanm(short anim_num) ENDOFANIMLOOP: GLInterface.EnableNonTransparent255(false); - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); videoSetPalette(0, BASEPAL, 2); diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index e8e64c69d..882bdca4d 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -1462,7 +1462,7 @@ void LogoLevel(void) DSPRINTF(ds,"About to display 3drealms pic..."); MONO_PRINT(ds); - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); rotatesprite(0, 0, RS_SCALE, 0, THREED_REALMS_PIC, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1); videoNextPage(); //FadeIn(0, 3); @@ -1486,7 +1486,7 @@ void LogoLevel(void) } } - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); videoSetPalette(0, BASEPAL, 2); @@ -1517,7 +1517,7 @@ void CreditsLevel(void) save = gs.BorderNum; ClearStartMost(); gs.BorderNum = save; - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); // Lo Wang feel like singing! @@ -1580,7 +1580,7 @@ void CreditsLevel(void) } // put up a blank screen while loading - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); inputState.ClearAllInput(); Mus_Stop(); @@ -1618,7 +1618,7 @@ TitleLevel(void) tempbuf[i] = i; palookup[0] = tempbuf; - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); ready2send = 0; @@ -1675,19 +1675,19 @@ TitleLevel(void) void DrawMenuLevelScreen(void) { - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); rotatesprite(0, 0, RS_SCALE, 0, TITLE_PIC, 20, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1); } void DrawStatScreen(void) { - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); rotatesprite(0, 0, RS_SCALE, 0, STAT_SCREEN_PIC, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1); } void DrawLoadLevelScreen(void) { - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); rotatesprite(0, 0, RS_SCALE, 0, TITLE_PIC, 20, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1); } @@ -1723,7 +1723,7 @@ void MenuLevel(void) DemoMode = FALSE; DemoPlaying = FALSE; - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); //FadeOut(0, 0); @@ -1833,7 +1833,7 @@ void MenuLevel(void) inputState.ClearAllInput(); M_ClearMenus(); InMenuLevel = FALSE; - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); } @@ -2058,7 +2058,7 @@ void BonusScreen(PLAYERp pp) if (Level < 0) Level = 0; - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); videoNextPage(); inputState.ClearAllInput(); @@ -2101,7 +2101,7 @@ void BonusScreen(PLAYERp pp) gStateControl(&State, &Tics); - twod->AddColorOnlyQuad(0, 0, xdim, ydim, 0xff000000); + twod->ClearScreen(); rotatesprite(0, 0, RS_SCALE, 0, 5120, 0, 0, TITLE_ROT_FLAGS, 0, 0, xdim - 1, ydim - 1); if (UserMapName[0])