RingRacers/src/k_color.h
Sally Coolatta cb5ea8b335 Add basic damage hitlag effects
- Invert high contrast greyscale colorization effect for damage hitlag
- Jitter is now also exclusive to damage-related hitlag
- Since jitter is now just tied to a flag, removed the old trick momentum hack
2021-11-27 13:38:45 -05:00

113 lines
3.1 KiB
C

// SONIC ROBO BLAST 2 KART
//-----------------------------------------------------------------------------
// Copyright (C) 2018-2020 by Kart Krew
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file k_color.h
/// \brief Skincolor & colormapping code
#ifndef __K_COLOR__
#define __K_COLOR__
#include "doomdef.h"
#include "doomtype.h"
#define SKIN_RAMP_LENGTH 16
#define DEFAULT_STARTTRANSCOLOR 96
#define NUM_PALETTE_ENTRIES 256
/*--------------------------------------------------
UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b);
Gives you the brightness value of the provided RGB value, based on how the human eye interprets it.
See https://en.wikipedia.org/wiki/Relative_luminance for more info.
Input Arguments:-
r - Red component
g - Green component
b - Blue component
Return:-
Brightness value from 0 to 255.
--------------------------------------------------*/
UINT8 K_ColorRelativeLuminance(UINT8 r, UINT8 g, UINT8 b);
/*--------------------------------------------------
UINT16 K_RainbowColor(tic_t time)
Gives you a color to use for rainbow effects (like invincibility).
Input Arguments:-
time - Time offset, usually is leveltime.
Return:-
Skincolor value.
--------------------------------------------------*/
UINT16 K_RainbowColor(tic_t time);
/*--------------------------------------------------
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
Generates a colormap to "colorize" all palette indicies
to the provided skincolor.
Input Arguments:-
dest_colormap - Colormap to populate.
skincolor - Translation color.
Return:-
None
--------------------------------------------------*/
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
/*--------------------------------------------------
UINT8 K_HitlagColorValue(RGBA_t color);
Gets the new replacement brightness value for the hitlag effect.
Input Arguments:-
color - Input color we intend to replace.
Return:-
0 to 255 brightness value.
--------------------------------------------------*/
UINT8 K_HitlagColorValue(RGBA_t color);
/*--------------------------------------------------
void K_HitlagColormap(UINT8 *dest_colormap);
Generates a inverted hi-contrast greyscale colormap,
for the hitlag effect.
Input Arguments:-
dest_colormap - Colormap to populate.
Return:-
None
--------------------------------------------------*/
void K_HitlagColormap(UINT8 *dest_colormap);
/*--------------------------------------------------
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
Generates a translation colormap for Kart, to replace R_GenerateTranslationColormap in r_draw.c
Input Arguments:-
dest_colormap - Colormap to populate.
skinnum - Number of skin or translation mode (TC_ constants)
color - Translation color.
Return:-
None
--------------------------------------------------*/
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
#endif