mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
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:
parent
392094ee94
commit
5c69ae7d11
4 changed files with 9 additions and 8 deletions
|
@ -703,6 +703,10 @@ EXTERN char showinvisibility;
|
||||||
EXTERN int32_t g_visibility, parallaxvisibility;
|
EXTERN int32_t g_visibility, parallaxvisibility;
|
||||||
EXTERN int32_t g_rotatespriteNoWidescreen;
|
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 int32_t windowx1, windowy1, windowx2, windowy2;
|
||||||
EXTERN int16_t *startumost, *startdmost;
|
EXTERN int16_t *startumost, *startdmost;
|
||||||
|
|
||||||
|
|
|
@ -2432,11 +2432,6 @@ char palfadedelta = 0;
|
||||||
//
|
//
|
||||||
// Internal Engine Functions
|
// Internal Engine Functions
|
||||||
//
|
//
|
||||||
|
|
||||||
// blendtable[1] to blendtable[numalphatabs] are considered to be
|
|
||||||
// alpha-blending tables:
|
|
||||||
static uint8_t numalphatabs;
|
|
||||||
|
|
||||||
static char *blendtable[MAXBLENDTABS];
|
static char *blendtable[MAXBLENDTABS];
|
||||||
#define getblendtab(blend) (blendtable[blend])
|
#define getblendtab(blend) (blendtable[blend])
|
||||||
|
|
||||||
|
|
|
@ -158,8 +158,9 @@ static void G_DoOrderScreen(void);
|
||||||
|
|
||||||
#define FTAOPAQUETIME 30
|
#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 \
|
#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)ps->fta << 7) & 2047] >> 11) : \
|
||||||
(sintable[((uint32_t)FTAOPAQUETIME << 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)
|
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 > 4) return 0;
|
||||||
if (t > 2) return 85;
|
if (t > 2) return 85;
|
||||||
|
|
|
@ -435,7 +435,8 @@ extern int32_t m_mouselastactivity;
|
||||||
# define MOUSEWATCHPOINTCONDITIONAL(condition) (condition)
|
# define MOUSEWATCHPOINTCONDITIONAL(condition) (condition)
|
||||||
#else
|
#else
|
||||||
extern int32_t m_mousewake_watchpoint, m_menuchange_watchpoint;
|
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 MOUSEACTIVECONDITION (totalclock - m_mouselastactivity < M_MOUSETIMEOUT)
|
||||||
# define MOUSEACTIVECONDITIONAL(condition) (MOUSEACTIVECONDITION && (condition))
|
# define MOUSEACTIVECONDITIONAL(condition) (MOUSEACTIVECONDITION && (condition))
|
||||||
# define MOUSEINACTIVECONDITIONAL(condition) (!MOUSEACTIVECONDITION && (condition))
|
# define MOUSEINACTIVECONDITIONAL(condition) (!MOUSEACTIVECONDITION && (condition))
|
||||||
|
|
Loading…
Reference in a new issue