mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 14:52:08 +00:00
removal of Draw_TranPic. Thanks, Seth.
This commit is contained in:
parent
b948a6c004
commit
06ead88d9d
4 changed files with 60 additions and 130 deletions
154
source/draw.c
154
source/draw.c
|
@ -333,108 +333,6 @@ Draw_Pic
|
|||
=============
|
||||
*/
|
||||
void Draw_Pic (int x, int y, qpic_t *pic)
|
||||
{
|
||||
byte *dest, *source;
|
||||
unsigned short *pusdest;
|
||||
int v, u;
|
||||
|
||||
if ((x < 0) ||
|
||||
(x + pic->width > vid.width) ||
|
||||
(y < 0) ||
|
||||
(y + pic->height > vid.height))
|
||||
{
|
||||
Sys_Error ("Draw_Pic: bad coordinates");
|
||||
}
|
||||
|
||||
source = pic->data;
|
||||
|
||||
if (r_pixbytes == 1)
|
||||
{
|
||||
dest = vid.buffer + y * vid.rowbytes + x;
|
||||
|
||||
for (v=0 ; v<pic->height ; v++)
|
||||
{
|
||||
memcpy (dest, source, pic->width);
|
||||
dest += vid.rowbytes;
|
||||
source += pic->width;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: pretranslate at load time?
|
||||
pusdest = (unsigned short *)vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
|
||||
for (v=0 ; v<pic->height ; v++)
|
||||
{
|
||||
for (u=0 ; u<pic->width ; u++)
|
||||
{
|
||||
pusdest[u] = d_8to16table[source[u]];
|
||||
}
|
||||
|
||||
pusdest += vid.rowbytes >> 1;
|
||||
source += pic->width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_SubPic
|
||||
=============
|
||||
*/
|
||||
void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height)
|
||||
{
|
||||
byte *dest, *source;
|
||||
unsigned short *pusdest;
|
||||
int v, u;
|
||||
|
||||
if ((x < 0) ||
|
||||
(x + width > vid.width) ||
|
||||
(y < 0) ||
|
||||
(y + height > vid.height))
|
||||
{
|
||||
Sys_Error ("Draw_Pic: bad coordinates");
|
||||
}
|
||||
|
||||
source = pic->data + srcy * pic->width + srcx;
|
||||
|
||||
if (r_pixbytes == 1)
|
||||
{
|
||||
dest = vid.buffer + y * vid.rowbytes + x;
|
||||
|
||||
for (v=0 ; v<height ; v++)
|
||||
{
|
||||
memcpy (dest, source, width);
|
||||
dest += vid.rowbytes;
|
||||
source += pic->width;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: pretranslate at load time?
|
||||
pusdest = (unsigned short *)vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
|
||||
for (v=0 ; v<height ; v++)
|
||||
{
|
||||
for (u=srcx ; u<(srcx+width) ; u++)
|
||||
{
|
||||
pusdest[u] = d_8to16table[source[u]];
|
||||
}
|
||||
|
||||
pusdest += vid.rowbytes >> 1;
|
||||
source += pic->width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_TransPic
|
||||
=============
|
||||
*/
|
||||
void Draw_TransPic (int x, int y, qpic_t *pic)
|
||||
{
|
||||
byte *dest, *source, tbyte;
|
||||
unsigned short *pusdest;
|
||||
|
@ -443,7 +341,7 @@ void Draw_TransPic (int x, int y, qpic_t *pic)
|
|||
if (x < 0 || (unsigned int)(x + pic->width) > vid.width || y < 0 ||
|
||||
(unsigned int)(y + pic->height) > vid.height)
|
||||
{
|
||||
Sys_Error ("Draw_TransPic: bad coordinates");
|
||||
Sys_Error ("Draw_Pic: bad coordinates");
|
||||
}
|
||||
|
||||
source = pic->data;
|
||||
|
@ -516,6 +414,56 @@ void Draw_TransPic (int x, int y, qpic_t *pic)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_SubPic
|
||||
=============
|
||||
*/
|
||||
void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height)
|
||||
{
|
||||
byte *dest, *source;
|
||||
unsigned short *pusdest;
|
||||
int v, u;
|
||||
|
||||
if ((x < 0) ||
|
||||
(x + width > vid.width) ||
|
||||
(y < 0) ||
|
||||
(y + height > vid.height))
|
||||
{
|
||||
Sys_Error ("Draw_Pic: bad coordinates");
|
||||
}
|
||||
|
||||
source = pic->data + srcy * pic->width + srcx;
|
||||
|
||||
if (r_pixbytes == 1)
|
||||
{
|
||||
dest = vid.buffer + y * vid.rowbytes + x;
|
||||
|
||||
for (v=0 ; v<height ; v++)
|
||||
{
|
||||
memcpy (dest, source, width);
|
||||
dest += vid.rowbytes;
|
||||
source += pic->width;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: pretranslate at load time?
|
||||
pusdest = (unsigned short *)vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
|
||||
for (v=0 ; v<height ; v++)
|
||||
{
|
||||
for (u=srcx ; u<(srcx+width) ; u++)
|
||||
{
|
||||
pusdest[u] = d_8to16table[source[u]];
|
||||
}
|
||||
|
||||
pusdest += vid.rowbytes >> 1;
|
||||
source += pic->width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_TransPicTranslate
|
||||
|
|
|
@ -664,24 +664,6 @@ void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int h
|
|||
glColor3ubv(lighthalf_v);
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_TransPic
|
||||
=============
|
||||
*/
|
||||
void Draw_TransPic (int x, int y, qpic_t *pic)
|
||||
{
|
||||
|
||||
if (x < 0 || (unsigned int)(x + pic->width) > vid.width || y < 0 ||
|
||||
(unsigned int)(y + pic->height) > vid.height)
|
||||
{
|
||||
Sys_Error ("Draw_TransPic: bad coordinates");
|
||||
}
|
||||
|
||||
Draw_Pic (x, y, pic);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_TransPicTranslate
|
||||
|
|
|
@ -164,7 +164,7 @@ void M_PrintWhite (int cx, int cy, char *str)
|
|||
|
||||
void M_DrawTransPic (int x, int y, qpic_t *pic)
|
||||
{
|
||||
Draw_TransPic (x + ((vid.width - 320)>>1), y, pic);
|
||||
Draw_Pic (x + ((vid.width - 320)>>1), y, pic);
|
||||
}
|
||||
|
||||
void M_DrawPic (int x, int y, qpic_t *pic)
|
||||
|
|
|
@ -277,7 +277,7 @@ Sbar_DrawTransPic
|
|||
*/
|
||||
void Sbar_DrawTransPic (int x, int y, qpic_t *pic)
|
||||
{
|
||||
Draw_TransPic (x /*+ ((vid.width - 320)>>1) */, y + (vid.height-SBAR_HEIGHT), pic);
|
||||
Draw_Pic (x /*+ ((vid.width - 320)>>1) */, y + (vid.height-SBAR_HEIGHT), pic);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -887,7 +887,7 @@ void Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
|
|||
else
|
||||
frame = *ptr -'0';
|
||||
|
||||
Draw_TransPic (x,y,sb_nums[color][frame]);
|
||||
Draw_Pic (x,y,sb_nums[color][frame]);
|
||||
x += 24;
|
||||
ptr++;
|
||||
}
|
||||
|
@ -1330,7 +1330,7 @@ void Sbar_FinaleOverlay (void)
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue