From 20b9411bcc0add48d31b2ed0e6d66321c5f18e4b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 16 Feb 2001 22:07:40 +0000 Subject: [PATCH] disable transparent pixels in the conback. They will still currently be black, but at least they won't flicker on some drivers. --- include/draw.h | 2 +- source/draw.c | 24 ++++++++++----------- source/gl_draw.c | 34 ++++++++++++++--------------- source/gl_screen.c | 2 +- source/menu.c | 54 +++++++++++++++++++++++----------------------- source/sbar.c | 6 +++--- source/screen.c | 2 +- source/vid_mgl.c | 2 +- source/vid_wgl.c | 2 +- 9 files changed, 64 insertions(+), 64 deletions(-) diff --git a/include/draw.h b/include/draw.h index b28a806..85b2a36 100644 --- a/include/draw.h +++ b/include/draw.h @@ -50,7 +50,7 @@ void Draw_FadeScreen (void); void Draw_String8 (int x, int y, char *str); void Draw_AltString8 (int x, int y, char *str); qpic_t *Draw_PicFromWad (char *name); -qpic_t *Draw_CachePic (char *path); +qpic_t *Draw_CachePic (char *path, qboolean alpha); void Draw_Crosshair(void); #endif // _DRAW_H diff --git a/source/draw.c b/source/draw.c index c2b238c..8fee3c1 100644 --- a/source/draw.c +++ b/source/draw.c @@ -93,7 +93,7 @@ Draw_ClearCache (void) Draw_CachePic */ qpic_t * -Draw_CachePic (char *path) +Draw_CachePic (char *path, qboolean alpha) { cachepic_t *pic; int i; @@ -140,30 +140,30 @@ Draw_TextBox (int x, int y, int width, int lines) // draw left side cx = x; cy = y; - p = Draw_CachePic ("gfx/box_tl.lmp"); + p = Draw_CachePic ("gfx/box_tl.lmp", true); Draw_Pic (cx, cy, p); - p = Draw_CachePic ("gfx/box_ml.lmp"); + p = Draw_CachePic ("gfx/box_ml.lmp", true); for (n = 0; n < lines; n++) { cy += 8; Draw_Pic (cx, cy, p); } - p = Draw_CachePic ("gfx/box_bl.lmp"); + p = Draw_CachePic ("gfx/box_bl.lmp", true); Draw_Pic (cx, cy + 8, p); // draw middle cx += 8; while (width > 0) { cy = y; - p = Draw_CachePic ("gfx/box_tm.lmp"); + p = Draw_CachePic ("gfx/box_tm.lmp", true); Draw_Pic (cx, cy, p); - p = Draw_CachePic ("gfx/box_mm.lmp"); + p = Draw_CachePic ("gfx/box_mm.lmp", true); for (n = 0; n < lines; n++) { cy += 8; if (n == 1) - p = Draw_CachePic ("gfx/box_mm2.lmp"); + p = Draw_CachePic ("gfx/box_mm2.lmp", true); Draw_Pic (cx, cy, p); } - p = Draw_CachePic ("gfx/box_bm.lmp"); + p = Draw_CachePic ("gfx/box_bm.lmp", true); Draw_Pic (cx, cy + 8, p); width -= 2; cx += 16; @@ -171,14 +171,14 @@ Draw_TextBox (int x, int y, int width, int lines) // draw right side cy = y; - p = Draw_CachePic ("gfx/box_tr.lmp"); + p = Draw_CachePic ("gfx/box_tr.lmp", true); Draw_Pic (cx, cy, p); - p = Draw_CachePic ("gfx/box_mr.lmp"); + p = Draw_CachePic ("gfx/box_mr.lmp", true); for (n = 0; n < lines; n++) { cy += 8; Draw_Pic (cx, cy, p); } - p = Draw_CachePic ("gfx/box_br.lmp"); + p = Draw_CachePic ("gfx/box_br.lmp", true); Draw_Pic (cx, cy + 8, p); } @@ -565,7 +565,7 @@ Draw_ConsoleBackground (int lines) int f, fstep; qpic_t *conback; - conback = Draw_CachePic ("gfx/conback.lmp"); + conback = Draw_CachePic ("gfx/conback.lmp", false); // draw the pic if (r_pixbytes == 1) { diff --git a/source/gl_draw.c b/source/gl_draw.c index 5762d57..4949a20 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -47,7 +47,7 @@ #include "screen.h" #include "sys.h" -static int GL_LoadPicTexture (qpic_t *pic); +static int GL_LoadPicTexture (qpic_t *pic, qboolean alpha); extern byte *host_basepal; extern unsigned char d_15to8table[65536]; @@ -136,7 +136,7 @@ Draw_PicFromWad (char *name) p = W_GetLumpName (name); gl = (glpic_t *) p->data; - gl->texnum = GL_LoadPicTexture (p); + gl->texnum = GL_LoadPicTexture (p, true); gl->sl = 0; gl->sh = 1; gl->tl = 0; @@ -159,7 +159,7 @@ Draw_ClearCache (void) Draw_CachePic */ qpic_t * -Draw_CachePic (char *path) +Draw_CachePic (char *path, qboolean alpha) { cachepic_t *pic; int i; @@ -194,7 +194,7 @@ Draw_CachePic (char *path) // Now feed it to the GL stuff and get a texture number.. gl = (glpic_t *) pic->pic.data; - gl->texnum = GL_LoadPicTexture (dat); + gl->texnum = GL_LoadPicTexture (dat, alpha); // Alignment stuff.. gl->sl = 0; @@ -287,30 +287,30 @@ Draw_TextBox (int x, int y, int width, int lines) // draw left side cx = x; cy = y; - p = Draw_CachePic ("gfx/box_tl.lmp"); + p = Draw_CachePic ("gfx/box_tl.lmp", true); Draw_Pic (cx, cy, p); - p = Draw_CachePic ("gfx/box_ml.lmp"); + p = Draw_CachePic ("gfx/box_ml.lmp", true); for (n = 0; n < lines; n++) { cy += 8; Draw_Pic (cx, cy, p); } - p = Draw_CachePic ("gfx/box_bl.lmp"); + p = Draw_CachePic ("gfx/box_bl.lmp", true); Draw_Pic (cx, cy + 8, p); // draw middle cx += 8; while (width > 0) { cy = y; - p = Draw_CachePic ("gfx/box_tm.lmp"); + p = Draw_CachePic ("gfx/box_tm.lmp", true); Draw_Pic (cx, cy, p); - p = Draw_CachePic ("gfx/box_mm.lmp"); + p = Draw_CachePic ("gfx/box_mm.lmp", true); for (n = 0; n < lines; n++) { cy += 8; if (n == 1) - p = Draw_CachePic ("gfx/box_mm2.lmp"); + p = Draw_CachePic ("gfx/box_mm2.lmp", true); Draw_Pic (cx, cy, p); } - p = Draw_CachePic ("gfx/box_bm.lmp"); + p = Draw_CachePic ("gfx/box_bm.lmp", true); Draw_Pic (cx, cy + 8, p); width -= 2; cx += 16; @@ -318,14 +318,14 @@ Draw_TextBox (int x, int y, int width, int lines) // draw right side cy = y; - p = Draw_CachePic ("gfx/box_tr.lmp"); + p = Draw_CachePic ("gfx/box_tr.lmp", true); Draw_Pic (cx, cy, p); - p = Draw_CachePic ("gfx/box_mr.lmp"); + p = Draw_CachePic ("gfx/box_mr.lmp", true); for (n = 0; n < lines; n++) { cy += 8; Draw_Pic (cx, cy, p); } - p = Draw_CachePic ("gfx/box_br.lmp"); + p = Draw_CachePic ("gfx/box_br.lmp", true); Draw_Pic (cx, cy + 8, p); } @@ -658,7 +658,7 @@ Draw_ConsoleBackground (int lines) float alpha; // This can be a CachePic now, just like in software - conback = Draw_CachePic ("gfx/conback.lmp"); + conback = Draw_CachePic ("gfx/conback.lmp", false); gl = (glpic_t *) conback->data; // spin the console? - effect described in a QER tutorial @@ -1229,8 +1229,8 @@ GL_LoadTexture (char *identifier, int width, int height, byte * data, GL_LoadPicTexture */ static int -GL_LoadPicTexture (qpic_t *pic) +GL_LoadPicTexture (qpic_t *pic, qboolean alpha) { - return GL_LoadTexture ("", pic->width, pic->height, pic->data, false, true, + return GL_LoadTexture ("", pic->width, pic->height, pic->data, false, alpha, 1); } diff --git a/source/gl_screen.c b/source/gl_screen.c index 929016f..3655ad0 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -563,7 +563,7 @@ SCR_DrawPause (void) if (!cl.paused) return; - pic = Draw_CachePic ("gfx/pause.lmp"); + pic = Draw_CachePic ("gfx/pause.lmp", true); Draw_Pic ((vid.width - pic->width) / 2, (vid.height - 48 - pic->height) / 2, pic); } diff --git a/source/menu.c b/source/menu.c index da77719..3fbd939 100644 --- a/source/menu.c +++ b/source/menu.c @@ -245,30 +245,30 @@ M_DrawTextBox (int x, int y, int width, int lines) // draw left side cx = x; cy = y; - p = Draw_CachePic ("gfx/box_tl.lmp"); + p = Draw_CachePic ("gfx/box_tl.lmp", true); M_DrawTransPic (cx, cy, p); - p = Draw_CachePic ("gfx/box_ml.lmp"); + p = Draw_CachePic ("gfx/box_ml.lmp", true); for (n = 0; n < lines; n++) { cy += 8; M_DrawTransPic (cx, cy, p); } - p = Draw_CachePic ("gfx/box_bl.lmp"); + p = Draw_CachePic ("gfx/box_bl.lmp", true); M_DrawTransPic (cx, cy + 8, p); // draw middle cx += 8; while (width > 0) { cy = y; - p = Draw_CachePic ("gfx/box_tm.lmp"); + p = Draw_CachePic ("gfx/box_tm.lmp", true); M_DrawTransPic (cx, cy, p); - p = Draw_CachePic ("gfx/box_mm.lmp"); + p = Draw_CachePic ("gfx/box_mm.lmp", true); for (n = 0; n < lines; n++) { cy += 8; if (n == 1) - p = Draw_CachePic ("gfx/box_mm2.lmp"); + p = Draw_CachePic ("gfx/box_mm2.lmp", true); M_DrawTransPic (cx, cy, p); } - p = Draw_CachePic ("gfx/box_bm.lmp"); + p = Draw_CachePic ("gfx/box_bm.lmp", true); M_DrawTransPic (cx, cy + 8, p); width -= 2; cx += 16; @@ -276,14 +276,14 @@ M_DrawTextBox (int x, int y, int width, int lines) // draw right side cy = y; - p = Draw_CachePic ("gfx/box_tr.lmp"); + p = Draw_CachePic ("gfx/box_tr.lmp", true); M_DrawTransPic (cx, cy, p); - p = Draw_CachePic ("gfx/box_mr.lmp"); + p = Draw_CachePic ("gfx/box_mr.lmp", true); for (n = 0; n < lines; n++) { cy += 8; M_DrawTransPic (cx, cy, p); } - p = Draw_CachePic ("gfx/box_br.lmp"); + p = Draw_CachePic ("gfx/box_br.lmp", true); M_DrawTransPic (cx, cy + 8, p); } @@ -345,15 +345,15 @@ M_Main_Draw (void) int f; qpic_t *p; - M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp")); - p = Draw_CachePic ("gfx/ttl_main.lmp"); + M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp", true)); + p = Draw_CachePic ("gfx/ttl_main.lmp", true); M_DrawPic ((320 - p->width) / 2, 4, p); - M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mainmenu.lmp")); + M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mainmenu.lmp", true)); f = (int) (realtime * 10) % 6; M_DrawTransPic (54, 32 + m_main_cursor * 20, - Draw_CachePic (va ("gfx/menudot%i.lmp", f + 1))); + Draw_CachePic (va ("gfx/menudot%i.lmp", f + 1), true)); } @@ -532,8 +532,8 @@ M_Options_Draw (void) float r; qpic_t *p; - M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp")); - p = Draw_CachePic ("gfx/p_option.lmp"); + M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp", true)); + p = Draw_CachePic ("gfx/p_option.lmp", true); M_DrawPic ((320 - p->width) / 2, 4, p); M_Print (16, 32, " Customize controls"); @@ -762,7 +762,7 @@ M_Keys_Draw (void) int x, y; qpic_t *p; - p = Draw_CachePic ("gfx/ttl_cstm.lmp"); + p = Draw_CachePic ("gfx/ttl_cstm.lmp", true); M_DrawPic ((320 - p->width) / 2, 4, p); if (bind_grab) @@ -906,7 +906,7 @@ M_Menu_Help_f (void) void M_Help_Draw (void) { - M_DrawPic (0, 0, Draw_CachePic (va ("gfx/help%i.lmp", help_page))); + M_DrawPic (0, 0, Draw_CachePic (va ("gfx/help%i.lmp", help_page), true)); } @@ -1039,11 +1039,11 @@ M_SinglePlayer_Draw (void) { qpic_t *p; - M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp")); -// M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); - p = Draw_CachePic ("gfx/ttl_sgl.lmp"); + M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp", true)); +// M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp", true) ); + p = Draw_CachePic ("gfx/ttl_sgl.lmp", true); M_DrawPic ((320 - p->width) / 2, 4, p); -// M_DrawTransPic (72, 32, Draw_CachePic ("gfx/sp_menu.lmp") ); +// M_DrawTransPic (72, 32, Draw_CachePic ("gfx/sp_menu.lmp", true) ); M_DrawTextBox (60, 10 * 8, 23, 4); M_PrintWhite (88, 12 * 8, "This client is for"); @@ -1092,8 +1092,8 @@ M_MultiPlayer_Draw (void) int f; - M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp")); - p = Draw_CachePic ("gfx/p_multi.lmp"); + M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp", true)); + p = Draw_CachePic ("gfx/p_multi.lmp", true); M_DrawPic ((320 - p->width) / 2, 4, p); if (!slist) { @@ -1187,7 +1187,7 @@ M_MultiPlayer_Draw (void) M_PrintWhite (STAT_X + 10, STAT_Y + 24, "Updating..."); f = (int)(realtime * 10) % 6; M_PrintWhite(STAT_X+118,STAT_Y+48,"uakeforge!"); - M_DrawTransPic(STAT_X+105,STAT_Y+38,Draw_CachePic(va("gfx/menudot%i.lmp",f+1))); + M_DrawTransPic(STAT_X+105,STAT_Y+38,Draw_CachePic(va("gfx/menudot%i.lmp",f+1), true)); } M_DrawCharacter (MENU_X + 8, (m_multip_cursor - m_multip_mins + 1) * 8 + MENU_Y, 12 + ((int) (realtime * 4) & 1)); @@ -1378,8 +1378,8 @@ M_SEdit_Draw (void) { qpic_t *p; - M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp")); - p = Draw_CachePic ("gfx/p_multi.lmp"); + M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp", true)); + p = Draw_CachePic ("gfx/p_multi.lmp", true); M_DrawPic ((320 - p->width) / 2, 4, p); M_DrawTextBox (SERV_X, SERV_Y, 23, 1); diff --git a/source/sbar.c b/source/sbar.c index 0cecec0..6e0200a 100644 --- a/source/sbar.c +++ b/source/sbar.c @@ -891,7 +891,7 @@ Sbar_TeamOverlay (void) scr_copyeverything = 1; scr_fullupdate = 0; - pic = Draw_CachePic ("gfx/ranking.lmp"); + pic = Draw_CachePic ("gfx/ranking.lmp", true); Draw_Pic (160 - pic->width / 2, 0, pic); y = 24; @@ -992,7 +992,7 @@ Sbar_DeathmatchOverlay (int start) scr_fullupdate = 0; if (!start) { - pic = Draw_CachePic ("gfx/ranking.lmp"); + pic = Draw_CachePic ("gfx/ranking.lmp", true); Draw_Pic (160 - pic->width / 2, 0, pic); } // scores @@ -1278,6 +1278,6 @@ Sbar_FinaleOverlay (void) scr_copyeverything = 1; - pic = Draw_CachePic ("gfx/finale.lmp"); + pic = Draw_CachePic ("gfx/finale.lmp", true); Draw_Pic ((vid.width - pic->width) / 2, 16, pic); } diff --git a/source/screen.c b/source/screen.c index 1ff149b..f33bbc8 100644 --- a/source/screen.c +++ b/source/screen.c @@ -578,7 +578,7 @@ SCR_DrawPause (void) if (!cl.paused) return; - pic = Draw_CachePic ("gfx/pause.lmp"); + pic = Draw_CachePic ("gfx/pause.lmp", true); Draw_Pic ((vid.width - pic->width) / 2, (vid.height - 48 - pic->height) / 2, pic); } diff --git a/source/vid_mgl.c b/source/vid_mgl.c index f13d973..f35b876 100644 --- a/source/vid_mgl.c +++ b/source/vid_mgl.c @@ -2946,7 +2946,7 @@ VID_MenuDraw (void) vmode_t *pv; modedesc_t tmodedesc; - p = Draw_CachePic ("gfx/vidmodes.lmp"); + p = Draw_CachePic ("gfx/vidmodes.lmp", true); M_DrawPic ((320 - p->width) / 2, 4, p); for (i = 0; i < 3; i++) { diff --git a/source/vid_wgl.c b/source/vid_wgl.c index a1fd56c..d8d10b9 100644 --- a/source/vid_wgl.c +++ b/source/vid_wgl.c @@ -1698,7 +1698,7 @@ VID_MenuDraw (void) int lnummodes, i, k, column, row; vmode_t *pv; - p = Draw_CachePic ("gfx/vidmodes.lmp"); + p = Draw_CachePic ("gfx/vidmodes.lmp", true); M_DrawPic ((320 - p->width) / 2, 4, p); vid_wmodes = 0;