mirror of
https://github.com/ZDoom/ZDRay.git
synced 2025-01-24 16:51:08 +00:00
Remove 'lightintensity' UDMF key from Things, replaced it with the Thing's alpha instead
This commit is contained in:
parent
20cd01ebad
commit
f38995889d
4 changed files with 11 additions and 10 deletions
|
@ -220,6 +220,7 @@ struct MapThing2
|
||||||
short angle;
|
short angle;
|
||||||
short type;
|
short type;
|
||||||
short flags;
|
short flags;
|
||||||
|
float alpha;
|
||||||
uint8_t special;
|
uint8_t special;
|
||||||
uint8_t args[5];
|
uint8_t args[5];
|
||||||
};
|
};
|
||||||
|
@ -239,6 +240,7 @@ struct IntThing
|
||||||
|
|
||||||
short pitch; // UDMF
|
short pitch; // UDMF
|
||||||
float height; // UDMF
|
float height; // UDMF
|
||||||
|
float alpha;
|
||||||
|
|
||||||
TArray<UDMFKey> props;
|
TArray<UDMFKey> props;
|
||||||
};
|
};
|
||||||
|
|
|
@ -150,6 +150,7 @@ void FProcessor::LoadThings ()
|
||||||
Level.Things[i].args[3] = Things[i].args[3];
|
Level.Things[i].args[3] = Things[i].args[3];
|
||||||
Level.Things[i].args[4] = Things[i].args[4];
|
Level.Things[i].args[4] = Things[i].args[4];
|
||||||
Level.Things[i].pitch = 0;
|
Level.Things[i].pitch = 0;
|
||||||
|
Level.Things[i].alpha = Things[i].alpha;
|
||||||
}
|
}
|
||||||
delete[] Things;
|
delete[] Things;
|
||||||
}
|
}
|
||||||
|
@ -174,6 +175,7 @@ void FProcessor::LoadThings ()
|
||||||
Level.Things[i].args[3] = 0;
|
Level.Things[i].args[3] = 0;
|
||||||
Level.Things[i].args[4] = 0;
|
Level.Things[i].args[4] = 0;
|
||||||
Level.Things[i].pitch = 0;
|
Level.Things[i].pitch = 0;
|
||||||
|
Level.Things[i].alpha = 1.0f;
|
||||||
}
|
}
|
||||||
delete[] mt;
|
delete[] mt;
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,16 +324,8 @@ void FLevel::CreateLights()
|
||||||
// this is known as "intensity" on dynamic lights (and in UDB)
|
// this is known as "intensity" on dynamic lights (and in UDB)
|
||||||
lightdistance = thing->args[3];
|
lightdistance = thing->args[3];
|
||||||
|
|
||||||
for (unsigned int propIndex = 0; propIndex < thing->props.Size(); propIndex++)
|
|
||||||
{
|
|
||||||
const UDMFKey &key = thing->props[propIndex];
|
|
||||||
|
|
||||||
// static light intensity (not to be confused with dynamic lights' intensity, which is actually static light distance
|
// static light intensity (not to be confused with dynamic lights' intensity, which is actually static light distance
|
||||||
if (!stricmp(key.key, "lightintensity"))
|
lightintensity = thing->alpha;
|
||||||
{
|
|
||||||
lightintensity = atof(key.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lightdistance > 0.0f && lightintensity > 0.0f && lightcolor != 0)
|
if (lightdistance > 0.0f && lightintensity > 0.0f && lightcolor != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -219,6 +219,11 @@ void FProcessor::ParseThing(IntThing *th)
|
||||||
{
|
{
|
||||||
th->args[4] = CheckInt(key);
|
th->args[4] = CheckInt(key);
|
||||||
}
|
}
|
||||||
|
th->alpha = 1.0f;
|
||||||
|
if (!stricmp(key, "alpha"))
|
||||||
|
{
|
||||||
|
th->alpha = CheckFloat(key);
|
||||||
|
}
|
||||||
|
|
||||||
// now store the key in its unprocessed form
|
// now store the key in its unprocessed form
|
||||||
UDMFKey k = {key, value};
|
UDMFKey k = {key, value};
|
||||||
|
|
Loading…
Reference in a new issue