mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Merge branch 'skincolor_fixes' into 'master'
Skincolor Fixes (#109, #115) Closes #115 and #109 See merge request KartKrew/RingRacers!50
This commit is contained in:
		
						commit
						1caba7d15f
					
				
					 5 changed files with 17 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -143,7 +143,7 @@ static inline int lib_freeslot(lua_State *L)
 | 
			
		|||
					CONS_Printf("Skincolor SKINCOLOR_%s allocated.\n",word);
 | 
			
		||||
					FREE_SKINCOLORS[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL);
 | 
			
		||||
					strcpy(FREE_SKINCOLORS[i],word);
 | 
			
		||||
					skincolors[i].cache_spraycan = UINT16_MAX;
 | 
			
		||||
					skincolors[SKINCOLOR_FIRSTFREESLOT+i].cache_spraycan = UINT16_MAX;
 | 
			
		||||
					numskincolors++;
 | 
			
		||||
					lua_pushinteger(L, SKINCOLOR_FIRSTFREESLOT + i);
 | 
			
		||||
					r++;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -334,7 +334,7 @@ void readfreeslots(MYFILE *f)
 | 
			
		|||
						CONS_Printf("Skincolor SKINCOLOR_%s allocated.\n",word);
 | 
			
		||||
						FREE_SKINCOLORS[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL);
 | 
			
		||||
						strcpy(FREE_SKINCOLORS[i],word);
 | 
			
		||||
						skincolors[i].cache_spraycan = UINT16_MAX;
 | 
			
		||||
						skincolors[SKINCOLOR_FIRSTFREESLOT+i].cache_spraycan = UINT16_MAX;
 | 
			
		||||
						numskincolors++;
 | 
			
		||||
						break;
 | 
			
		||||
					}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,11 +53,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;
 | 
			
		||||
| 
						 | 
				
			
			@ -193,7 +193,7 @@ static void K_IntermissionColormap(UINT8 *dest_colormap)
 | 
			
		|||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		UINT16 skincolor = SKINCOLOR_INTERMISSION1;
 | 
			
		||||
		skincolornum_t skincolor = SKINCOLOR_INTERMISSION1;
 | 
			
		||||
		const double blue_start = 3.0;
 | 
			
		||||
		const double blue_end = 5.0;
 | 
			
		||||
		const double green_buffer = 0.5;
 | 
			
		||||
| 
						 | 
				
			
			@ -214,11 +214,11 @@ static void K_IntermissionColormap(UINT8 *dest_colormap)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
/*--------------------------------------------------
 | 
			
		||||
	void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
 | 
			
		||||
	void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, skincolornum_t color)
 | 
			
		||||
 | 
			
		||||
		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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,7 +68,7 @@ UINT16 K_RainbowColor(tic_t time);
 | 
			
		|||
		None
 | 
			
		||||
--------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
 | 
			
		||||
void K_RainbowColormap(UINT8 *dest_colormap, skincolornum_t skincolor);
 | 
			
		||||
 | 
			
		||||
/*--------------------------------------------------
 | 
			
		||||
	UINT8 K_HitlagColorValue(RGBA_t color);
 | 
			
		||||
| 
						 | 
				
			
			@ -100,7 +100,7 @@ UINT8 K_HitlagColorValue(RGBA_t color);
 | 
			
		|||
void K_HitlagColormap(UINT8 *dest_colormap);
 | 
			
		||||
 | 
			
		||||
/*--------------------------------------------------
 | 
			
		||||
	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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -113,7 +113,7 @@ void K_HitlagColormap(UINT8 *dest_colormap);
 | 
			
		|||
		None
 | 
			
		||||
--------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
 | 
			
		||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, skincolornum_t color);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*--------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4881,6 +4881,12 @@ static void K_drawKartMinimap(void)
 | 
			
		|||
				if (encoremode)
 | 
			
		||||
					ang = ANGLE_180 - ang;
 | 
			
		||||
 | 
			
		||||
				if (skin && mobj->color && !mobj->colorized // relevant to redo
 | 
			
		||||
				&& skins[skin].starttranscolor != skins[0].starttranscolor) // redoing would have an affect
 | 
			
		||||
				{
 | 
			
		||||
					colormap = R_GetTranslationColormap(TC_DEFAULT, static_cast<skincolornum_t>(mobj->color), GTC_CACHE);
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				K_drawKartMinimapIcon(
 | 
			
		||||
						interpx,
 | 
			
		||||
						interpy,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue