From 738e91cd6052ddfd12651cd2f639888cbc64b05e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 1 Oct 2008 18:31:38 +0000 Subject: Finish merge of hexen/v_video.c to common (oops) Subversion-branch: /branches/raven-branch Subversion-revision: 1315 --- src/v_video.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/v_video.h | 1 + 2 files changed, 51 insertions(+) (limited to 'src') diff --git a/src/v_video.c b/src/v_video.c index 9d125255..564359a4 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -365,6 +365,56 @@ void V_DrawTLPatch(int x, int y, patch_t * patch) } } +// +// V_DrawAltTLPatch +// +// Masks a column based translucent masked pic to the screen. +// + +void V_DrawAltTLPatch(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 (x < 0 + || x + SHORT(patch->width) > SCREENWIDTH + || y < 0 + || y + SHORT(patch->height) > SCREENHEIGHT) + { + I_Error("Bad V_DrawAltTLPatch"); + } + + col = 0; + desttop = 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 = tinttable[((*dest) << 8) + *source++]; + dest += SCREENWIDTH; + } + column = (column_t *) ((byte *) column + column->length + 4); + } + } +} + // // V_DrawShadowedPatch // diff --git a/src/v_video.h b/src/v_video.h index 1d4569b9..34c36f79 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -58,6 +58,7 @@ void V_CopyRect(int srcx, int srcy, byte *source, void V_DrawPatch(int x, int y, patch_t *patch); void V_DrawPatchFlipped(int x, int y, patch_t *patch); void V_DrawTLPatch(int x, int y, patch_t *patch); +void V_DrawAltTLPatch(int x, int y, patch_t * patch); void V_DrawShadowedPatch(int x, int y, patch_t *patch); void V_DrawPatchDirect(int x, int y, patch_t *patch); -- cgit v1.2.3