- Moved all BorderNeedRefresh and SB_state updating code into separate functions that won't crash if screen is NULL.

SVN r4167 (trunk)
This commit is contained in:
Randy Heit 2013-02-27 03:10:25 +00:00
commit be0845acf1
22 changed files with 85 additions and 45 deletions

View file

@ -697,21 +697,21 @@ void D_Display ()
if (screen->Lock (false))
{
SB_state = screen->GetPageCount ();
BorderNeedRefresh = screen->GetPageCount ();
ST_SetNeedRefresh();
V_SetBorderNeedRefresh();
}
// [RH] Allow temporarily disabling wipes
if (NoWipe)
{
BorderNeedRefresh = screen->GetPageCount ();
V_SetBorderNeedRefresh();
NoWipe--;
wipe = false;
wipegamestate = gamestate;
}
else if (gamestate != wipegamestate && gamestate != GS_FULLCONSOLE && gamestate != GS_TITLELEVEL)
{ // save the current screen if about to wipe
BorderNeedRefresh = screen->GetPageCount ();
V_SetBorderNeedRefresh();
switch (wipegamestate)
{
default:
@ -780,8 +780,8 @@ void D_Display ()
if ((hw2d = screen->Begin2D(viewactive)))
{
// Redraw everything every frame when using 2D accel
SB_state = screen->GetPageCount();
BorderNeedRefresh = screen->GetPageCount();
ST_SetNeedRefresh();
V_SetBorderNeedRefresh();
}
Renderer->DrawRemainingPlayerSprites();
screen->DrawBlendingRect();
@ -1278,7 +1278,7 @@ void D_DoAdvanceDemo (void)
Advisory = NULL;
if (!M_DemoNoPlay)
{
BorderNeedRefresh = screen->GetPageCount ();
V_SetBorderNeedRefresh();
democount++;
mysnprintf (demoname + 4, countof(demoname) - 4, "%d", democount);
if (Wads.CheckNumForName (demoname) < 0)