2006-04-23 06:44:19 +00:00
|
|
|
/*
|
|
|
|
* High-colour textures support for Polymost
|
|
|
|
* by Jonathon Fowler
|
|
|
|
* See the included license file "BUILDLIC.TXT" for license info.
|
|
|
|
*/
|
|
|
|
|
2017-07-15 21:56:17 +00:00
|
|
|
#include "build.h"
|
2008-12-02 10:44:39 +00:00
|
|
|
#include "compat.h"
|
2009-02-19 16:47:54 +00:00
|
|
|
#include "kplib.h"
|
2008-12-02 10:44:39 +00:00
|
|
|
#include "hightile.h"
|
2011-01-20 21:46:15 +00:00
|
|
|
#include "baselayer.h"
|
2008-12-02 10:44:39 +00:00
|
|
|
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2017-06-21 13:46:44 +00:00
|
|
|
polytint_t hictinting[MAXPALOOKUPS];
|
2006-04-23 06:44:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// hicinit()
|
2008-02-24 00:46:57 +00:00
|
|
|
// Initialize the high-colour stuff to default.
|
2006-04-23 06:44:19 +00:00
|
|
|
//
|
|
|
|
void hicinit(void)
|
|
|
|
{
|
2014-09-30 04:06:05 +00:00
|
|
|
int32_t i;
|
2006-04-24 19:04:22 +00:00
|
|
|
|
2009-02-19 16:47:54 +00:00
|
|
|
for (i=0; i<MAXPALOOKUPS; i++) // all tints should be 100%
|
2007-12-12 17:42:14 +00:00
|
|
|
{
|
2017-06-21 13:46:50 +00:00
|
|
|
polytint_t & tint = hictinting[i];
|
|
|
|
tint.r = tint.g = tint.b = 0xff;
|
|
|
|
tint.f = 0;
|
2006-04-24 19:04:22 +00:00
|
|
|
}
|
2006-04-23 06:44:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
2017-12-12 05:13:58 +00:00
|
|
|
// hicsetpalettetint(pal,r,g,b,sr,sg,sb,effect)
|
2006-04-23 06:44:19 +00:00
|
|
|
// 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
|
|
|
|
//
|
2017-12-12 05:13:58 +00:00
|
|
|
void hicsetpalettetint(int32_t palnum, char r, char g, char b, char sr, char sg, char sb, polytintflags_t effect)
|
2006-04-23 06:44:19 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
if ((uint32_t)palnum >= (uint32_t)MAXPALOOKUPS) return;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2017-06-21 13:46:50 +00:00
|
|
|
polytint_t & tint = hictinting[palnum];
|
|
|
|
tint.r = r;
|
|
|
|
tint.g = g;
|
|
|
|
tint.b = b;
|
2017-12-12 05:13:58 +00:00
|
|
|
tint.sr = sr;
|
|
|
|
tint.sg = sg;
|
|
|
|
tint.sb = sb;
|
2017-06-21 13:46:50 +00:00
|
|
|
tint.f = effect;
|
2006-04-23 06:44:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-12-02 10:44:39 +00:00
|
|
|
|