mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-03 14:42:53 +00:00
Merge branch 'separate-capsule-tracker' into 'master'
Only draw capsule icon for Break the Capsules HUD tracking See merge request KartKrew/Kart!964
This commit is contained in:
commit
016a3f82ca
1 changed files with 16 additions and 7 deletions
|
|
@ -100,7 +100,10 @@ void K_DrawTargetTracking(const TargetTracking& target)
|
|||
borderDir.y = FRACUNIT;
|
||||
}
|
||||
|
||||
targetPatch = kp_capsuletarget_icon[timer & 1];
|
||||
if (target.mobj->type == MT_BATTLECAPSULE)
|
||||
{
|
||||
targetPatch = kp_capsuletarget_icon[timer & 1];
|
||||
}
|
||||
|
||||
if (abs(borderDir.x) > abs(borderDir.y))
|
||||
{
|
||||
|
|
@ -143,15 +146,18 @@ void K_DrawTargetTracking(const TargetTracking& target)
|
|||
arrowPos.x = std::clamp(arrowPos.x, borderSize, borderWin.x) * FRACUNIT;
|
||||
arrowPos.y = std::clamp(arrowPos.y, borderSize, borderWin.y) * FRACUNIT;
|
||||
|
||||
targetPos.x = arrowPos.x - (arrowDir.x * 12);
|
||||
targetPos.y = arrowPos.y - (arrowDir.y * 12);
|
||||
if (targetPatch)
|
||||
{
|
||||
targetPos.x = arrowPos.x - (arrowDir.x * 12);
|
||||
targetPos.y = arrowPos.y - (arrowDir.y * 12);
|
||||
|
||||
targetPos.x -= (targetPatch->width << FRACBITS) >> 1;
|
||||
targetPos.y -= (targetPatch->height << FRACBITS) >> 1;
|
||||
}
|
||||
|
||||
arrowPos.x -= (arrowPatch->width << FRACBITS) >> 1;
|
||||
arrowPos.y -= (arrowPatch->height << FRACBITS) >> 1;
|
||||
|
||||
targetPos.x -= (targetPatch->width << FRACBITS) >> 1;
|
||||
targetPos.y -= (targetPatch->height << FRACBITS) >> 1;
|
||||
|
||||
if (arrowDir.x < 0)
|
||||
{
|
||||
arrowPos.x += arrowPatch->width << FRACBITS;
|
||||
|
|
@ -164,7 +170,10 @@ void K_DrawTargetTracking(const TargetTracking& target)
|
|||
arrowFlags |= V_VFLIP;
|
||||
}
|
||||
|
||||
V_DrawFixedPatch(targetPos.x, targetPos.y, FRACUNIT, V_SPLITSCREEN, targetPatch, nullptr);
|
||||
if (targetPatch)
|
||||
{
|
||||
V_DrawFixedPatch(targetPos.x, targetPos.y, FRACUNIT, V_SPLITSCREEN, targetPatch, nullptr);
|
||||
}
|
||||
|
||||
V_DrawFixedPatch(arrowPos.x, arrowPos.y, FRACUNIT, V_SPLITSCREEN | arrowFlags, arrowPatch, nullptr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue