diff --git a/src/g_shared/sbar.h b/src/g_shared/sbar.h index be5ebddd5..22a99709d 100644 --- a/src/g_shared/sbar.h +++ b/src/g_shared/sbar.h @@ -343,6 +343,7 @@ public: bool Scaled; bool Centering; bool FixedOrigin; + bool CompleteBorder; fixed_t CrosshairSize; fixed_t Displacement; diff --git a/src/g_shared/sbarinfo.cpp b/src/g_shared/sbarinfo.cpp index 6a1f6fd98..99158f568 100644 --- a/src/g_shared/sbarinfo.cpp +++ b/src/g_shared/sbarinfo.cpp @@ -978,6 +978,8 @@ public: } invBarOffset = script->Images.Size(); Images.Init(&patchnames[0], patchnames.Size()); + + CompleteBorder = script->completeBorder; } ~DSBarInfo () @@ -991,13 +993,6 @@ public: int hud = STBAR_NORMAL; if(state == HUD_StatusBar) { - if(script->completeBorder) //Fill the statusbar with the border before we draw. - { - FTexture *b = TexMan[gameinfo.border->b]; - V_DrawBorder(viewwindowx, viewwindowy + viewheight + b->GetHeight(), viewwindowx + viewwidth, SCREENHEIGHT); - if(screenblocks == 10) - screen->FlatFill(viewwindowx, viewwindowy + viewheight, viewwindowx + viewwidth, viewwindowy + viewheight + b->GetHeight(), b, true); - } if(script->automapbar && automapactive) { hud = STBAR_AUTOMAP; diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index ee4e98890..57a0d9106 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -216,6 +216,7 @@ void ST_Clear() DBaseStatusBar::DBaseStatusBar (int reltop, int hres, int vres) { + CompleteBorder = false; Centering = false; FixedOrigin = false; CrosshairSize = FRACUNIT; @@ -1037,27 +1038,43 @@ void DBaseStatusBar::RefreshBackground () const { int x, x2, y, ratio; - if (SCREENWIDTH > 320) + ratio = CheckRatio (SCREENWIDTH, SCREENHEIGHT); + x = (!(ratio & 3) || !Scaled) ? ST_X : SCREENWIDTH*(48-BaseRatioSizes[ratio][3])/(48*2); + y = x == ST_X && x > 0 ? ST_Y : ::ST_Y; + + if(!CompleteBorder) { - ratio = CheckRatio (SCREENWIDTH, SCREENHEIGHT); - x = (!(ratio & 3) || !Scaled) ? ST_X : SCREENWIDTH*(48-BaseRatioSizes[ratio][3])/(48*2); - if (x > 0) + V_DrawBorder (x+1, y, SCREENWIDTH, y+1); + V_DrawBorder (x+1, SCREENHEIGHT-1, SCREENWIDTH, SCREENHEIGHT); + } + else + { + x = SCREENWIDTH; + } + + if (x > 0) + { + if(!CompleteBorder) { - y = x == ST_X ? ST_Y : ::ST_Y; x2 = !(ratio & 3) || !Scaled ? ST_X+HorizontalResolution : SCREENWIDTH - (SCREENWIDTH*(48-BaseRatioSizes[ratio][3])+48*2-1)/(48*2); - V_DrawBorder (0, y, x, SCREENHEIGHT); - V_DrawBorder (x2, y, SCREENWIDTH, SCREENHEIGHT); + } + else + { + x2 = SCREENWIDTH; + } - if (setblocks >= 10) - { - const gameborder_t *border = gameinfo.border; - FTexture *p; + V_DrawBorder (0, y, x+1, SCREENHEIGHT); + V_DrawBorder (x2-1, y, SCREENWIDTH, SCREENHEIGHT); - p = TexMan[border->b]; - screen->FlatFill(0, y, x, y + p->GetHeight(), p, true); - screen->FlatFill(x2, y, SCREENWIDTH, y + p->GetHeight(), p, true); - } + if (setblocks >= 10) + { + const gameborder_t *border = gameinfo.border; + FTexture *p; + + p = TexMan[border->b]; + screen->FlatFill(0, y, x, y + p->GetHeight(), p, true); + screen->FlatFill(x2, y, SCREENWIDTH, y + p->GetHeight(), p, true); } } }