-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
Adjust secret automap colors in case PLAYPAL was not loaded from vanilla DOOM (2) IWAD or FreeD(OO)M
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,9 @@ | |
// Needs access to LFB. | ||
#include "v_video.h" | ||
|
||
// V_GetPaletteIndex | ||
#include "v_trans.h" | ||
|
||
// State. | ||
#include "doomstat.h" | ||
#include "r_state.h" | ||
|
@@ -79,9 +82,8 @@ extern boolean inhelpscreens; // [crispy] | |
#define CDWALLRANGE YELLOWRANGE | ||
#define THINGCOLORS GREENS | ||
#define THINGRANGE GREENRANGE | ||
#define SECRETWALLCOLORS 252 // [crispy] purple | ||
#define SECRETWALLCOLORS WALLCOLORS | ||
#define CRISPY_HIGHLIGHT_REVEALED_SECRETS | ||
#define REVEALEDSECRETWALLCOLORS 112 // [crispy] green | ||
#define SECRETWALLRANGE WALLRANGE | ||
#define GRIDCOLORS (GRAYS + GRAYSRANGE/2) | ||
#define GRIDRANGE 0 | ||
|
@@ -127,6 +129,10 @@ static int m_zoomin_mouse; | |
static int m_zoomout_mouse; | ||
static boolean mousewheelzoom; | ||
|
||
// [JN] Make wall colors of secret sectors palette-independent. | ||
static int secretwallcolors = -1; | ||
static int revealedsecretwallcolors = -1; | ||
|
||
// translates between frame-buffer and map distances | ||
// [crispy] fix int overflow that causes map and grid lines to disappear | ||
#define FTOM(x) (((int64_t)((x)<<FRACBITS) * scale_ftom) >> FRACBITS) | ||
|
@@ -656,9 +662,11 @@ void AM_LevelInit(boolean reinit) | |
|
||
f_h_old = f_h; | ||
|
||
// [crispy] Precalculate color lookup tables for antialised line drawing using COLORMAP | ||
// [crispy] Precalculate color lookup tables for antialiased line drawing using COLORMAP | ||
if (!precalc_once) | ||
{ | ||
unsigned char *playpal = W_CacheLumpName("PLAYPAL", PU_STATIC); | ||
|
||
precalc_once = 1; | ||
for (int color = 0; color < 256; ++color) | ||
{ | ||
|
@@ -674,6 +682,12 @@ void AM_LevelInit(boolean reinit) | |
color_shades[color * NUMSHADES + shade] = colormaps[shade_index[shade]]; | ||
} | ||
} | ||
|
||
// [crispy] Make secret wall colors independent from PLAYPAL color indexes | ||
secretwallcolors = V_GetPaletteIndex(playpal, 255, 0, 255); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JNechaevsky
Collaborator
|
||
revealedsecretwallcolors = V_GetPaletteIndex(playpal, 119, 255, 111); | ||
|
||
W_ReleaseLumpName("PLAYPAL"); | ||
} | ||
} | ||
|
||
|
@@ -1672,13 +1686,13 @@ void AM_drawWalls(void) | |
// [crispy] draw 1S secret sector boundaries in purple | ||
if (crispy->extautomap && | ||
cheating && (lines[i].frontsector->special == 9)) | ||
AM_drawMline(&l, SECRETWALLCOLORS); | ||
AM_drawMline(&l, secretwallcolors); | ||
#if defined CRISPY_HIGHLIGHT_REVEALED_SECRETS | ||
// [crispy] draw revealed secret sector boundaries in green | ||
else | ||
if (crispy->extautomap && | ||
crispy->secretmessage && (lines[i].frontsector->oldspecial == 9)) | ||
AM_drawMline(&l, REVEALEDSECRETWALLCOLORS); | ||
AM_drawMline(&l, revealedsecretwallcolors); | ||
#endif | ||
else | ||
AM_drawMline(&l, WALLCOLORS+lightlev); | ||
|
@@ -1697,7 +1711,7 @@ void AM_drawWalls(void) | |
{ | ||
// [crispy] NB: Choco has this check, but (SECRETWALLCOLORS == WALLCOLORS) | ||
// Boom/PrBoom+ does not have this check at all | ||
if (false && cheating) AM_drawMline(&l, SECRETWALLCOLORS + lightlev); | ||
if (false && cheating) AM_drawMline(&l, secretwallcolors + lightlev); | ||
else AM_drawMline(&l, WALLCOLORS+lightlev); | ||
} | ||
#if defined CRISPY_HIGHLIGHT_REVEALED_SECRETS | ||
|
@@ -1706,15 +1720,15 @@ void AM_drawWalls(void) | |
(lines[i].backsector->oldspecial == 9 || | ||
lines[i].frontsector->oldspecial == 9)) | ||
{ | ||
AM_drawMline(&l, REVEALEDSECRETWALLCOLORS); | ||
AM_drawMline(&l, revealedsecretwallcolors); | ||
} | ||
#endif | ||
// [crispy] draw 2S secret sector boundaries in purple | ||
else if (crispy->extautomap && cheating && | ||
(lines[i].backsector->special == 9 || | ||
lines[i].frontsector->special == 9)) | ||
{ | ||
AM_drawMline(&l, SECRETWALLCOLORS); | ||
AM_drawMline(&l, secretwallcolors); | ||
} | ||
else if (lines[i].backsector->floorheight | ||
!= lines[i].frontsector->floorheight) { | ||
|
2 comments
on commit 4c0a56a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, my fault with the commit message, the condition "in case PLAYPAL was not loaded from vanilla DOOM (2) IWAD or FreeD(OO)M" was actually removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, my fault with the commit message, the condition "in case PLAYPAL was not loaded from vanilla DOOM (2) IWAD or FreeD(OO)M" was actually removed.
No problem! 🤷
Dammit, could you guys please check if this breaks the truecolor build?