raze-gles/source/build/src/hightile.cpp
Christoph Oelckers 55dab6d3d3 - hooked up the high color texture colorization code.
Not tested and probably still not working correctly, the entire feature was a nearly impenetrable mess of convoluted code. This definitely needs verification with multiple mods using it.
2020-01-11 22:18:06 +01:00

54 lines
1.2 KiB
C++

/*
* High-colour textures support for Polymost
* by Jonathon Fowler
* See the included license file "BUILDLIC.TXT" for license info.
*/
#include "build.h"
#include "compat.h"
#include "hightile.h"
#include "baselayer.h"
polytint_t hictinting[MAXPALOOKUPS];
//
// hicinit()
// Initialize the high-colour stuff to default.
//
void hicinit(void)
{
int32_t i;
for (i=0; i<MAXPALOOKUPS; i++) // all tints should be 100%
{
polytint_t & tint = hictinting[i];
tint.tint = 0xffffff;
tint.f = 0;
}
}
//
// hicsetpalettetint(pal,r,g,b,sr,sg,sb,effect)
// The tinting values represent a mechanism for emulating the effect of global sector
// palette shifts on true-colour textures and only true-colour textures.
// effect bitset: 1 = greyscale, 2 = invert
//
void hicsetpalettetint(int32_t palnum, char r, char g, char b, char sr, char sg, char sb, polytintflags_t effect)
{
if ((uint32_t)palnum >= (uint32_t)MAXPALOOKUPS) return;
polytint_t & tint = hictinting[palnum];
tint.tint.r = r;
tint.tint.g = g;
tint.tint.b = b;
tint.shade.r = sr;
tint.shade.g = sg;
tint.shade.b = sb;
tint.f = effect;
}