dxx-rebirth/2d/tmerge.c
Bradley Bell 9bd1ba7c47 This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.
2001-01-19 03:30:16 +00:00

62 lines
1.2 KiB
C

// tmerge.c - C Texture merge routines for use with D1X
// Ripped from ldescent by <dph-man@iname.com>
#include <conf.h>
#ifdef NO_ASM // If for some reason we have elected not to use assembler...
#include "gr.h"
void gr_merge_textures( ubyte * lower, ubyte * upper, ubyte * dest )
{
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;
}
}
void gr_merge_textures_1( ubyte * lower, ubyte * upper, ubyte * dest )
{
int x,y;
ubyte c;
for (y=0; y<64; y++ )
for (x=0; x<64; x++ ) {
c = upper[ 64*x+(63-y) ];
if (c==TRANSPARENCY_COLOR)
c = lower[ 64*y+x ];
*dest++ = c;
}
}
void gr_merge_textures_2( ubyte * lower, ubyte * upper, ubyte * dest )
{
int x,y;
ubyte c;
for (y=0; y<64; y++ )
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++ )
for (x=0; x<64; x++ ) {
c = upper[ 64*(63-x)+y ];
if (c==TRANSPARENCY_COLOR)
c = lower[ 64*y+x ];
*dest++ = c;
}
}
#endif