- removed the border refresh counter.

This was just a relic of DirectDraw as main backend and is no longer needed.
This commit is contained in:
Christoph Oelckers 2018-04-03 00:50:40 +02:00
parent 942460ba55
commit 853903bb7e
20 changed files with 1 additions and 132 deletions

View file

@ -1383,7 +1383,6 @@ void AM_Stop ()
{
automapactive = false;
stopped = true;
V_SetBorderNeedRefresh();
viewactive = true;
}

View file

@ -1000,8 +1000,6 @@ void FNotifyBuffer::Draw()
lineadv = SmallFont->GetHeight ();
BorderTopRefresh = screen->GetPageCount ();
for (unsigned i = 0; i < Text.Size(); ++ i)
{
FNotifyText &notify = 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)

View file

@ -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 &&

View file

@ -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)

View file

@ -2412,7 +2412,6 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
paused = player + 1;
S_PauseSound (false, false);
}
V_SetBorderNeedRefresh();
}
break;

View file

@ -70,6 +70,5 @@ int NextSkill = -1;
int SinglePlayerClass[MAXPLAYERS];
bool ToggleFullscreen;
int BorderTopRefresh;
FString LumpFilterIWAD;

View file

@ -192,9 +192,6 @@ extern bool precache;
extern bool setsizeneeded;
extern bool setmodeneeded;
extern int BorderNeedRefresh;
extern int BorderTopRefresh;
EXTERN_CVAR (Float, mouse_sensitivity)
//?

View file

@ -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)

View file

@ -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
{

View file

@ -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 ();
}
}

View file

@ -329,12 +329,6 @@ void OpenGLFrameBuffer::GetFlash(PalEntry &rgb, int &amount)
amount = Flash.a;
}
int OpenGLFrameBuffer::GetPageCount()
{
return 1;
}
//==========================================================================
//
//

View file

@ -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();

View file

@ -184,7 +184,6 @@ void HU_DrawScores (player_t *player)
HU_DoDrawScores (player, sortedplayers);
V_SetBorderNeedRefresh();
}
//==========================================================================

View file

@ -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)

View file

@ -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;
}

View file

@ -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());

View file

@ -297,7 +297,6 @@ void S_NoiseDebug (void)
}
chan = (FSoundChan *)((size_t)chan->PrevChan - myoffsetof(FSoundChan, NextChan));
}
V_SetBorderNeedRefresh();
}
static FString LastLocalSndInfo;

View file

@ -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();
}
}

View file

@ -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;
}

View file

@ -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; }