diff options
author | Simon Howard | 2008-10-01 18:31:38 +0000 |
---|---|---|
committer | Simon Howard | 2008-10-01 18:31:38 +0000 |
commit | 738e91cd6052ddfd12651cd2f639888cbc64b05e (patch) | |
tree | 80430b11d544e4fc6b3a917cb6f459034f7a3635 | |
parent | 4385c78edb8f2a38c50533455d45b6510d0d1c9b (diff) | |
download | chocolate-doom-738e91cd6052ddfd12651cd2f639888cbc64b05e.tar.gz chocolate-doom-738e91cd6052ddfd12651cd2f639888cbc64b05e.tar.bz2 chocolate-doom-738e91cd6052ddfd12651cd2f639888cbc64b05e.zip |
Finish merge of hexen/v_video.c to common (oops)
Subversion-branch: /branches/raven-branch
Subversion-revision: 1315
-rw-r--r-- | src/v_video.c | 50 | ||||
-rw-r--r-- | src/v_video.h | 1 |
2 files changed, 51 insertions, 0 deletions
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 @@ -366,6 +366,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 // // Masks a column based masked pic to the screen. 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); |