mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-05-30 00:30:38 +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
156
source/draw.c
156
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,9 +341,9 @@ 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;
|
||||
|
||||
if (r_pixbytes == 1)
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue