From 8fc9f62698227654e95174599207cb341abc4bfb Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 18 Aug 2024 16:24:15 +0100 Subject: [PATCH] k_color: Fix support for more than 255 skincolors Resolves KartKrew/RingRacers#109 --- src/k_color.c | 6 +++--- src/k_color.h | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/k_color.c b/src/k_color.c index c7b0bbf91..a71faaa4c 100644 --- a/src/k_color.c +++ b/src/k_color.c @@ -43,11 +43,11 @@ UINT16 K_RainbowColor(tic_t time) } /*-------------------------------------------------- - void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) + void K_RainbowColormap(UINT8 *dest_colormap, skincolornum_t skincolor) See header file for description. --------------------------------------------------*/ -void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) +void K_RainbowColormap(UINT8 *dest_colormap, skincolornum_t skincolor) { INT32 i; RGBA_t color; @@ -95,7 +95,7 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) See header file for description. --------------------------------------------------*/ -void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color) +void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, skincolornum_t color) { INT32 i; INT32 starttranscolor; diff --git a/src/k_color.h b/src/k_color.h index cb14459eb..a3c566cf2 100644 --- a/src/k_color.h +++ b/src/k_color.h @@ -55,7 +55,7 @@ UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b); UINT16 K_RainbowColor(tic_t time); /*-------------------------------------------------- - void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor); + void K_RainbowColormap(UINT8 *dest_colormap, skincolornum_t skincolor); Generates a colormap to "colorize" all palette indicies to the provided skincolor. @@ -68,11 +68,11 @@ UINT16 K_RainbowColor(tic_t time); None --------------------------------------------------*/ -void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor); +void K_RainbowColormap(UINT8 *dest_colormap, skincolornum_t skincolor); /*-------------------------------------------------- - void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color); + void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, skincolornum_t color); Generates a translation colormap for Kart, to replace R_GenerateTranslationColormap in r_draw.c @@ -84,7 +84,8 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor); Return:- None --------------------------------------------------*/ -void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color); + +void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, skincolornum_t color); #ifdef __cplusplus } // extern "C"