extern unsigned char d_15to8table[65536];
cvar_t qsg_version = {"qsg_version", "1"};
-cvar_t gl_conalpha = {"gl_conalpha", "1"};
+cvar_t scr_conalpha = {"scr_conalpha", "1"};
byte *draw_chars; // 8*8 graphic characters
qpic_t *draw_disc;
{
int i;
Cvar_RegisterVariable (&qsg_version);
- Cvar_RegisterVariable (&gl_conalpha);
+ Cvar_RegisterVariable (&scr_conalpha);
Cmd_AddCommand ("loadsky", &LoadSky_f);
if (scrap_dirty)
Scrap_Upload ();
gl = (glpic_t *)pic->data;
-// glDisable(GL_ALPHA_TEST);
-// glEnable (GL_BLEND);
-// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-// glCullFace(GL_FRONT);
- glColor4f(0.8,0.8,0.8,alpha);
+ glColor4f(1,1,1,alpha);
glBindTexture(GL_TEXTURE_2D, gl->texnum);
-// glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBegin (GL_QUADS);
glTexCoord2f (gl->sl, gl->tl);
glVertex2f (x, y);
glTexCoord2f (gl->sl, gl->th);
glVertex2f (x, y+pic->height);
glEnd ();
- glColor3f(1,1,1);
-// glEnable(GL_ALPHA_TEST);
-// glDisable (GL_BLEND);
}
if (scrap_dirty)
Scrap_Upload ();
gl = (glpic_t *)pic->data;
- glColor3f(0.8,0.8,0.8);
+ glColor3f(1,1,1);
glBindTexture(GL_TEXTURE_2D, gl->texnum);
glBegin (GL_QUADS);
glTexCoord2f (gl->sl, gl->tl);
/*
=============
-Draw_TransPic
-=============
-*/
-void Draw_TransPic (int x, int y, qpic_t *pic)
-{
- if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 || (unsigned)(y + pic->height) > vid.height)
- Sys_Error ("Draw_TransPic: bad coordinates");
-
-// glEnable(GL_BLEND);
-// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-// glDisable(GL_ALPHA_TEST);
- Draw_Pic (x, y, pic);
-// glDisable(GL_BLEND);
-}
-
-
-/*
-=============
-Draw_TransPicTranslate
+Draw_PicTranslate
Only used for the player color selection menu
=============
*/
-void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation)
+void Draw_PicTranslate (int x, int y, qpic_t *pic, byte *translation)
{
- int v, u, c;
- unsigned trans[64*64], *dest;
- byte *src;
- int p;
+ int i, c;
+ byte *trans, *src, *dest;
c = pic->width * pic->height;
+ src = menuplyr_pixels;
+ dest = trans = malloc(c);
+ for (i = 0;i < c;i++)
+ *dest++ = translation[*src++];
- dest = trans;
- for (v=0 ; v<64 ; v++, dest += 64)
- {
- src = &menuplyr_pixels[ ((v*pic->height)>>6) *pic->width];
- for (u=0 ; u<64 ; u++)
- {
- p = src[(u*pic->width)>>6];
- if (p == 255)
- dest[u] = p;
- else
- dest[u] = d_8to24table[translation[p]];
- }
- }
-
- glBindTexture(GL_TEXTURE_2D, GL_LoadTexture ("translatedplayerpic", 64, 64, (void *) trans, false, true, 1));
+ glBindTexture(GL_TEXTURE_2D, GL_LoadTexture ("translatedplayerpic", pic->width, pic->height, trans, false, true, 1));
+ free(trans);
- glColor3f(0.8,0.8,0.8);
+ glColor3f(1,1,1);
glBegin (GL_QUADS);
glTexCoord2f (0, 0);
glVertex2f (x, y);
if (lines >= (int) vid.height)
Draw_Pic(0, lines - vid.height, conback);
else
- Draw_AlphaPic (0, lines - vid.height, conback, gl_conalpha.value*lines/vid.height);
+ Draw_AlphaPic (0, lines - vid.height, conback, scr_conalpha.value*lines/vid.height);
// Draw_AlphaPic (0, lines - vid.height, conback, (float)(1.2 * lines)/y);
// LordHavoc: draw version
Draw_String(engineversionx, lines - vid.height + engineversiony, engineversion, 9999);
int i;
for (i = 0;i < SHOWLMP_MAXLABELS;i++)
if (showlmp[i].isactive)
- Draw_TransPic(showlmp[i].x, showlmp[i].y, Draw_CachePic(showlmp[i].pic));
+ Draw_Pic(showlmp[i].x, showlmp[i].y, Draw_CachePic(showlmp[i].pic));
}
void SHOWLMP_clear()
}
}
-void M_DrawTransPic (int x, int y, qpic_t *pic)
-{
- Draw_TransPic (x + ((vid.width - 320)>>1), y, pic);
-}
-
void M_DrawPic (int x, int y, qpic_t *pic)
{
Draw_Pic (x + ((vid.width - 320)>>1), y, pic);
}
-void M_DrawTransPicTranslate (int x, int y, qpic_t *pic)
+void M_DrawPicTranslate (int x, int y, qpic_t *pic)
{
- Draw_TransPicTranslate (x + ((vid.width - 320)>>1), y, pic, translationTable);
+ Draw_PicTranslate (x + ((vid.width - 320)>>1), y, pic, translationTable);
}
cx = x;
cy = y;
p = Draw_CachePic ("gfx/box_tl.lmp");
- M_DrawTransPic (cx, cy, p);
+ M_DrawPic (cx, cy, p);
p = Draw_CachePic ("gfx/box_ml.lmp");
for (n = 0; n < lines; n++)
{
cy += 8;
- M_DrawTransPic (cx, cy, p);
+ M_DrawPic (cx, cy, p);
}
p = Draw_CachePic ("gfx/box_bl.lmp");
- M_DrawTransPic (cx, cy+8, p);
+ M_DrawPic (cx, cy+8, p);
// draw middle
cx += 8;
{
cy = y;
p = Draw_CachePic ("gfx/box_tm.lmp");
- M_DrawTransPic (cx, cy, p);
+ M_DrawPic (cx, cy, p);
p = Draw_CachePic ("gfx/box_mm.lmp");
for (n = 0; n < lines; n++)
{
cy += 8;
if (n == 1)
p = Draw_CachePic ("gfx/box_mm2.lmp");
- M_DrawTransPic (cx, cy, p);
+ M_DrawPic (cx, cy, p);
}
p = Draw_CachePic ("gfx/box_bm.lmp");
- M_DrawTransPic (cx, cy+8, p);
+ M_DrawPic (cx, cy+8, p);
width -= 2;
cx += 16;
}
// draw right side
cy = y;
p = Draw_CachePic ("gfx/box_tr.lmp");
- M_DrawTransPic (cx, cy, p);
+ M_DrawPic (cx, cy, p);
p = Draw_CachePic ("gfx/box_mr.lmp");
for (n = 0; n < lines; n++)
{
cy += 8;
- M_DrawTransPic (cx, cy, p);
+ M_DrawPic (cx, cy, p);
}
p = Draw_CachePic ("gfx/box_br.lmp");
- M_DrawTransPic (cx, cy+8, p);
+ M_DrawPic (cx, cy+8, p);
}
//=============================================================================
int f;
qpic_t *p;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/ttl_main.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
// Nehahra
if (nehahra)
{
if (NehGameType == TYPE_BOTH)
- M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mainmenu.lmp"));
+ M_DrawPic (72, 32, Draw_CachePic ("gfx/mainmenu.lmp"));
else if (NehGameType == TYPE_GAME)
- M_DrawTransPic (72, 32, Draw_CachePic ("gfx/gamemenu.lmp"));
+ M_DrawPic (72, 32, Draw_CachePic ("gfx/gamemenu.lmp"));
else
- M_DrawTransPic (72, 32, Draw_CachePic ("gfx/demomenu.lmp"));
+ M_DrawPic (72, 32, Draw_CachePic ("gfx/demomenu.lmp"));
}
else
- M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mainmenu.lmp"));
+ M_DrawPic (72, 32, Draw_CachePic ("gfx/mainmenu.lmp"));
f = (int)(host_time * 10)%6;
- M_DrawTransPic (54, 32 + m_main_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
+ M_DrawPic (54, 32 + m_main_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
}
int f;
qpic_t *p;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/ttl_sgl.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
- M_DrawTransPic (72, 32, Draw_CachePic ("gfx/sp_menu.lmp") );
+ M_DrawPic (72, 32, Draw_CachePic ("gfx/sp_menu.lmp") );
f = (int)(host_time * 10)%6;
- M_DrawTransPic (54, 32 + m_singleplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
+ M_DrawPic (54, 32 + m_singleplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
}
int f;
qpic_t *p;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
- M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mp_menu.lmp") );
+ M_DrawPic (72, 32, Draw_CachePic ("gfx/mp_menu.lmp") );
f = (int)(host_time * 10)%6;
- M_DrawTransPic (54, 32 + m_multiplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
+ M_DrawPic (54, 32 + m_multiplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
if (serialAvailable || ipxAvailable || tcpipAvailable)
return;
{
qpic_t *p;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
M_Print (72, 140, "Accept Changes");
p = Draw_CachePic ("gfx/bigbox.lmp");
- M_DrawTransPic (160, 64, p);
+ M_DrawPic (160, 64, p);
p = Draw_CachePic ("gfx/menuplyr.lmp");
M_BuildTranslationTable(setup_top*16, setup_bottom*16);
- M_DrawTransPicTranslate (172, 72, p);
+ M_DrawPicTranslate (172, 72, p);
M_DrawCharacter (56, setup_cursor_table [setup_cursor], 12+((int)(realtime*4)&1));
int f;
qpic_t *p;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
}
if (p)
- M_DrawTransPic (72, f, p);
+ M_DrawPic (72, f, p);
f += 19;
}
if (p)
- M_DrawTransPic (72, f, p);
+ M_DrawPic (72, f, p);
f += 19;
if (ipxAvailable)
p = Draw_CachePic ("gfx/netmen3.lmp");
else
p = Draw_CachePic ("gfx/dim_ipx.lmp");
- M_DrawTransPic (72, f, p);
+ M_DrawPic (72, f, p);
f += 19;
if (tcpipAvailable)
p = Draw_CachePic ("gfx/netmen4.lmp");
else
p = Draw_CachePic ("gfx/dim_tcp.lmp");
- M_DrawTransPic (72, f, p);
+ M_DrawPic (72, f, p);
if (m_net_items == 5) // JDC, could just be removed
{
f += 19;
p = Draw_CachePic ("gfx/netmen5.lmp");
- M_DrawTransPic (72, f, p);
+ M_DrawPic (72, f, p);
}
f = (320-26*8)/2;
M_Print (f, 166, net_helpMessage[m_net_cursor*4+3]);
f = (int)(host_time * 10)%6;
- M_DrawTransPic (54, 32 + m_net_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
+ M_DrawPic (54, 32 + m_net_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
}
float r;
qpic_t *p;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_option.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
char *startJoin;
char *directModem;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
basex = (320-p->width)/2;
M_DrawPic (basex, 4, p);
qpic_t *p;
int basex;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
basex = (320-p->width)/2;
M_DrawPic (basex, 4, p);
char *startJoin;
char *protocol;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
basex = (320-p->width)/2;
M_DrawPic (basex, 4, p);
qpic_t *p;
int x;
- M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
+ M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
Draw_AlphaPic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic, alpha);
}
-/*
-=============
-Sbar_DrawTransPic
-=============
-*/
-void Sbar_DrawTransPic (int x, int y, qpic_t *pic)
-{
- if (cl.gametype == GAME_DEATHMATCH)
- Draw_TransPic (x /*+ ((vid.width - 320)>>1)*/, y + (vid.height-SBAR_HEIGHT), pic);
- else
- Draw_TransPic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic);
-}
-
/*
================
Sbar_DrawCharacter
else
frame = *ptr -'0';
- Sbar_DrawTransPic (x,y,sb_nums[color][frame]);
+ Sbar_DrawPic (x,y,sb_nums[color][frame]);
x += 24;
ptr++;
}
else
frame = *ptr -'0';
- Draw_TransPic (x,y,sb_nums[color][frame]);
+ Draw_Pic (x,y,sb_nums[color][frame]);
x += 24;
ptr++;
}
Draw_Pic (64, 24, pic);
pic = Draw_CachePic ("gfx/inter.lmp");
- Draw_TransPic (0, 56, pic);
+ Draw_Pic (0, 56, pic);
// time
dig = cl.completed_time/60;
Sbar_IntermissionNumber (160, 64, dig, 3, 0);
num = cl.completed_time - dig*60;
- Draw_TransPic (234,64,sb_colon);
- Draw_TransPic (246,64,sb_nums[0][num/10]);
- Draw_TransPic (266,64,sb_nums[0][num%10]);
+ Draw_Pic (234,64,sb_colon);
+ Draw_Pic (246,64,sb_nums[0][num/10]);
+ Draw_Pic (266,64,sb_nums[0][num%10]);
Sbar_IntermissionNumber (160, 104, cl.stats[STAT_SECRETS], 3, 0);
- Draw_TransPic (232,104,sb_slash);
+ Draw_Pic (232,104,sb_slash);
Sbar_IntermissionNumber (240, 104, cl.stats[STAT_TOTALSECRETS], 3, 0);
Sbar_IntermissionNumber (160, 144, cl.stats[STAT_MONSTERS], 3, 0);
- Draw_TransPic (232,144,sb_slash);
+ Draw_Pic (232,144,sb_slash);
Sbar_IntermissionNumber (240, 144, cl.stats[STAT_TOTALMONSTERS], 3, 0);
}
scr_copyeverything = 1;
pic = Draw_CachePic ("gfx/finale.lmp");
- Draw_TransPic ( (vid.width-pic->width)/2, 16, pic);
+ Draw_Pic ( (vid.width-pic->width)/2, 16, pic);
}