summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/v_video.c50
-rw-r--r--src/v_video.h1
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);