remove some unnecessary of unsafe caches, fixing menu_servers2 not being able to load without slidebar graphics

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2142 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-04-02 08:11:17 +00:00
parent 1785c0bfc5
commit 83e22715bc
5 changed files with 21 additions and 14 deletions

View File

@ -1213,22 +1213,22 @@ void SL_SliderDraw (int x, int y, menucustom_t *ths, menu_t *menu)
mpic_t *pic;
pic = Draw_CachePic("scrollbars/slidebg.png");
pic = Draw_SafeCachePic("scrollbars/slidebg.png");
if (pic)
{
Draw_ScalePic(x + ths->common.width - 8, y+8, 8, ths->common.height-16, pic);
pic = Draw_CachePic("scrollbars/arrow_down.png");
pic = Draw_SafeCachePic("scrollbars/arrow_down.png");
Draw_ScalePic(x + ths->common.width - 8, y, 8, 8, pic);
pic = Draw_CachePic("scrollbars/arrow_up.png");
pic = Draw_SafeCachePic("scrollbars/arrow_up.png");
Draw_ScalePic(x + ths->common.width - 8, y + ths->common.height - 8, 8, 8, pic);
y += ((info->scrollpos) / ((float)info->numslots - info->visibleslots)) * (float)(ths->common.height-(64+16-1));
y += 8;
pic = Draw_CachePic("scrollbars/slider.png");
pic = Draw_SafeCachePic("scrollbars/slider.png");
Draw_ScalePic(x + ths->common.width - 8, y, 8, 64, pic);
}
else
@ -1252,7 +1252,7 @@ void SL_SliderDraw (int x, int y, menucustom_t *ths, menu_t *menu)
my = mousecursor_y;
my -= ths->common.posy;
if (Draw_CachePic("scrollbars/slidebg.png"))
if (Draw_SafeCachePic("scrollbars/slidebg.png"))
{
my -= 32+8;
my /= ths->common.height - (64+16);
@ -1282,7 +1282,7 @@ qboolean SL_SliderKey (menucustom_t *ths, menu_t *menu, int key)
my = mousecursor_y;
my -= ths->common.posy;
if (Draw_CachePic("scrollbars/slidebg.png"))
if (Draw_SafeCachePic("scrollbars/slidebg.png"))
{
my -= 32+8;
my /= ths->common.height - (64+16);

View File

@ -312,8 +312,9 @@ void M_Media_Draw (void)
#define MP_Hightlight(x,y,text,hl) (hl?M_PrintWhite(x, y, text):M_Print(x, y, text))
p = Draw_CachePic ("gfx/p_option.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
p = Draw_SafeCachePic ("gfx/p_option.lmp");
if (p)
M_DrawPic ( (320-p->width)/2, 4, p);
if (!bgmvolume.value)
M_Print (12, 32, "Not playing - no volume");
else if (!*currenttrack.nicename)

View File

@ -210,7 +210,7 @@ void M_Menu_SinglePlayer_f (void)
MC_AddCenterPicture(menu, 4, "gfx/p_option.lmp");
}
p = Draw_CachePic("gfx/sp_menu.lmp");
p = Draw_SafeCachePic("gfx/sp_menu.lmp");
if (!p)
{
MC_AddBox (menu, 60, 10*8, 23, 4);

View File

@ -175,7 +175,11 @@ void M_DrawTextBox (int x, int y, int width, int lines)
{
cy += 8;
if (n == 1)
p = Draw_CachePic ("gfx/box_mm2.lmp");
{
p = Draw_SafeCachePic ("gfx/box_mm2.lmp");
if (!p)
break;
}
M_DrawTransPic (cx, cy, p);
}
p = Draw_SafeCachePic ("gfx/box_bm.lmp");

View File

@ -2379,8 +2379,9 @@ void Sbar_CoopIntermission (void)
return;
Draw_Pic ((sbar_rect.width - 320)/2 + 64, (sbar_rect.height - 200)/2 + 24, pic);
pic = Draw_CachePic ("gfx/inter.lmp");
Draw_TransPic ((sbar_rect.width - 320)/2 + 0, (sbar_rect.height - 200)/2 + 56, pic);
pic = Draw_SafeCachePic ("gfx/inter.lmp");
if (pic)
Draw_TransPic ((sbar_rect.width - 320)/2 + 0, (sbar_rect.height - 200)/2 + 56, pic);
// time
dig = cl.completed_time/60;
@ -2437,7 +2438,8 @@ void Sbar_FinaleOverlay (void)
if (UI_DrawFinale()>0)
return;
#endif
pic = Draw_CachePic ("gfx/finale.lmp");
Draw_TransPic ( (vid.width-pic->width)/2, 16, pic);
pic = Draw_SafeCachePic ("gfx/finale.lmp");
if (pic)
Draw_TransPic ( (vid.width-pic->width)/2, 16, pic);
}