fix: weapon-wheel crosshair selection, gold highlight, ring edge smoothing (issue #31)
linux / build (push) Successful in 11m22s

This commit is contained in:
2026-12-02 09:01:53 +00:00
parent e85506f712
commit 7c895b9f69
+16 -4
View File
@@ -102,7 +102,7 @@ enum
#define WHEEL_CURSOR_DEADZONE 0.06f
#define WHEEL_CURSOR_ARM 0.012f // marker arm length, fraction of screen height
#define WHEEL_CURSOR_THICK 0.0018f // marker thickness, fraction of screen height
#define WHEEL_RING_FEATHER 0.0015f // alpha-feather band on the procedural ring edges
#define WHEEL_RING_FEATHER 0.003f // alpha-feather band on the procedural ring edges
#define WHEEL_ART_WW_PATH "weapon_wheel/ww%d.png"
#define WHEEL_ART_ICON_PATH "weapon_wheel/icon%d.png"
@@ -814,7 +814,14 @@ Wheel_UpdateInput(void)
}
}
if (bestMag > 0.0f)
// The mouse is authoritative once the crosshair leaves the deadzone: the
// maintainer's round-3 report was exactly "crosshair moves but selection
// never changes", caused by updating the cursor without ever assigning
// ms_nHovered from it. Stick/keyboard still drive selection while the
// crosshair is parked at the centre.
if (cursorDist > WHEEL_CURSOR_DEADZONE * SCREEN_HEIGHT)
ms_nHovered = Wheel_SegmentFromVector(cursorDX, cursorDY);
else if (bestMag > 0.0f)
ms_nHovered = Wheel_SegmentFromVector(bestX, bestY);
if (ms_nHovered >= 0) {
@@ -1173,9 +1180,14 @@ Wheel_Draw(void)
bool highlightAvailable = highlight >= 0 && highlight < WHEEL_SEGMENTS
&& player != nil && Wheel_SelectedWeapon(player, highlight) >= 0
&& Wheel_SegmentArtMatches(player, highlight);
if (highlightAvailable && ms_apWwArt[highlight] != nil)
if (highlightAvailable && ms_apWwArt[highlight] != nil) {
// The wwN art is ~95% opaque white. Tint it warm gold; the texture
// is premultiplied and Wheel_DrawArt uses ONE/INVSRCALPHA, so the
// vertex colour multiplies the premultiplied texels and keeps the
// gradient while turning the block into a highlight.
Wheel_DrawArt(ms_apWwArt[highlight], ms_aWwOffX[highlight], ms_aWwOffY[highlight],
ms_aWwW[highlight], ms_aWwH[highlight], CRGBA(255, 255, 255, 255));
ms_aWwW[highlight], ms_aWwH[highlight], CRGBA(255, 205, 110, 255));
}
Wheel_DrawWeaponIcons();
}