diff options
Diffstat (limited to 'src/v_video.c')
-rw-r--r-- | src/v_video.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/v_video.c b/src/v_video.c index b6c621ba..3d874d6c 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -48,6 +48,9 @@ byte *tinttable = NULL; +// villsa [STRIFE] Blending table used for Strife +byte *xlatab = NULL; + // The screen buffer that the v_video.c code draws to. static byte *dest_screen = NULL; @@ -316,6 +319,55 @@ void V_DrawTLPatch(int x, int y, patch_t * patch) } // +// V_DrawXlaPatch +// +// villsa [STRIFE] Masks a column based translucent masked pic to the screen. +// + +void V_DrawXlaPatch(int x, int y, patch_t * patch) +{ + int count, col; + column_t *column; + byte *desttop, *dest, *source; + int w; + + y -= SHORT(patch->topoffset); + x -= SHORT(patch->leftoffset); + + if(patchclip_callback) + { + if(!patchclip_callback(patch, x, y)) + return; + } + + col = 0; + desttop = dest_screen + y * SCREENWIDTH + x; + + w = SHORT(patch->width); + for(; col < w; x++, col++, desttop++) + { + column = (column_t *) ((byte *) patch + LONG(patch->columnofs[col])); + + // step through the posts in a column + + while(column->topdelta != 0xff) + { + source = (byte *) column + 3; + dest = desttop + column->topdelta * SCREENWIDTH; + count = column->length; + + while(count--) + { + *dest = xlatab[*dest + ((*source) << 8)]; + source++; + dest += SCREENWIDTH; + } + column = (column_t *) ((byte *) column + column->length + 4); + } + } +} + +// // V_DrawAltTLPatch // // Masks a column based translucent masked pic to the screen. @@ -431,6 +483,17 @@ void V_LoadTintTable(void) } // +// V_LoadXlaTable +// +// villsa [STRIFE] Load xla table from XLATAB lump. +// + +void V_LoadXlaTable(void) +{ + xlatab = W_CacheLumpName("XLATAB", PU_STATIC); +} + +// // V_DrawBlock // Draw a linear block of pixels into the view buffer. // |