shithub: choc

Download patch

ref: 738e91cd6052ddfd12651cd2f639888cbc64b05e
parent: 4385c78edb8f2a38c50533455d45b6510d0d1c9b
author: Simon Howard <[email protected]>
date: Wed Oct 1 14:31:38 EDT 2008

Finish merge of hexen/v_video.c to common (oops)

Subversion-branch: /branches/raven-branch
Subversion-revision: 1315

--- a/src/v_video.c
+++ b/src/v_video.c
@@ -366,6 +366,56 @@
 }
 
 //
+// 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.
--- a/src/v_video.h
+++ b/src/v_video.h
@@ -58,6 +58,7 @@
 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);