diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index 56ba7576f..eae3ff366 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -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); diff --git a/source/duke3d/src/menus.h b/source/duke3d/src/menus.h index dba733902..84d010724 100644 --- a/source/duke3d/src/menus.h +++ b/source/duke3d/src/menus.h @@ -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))