Skip to content

Commit

Permalink
Statbar flicker fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 3, 2003
1 parent 23611bd commit 3bec2b7
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 45 deletions.
1 change: 0 additions & 1 deletion doomsday/Include/jHeretic/Doomdef.h
Expand Up @@ -921,7 +921,6 @@ void F_StartFinale(void);
// STATUS BAR (SB_bar.c)
//----------------------

extern int SB_state;
void SB_Init(void);
boolean SB_Responder(event_t *event);
void SB_Ticker(void);
Expand Down
1 change: 0 additions & 1 deletion doomsday/Include/jHeretic/P_local.h
Expand Up @@ -279,7 +279,6 @@ void AM_Drawer(void);

// ***** SB_BAR *****

extern int SB_state;
extern int ArtifactFlash;
void SB_PaletteFlash(void);

Expand Down
5 changes: 2 additions & 3 deletions doomsday/Src/Common/g_game.c
Expand Up @@ -1778,10 +1778,10 @@ void G_PlayerFinishLevel (int player)
p->messageTics = 0;
p->rain1 = NULL;
p->rain2 = NULL;
if(p == &players[consoleplayer])
/* if(p == &players[consoleplayer])
{
SB_state = -1; // refresh the status bar
}
}*/
#endif

p->plr->mo->flags &= ~MF_SHADOW; // cancel invisibility
Expand Down Expand Up @@ -1922,7 +1922,6 @@ void G_PlayerReborn (int player)
#elif __JHERETIC__
if(p == &players[consoleplayer])
{
SB_state = -1; // refresh the status bar
inv_ptr = 0; // reset the inventory pointer
curpos = 0;
}
Expand Down
5 changes: 1 addition & 4 deletions doomsday/Src/jHeretic/H_Main.c
Expand Up @@ -173,14 +173,11 @@ void D_Display(void)
CT_Drawer();
if(!iscam) SB_Drawer(); // $democam
// Also update view borders?
if(Get(DD_VIEWWINDOW_WIDTH) != 320) GL_Update(DDUF_BORDER);
if(Get(DD_VIEWWINDOW_HEIGHT) != 200) GL_Update(DDUF_BORDER);
break;
case GS_INTERMISSION:
IN_Drawer ();
break;
/*case GS_FINALE:
F_Drawer ();
break;*/
case GS_INFINE:
FI_Drawer();
break;
Expand Down
1 change: 0 additions & 1 deletion doomsday/Src/jHeretic/In_lude.c
Expand Up @@ -195,7 +195,6 @@ void IN_Stop(void)

intermission = false;
IN_UnloadPics();
SB_state = -1;
GL_Update(DDUF_BORDER);
}

Expand Down
1 change: 0 additions & 1 deletion doomsday/Src/jHeretic/Mn_menu.c
Expand Up @@ -2822,7 +2822,6 @@ boolean MN_Responder(event_t *event)
{
paused = false;
MN_DeactivateMenu();
SB_state = -1; //refresh the statbar
GL_Update(DDUF_BORDER);
menuDark = 0; // Darkness immediately gone.
}
Expand Down
52 changes: 18 additions & 34 deletions doomsday/Src/jHeretic/Sb_bar.c
Expand Up @@ -707,7 +707,6 @@ char ammopic[][10] =
{"INAMLOB"}
};

int SB_state = -1;
static int oldarti = 0;
static int oldartiCount = 0;
static int oldfrags = -9999;
Expand All @@ -727,16 +726,10 @@ void SB_Drawer(void)
int frame;
static boolean hitCenterFrame;

// Sound info debug stuff
/* if(DebugSound == true)
{
DrawSoundInfo();
}*/
CPlayer = &players[consoleplayer];
if(Get(DD_VIEWWINDOW_HEIGHT) == SCREENHEIGHT && !automapactive)
{
DrawFullScreenStuff();
SB_state = -1;
}
else
{
Expand All @@ -750,42 +743,34 @@ void SB_Drawer(void)
gl.Scalef(fscale, fscale, 1);
}

//if(SB_state == -1)
GL_DrawPatch(0, 158, PatchBARBACK);
if(players[consoleplayer].cheats&CF_GODMODE)
{
GL_DrawPatch(0, 158, PatchBARBACK);
if(players[consoleplayer].cheats&CF_GODMODE)
{
GL_DrawPatch(16, 167, W_GetNumForName("GOD1"));
GL_DrawPatch(287, 167, W_GetNumForName("GOD2"));
}
oldhealth = -1;
GL_DrawPatch(16, 167, W_GetNumForName("GOD1"));
GL_DrawPatch(287, 167, W_GetNumForName("GOD2"));
}
oldhealth = -1;

DrawCommonBar();
if(!inventory)
{
//if(SB_state != 0)
{
// Main interface
GL_DrawPatch(34, 160, PatchSTATBAR);
oldarti = 0;
oldammo = -1;
oldarmor = -1;
oldweapon = -1;
oldfrags = -9999; //can't use -1, 'cuz of negative frags
oldlife = -1;
oldkeys = -1;
}
// Main interface
GL_DrawPatch(34, 160, PatchSTATBAR);
oldarti = 0;
oldammo = -1;
oldarmor = -1;
oldweapon = -1;
oldfrags = -9999; //can't use -1, 'cuz of negative frags
oldlife = -1;
oldkeys = -1;

DrawMainBar();
SB_state = 0;
}
else
{
//if(SB_state != 1)
{
GL_DrawPatch(34, 160, PatchINVBAR);
}
GL_DrawPatch(34, 160, PatchINVBAR);

DrawInventoryBar();
SB_state = 1;
}

// Restore the old modelview matrix.
Expand Down Expand Up @@ -1310,7 +1295,6 @@ static void CheatGodFunc(player_t *player, Cheat_t *cheat)
{
P_SetMessage(player, TXT_CHEATGODOFF, false);
}
SB_state = -1;
}

static void CheatNoClipFunc(player_t *player, Cheat_t *cheat)
Expand Down

0 comments on commit 3bec2b7

Please sign in to comment.