mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Make default extracolormap on init
* Calc fadedist in R_CreateLightTable
This commit is contained in:
parent
22746c1d91
commit
43ae25c4fd
3 changed files with 23 additions and 11 deletions
|
@ -660,7 +660,6 @@ static void P_NetArchiveWorld(void)
|
||||||
{
|
{
|
||||||
WRITEUINT8(put, ss->extra_colormap->fadestart);
|
WRITEUINT8(put, ss->extra_colormap->fadestart);
|
||||||
WRITEUINT8(put, ss->extra_colormap->fadeend);
|
WRITEUINT8(put, ss->extra_colormap->fadeend);
|
||||||
WRITEUINT8(put, ss->extra_colormap->fadedist);
|
|
||||||
WRITEUINT8(put, (UINT8)ss->extra_colormap->fog);
|
WRITEUINT8(put, (UINT8)ss->extra_colormap->fog);
|
||||||
|
|
||||||
WRITEUINT8(put, ss->extra_colormap->cr);
|
WRITEUINT8(put, ss->extra_colormap->cr);
|
||||||
|
@ -880,8 +879,7 @@ static void P_NetUnArchiveWorld(void)
|
||||||
//size_t dbg_i = 0;
|
//size_t dbg_i = 0;
|
||||||
|
|
||||||
UINT8 fadestart = READUINT8(get),
|
UINT8 fadestart = READUINT8(get),
|
||||||
fadeend = READUINT8(get),
|
fadeend = READUINT8(get);
|
||||||
fadedist = READUINT8(get);
|
|
||||||
|
|
||||||
boolean fog = (boolean)READUINT8(get);
|
boolean fog = (boolean)READUINT8(get);
|
||||||
|
|
||||||
|
@ -952,7 +950,6 @@ static void P_NetUnArchiveWorld(void)
|
||||||
|
|
||||||
exc->fadestart = fadestart;
|
exc->fadestart = fadestart;
|
||||||
exc->fadeend = fadeend;
|
exc->fadeend = fadeend;
|
||||||
exc->fadedist = fadedist;
|
|
||||||
exc->fog = fog;
|
exc->fog = fog;
|
||||||
|
|
||||||
exc->cr = cr;
|
exc->cr = cr;
|
||||||
|
|
28
src/r_data.c
28
src/r_data.c
|
@ -1330,7 +1330,25 @@ void R_ClearColormaps(void)
|
||||||
memset(exc, 0, sizeof(*exc));
|
memset(exc, 0, sizeof(*exc));
|
||||||
}
|
}
|
||||||
|
|
||||||
extra_colormaps = NULL;
|
// make a default extra_colormap
|
||||||
|
exc = Z_Calloc(sizeof (*exc), PU_LEVEL, NULL);
|
||||||
|
exc->cr = exc->cg = exc->cb = 0xff;
|
||||||
|
exc->ca = 0;
|
||||||
|
exc->cfr = exc->cfg = exc->cfb = 0;
|
||||||
|
exc->cfa = 18;
|
||||||
|
exc->fadestart = 0;
|
||||||
|
exc->fadeend = 31;
|
||||||
|
exc->fog = 0;
|
||||||
|
exc->rgba = 0;
|
||||||
|
exc->fadergba = 0x19000000;
|
||||||
|
exc->colormap = R_CreateLightTable(exc);
|
||||||
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
|
exc->lump = LUMPERROR;
|
||||||
|
exc->lumpname[0] = 0;
|
||||||
|
#endif
|
||||||
|
exc->next = exc->prev = NULL;
|
||||||
|
|
||||||
|
extra_colormaps = exc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1427,8 +1445,8 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap)
|
||||||
cfb = extra_colormap->cfb;
|
cfb = extra_colormap->cfb;
|
||||||
// cfa = extra_colormap->cfa; // unused in software
|
// cfa = extra_colormap->cfa; // unused in software
|
||||||
|
|
||||||
UINT32 fadestart = (UINT16)extra_colormap->fadestart,
|
UINT8 fadestart = extra_colormap->fadestart,
|
||||||
fadedist = extra_colormap->fadedist;
|
fadedist = extra_colormap->fadeend - extra_colormap->fadestart;
|
||||||
|
|
||||||
lighttable_t *lighttable = NULL;
|
lighttable_t *lighttable = NULL;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -1548,7 +1566,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
||||||
extracolormap_t *extra_colormap, *exc;
|
extracolormap_t *extra_colormap, *exc;
|
||||||
|
|
||||||
UINT8 cr, cg, cb, ca, cfr, cfg, cfb, cfa;
|
UINT8 cr, cg, cb, ca, cfr, cfg, cfb, cfa;
|
||||||
UINT32 fadestart = 0, fadeend = 31, fadedist = 31;
|
UINT32 fadestart = 0, fadeend = 31;
|
||||||
|
|
||||||
INT32 rgba, fadergba;
|
INT32 rgba, fadergba;
|
||||||
|
|
||||||
|
@ -1596,7 +1614,6 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
||||||
fadestart = 0;
|
fadestart = 0;
|
||||||
if (fadeend > 31 || fadeend < 1)
|
if (fadeend > 31 || fadeend < 1)
|
||||||
fadeend = 31;
|
fadeend = 31;
|
||||||
fadedist = fadeend - fadestart;
|
|
||||||
fog = (boolean)NUMFROMCHAR(p2[1]);
|
fog = (boolean)NUMFROMCHAR(p2[1]);
|
||||||
}
|
}
|
||||||
#undef NUMFROMCHAR
|
#undef NUMFROMCHAR
|
||||||
|
@ -1662,7 +1679,6 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
||||||
|
|
||||||
extra_colormap->fadestart = (UINT16)fadestart;
|
extra_colormap->fadestart = (UINT16)fadestart;
|
||||||
extra_colormap->fadeend = (UINT16)fadeend;
|
extra_colormap->fadeend = (UINT16)fadeend;
|
||||||
extra_colormap->fadedist = fadedist;
|
|
||||||
extra_colormap->fog = fog;
|
extra_colormap->fog = fog;
|
||||||
|
|
||||||
extra_colormap->cr = cr;
|
extra_colormap->cr = cr;
|
||||||
|
|
|
@ -53,7 +53,6 @@ typedef UINT8 lighttable_t;
|
||||||
typedef struct extracolormap_s
|
typedef struct extracolormap_s
|
||||||
{
|
{
|
||||||
UINT8 fadestart, fadeend;
|
UINT8 fadestart, fadeend;
|
||||||
UINT8 fadedist;
|
|
||||||
boolean fog;
|
boolean fog;
|
||||||
|
|
||||||
// rgba for colormap table generation
|
// rgba for colormap table generation
|
||||||
|
|
Loading…
Reference in a new issue