diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 7a4157def..61d925aba 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -319,6 +319,15 @@ void HU_Init(void) PR ("PRFN"); REG; + DIM ('0', 10); + DIG (2); + + PR ("ROLNUM"); + REG; + + PR ("RO4NUM"); + REG; + DIG (3); ADIM (KART); diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 94130c7fb..487b06e1a 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -80,6 +80,8 @@ enum X (NIGHTSNUM), X (PINGNUM), X (PROFNUM), + X (ROLNUM), + X (RO4NUM), X (KART), X (TIMER), diff --git a/src/k_hud.cpp b/src/k_hud.cpp index e9f1091a0..87d1095ec 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -1371,6 +1371,7 @@ static void K_drawKartItem(void) // Set to 'no item' just in case. const UINT8 offset = ((r_splitscreen > 1) ? 1 : 0); patch_t *localpatch[3] = { kp_nodraw, kp_nodraw, kp_nodraw }; + UINT8 localamt[3] = {0, 0, 0}; patch_t *localbg = ((offset) ? kp_itembg[2] : kp_itembg[0]); patch_t *localinv = ((offset) ? kp_invincibility[((leveltime % (6*3)) / 3) + 7] : kp_invincibility[(leveltime % (7*3)) / 3]); INT32 fx = 0, fy = 0, fflags = 0; // final coords for hud and flags... @@ -1403,14 +1404,19 @@ static void K_drawKartItem(void) { case KITEM_INVINCIBILITY: localpatch[i] = localinv; + localamt[i] = amt; break; case KITEM_ORBINAUT: localpatch[i] = kp_orbinaut[(offset ? 4 : std::min(amt-1, 3))]; + if (amt > 4) + localamt[i] = amt; break; default: localpatch[i] = K_GetCachedItemPatch(item, offset); + if (item != KITEM_BALLHOG || amt != 5) + localamt[i] = amt; break; } } @@ -1586,25 +1592,35 @@ static void K_drawKartItem(void) V_SLIDEIN|fflags ); - V_DrawFixedPatch( - fx< 1) + { + using srb2::Draw; + Draw( + fx + rouletteCrop.x + FixedToFloat(rouletteSpace/2), + fy + rouletteCrop.y + FixedToFloat(rouletteOffset + y + rouletteSpace) - (r_splitscreen > 1 ? 15 : 33)) + .font(r_splitscreen > 1 ? Draw::Font::kRollingNum4P : Draw::Font::kRollingNum) + .align(Draw::Align::kCenter) + .flags(V_HUDTRANS|V_SLIDEIN|fflags) + .colormap(colormap) + .text("{}", localamt[i]); + } + }; + + draw_item(rouletteSpace, 0); + draw_item(-rouletteSpace, 2); if (stplyr->itemRoulette.active == true) { // Draw the item underneath the box. - V_DrawFixedPatch( - fx<spacew = 3; break; + case ROLNUM_FONT: + result->spacew = 17; + break; + case RO4NUM_FONT: + result->spacew = 9; + break; } switch (fontno) @@ -2373,6 +2379,12 @@ static void V_GetFontSpecification(int fontno, INT32 flags, fontspec_t *result) case PINGF_FONT: result->lfh = 10; break; + case ROLNUM_FONT: + result->lfh = 33; + break; + case RO4NUM_FONT: + result->lfh = 15; + break; } switch (fontno) @@ -2432,6 +2444,8 @@ static void V_GetFontSpecification(int fontno, INT32 flags, fontspec_t *result) break; case OPPRF_FONT: case PINGF_FONT: + case ROLNUM_FONT: + case RO4NUM_FONT: if (result->chw) result->dim_fn = FixedCharacterDim; else