1 parent
fc3df5bfe4
commit
e207b75c7a
5 files changed
+17
-19
No files matched your search
+3
-4
@@ -91,7 +91,7 @@ INT32 lastwipetic = 0;
|
||||
static UINT8 *wipe_scr_start; //screen 3
|
||||
static UINT8 *wipe_scr_end; //screen 4
|
||||
static UINT8 *wipe_scr; //screen 0 (main drawing)
|
||||
static fixed_t paldiv = 0;
|
||||
static fixed_t paldiv;
|
||||
|
||||
/** Create fademask_t from lump
|
||||
*
|
||||
@@ -157,7 +157,7 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) {
|
||||
while (lsize--)
|
||||
{
|
||||
// Determine pixel to use from fademask
|
||||
pcolor = &pMasterPalette[*lump++];
|
||||
pcolor = &pLocalPalette[*lump++];
|
||||
*mask++ = FixedDiv((pcolor->s.red+1)<<FRACBITS, paldiv)>>FRACBITS;
|
||||
}
|
||||
|
||||
@@ -349,8 +349,7 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
|
||||
UINT8 wipeframe = 0;
|
||||
fademask_t *fmask;
|
||||
|
||||
if (!paldiv)
|
||||
paldiv = FixedDiv(257<<FRACBITS, 11<<FRACBITS);
|
||||
paldiv = FixedDiv(257<<FRACBITS, 11<<FRACBITS);
|
||||
|
||||
// Init the wipe
|
||||
WipeInAction = true;
|
||||
|
||||
@@ -883,7 +883,9 @@ void HWR_SetMapPalette(void)
|
||||
if ((!(gamestate == GS_LEVEL)) || (gamestate == GS_TITLESCREEN))
|
||||
{
|
||||
// outside of a level, pMasterPalette should have PLAYPAL ready for us
|
||||
palette = pMasterPalette;
|
||||
//palette = pMasterPalette; // we dont have this in kart so just use pLocalPalette as before
|
||||
|
||||
palette = pLocalPalette;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -972,7 +974,8 @@ UINT32 HWR_GetLightTableID(extracolormap_t *colormap)
|
||||
// call become invalid and must not be used.
|
||||
void HWR_ClearLightTables(void)
|
||||
{
|
||||
if (vid.glstate == VID_GL_LIBRARY_LOADED)
|
||||
//if (vid.glstate == VID_GL_LIBRARY_LOADED) // we have pfnInit which is essentially the same, but it doesent work here for whatever reason, since this should not be done in software renderer ever!
|
||||
if (rendermode == render_opengl)
|
||||
HWD.pfnClearLightTables();
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -1341,9 +1341,9 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
|
||||
// map[i]'s values are decremented by after each use
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
r = pMasterPalette[i].s.red;
|
||||
g = pMasterPalette[i].s.green;
|
||||
b = pMasterPalette[i].s.blue;
|
||||
r = pLocalPalette[i].s.red;
|
||||
g = pLocalPalette[i].s.green;
|
||||
b = pLocalPalette[i].s.blue;
|
||||
cbrightness = sqrt((r*r) + (g*g) + (b*b));
|
||||
|
||||
map[i][0] = (cbrightness * cmaskr) + (r * othermask);
|
||||
@@ -1424,9 +1424,9 @@ UINT8 NearestPaletteColor(UINT8 r, UINT8 g, UINT8 b, RGBA_t *palette)
|
||||
int dr, dg, db;
|
||||
int distortion, bestdistortion = 256 * 256 * 4, bestcolor = 0, i;
|
||||
|
||||
// Use MasterPalette palette if none specified
|
||||
// Use local palette if none specified
|
||||
if (palette == NULL)
|
||||
palette = pMasterPalette;
|
||||
palette = pLocalPalette;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
|
||||
+4
-7
@@ -86,7 +86,6 @@ consvar_t cv_menucaps = {"menucaps", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NUL
|
||||
|
||||
// local copy of the palette for V_GetColor()
|
||||
RGBA_t *pLocalPalette = NULL;
|
||||
RGBA_t *pMasterPalette = NULL;
|
||||
|
||||
/*
|
||||
The following was an extremely helpful resource when developing my Colour Cube LUT.
|
||||
@@ -314,18 +313,16 @@ static void LoadPalette(const char *lumpname)
|
||||
UINT8 *pal;
|
||||
|
||||
Z_Free(pLocalPalette);
|
||||
Z_Free(pMasterPalette);
|
||||
|
||||
pLocalPalette = Z_Malloc(sizeof (*pLocalPalette)*palsize, PU_STATIC, NULL);
|
||||
pMasterPalette = Z_Malloc(sizeof (*pMasterPalette)*palsize, PU_STATIC, NULL);
|
||||
|
||||
pal = W_CacheLumpNum(lumpnum, PU_CACHE);
|
||||
for (i = 0; i < palsize; i++)
|
||||
{
|
||||
pMasterPalette[i].s.red = pLocalPalette[i].s.red = correctiontable[*pal++];
|
||||
pMasterPalette[i].s.green = pLocalPalette[i].s.green = correctiontable[*pal++];
|
||||
pMasterPalette[i].s.blue = pLocalPalette[i].s.blue = correctiontable[*pal++];
|
||||
pMasterPalette[i].s.alpha = pLocalPalette[i].s.alpha = 0xFF;
|
||||
pLocalPalette[i].s.red = correctiontable[*pal++];
|
||||
pLocalPalette[i].s.green = correctiontable[*pal++];
|
||||
pLocalPalette[i].s.blue = correctiontable[*pal++];
|
||||
pLocalPalette[i].s.alpha = 0xFF;
|
||||
|
||||
// lerp of colour cubing!
|
||||
if (cube)
|
||||
|
||||
@@ -58,7 +58,6 @@ const char *R_GetPalname(UINT16 num);
|
||||
const char *GetPalette(void);
|
||||
|
||||
extern RGBA_t *pLocalPalette;
|
||||
extern RGBA_t *pMasterPalette;
|
||||
|
||||
extern UINT8 hudtrans;
|
||||
|
||||
|
||||
Reference in new issue
Block a user