mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-23 03:12:38 +00:00
Add sector flag that protects the colormap from being changed
This commit is contained in:
parent
7cf9ad2f2b
commit
0ecf8616ba
3 changed files with 18 additions and 1 deletions
|
@ -947,6 +947,8 @@ static void P_LoadSectors(UINT8 *data)
|
|||
|
||||
ss->floorpic_angle = ss->ceilingpic_angle = 0;
|
||||
|
||||
ss->colormap_protected = false;
|
||||
|
||||
P_InitializeSector(ss);
|
||||
}
|
||||
}
|
||||
|
@ -1468,6 +1470,8 @@ static void ParseTextmapSectorParameter(UINT32 i, char *param, char *val)
|
|||
textmap_colormap.used = true;
|
||||
textmap_colormap.flags |= CMF_FADEFULLBRIGHTSPRITES;
|
||||
}
|
||||
else if (fastcmp(param, "colormapprotected") && fastcmp("true", val))
|
||||
sectors[i].colormap_protected = true;
|
||||
}
|
||||
|
||||
static void ParseTextmapSidedefParameter(UINT32 i, char *param, char *val)
|
||||
|
@ -1702,6 +1706,8 @@ static void P_LoadTextmap(void)
|
|||
|
||||
sc->floorpic_angle = sc->ceilingpic_angle = 0;
|
||||
|
||||
sc->colormap_protected = false;
|
||||
|
||||
textmap_colormap.used = false;
|
||||
textmap_colormap.lightcolor = 0;
|
||||
textmap_colormap.lightalpha = 25;
|
||||
|
|
12
src/p_spec.c
12
src/p_spec.c
|
@ -3518,6 +3518,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
|
||||
for (secnum = -1; (secnum = P_FindSectorFromTag(line->args[0], secnum)) >= 0;)
|
||||
{
|
||||
if (sectors[secnum].colormap_protected)
|
||||
continue;
|
||||
|
||||
P_ResetColormapFader(§ors[secnum]);
|
||||
|
||||
if (line->args[2] & 1) // relative calc
|
||||
|
@ -3852,6 +3855,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
{
|
||||
extracolormap_t *source_exc, *dest_exc, *exc;
|
||||
|
||||
if (sectors[secnum].colormap_protected)
|
||||
continue;
|
||||
|
||||
// Don't interrupt ongoing fade
|
||||
if (!(line->args[3] & 8192)
|
||||
&& sectors[secnum].fadecolormapdata)
|
||||
|
@ -7413,6 +7419,10 @@ void P_SpawnSpecials(boolean fromnetsave)
|
|||
for (s = -1; (s = P_FindSectorFromTag(lines[i].args[0], s)) >= 0;)
|
||||
{
|
||||
extracolormap_t *exc;
|
||||
|
||||
if (sectors[s].colormap_protected)
|
||||
continue;
|
||||
|
||||
if (!udmf)
|
||||
exc = sides[lines[i].sidenum[0]].colormap_data;
|
||||
else
|
||||
|
@ -8370,7 +8380,7 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor
|
|||
d->destlightlevel = -1;
|
||||
|
||||
// Set a separate thinker for colormap fading
|
||||
if (docolormap && !(rover->flags & FF_NOSHADE) && sectors[rover->secnum].spawn_extra_colormap)
|
||||
if (docolormap && !(rover->flags & FF_NOSHADE) && sectors[rover->secnum].spawn_extra_colormap && !sectors[rover->secnum].colormap_protected)
|
||||
{
|
||||
extracolormap_t *dest_exc,
|
||||
*source_exc = sectors[rover->secnum].extra_colormap ? sectors[rover->secnum].extra_colormap : R_GetDefaultColormap();
|
||||
|
|
|
@ -352,6 +352,7 @@ typedef struct sector_s
|
|||
|
||||
// per-sector colormaps!
|
||||
extracolormap_t *extra_colormap;
|
||||
boolean colormap_protected;
|
||||
|
||||
#ifdef HWRENDER // ----- for special tricks with HW renderer -----
|
||||
boolean pseudoSector;
|
||||
|
|
Loading…
Reference in a new issue