Rework implementation as per the new specification
The new specification is more flexible, and allows assigning additive colors to individual parts of a sector (walls, sprites, flats) and even individual parts of a side (top, middle, bottom) Add AdditiveColors arrays to sector_t and side_t::part Initialize AdditiveColors arrays to 0 Export AdditiveColors to ZScript Save AdditiveColors in saved game files Use colors from AdditiveColors arrays when setting the additive color for the render state Add code to parse the new UDMF additive color properties Remove additive color slot from sector color/part enum Add SetAdditiveColor to sector_t and side_t Add GetAdditiveColor to side_t Export new methods and additive color arrays to ZScript
This commit is contained in:
parent
60696c91a2
commit
0773e6a98e
10 changed files with 123 additions and 16 deletions
|
|
@ -542,6 +542,23 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetSpecialColor, SetSpecialColor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void SetAdditiveColor(sector_t *self, int pos, int color)
|
||||
{
|
||||
if (pos >= 0 && pos < 5)
|
||||
{
|
||||
self->SetAdditiveColor(pos, color);
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetAdditiveColor, SetAdditiveColor)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
|
||||
PARAM_INT(pos);
|
||||
PARAM_COLOR(color);
|
||||
SetSpecialColor(self, pos, color);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void SetFogDensity(sector_t *self, int dens)
|
||||
{
|
||||
self->Colormap.FogDensity = dens;
|
||||
|
|
@ -1524,6 +1541,40 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, RemoveForceField, RemoveForceField)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int GetSideAdditiveColor(side_t *self, int tier)
|
||||
{
|
||||
if (tier >= 0 && tier < 3)
|
||||
{
|
||||
return self->GetAdditiveColor(tier, self->sector);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_Side, GetAdditiveColor, GetSideAdditiveColor)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(side_t);
|
||||
PARAM_INT(tier);
|
||||
ACTION_RETURN_INT(GetSideAdditiveColor(self, tier));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void SetSideAdditiveColor(side_t *self, int tier, int color)
|
||||
{
|
||||
if (tier >= 0 && tier < 3)
|
||||
{
|
||||
self->SetAdditiveColor(tier, color);
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_Side, SetAdditiveColor, SetSideAdditiveColor)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(side_t);
|
||||
PARAM_INT(tier);
|
||||
PARAM_COLOR(color);
|
||||
SetSideAdditiveColor(self, tier, color);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int SideIndex(side_t *self)
|
||||
{
|
||||
unsigned ndx = self->Index();
|
||||
|
|
@ -2701,6 +2752,7 @@ DEFINE_FIELD_X(Sector, sector_t, floorplane)
|
|||
DEFINE_FIELD_X(Sector, sector_t, ceilingplane)
|
||||
DEFINE_FIELD_X(Sector, sector_t, Colormap)
|
||||
DEFINE_FIELD_X(Sector, sector_t, SpecialColors)
|
||||
DEFINE_FIELD_X(Sector, sector_t, AdditiveColors)
|
||||
DEFINE_FIELD_X(Sector, sector_t, SoundTarget)
|
||||
DEFINE_FIELD_X(Sector, sector_t, special)
|
||||
DEFINE_FIELD_X(Sector, sector_t, lightlevel)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue