diff --git a/src/d_main.c b/src/d_main.c index fd82f272f..e762682c7 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1276,6 +1276,7 @@ boolean statdp; // stat display for extended player setup boolean nametaggfx; // Nametag stuffs boolean driftgaugegfx; // Driftgauge stuffs boolean multiitem_icon; // Extra icons for Sneakers, Banana and Jawz +boolean joystickicon; // Extra icons for the joystick input display // static void IdentifyVersion(void) @@ -1712,6 +1713,11 @@ void D_SRB2Main(void) driftgaugegfx = true; } + if (W_CheckMultipleLumps("JOYBCK","JOYKNB","JOYSHD", NULL)) + { + joystickicon = true; + } + // extra item icons if (W_CheckMultipleLumps("K_ITSHO2", "K_ITSHO3", "K_ITBAN2", "K_ITBAN3", "K_ITBAN4", "K_ITJAW2", NULL)) multiitem_icon = true; diff --git a/src/d_main.h b/src/d_main.h index faa52edc0..2ca97839c 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -47,6 +47,7 @@ extern boolean statdp; // stat display for extended player setup extern boolean nametaggfx; // Nametag stuffs extern boolean driftgaugegfx; // Driftgauge stuffs extern boolean multiitem_icon; // Extra icons for Sneakers, Banana and Jawz +extern boolean joystickicon; // Extra icons for the joystick input display // // autoload stuff diff --git a/src/k_kart.c b/src/k_kart.c index 8c5196ef2..69766eb30 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7818,6 +7818,10 @@ static patch_t *skp_speedpatchesachi[5]; static patch_t *skp_smallstickerachiclr; static patch_t *skp_speedpatchesachiclr[5]; +static patch_t *joybacking; +static patch_t *joyknob; +static patch_t *joyshadow; + void K_LoadKartHUDGraphics(void) { INT32 i, j; @@ -7944,6 +7948,13 @@ void K_LoadKartHUDGraphics(void) driftgaugesmallcolor = W_CachePatchName("K_DCSU", PU_HUDGFX); } + if (joystickicon) + { + joybacking = W_CachePatchName("JOYBCK", PU_HUDGFX); + joyknob = W_CachePatchName("JOYKNB", PU_HUDGFX); + joyshadow = W_CachePatchName("JOYSHD", PU_HUDGFX); + } + // Starting countdown kp_startcountdown[0] = W_CachePatchName("K_CNT3A", PU_HUDGFX); kp_startcountdown[1] = W_CachePatchName("K_CNT2A", PU_HUDGFX); @@ -11021,20 +11032,25 @@ static void K_drawKartFirstPerson(void) // doesn't need to ever support 4p static void K_drawInput(void) { + static INT32 pn = 0; + INT32 offs, col; + if (!cv_showinput.value && !modeattacking) // dont bother return; - static INT32 pn = 0; - INT32 target = 0, splitflags = (V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS); - INT32 x = (BASEVIDWIDTH - 32 + cv_wheel_xoffset.value)*FRACUNIT, y = (BASEVIDHEIGHT - 24 + cv_wheel_yoffset.value)*FRACUNIT; - INT32 offs, col; - const INT32 accent1 = splitflags|colortranslations[K_GetHudColor()][5]; - const INT32 accent2 = splitflags|colortranslations[K_GetHudColor()][9]; - ticcmd_t *cmd = &stplyr->cmd; - if (timeinmap <= 105) return; + INT32 target = 0, splitflags = (V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS); + INT32 x = (BASEVIDWIDTH - 32 + cv_wheel_xoffset.value)*FRACUNIT, y = (BASEVIDHEIGHT - 24 + cv_wheel_yoffset.value)*FRACUNIT; + + const UINT8 hudcolor = K_GetHudColor(); + const INT32 accent1 = splitflags|colortranslations[hudcolor][5]; + const INT32 accent2 = splitflags|colortranslations[hudcolor][9]; + const UINT8 *hudcolormap = R_GetTranslationColormap(0, hudcolor, GTC_CACHE); + + ticcmd_t *cmd = &stplyr->cmd; + if (timeinmap < 113) { INT32 count = ((INT32)(timeinmap) - 105); @@ -11081,10 +11097,19 @@ static void K_drawInput(void) INT32 joyx, joyxoffs, joyy, joyyoffs, axis; joyxoffs = -8, joyyoffs = -24; joyx = x>>FRACBITS, joyy = y>>FRACBITS; + UINT8 *shadowcolormap = NULL; // O backing - V_DrawFill(joyx+joyxoffs, joyy+joyyoffs-1, 16, 16, splitflags|accent2); - V_DrawFill(joyx+joyxoffs, joyy+joyyoffs+15, 16, 1, splitflags|31); + if (joystickicon) + { + shadowcolormap = R_GetTranslationColormap(0, SKINCOLOR_BLACK, GTC_CACHE); + V_DrawFixedPatch((joyx+joyxoffs)<driftturn || hudforward) { INT16 turning = encoremode ? -cmd->driftturn : cmd->driftturn; - // joystick hole - V_DrawFill(joyx+joyxoffs+5, joyy+joyyoffs+4, 6, 6, splitflags|accent1); - // joystick top and back - V_DrawFill(joyx+joyxoffs+3-turning/80, - joyy+joyyoffs+2-hudforward/80, - 10, 10, splitflags|31); - V_DrawFill(joyx+joyxoffs+3-turning/64, - joyy+joyyoffs+1-hudforward/64, - 10, 10, splitflags|accent1); + + if (joystickicon) + { + V_DrawFixedPatch((joyx+joyxoffs+3-turning/80)<driftturn) // no turn target = 0; else // turning of multiple strengths! @@ -11180,10 +11220,7 @@ static void K_drawInput(void) if (target > 4) target = 4; - if (K_GetHudColor()) - colormap = R_GetTranslationColormap(0, K_GetHudColor(), GTC_CACHE); - - V_DrawFixedPatch(x, y, FRACUNIT, splitflags, kp_inputwheel[target], colormap); + V_DrawFixedPatch(x, y, FRACUNIT, splitflags, kp_inputwheel[target], hudcolormap); } }