diff --git a/src/am_map.cpp b/src/am_map.cpp index f848c6f47..9487693c6 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -1383,7 +1383,6 @@ void AM_Stop () { automapactive = false; stopped = true; - V_SetBorderNeedRefresh(); viewactive = true; } diff --git a/src/c_console.cpp b/src/c_console.cpp index a4630a952..3cddf4160 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -1000,8 +1000,6 @@ void FNotifyBuffer::Draw() lineadv = SmallFont->GetHeight (); - BorderTopRefresh = screen->GetPageCount (); - for (unsigned i = 0; i < Text.Size(); ++ i) { FNotifyText ¬ify = Text[i]; @@ -1088,14 +1086,6 @@ void C_DrawConsole () offset = -ConFont->GetHeight(); } - if ((ConBottom < oldbottom) && - (gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL) && - (viewwindowx || viewwindowy) && - viewactive) - { - V_SetBorderNeedRefresh(); - } - oldbottom = ConBottom; if (ConsoleState == c_up) diff --git a/src/ct_chat.cpp b/src/ct_chat.cpp index 34a5ee970..baaa34db5 100644 --- a/src/ct_chat.cpp +++ b/src/ct_chat.cpp @@ -274,8 +274,6 @@ void CT_Drawer (void) screen->DrawText (SmallFont, CR_GREY, promptwidth, y, (char *)(ChatQueue + i), DTA_VirtualWidth, screen_width, DTA_VirtualHeight, screen_height, DTA_KeepRatio, true, TAG_DONE); ChatQueue[len] = '\0'; - - BorderTopRefresh = screen->GetPageCount (); } if (players[consoleplayer].camera != NULL && diff --git a/src/d_main.cpp b/src/d_main.cpp index 9af1039fe..f203e9a85 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -738,8 +738,6 @@ void D_Display () } setmodeneeded = false; - V_SetBorderNeedRefresh(); - // [RH] Allow temporarily disabling wipes if (NoWipe) { @@ -810,7 +808,6 @@ void D_Display () Renderer->RenderView(&players[consoleplayer]); screen->Begin2D(viewactive); - V_SetBorderNeedRefresh(); Renderer->DrawRemainingPlayerSprites(); screen->DrawBlendingRect(); if (automapactive) @@ -1311,7 +1308,6 @@ void D_DoAdvanceDemo (void) Advisory = NULL; if (!M_DemoNoPlay) { - V_SetBorderNeedRefresh(); democount++; mysnprintf (demoname + 4, countof(demoname) - 4, "%d", democount); if (Wads.CheckNumForName (demoname) < 0) diff --git a/src/d_net.cpp b/src/d_net.cpp index 7681626d0..ec26da584 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2412,7 +2412,6 @@ void Net_DoCommand (int type, uint8_t **stream, int player) paused = player + 1; S_PauseSound (false, false); } - V_SetBorderNeedRefresh(); } break; diff --git a/src/doomstat.cpp b/src/doomstat.cpp index e02dc4457..01cfea36a 100644 --- a/src/doomstat.cpp +++ b/src/doomstat.cpp @@ -70,6 +70,5 @@ int NextSkill = -1; int SinglePlayerClass[MAXPLAYERS]; bool ToggleFullscreen; -int BorderTopRefresh; FString LumpFilterIWAD; diff --git a/src/doomstat.h b/src/doomstat.h index 3e76d7f2f..e0cd34b48 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -192,9 +192,6 @@ extern bool precache; extern bool setsizeneeded; extern bool setmodeneeded; -extern int BorderNeedRefresh; -extern int BorderTopRefresh; - EXTERN_CVAR (Float, mouse_sensitivity) //? diff --git a/src/g_level.cpp b/src/g_level.cpp index eaac08734..50d77d4a7 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -523,7 +523,6 @@ void G_InitNew (const char *mapname, bool bTitleLevel) demoplayback = false; automapactive = false; viewactive = true; - V_SetBorderNeedRefresh(); //Added by MC: Initialize bots. if (!deathmatch) diff --git a/src/g_shared/hudmessages.cpp b/src/g_shared/hudmessages.cpp index f2fa20854..0299a0b93 100644 --- a/src/g_shared/hudmessages.cpp +++ b/src/g_shared/hudmessages.cpp @@ -220,10 +220,6 @@ void DHUDMessage::OnDestroy() { V_FreeBrokenLines (Lines); Lines = NULL; - if (screen != NULL) - { - V_SetBorderNeedRefresh(); - } } if (SourceText != NULL) { @@ -618,7 +614,6 @@ void DHUDMessageFadeOut::DoDraw (int linenum, int x, int y, bool clean, int hudh DTA_RenderStyle, Style, TAG_DONE); } - V_SetBorderNeedRefresh(); } } @@ -708,7 +703,6 @@ void DHUDMessageFadeInOut::DoDraw (int linenum, int x, int y, bool clean, int hu DTA_RenderStyle, Style, TAG_DONE); } - V_SetBorderNeedRefresh(); } else { diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index 440baf69e..588ee6bf3 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -1017,7 +1017,6 @@ void DBaseStatusBar::Draw (EHudState state) VMValue params[] = { (DObject*)this }; VMCall(func, params, countof(params), nullptr, 0); } - V_SetBorderNeedRefresh(); } if (viewactive) @@ -1258,7 +1257,6 @@ void DBaseStatusBar::DrawConsistancy () const screen->DrawText (SmallFont, CR_GREEN, (screen->GetWidth() - SmallFont->StringWidth (conbuff)*CleanXfac) / 2, 0, conbuff, DTA_CleanNoMove, true, TAG_DONE); - BorderTopRefresh = screen->GetPageCount (); } } @@ -1291,7 +1289,6 @@ void DBaseStatusBar::DrawWaiting () const screen->DrawText (SmallFont, CR_ORANGE, (screen->GetWidth() - SmallFont->StringWidth (conbuff)*CleanXfac) / 2, SmallFont->GetHeight()*CleanYfac, conbuff, DTA_CleanNoMove, true, TAG_DONE); - BorderTopRefresh = screen->GetPageCount (); } } diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index 795520b1f..d7e362c5f 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -329,12 +329,6 @@ void OpenGLFrameBuffer::GetFlash(PalEntry &rgb, int &amount) amount = Flash.a; } -int OpenGLFrameBuffer::GetPageCount() -{ - return 1; -} - - //========================================================================== // // diff --git a/src/gl/system/gl_framebuffer.h b/src/gl/system/gl_framebuffer.h index 4f3724b86..c0274e3d8 100644 --- a/src/gl/system/gl_framebuffer.h +++ b/src/gl/system/gl_framebuffer.h @@ -44,7 +44,6 @@ public: PalEntry *GetPalette (); bool SetFlash(PalEntry rgb, int amount); void GetFlash(PalEntry &rgb, int &amount); - int GetPageCount(); bool Begin2D(bool copy3d); void GameRestart(); diff --git a/src/hu_scores.cpp b/src/hu_scores.cpp index 45581bfc6..91c3dacfc 100644 --- a/src/hu_scores.cpp +++ b/src/hu_scores.cpp @@ -184,7 +184,6 @@ void HU_DrawScores (player_t *player) HU_DoDrawScores (player, sortedplayers); - V_SetBorderNeedRefresh(); } //========================================================================== diff --git a/src/menu/loadsavemenu.cpp b/src/menu/loadsavemenu.cpp index 7d4b1ebf4..87906f4fa 100644 --- a/src/menu/loadsavemenu.cpp +++ b/src/menu/loadsavemenu.cpp @@ -386,7 +386,6 @@ void FSavegameManager::LoadSavegame(int Selected) quickSaveSlot = SaveGames[Selected]; } M_ClearMenus(); - V_SetBorderNeedRefresh(); LastAccessed = Selected; } @@ -428,7 +427,6 @@ void FSavegameManager::DoSave(int Selected, const char *savegamestring) G_SaveGame(filename, savegamestring); } M_ClearMenus(); - V_SetBorderNeedRefresh(); } DEFINE_ACTION_FUNCTION(FSavegameManager, DoSave) diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index 8ed935dd4..915449e45 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -834,7 +834,6 @@ void M_Drawer (void) if (!CurrentMenu->DontDim) { M_Dim(); - V_SetBorderNeedRefresh(); } CurrentMenu->CallDrawer(); } @@ -855,7 +854,6 @@ void M_ClearMenus() CurrentMenu->Destroy(); CurrentMenu = parent; } - V_SetBorderNeedRefresh(); menuactive = MENU_Off; } diff --git a/src/r_utility.cpp b/src/r_utility.cpp index 4f8f3b0f4..f3479bf6f 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -266,7 +266,6 @@ void R_SetWindow (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, int wind void R_ExecuteSetViewSize (FRenderViewpoint &viewpoint, FViewWindow &viewwindow) { setsizeneeded = false; - V_SetBorderNeedRefresh(); R_SetWindow (viewpoint, viewwindow, setblocks, SCREENWIDTH, SCREENHEIGHT, StatusBar->GetTopOfStatusbar()); diff --git a/src/s_sound.cpp b/src/s_sound.cpp index f6f96fbe8..69a559de3 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -297,7 +297,6 @@ void S_NoiseDebug (void) } chan = (FSoundChan *)((size_t)chan->PrevChan - myoffsetof(FSoundChan, NextChan)); } - V_SetBorderNeedRefresh(); } static FString LastLocalSndInfo; diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 757a315e0..081c20ab4 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -1217,23 +1217,6 @@ void DFrameBuffer::FlatFill(int left, int top, int right, int bottom, FTexture * m2DDrawer.AddFlatFill(left, top, right, bottom, src, local_origin); } -//========================================================================== -// -// V_SetBorderNeedRefresh -// -// Flag the border as in need of updating. (Probably because something that -// was on top of it has changed. -// -//========================================================================== - -void V_SetBorderNeedRefresh() -{ - if (screen != NULL) - { - BorderNeedRefresh = screen->GetPageCount(); - } -} - //========================================================================== // // V_DrawFrame @@ -1321,9 +1304,6 @@ void DFrameBuffer::DrawBorder (int x1, int y1, int x2, int y2) // //========================================================================== -int BorderNeedRefresh; - - void DFrameBuffer::DrawViewBorder (void) { if (viewwidth == Width) @@ -1339,49 +1319,6 @@ void DFrameBuffer::DrawViewBorder (void) DrawFrame (viewwindowx, viewwindowy, viewwidth, viewheight); } -//========================================================================== -// -// R_DrawTopBorder -// -// Draws the top border around the view for different size windows -// -//========================================================================== - -void DFrameBuffer::DrawTopBorder () -{ - FTexture *p; - int offset; - - if (viewwidth == Width) - return; - - offset = gameinfo.Border.offset; - - if (viewwindowy < 34) - { - DrawBorder (0, 0, viewwindowx, 34); - DrawBorder (viewwindowx, 0, viewwindowx + viewwidth, viewwindowy); - DrawBorder (viewwindowx + viewwidth, 0, Width, 34); - p = TexMan(gameinfo.Border.t); - FlatFill(viewwindowx, viewwindowy - p->GetHeight(), viewwindowx + viewwidth, viewwindowy, p, true); - - p = TexMan(gameinfo.Border.l); - FlatFill(viewwindowx - p->GetWidth(), viewwindowy, viewwindowx, 35, p, true); - p = TexMan(gameinfo.Border.r); - FlatFill(viewwindowx + viewwidth, viewwindowy, viewwindowx + viewwidth + p->GetWidth(), 35, p, true); - - p = TexMan(gameinfo.Border.tl); - DrawTexture (p, viewwindowx - offset, viewwindowy - offset, TAG_DONE); - - p = TexMan(gameinfo.Border.tr); - DrawTexture (p, viewwindowx + viewwidth, viewwindowy - offset, TAG_DONE); - } - else - { - DrawBorder (0, 0, Width, 34); - } -} - //========================================================================== // // R_RefreshViewBorder @@ -1394,20 +1331,7 @@ void DFrameBuffer::RefreshViewBorder () { if (setblocks < 10) { - if (BorderNeedRefresh) - { - BorderNeedRefresh--; - if (BorderTopRefresh) - { - BorderTopRefresh--; - } - DrawViewBorder(); - } - else if (BorderTopRefresh) - { - BorderTopRefresh--; - DrawTopBorder(); - } + DrawViewBorder(); } } diff --git a/src/v_video.cpp b/src/v_video.cpp index 465bcd18d..00563d1bf 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -133,7 +133,6 @@ public: bool SetGamma(float gamma) { Gamma = gamma; return true; } bool SetFlash(PalEntry rgb, int amount) { DBGBREAK; return false; } void GetFlash(PalEntry &rgb, int &amount) { DBGBREAK; } - int GetPageCount() { DBGBREAK; return 0; } bool IsFullscreen() { DBGBREAK; return 0; } float Gamma; @@ -1252,7 +1251,6 @@ void V_Init2() FBaseCVar::ResetColors (); C_NewModeAdjust(); M_InitVideoModesMenu(); - V_SetBorderNeedRefresh(); setsizeneeded = true; } diff --git a/src/v_video.h b/src/v_video.h index 56f078b3d..a8ed14db1 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -325,9 +325,6 @@ public: // Converse of SetFlash virtual void GetFlash (PalEntry &rgb, int &amount) = 0; - // Returns the number of video pages the frame buffer is using. - virtual int GetPageCount () = 0; - // Returns true if running fullscreen. virtual bool IsFullscreen () = 0; @@ -431,7 +428,6 @@ public: void DrawFrame(int left, int top, int width, int height); void DrawBorder(int x1, int y1, int x2, int y2); void DrawViewBorder(); - void DrawTopBorder(); void RefreshViewBorder(); // Calculate gamma table @@ -493,9 +489,6 @@ FString V_GetColorStringByName (const char *name, FScriptPosition *sc = nullptr) int V_GetColor (const uint32_t *palette, const char *str, FScriptPosition *sc = nullptr); int V_GetColor(const uint32_t *palette, FScanner &sc); -// If the view size is not full screen, draws a border around it. -void V_SetBorderNeedRefresh(); - int CheckRatio (int width, int height, int *trueratio=NULL); static inline int CheckRatio (double width, double height) { return CheckRatio(int(width), int(height)); } inline bool IsRatioWidescreen(int ratio) { return (ratio & 3) != 0; }