#include #include #include #include #include #include #include #include typedef unsigned char byte; unsigned NUMLIGHTS; byte palette[768]; byte far lightpalette[254][256]; /* ===================== = = RF_BuildLights = = 0 is full palette = NUMLIGHTS and NUMLIGHTS+1 are all black = ===================== */ void RF_BuildLights (void) { int i,l,c,test,table; int red,green,blue; int dist,bestdist,rdist,gdist,bdist,bestcolor; byte *palptr, *palsrc; byte far *screen; screen = MK_FP(0xa000,0); for (l=0;l added 11-12-94 // Allows last 16 palette entries to be unafected // by shading and thus available for lighted tiles // such as flames, lamps, etc. if (c < 248) { palptr = palette; bestdist = 32000; for (test=0;test<256;test++) { rdist = (int)*palptr++ - red; gdist = (int)*palptr++ - green; bdist = (int)*palptr++ - blue; dist = rdist*rdist + gdist*gdist + bdist*bdist; if (dist