Allow alpha fade-out for quotes and the menu mouse cursor in 8-bit when the supplied PALETTE.DAT has enough alpha tables to fully display each effect.

git-svn-id: https://svn.eduke32.com/eduke32@5124 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-04-09 07:51:48 +00:00
parent 392094ee94
commit 5c69ae7d11
4 changed files with 9 additions and 8 deletions

View File

@ -703,6 +703,10 @@ EXTERN char showinvisibility;
EXTERN int32_t g_visibility, parallaxvisibility;
EXTERN int32_t g_rotatespriteNoWidescreen;
// blendtable[1] to blendtable[numalphatabs] are considered to be
// alpha-blending tables:
EXTERN uint8_t numalphatabs;
EXTERN int32_t windowx1, windowy1, windowx2, windowy2;
EXTERN int16_t *startumost, *startdmost;

View File

@ -2432,11 +2432,6 @@ char palfadedelta = 0;
//
// Internal Engine Functions
//
// blendtable[1] to blendtable[numalphatabs] are considered to be
// alpha-blending tables:
static uint8_t numalphatabs;
static char *blendtable[MAXBLENDTABS];
#define getblendtab(blend) (blendtable[blend])

View File

@ -158,8 +158,9 @@ static void G_DoOrderScreen(void);
#define FTAOPAQUETIME 30
// alpha increments of 8 --> 256 / 8 = 32 --> round up to power of 2 --> 32 --> divide by 2 --> 16 alphatabs required
#define ftapulseshade \
((hud_glowingquotes && (getrendermode() == REND_CLASSIC || ps->fta >= FTAOPAQUETIME)) ? \
((hud_glowingquotes && ((getrendermode() == REND_CLASSIC && numalphatabs < 16) || ps->fta >= FTAOPAQUETIME)) ? \
(sintable[((uint32_t)ps->fta << 7) & 2047] >> 11) : \
(sintable[((uint32_t)FTAOPAQUETIME << 7) & 2047] >> 11))
@ -2606,7 +2607,7 @@ static inline int32_t texto(int32_t t)
static inline int32_t texta(int32_t t)
{
if (getrendermode() == REND_CLASSIC)
if (getrendermode() == REND_CLASSIC && numalphatabs < 16)
{
if (t > 4) return 0;
if (t > 2) return 85;

View File

@ -435,7 +435,8 @@ extern int32_t m_mouselastactivity;
# define MOUSEWATCHPOINTCONDITIONAL(condition) (condition)
#else
extern int32_t m_mousewake_watchpoint, m_menuchange_watchpoint;
# define MOUSEALPHA (getrendermode() == REND_CLASSIC ? 0 : clamp((totalclock - m_mouselastactivity - 90)*3, 0, 255))
// alpha increments of 3 --> 255 / 3 = 85 --> round up to power of 2 --> 128 --> divide by 2 --> 64 alphatabs required
# define MOUSEALPHA ((getrendermode() == REND_CLASSIC && numalphatabs < 64) ? 0 : clamp((totalclock - m_mouselastactivity - 90)*3, 0, 255))
# define MOUSEACTIVECONDITION (totalclock - m_mouselastactivity < M_MOUSETIMEOUT)
# define MOUSEACTIVECONDITIONAL(condition) (MOUSEACTIVECONDITION && (condition))
# define MOUSEINACTIVECONDITIONAL(condition) (!MOUSEACTIVECONDITION && (condition))