Merge branch 'colormap-overhaul' into colormap-overhaul-fade

This commit is contained in:
mazmazz 2018-09-11 13:48:39 -04:00
commit e20d5e90a7
3 changed files with 13 additions and 13 deletions

View file

@ -1322,29 +1322,28 @@ void R_ReInitColormaps(UINT16 num)
//
void R_ClearColormaps(void)
{
extracolormap_t *exc, *exc_next;
// Purged by PU_LEVEL, just overwrite the pointer
extra_colormaps = R_CreateDefaultColormap(true);
}
for (exc = extra_colormaps; exc; exc = exc_next)
{
exc_next = exc->next;
memset(exc, 0, sizeof(*exc));
}
// make a default extra_colormap
exc = Z_Calloc(sizeof (*exc), PU_LEVEL, NULL);
//
// R_CreateDefaultColormap()
//
extracolormap_t *R_CreateDefaultColormap(boolean lighttable)
{
extracolormap_t *exc = Z_Calloc(sizeof (*exc), PU_LEVEL, NULL);
exc->fadestart = 0;
exc->fadeend = 31;
exc->fog = 0;
exc->rgba = 0;
exc->fadergba = 0x19000000;
exc->colormap = R_CreateLightTable(exc);
exc->colormap = lighttable ? R_CreateLightTable(exc) : NULL;
#ifdef EXTRACOLORMAPLUMPS
exc->lump = LUMPERROR;
exc->lumpname[0] = 0;
#endif
exc->next = exc->prev = NULL;
extra_colormaps = exc;
return exc;
}
//

View file

@ -105,6 +105,7 @@ INT32 R_CheckTextureNumForName(const char *name);
void R_ReInitColormaps(UINT16 num);
void R_ClearColormaps(void);
extracolormap_t *R_CreateDefaultColormap(boolean lighttable);
void R_AddColormapToList(extracolormap_t *extra_colormap);
lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap);
extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3);

View file

@ -118,7 +118,7 @@ lighttable_t *scalelightfixed[MAXLIGHTSCALE];
lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ];
// Hack to support extra boom colormaps.
extracolormap_t *extra_colormaps;
extracolormap_t *extra_colormaps = NULL;
static CV_PossibleValue_t drawdist_cons_t[] = {
{256, "256"}, {512, "512"}, {768, "768"},