From f8796d1a1bcec80e27fc24b91511f01cdc50374c Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 4 Apr 2012 18:57:06 +0000 Subject: [PATCH] When in GL modes, clear the screen first in some non-in-game places. This is so that when hud_bgstretch is disabled (i.e. background pictures are not stretched to the whole screen), the frame buffer has no leftover contents from previous frames on the sides of the screen. This was particularly noticable when using the console. The "places" are the following: - before drawing an anim frame - before drawing a "full-screen" background - while displaying logo, titlescreen, loadscreen (this leaves a couple others which I didn't test, and didn't tweak) git-svn-id: https://svn.eduke32.com/eduke32@2584 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/anim.c | 3 +++ polymer/eduke32/source/game.c | 18 ++++++++++++++++++ polymer/eduke32/source/premap.c | 2 ++ 3 files changed, 23 insertions(+) diff --git a/polymer/eduke32/source/anim.c b/polymer/eduke32/source/anim.c index 89c50dffa..1adb71dfc 100644 --- a/polymer/eduke32/source/anim.c +++ b/polymer/eduke32/source/anim.c @@ -409,6 +409,9 @@ void G_PlayAnim(const char *fn,char t) g_restorePalette = 0; } + if (getrendermode() >= 3) + clearview(0); + rotatesprite_fs(0<<16,0<<16,65536L,512,TILE_ANIM,0,0,2+4+8+16+64+(ud.bgstretch?1024:0)); nextpage(); } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index b978ed32c..8d6d9f85a 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3125,6 +3125,9 @@ void G_DrawBackground(void) } else { + if (getrendermode() >= 3) + clearview(0); + // when not rendering a game, fullscreen wipe #define MENUTILE (!getrendermode()?MENUSCREEN:LOADSCREEN) // Gv_SetVar(g_iReturnVarID,tilesizx[MENUTILE]==320&&tilesizy[MENUTILE]==200?MENUTILE:BIGHOLE, -1, -1); @@ -9189,6 +9192,9 @@ static void G_DisplayLogo(void) //G_FadePalette(0,0,0,63); if (logoflags & LOGO_3DRSCREEN) { + if (getrendermode() >= 3) + clearview(0); + P_SetGamePalette(g_player[myconnectindex].ps, DREALMSPAL, 8+2/*+1*/); // JBF 20040308 fadepal(0,0,0, 0,63,7); flushperms(); @@ -9198,6 +9204,9 @@ static void G_DisplayLogo(void) totalclock = 0; while (totalclock < (120*7) && !check_input_waiting()) { + if (getrendermode() >= 3) + clearview(0); + rotatesprite_fs(0,0,65536L,0,DREALMS,0,0,2+8+16+64+(ud.bgstretch?1024:0)); G_HandleAsync(); @@ -9220,6 +9229,9 @@ static void G_DisplayLogo(void) if (logoflags & LOGO_TITLESCREEN) { + if (getrendermode() >= 3) + clearview(0); + //g_player[myconnectindex].ps->palette = titlepal; P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 8+2/*+1*/); // JBF 20040308 flushperms(); @@ -9230,6 +9242,9 @@ static void G_DisplayLogo(void) while (totalclock < (860+120) && !KB_KeyWaiting() && !(MOUSE_GetButtons()&LEFT_MOUSE) && !BUTTON(gamefunc_Fire) && !BUTTON(gamefunc_Open)) { + if (getrendermode() >= 3) + clearview(0); + rotatesprite_fs(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64+(ud.bgstretch?1024:0)); if (logoflags & LOGO_DUKENUKEM) { @@ -11378,6 +11393,9 @@ FRAGBONUS: if (g_player[myconnectindex].ps->gm&MODE_EOL) { + if (getrendermode() >= 3) + clearview(0); + rotatesprite_fs(0,0,65536L,0,BONUSSCREEN+gfx_offset,0,0,2+8+16+64+128+(ud.bgstretch?1024:0)); if (totalclock > (1000000000L) && totalclock < (1000000320L)) diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index d8928154e..0db16ac33 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -362,6 +362,8 @@ static void G_DoLoadScreen(char *statustext, int32_t percent) if ((uint32_t)j < 2*MAXTILES) { + if (getrendermode() >= 3) + clearview(0); rotatesprite_fs(320<<15,200<<15,65536L,0, j > MAXTILES-1?j-MAXTILES:j,0,0, 2+8+64+(ud.bgstretch?1024:0)); }