dxx-rebirth/2d/tmerge.c

65 lines
1.2 KiB
C
Raw Normal View History

2002-10-10 18:55:32 +00:00
/* $Id: tmerge.c,v 1.4 2002-10-10 18:55:32 btb Exp $ */
2002-07-17 21:55:19 +00:00
/*
2002-10-10 18:55:32 +00:00
*
2002-07-17 21:55:19 +00:00
* tmerge.c - C Texture merge routines for use with D1X
* Ripped from ldescent by <dph-man@iname.com>
*
*/
2001-01-31 15:18:05 +00:00
#ifdef HAVE_CONFIG_H
#include <conf.h>
2001-01-31 15:18:05 +00:00
#endif
#include "gr.h"
void gr_merge_textures( ubyte * lower, ubyte * upper, ubyte * dest )
{
2002-10-10 18:55:32 +00:00
int x,y;
ubyte c;
for (y=0;y<64;y++) for (x=0;x<64;x++) {
c=upper[64*y+x];
if (c==TRANSPARENCY_COLOR)
c=lower[64*y+x];
*dest++=c;
2002-10-10 18:55:32 +00:00
}
}
void gr_merge_textures_1( ubyte * lower, ubyte * upper, ubyte * dest )
{
2002-10-10 18:55:32 +00:00
int x,y;
ubyte c;
for (y=0; y<64; y++ )
2002-10-10 18:55:32 +00:00
for (x=0; x<64; x++ ) {
c = upper[ 64*x+(63-y) ];
if (c==TRANSPARENCY_COLOR)
c = lower[ 64*y+x ];
*dest++ = c;
2002-10-10 18:55:32 +00:00
}
}
void gr_merge_textures_2( ubyte * lower, ubyte * upper, ubyte * dest )
{
int x,y;
ubyte c;
for (y=0; y<64; y++ )
2002-10-10 18:55:32 +00:00
for (x=0; x<64; x++ ) {
c = upper[ 64*(63-y)+(63-x) ];
if (c==TRANSPARENCY_COLOR)
c = lower[ 64*y+x ];
*dest++ = c;
}
}
void gr_merge_textures_3( ubyte * lower, ubyte * upper, ubyte * dest )
{
int x,y;
ubyte c;
for (y=0; y<64; y++ )
2002-10-10 18:55:32 +00:00
for (x=0; x<64; x++ ) {
c = upper[ 64*(63-x)+y ];
if (c==TRANSPARENCY_COLOR)
c = lower[ 64*y+x ];
*dest++ = c;
}
}