mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Improve translucence of menu cursor
git-svn-id: https://svn.eduke32.com/eduke32@6685 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
3543d6f3fa
commit
50ac58f374
2 changed files with 6 additions and 3 deletions
|
@ -6735,7 +6735,7 @@ void M_DisplayMenus(void)
|
|||
vec2_t cursorpos = m_mousepos;
|
||||
int32_t z = 65536;
|
||||
uint8_t p = CROSSHAIR_PAL;
|
||||
uint32_t o = 1|2;
|
||||
uint32_t o = 2;
|
||||
|
||||
auto const oyxaspect = yxaspect;
|
||||
if (KXDWN)
|
||||
|
@ -6748,7 +6748,7 @@ void M_DisplayMenus(void)
|
|||
o |= 1024;
|
||||
}
|
||||
|
||||
rotatesprite_fs_alpha(cursorpos.x, cursorpos.y, z, 0, a, 0, p, o, MOUSEALPHA);
|
||||
rotatesprite_fs_alpha(cursorpos.x, cursorpos.y, z, 0, a, 0, p, o, CURSORALPHA);
|
||||
|
||||
if (KXDWN)
|
||||
setaspect(viewingrange, oyxaspect);
|
||||
|
|
|
@ -470,13 +470,16 @@ extern int32_t m_mouselastactivity;
|
|||
|
||||
#if defined EDUKE32_TOUCH_DEVICES
|
||||
# define MOUSEALPHA 0
|
||||
# define CURSORALPHA (255/3)
|
||||
# define MOUSEACTIVECONDITIONAL(condition) (condition)
|
||||
# define MOUSEWATCHPOINTCONDITIONAL(condition) (condition)
|
||||
#else
|
||||
extern int32_t m_mousewake_watchpoint, m_menuchange_watchpoint;
|
||||
// alpha increments of 3 --> 255 / 3 = 85 --> round up to power of 2 --> 128 --> divide by 2 --> 64 alphatabs required
|
||||
// use 16 anyway :P
|
||||
# define MOUSEALPHA ((getrendermode() == REND_CLASSIC && numalphatabs < 15) ? 0 : clamp((totalclock - m_mouselastactivity - 90)*3, 0, 255))
|
||||
# define MOUSEUSEALPHA (getrendermode() != REND_CLASSIC || numalphatabs >= 15)
|
||||
# define MOUSEALPHA (MOUSEUSEALPHA ? clamp((totalclock - m_mouselastactivity - 90)*3, 0, 255) : 0)
|
||||
# define CURSORALPHA (MOUSEUSEALPHA ? clamp((totalclock - m_mouselastactivity - 90)*2 + (255/3), (255/3), 255) : 0)
|
||||
# define MOUSEACTIVECONDITION (totalclock - m_mouselastactivity < M_MOUSETIMEOUT)
|
||||
# define MOUSEACTIVECONDITIONAL(condition) (MOUSEACTIVECONDITION && (condition))
|
||||
# define MOUSEINACTIVECONDITIONAL(condition) (!MOUSEACTIVECONDITION && (condition))
|
||||
|
|
Loading…
Reference in a new issue