diff --git a/src/k_hud.c b/src/k_hud.c index 942405640..4fe7f352d 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -177,6 +177,7 @@ static patch_t *kp_trickcool[2]; patch_t *kp_capsuletarget_arrow[2][2]; patch_t *kp_capsuletarget_icon[2]; patch_t *kp_capsuletarget_far[2]; +patch_t *kp_capsuletarget_far_text[2]; patch_t *kp_capsuletarget_near[8]; void K_LoadKartHUDGraphics(void) @@ -665,6 +666,13 @@ void K_LoadKartHUDGraphics(void) } } + sprintf(buffer, "HUDCAPDx"); + for (i = 0; i < 2; i++) + { + buffer[7] = '0'+i; + HU_UpdatePatch(&kp_capsuletarget_far_text[i], "%s", buffer); + } + sprintf(buffer, "HUDCAPCx"); for (i = 0; i < 2; i++) { diff --git a/src/k_hud.h b/src/k_hud.h index 00839ed97..b80760c2c 100644 --- a/src/k_hud.h +++ b/src/k_hud.h @@ -50,6 +50,7 @@ extern patch_t *kp_facehighlight[8]; extern patch_t *kp_capsuletarget_arrow[2][2]; extern patch_t *kp_capsuletarget_icon[2]; extern patch_t *kp_capsuletarget_far[2]; +extern patch_t *kp_capsuletarget_far_text[2]; extern patch_t *kp_capsuletarget_near[8]; #ifdef __cplusplus diff --git a/src/k_hud_track.cpp b/src/k_hud_track.cpp index 8a04dd7ae..beaaea31f 100644 --- a/src/k_hud_track.cpp +++ b/src/k_hud_track.cpp @@ -174,7 +174,6 @@ void K_DrawTargetTracking(const TargetTracking& target) const fixed_t farDistance = 1280 * mapobjectscale; bool useNear = (target.camDist < farDistance); - patch_t* targetPatch = nullptr; vector2_t targetPos = {}; bool visible = P_CheckSight(stplyr->mo, target.mobj); @@ -188,21 +187,33 @@ void K_DrawTargetTracking(const TargetTracking& target) targetPos.x = result.x; targetPos.y = result.y; + auto draw = [&](patch_t* patch) + { + V_DrawFixedPatch( + targetPos.x - ((patch->width << FRACBITS) >> 1), + targetPos.y - ((patch->height << FRACBITS) >> 1), + FRACUNIT, + V_SPLITSCREEN, + patch, + nullptr + ); + }; + if (useNear == true) { timer = (leveltime / 2); - targetPatch = kp_capsuletarget_near[timer % 8]; + draw(kp_capsuletarget_near[timer % 8]); } else { timer = (leveltime / 3); - targetPatch = kp_capsuletarget_far[timer & 1]; + draw(kp_capsuletarget_far[timer & 1]); + + if (r_splitscreen <= 1) + { + draw(kp_capsuletarget_far_text[timer & 1]); + } } - - targetPos.x -= (targetPatch->width << FRACBITS) >> 1; - targetPos.y -= (targetPatch->height << FRACBITS) >> 1; - - V_DrawFixedPatch(targetPos.x, targetPos.y, FRACUNIT, V_SPLITSCREEN, targetPatch, nullptr); } }