mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add R_CheckEqualColormaps comparison method
This commit is contained in:
parent
994e8f8ed3
commit
a79e785f5d
2 changed files with 28 additions and 0 deletions
27
src/r_data.c
27
src/r_data.c
|
|
@ -1472,6 +1472,33 @@ boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgb
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, boolean checkrgba, boolean checkfadergba, boolean checkparams)
|
||||||
|
{
|
||||||
|
// Treat NULL as default colormap
|
||||||
|
// We need this because what if one exc is a default colormap, and the other is NULL? They're really both equal.
|
||||||
|
if (!exc_a)
|
||||||
|
exc_a = R_GetDefaultColormap();
|
||||||
|
if (!exc_b)
|
||||||
|
exc_b = R_GetDefaultColormap();
|
||||||
|
|
||||||
|
if (exc_a == exc_b)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return (
|
||||||
|
(!checkparams ? true :
|
||||||
|
(exc_a->fadestart == exc_b->fadestart
|
||||||
|
&& exc_a->fadeend == exc_b->fadeend
|
||||||
|
&& exc_a->fog == exc_b->fog)
|
||||||
|
)
|
||||||
|
&& (!checkrgba ? true : exc_a->rgba == exc_b->rgba)
|
||||||
|
&& (!checkfadergba ? true : exc_a->fadergba == exc_b->fadergba)
|
||||||
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
|
&& exc_a->lump == exc_b->lump
|
||||||
|
&& !strncmp(exc_a->lumpname, exc_b->lumpname, 9)
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// R_GetColormapFromListByValues()
|
// R_GetColormapFromListByValues()
|
||||||
// NOTE: Returns NULL if no match is found
|
// NOTE: Returns NULL if no match is found
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba,
|
||||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, boolean fog);
|
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, boolean fog);
|
||||||
#endif
|
#endif
|
||||||
boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgba, boolean checkfadergba, boolean checkparams);
|
boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgba, boolean checkfadergba, boolean checkparams);
|
||||||
|
boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b);
|
||||||
extracolormap_t *R_GetColormapFromList(extracolormap_t *extra_colormap);
|
extracolormap_t *R_GetColormapFromList(extracolormap_t *extra_colormap);
|
||||||
|
|
||||||
lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap);
|
lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue