HUD (task #68 follow-up): authentic reticle pip GROUPS -- front vs rear

The binary reticle registration resolves each weapon's RearFiring attribute
and registers its pip in group 1 (front) or 2 (rear) (part_014.c:5429-5434)
[T1]; the reticle draws the group selected by the mech's reticleElementMask
low bits (= binary mech+0x390, driven by the weapon-update view switch
part_013.c:5588-5595: forward |1&~2, look-back |2&~1).

Port: BTBuildReticle passes the real group (was hardcoded 1 on the disproven
"no BLH weapon is rear" belief); BTCommitLookState drives the mech's
reticleElementMask low bits per view (mech4's HUD tick already publishes
them as gBTHudGroupMask, and the reticle Draw already filters on it).

Resolves the user-reported "only 2 ERM dots but the mech has 3": ERMLaser_1
(front) and ERMLaser_2 (rear) both author pip position 1 -- with every pip
drawn in one group the two red dots sat exactly on top of each other.  Now:
forward view = 5 pips (2 PPC + ERM_1 + 2 SRM), look-back = the 2 rear
lasers' own group layout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-16 17:45:24 -05:00
co-authored by Claude Opus 4.8
parent 38febae36b
commit ebdfa40d95
2 changed files with 17 additions and 1 deletions
+11
View File
@@ -6225,6 +6225,17 @@ void BTCommitLookState(void *mech_v, int look_state)
(look_state == 3) ? rf : 0);
}
}
// (task #68) the HUD pip GROUP mask (binary mech+0x390, weapon update
// part_013.c:5588-5595): forward view shows the FRONT pip group (|=1,&~2),
// look-back shows the REAR group (|=2,&~1); side/down views leave it.
// mech4's HUD tick publishes the low bits as gBTHudGroupMask each frame.
if (look_state == 0)
m->targetReticle.reticleElementMask = (Reticle::ReticleElements)
(((int)m->targetReticle.reticleElementMask | 1) & ~2);
else if (look_state == 3)
m->targetReticle.reticleElementMask = (Reticle::ReticleElements)
(((int)m->targetReticle.reticleElementMask | 2) & ~1);
if (getenv("BT_KEY_LOG"))
DEBUG_STREAM << "[look] state=" << look_state
<< " rearFiring=" << m->rearFiring