2016-03-01 15:47:10 +00:00
|
|
|
#ifndef __RES_CMAP_H
|
|
|
|
#define __RES_CMAP_H
|
|
|
|
|
2019-06-27 07:16:34 +00:00
|
|
|
#include "doomtype.h"
|
|
|
|
|
2017-03-15 15:47:42 +00:00
|
|
|
struct lightlist_t;
|
2016-06-05 12:08:03 +00:00
|
|
|
|
2019-11-26 12:46:18 +00:00
|
|
|
void R_InitColormaps (bool allowCustomColormap = false);
|
2016-03-01 15:47:10 +00:00
|
|
|
void R_DeinitColormaps ();
|
|
|
|
|
2020-01-18 15:44:58 +00:00
|
|
|
void R_UpdateInvulnerabilityColormap ();
|
|
|
|
|
2017-03-09 19:19:55 +00:00
|
|
|
uint32_t R_ColormapNumForName(const char *name); // killough 4/4/98
|
2016-03-01 15:47:10 +00:00
|
|
|
void R_SetDefaultColormap (const char *name); // [RH] change normal fadetable
|
2017-03-09 19:19:55 +00:00
|
|
|
uint32_t R_BlendForColormap (uint32_t map); // [RH] return calculated blend for a colormap
|
2017-03-15 21:04:23 +00:00
|
|
|
|
|
|
|
struct FakeCmap
|
|
|
|
{
|
|
|
|
char name[8];
|
|
|
|
PalEntry blend;
|
|
|
|
int lump;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern TArray<FakeCmap> fakecmaps;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2020-04-11 17:46:57 +00:00
|
|
|
#include "fcolormap.h"
|
2017-03-15 15:47:42 +00:00
|
|
|
|
2016-03-01 15:47:10 +00:00
|
|
|
// For hardware-accelerated weapon sprites in colored sectors
|
|
|
|
struct FColormapStyle
|
|
|
|
{
|
|
|
|
PalEntry Color;
|
|
|
|
PalEntry Fade;
|
|
|
|
int Desaturate;
|
|
|
|
float FadeLevel;
|
|
|
|
};
|
|
|
|
|
|
|
|
// some utility functions to store special colormaps in powerup blends
|
|
|
|
#define SPECIALCOLORMAP_MASK 0x00b60000
|
|
|
|
|
2017-03-09 18:31:45 +00:00
|
|
|
inline uint32_t MakeSpecialColormap(int index)
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
assert(index >= 0 && index < 65536);
|
|
|
|
return index | SPECIALCOLORMAP_MASK;
|
|
|
|
}
|
|
|
|
|
2018-04-26 22:22:00 +00:00
|
|
|
enum EColorManipulation
|
|
|
|
{
|
|
|
|
CM_PLAIN2D = -2, // regular 2D drawing.
|
|
|
|
CM_INVALID = -1,
|
|
|
|
CM_DEFAULT = 0, // untranslated
|
|
|
|
CM_FIRSTSPECIALCOLORMAP, // first special fixed colormap
|
|
|
|
CM_FIRSTSPECIALCOLORMAPFORCED = 0x08000000, // first special fixed colormap, application forced (for 2D overlays)
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CM_MAXCOLORMAP int(CM_FIRSTSPECIALCOLORMAP + SpecialColormaps.Size())
|
|
|
|
#define CM_MAXCOLORMAPFORCED int(CM_FIRSTSPECIALCOLORMAPFORCED + SpecialColormaps.Size())
|
|
|
|
|
|
|
|
|
2016-03-01 15:47:10 +00:00
|
|
|
#endif
|