foxygit / doom Log in
commit d35a4b7cf3a206a35ac57e279fb36bad9436ab0b
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Wed Oct 1 19:03:51 2008 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Wed Oct 1 19:03:51 2008 +0000

    Merge tinttable variable to common.

    Subversion-branch: /branches/raven-branch
    Subversion-revision: 1316
---
 src/heretic/r_draw.c |  4 +---
 src/hexen/r_draw.c   |  4 +---
 src/v_video.c        | 11 ++++++++---
 src/v_video.h        |  7 +++++++
 4 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/heretic/r_draw.c b/src/heretic/r_draw.c
index 468645f6..23726b9c 100644
--- a/src/heretic/r_draw.c
+++ b/src/heretic/r_draw.c
@@ -39,7 +39,6 @@ int viewwidth, scaledviewwidth, viewheight, viewwindowx, viewwindowy;
 byte *ylookup[MAXHEIGHT];
 int columnofs[MAXWIDTH];
 byte translations[3][256];      // color tables for different players
-byte *tinttable;                // used for translucent sprites

 /*
 ==================
@@ -241,8 +240,7 @@ void R_InitTranslationTables(void)
 {
     int i;

-    // Load tint table
-    tinttable = W_CacheLumpName("TINTTAB", PU_STATIC);
+    V_LoadTintTable();

     // Allocate translation tables
     translationtables = Z_Malloc(256 * 3 + 255, PU_STATIC, 0);
diff --git a/src/hexen/r_draw.c b/src/hexen/r_draw.c
index 915d25b9..04d4009d 100644
--- a/src/hexen/r_draw.c
+++ b/src/hexen/r_draw.c
@@ -40,7 +40,6 @@ int viewwidth, scaledviewwidth, viewheight, viewwindowx, viewwindowy;
 byte *ylookup[MAXHEIGHT];
 int columnofs[MAXWIDTH];
 //byte translations[3][256]; // color tables for different players
-byte *tinttable;                // used for translucent sprites

 /*
 ==================
@@ -332,8 +331,7 @@ void R_InitTranslationTables(void)
     int i;
     byte *transLump;

-    // Load tint table
-    tinttable = W_CacheLumpName("TINTTAB", PU_STATIC);
+    V_LoadTintTable();

     // Allocate translation tables
     translationtables = Z_Malloc(256 * 3 * (MAXPLAYERS - 1) + 255,
diff --git a/src/v_video.c b/src/v_video.c
index 564359a4..69da2aed 100644
--- a/src/v_video.c
+++ b/src/v_video.c
@@ -390,7 +390,7 @@ void V_DrawAltTLPatch(int x, int y, patch_t * patch)
     }

     col = 0;
-    desttop = screen + y * SCREENWIDTH + x;
+    desttop = dest_screen + y * SCREENWIDTH + x;

     w = SHORT(patch->width);
     for (; col < w; x++, col++, desttop++)
@@ -471,9 +471,14 @@ void V_DrawShadowedPatch(int x, int y, patch_t *patch)
     }
 }

+//
+// Load tint table from TINTTAB lump.
+//

-
-
+void V_LoadTintTable(void)
+{
+    tinttable = W_CacheLumpName("TINTTAB", PU_STATIC);
+}

 //
 // V_DrawBlock
diff --git a/src/v_video.h b/src/v_video.h
index 34c36f79..649e7175 100644
--- a/src/v_video.h
+++ b/src/v_video.h
@@ -46,6 +46,8 @@ extern int dirtybox[4];

 extern const byte gammatable[5][256];

+extern byte *tinttable;
+
 // Allocates buffer screens, call before R_Init.
 void V_Init (void);

@@ -87,5 +89,10 @@ void V_RestoreBuffer(void);

 void V_ScreenShot(char *format);

+// Load the lookup table for translucency calculations from the TINTTAB
+// lump.
+
+void V_LoadTintTable(void);
+
 #endif