fixed side_t::SetSpecialColor.

This never set the needed flags to make the color appear.
This commit is contained in:
Christoph Oelckers 2020-10-17 12:28:22 +02:00
parent 38df70f4bc
commit 0478838a9d
3 changed files with 13 additions and 6 deletions

View file

@ -1320,15 +1320,21 @@ struct side_t
textures[which].yScale *= delta;
}
void SetSpecialColor(int which, int slot, int r, int g, int b)
void SetSpecialColor(int which, int slot, int r, int g, int b, bool useown = true)
{
textures[which].SpecialColors[slot] = PalEntry(255, r, g, b);
if (useown) textures[which].flags |= part::UseOwnSpecialColors;
else textures[which].flags &= ~part::UseOwnSpecialColors;
Flags |= WALLF_EXTCOLOR;
}
void SetSpecialColor(int which, int slot, PalEntry rgb)
void SetSpecialColor(int which, int slot, PalEntry rgb, bool useown = true)
{
rgb.a = 255;
textures[which].SpecialColors[slot] = rgb;
if (useown) textures[which].flags |= part::UseOwnSpecialColors;
else textures[which].flags &= ~part::UseOwnSpecialColors;
Flags |= WALLF_EXTCOLOR;
}
// Note that the sector being passed in here may not be the actual sector this sidedef belongs to

View file

@ -1399,11 +1399,11 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)
ACTION_RETURN_POINTER(self->V2());
}
static void SetSideSpecialColor(side_t *self, int tier, int position, int color)
static void SetSideSpecialColor(side_t *self, int tier, int position, int color, int useown)
{
if (tier >= 0 && tier < 3 && position >= 0 && position < 2)
{
self->SetSpecialColor(tier, position, color);
self->SetSpecialColor(tier, position, color, useown);
}
}
@ -1413,7 +1413,8 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)
PARAM_INT(tier);
PARAM_INT(position);
PARAM_COLOR(color);
SetSideSpecialColor(self, tier, position, color);
PARAM_BOOL(useown)
SetSideSpecialColor(self, tier, position, color, useown);
return 0;
}

View file

@ -83,7 +83,7 @@ struct Side native play
native void SetTextureYScale(int which, double scale);
native double GetTextureYScale(int which);
native void MultiplyTextureYScale(int which, double delta);
native void SetSpecialColor(int tier, int position, Color scolor);
native void SetSpecialColor(int tier, int position, Color scolor, bool useowncolor = true);
native Color GetAdditiveColor(int tier);
native void SetAdditiveColor(int tier, Color color);
native void EnableAdditiveColor(int tier, bool enable);