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"
|
|
|
|
#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];
|
2020-01-11 21:18:06 +00:00
|
|
|
tint.tint = 0xffffff;
|
2017-06-21 13:46:50 +00:00
|
|
|
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];
|
2020-01-11 21:18:06 +00:00
|
|
|
tint.tint.r = r;
|
|
|
|
tint.tint.g = g;
|
|
|
|
tint.tint.b = b;
|
|
|
|
tint.shade.r = sr;
|
|
|
|
tint.shade.g = sg;
|
|
|
|
tint.shade.b = 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
|
|
|
|