diff --git a/src/k_hud.c b/src/k_hud.c index f4f7f1c1a..d0146a38e 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -1065,7 +1065,7 @@ static void K_initKartHUD(void) } if (timeinmap > 113 || forceshowhud) - hudtrans = cv_translucenthud.value; + hudtrans = (UINT8)cv_translucenthud.value; else if (timeinmap > 105) hudtrans = ((((INT32)timeinmap) - 105)*cv_translucenthud.value)/(113-105); else @@ -1122,9 +1122,9 @@ void K_KartPlayerHUDUpdate(player_t *player) UINT8 K_GetHudColor(void) { if (cv_colorizedhud.value && cv_colorizedhudcolor.value) - return cv_colorizedhudcolor.value; + return (UINT8)cv_colorizedhudcolor.value; - return ((stplyr && gamestate == GS_LEVEL) ? stplyr->skincolor : cv_playercolor.value); + return ((stplyr && gamestate == GS_LEVEL) ? stplyr->skincolor : (UINT8)cv_playercolor.value); } boolean K_UseColorHud(void) @@ -1526,7 +1526,7 @@ static void K_drawKartItem(void) { localcolor = K_GetHudColor(); - switch((stplyr->kartstuff[k_itemroulette] % (14*3)) / 3) + switch ((stplyr->kartstuff[k_itemroulette] % (14*3)) / 3) { // Each case is handled in threes, to give three frames of in-game time to see the item on the roulette case 0: // Sneaker @@ -2195,7 +2195,7 @@ static boolean K_drawKartPositionFaces(void) return true; if (!LUA_HudEnabled(hud_minirankings)) - return false; // Don't proceed but still return true for free play above if HUD is disabled. + return false; // Don't proceed but still return true for free play above if HUD is disabled. for (j = 0; j < numplayersingame; j++) { diff --git a/src/k_kart.c b/src/k_kart.c index 767e041a1..bb4da62a5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3103,17 +3103,18 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I return NULL; } -static UINT16 K_DriftSparkColor(player_t *player, INT32 charge) +static UINT8 K_DriftSparkColor(player_t *player, INT32 charge) { - UINT16 color = SKINCOLOR_NONE; + UINT8 color = SKINCOLOR_NONE; + const INT32 sparkval = K_GetKartDriftSparkValue(player); - if (charge >= K_GetKartDriftSparkValue(player)*4) + if (charge >= sparkval*4) { color = K_RainbowColor(); } - else if (charge >= K_GetKartDriftSparkValue(player)*2) + else if (charge >= sparkval*2) { - if (charge <= (K_GetKartDriftSparkValue(player)*2)+(24*3)) + if (charge <= (sparkval*2)+(24*3)) color = SKINCOLOR_RASPBERRY; // transition else color = SKINCOLOR_KETCHUP;