summaryrefslogtreecommitdiff
path: root/src/strife/r_draw.c
diff options
context:
space:
mode:
authorJames Haley2010-08-28 05:35:52 +0000
committerJames Haley2010-08-28 05:35:52 +0000
commitcbfc9c134032630b71ec2acf4abe552a7569640f (patch)
tree19901c7157213d392931624833b04ac8bfd1b303 /src/strife/r_draw.c
parent8f24f63be140a34c9ac19463832bed0e7fabba67 (diff)
downloadchocolate-doom-cbfc9c134032630b71ec2acf4abe552a7569640f.tar.gz
chocolate-doom-cbfc9c134032630b71ec2acf4abe552a7569640f.tar.bz2
chocolate-doom-cbfc9c134032630b71ec2acf4abe552a7569640f.zip
Added crossfade wipe and code to load XLATAB lump. Changes to the menu
system including working Sigil cursor, alignment changes, shortcut character changes, and removal of items from the options menu that Strife put elsewhere. Initial sweep for global lump name changes completed: AMMNUM%d -> PLMNUM%d, M_DOOM -> M_STRIFE, M_OPTTTL -> M_OPTION, STTMINUS -> STCFN045, et al. A dummy modified Strife IWAD must be loaded over DOOM.WAD at this point in order to run. Subversion-branch: /branches/strife-branch Subversion-revision: 1968
Diffstat (limited to 'src/strife/r_draw.c')
-rw-r--r--src/strife/r_draw.c55
1 files changed, 38 insertions, 17 deletions
diff --git a/src/strife/r_draw.c b/src/strife/r_draw.c
index 1b6420d9..c491f6b3 100644
--- a/src/strife/r_draw.c
+++ b/src/strife/r_draw.c
@@ -526,7 +526,9 @@ void R_DrawTranslatedColumnLow (void)
}
-
+// haleyjd 08/26/10: [STRIFE] - Rogue's translucency lookup table
+// This is functionally equivalent to Raven's TINTTAB and BOOM's TRANMAPs.
+byte *xlatab;
//
// R_InitTranslationTables
@@ -535,28 +537,47 @@ void R_DrawTranslatedColumnLow (void)
// Assumes a given structure of the PLAYPAL.
// Could be read from a lump instead.
//
+// haleyjd 08/26/10: [STRIFE]
+// * Added loading of XLATAB
+//
void R_InitTranslationTables (void)
{
- int i;
-
+ int i;
+
+ // [STRIFE] Load xlatab. Here's how Rogue did it:
+ // v7 = W_CacheLumpName("XLATAB", PU_CACHE); // note potential cache bug...
+ // HIWORD(v8) = (Z_Malloc(131072, PU_STATIC, NULL) + 65535) >> 16;
+ // LOWORD(v8) = 0; // aligning to a 64K boundary, as if this is Wolf3D.
+ // xlatab = v8;
+ // memcpy(v8, v7, 65536);
+ // memcpy(v8+65536, v7+65536, 0); // 0 bytes, does nothing!
+ // As you can see, they copypasta'd id's unnecessary 64K boundary alignment
+ // from the colormap code, and then evidently at some point dropped the high
+ // side of the presumably 128KB lump (because it is redundant data), but
+ // just set the 2nd memset call's length to 0 bytes... Terrible. Since none
+ // of this accomplishes anything, and isn't strictly portable, all we need
+ // to do is this:
+ xlatab = W_CacheLumpName("XLATAB", PU_STATIC);
+
translationtables = Z_Malloc (256*3, PU_STATIC, 0);
-
+
+ // STRIFE-TODO: Strife has many more (and more varied) translations
// translate just the 16 green colors
for (i=0 ; i<256 ; i++)
{
- if (i >= 0x70 && i<= 0x7f)
- {
- // map green ramp to gray, brown, red
- translationtables[i] = 0x60 + (i&0xf);
- translationtables [i+256] = 0x40 + (i&0xf);
- translationtables [i+512] = 0x20 + (i&0xf);
- }
- else
- {
- // Keep all other colors as is.
- translationtables[i] = translationtables[i+256]
- = translationtables[i+512] = i;
- }
+ if (i >= 0x70 && i<= 0x7f)
+ {
+ // map green ramp to gray, brown, red
+ translationtables[i] = 0x60 + (i&0xf);
+ translationtables [i+256] = 0x40 + (i&0xf);
+ translationtables [i+512] = 0x20 + (i&0xf);
+ }
+ else
+ {
+ // Keep all other colors as is.
+ translationtables[i] = translationtables[i+256]
+ = translationtables[i+512] = i;
+ }
}
}