mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-12 23:54:35 +00:00
- reworked spot lights to receive all relevant information through the args.
As a bonus, arg0str can now be used for all dynamic lights to pass a color in textual form, including X11R6RGB-names.
This commit is contained in:
parent
dbf0a68b02
commit
6aaf5df617
4 changed files with 20 additions and 14 deletions
|
@ -372,8 +372,7 @@ struct FMapThing
|
||||||
uint32_t RenderStyle;
|
uint32_t RenderStyle;
|
||||||
int FloatbobPhase;
|
int FloatbobPhase;
|
||||||
int friendlyseeblocks;
|
int friendlyseeblocks;
|
||||||
double SpotInnerAngle = 10;
|
FString arg0str;
|
||||||
double SpotOuterAngle = 25;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -503,8 +503,6 @@ xx(Scale)
|
||||||
xx(ScaleX)
|
xx(ScaleX)
|
||||||
xx(ScaleY)
|
xx(ScaleY)
|
||||||
xx(FriendlySeeBlocks)
|
xx(FriendlySeeBlocks)
|
||||||
xx(SpotInnerAngle)
|
|
||||||
xx(SpotOuterAngle)
|
|
||||||
xx(Floatbobphase)
|
xx(Floatbobphase)
|
||||||
xx(Floatbobstrength)
|
xx(Floatbobstrength)
|
||||||
xx(Target)
|
xx(Target)
|
||||||
|
|
|
@ -6094,10 +6094,26 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
||||||
mobj->fillcolor = (mthing->fillcolor & 0xffffff) | (ColorMatcher.Pick((mthing->fillcolor & 0xff0000) >> 16,
|
mobj->fillcolor = (mthing->fillcolor & 0xffffff) | (ColorMatcher.Pick((mthing->fillcolor & 0xff0000) >> 16,
|
||||||
(mthing->fillcolor & 0xff00) >> 8, (mthing->fillcolor & 0xff)) << 24);
|
(mthing->fillcolor & 0xff00) >> 8, (mthing->fillcolor & 0xff)) << 24);
|
||||||
|
|
||||||
|
// allow color strings for lights and reshuffle the args for spot lights
|
||||||
if (i->IsDescendantOf(RUNTIME_CLASS(ADynamicLight)))
|
if (i->IsDescendantOf(RUNTIME_CLASS(ADynamicLight)))
|
||||||
{
|
{
|
||||||
((ADynamicLight*)mobj)->SpotInnerAngle = mthing->SpotInnerAngle;
|
auto light = static_cast<ADynamicLight*>(mobj);
|
||||||
((ADynamicLight*)mobj)->SpotOuterAngle = mthing->SpotOuterAngle;
|
if (mthing->arg0str.IsNotEmpty())
|
||||||
|
{
|
||||||
|
PalEntry color = V_GetColor(nullptr, mthing->arg0str);
|
||||||
|
}
|
||||||
|
else if (light->lightflags & LF_SPOT)
|
||||||
|
{
|
||||||
|
light->args[0] = RPART(mthing->args[0]);
|
||||||
|
light->args[1] = GPART(mthing->args[0]);
|
||||||
|
light->args[2] = BPART(mthing->args[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (light->lightflags & LF_SPOT)
|
||||||
|
{
|
||||||
|
light->SpotInnerAngle = double(mthing->args[1]);
|
||||||
|
light->SpotOuterAngle = double(mthing->args[2]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mobj->CallBeginPlay ();
|
mobj->CallBeginPlay ();
|
||||||
|
|
|
@ -604,6 +604,7 @@ public:
|
||||||
case NAME_Arg0Str:
|
case NAME_Arg0Str:
|
||||||
CHECK_N(Zd);
|
CHECK_N(Zd);
|
||||||
arg0str = CheckString(key);
|
arg0str = CheckString(key);
|
||||||
|
th->arg0str = arg0str;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_Arg1Str:
|
case NAME_Arg1Str:
|
||||||
|
@ -799,14 +800,6 @@ public:
|
||||||
th->Scale.X = th->Scale.Y = CheckFloat(key);
|
th->Scale.X = th->Scale.Y = CheckFloat(key);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_SpotInnerAngle:
|
|
||||||
th->SpotInnerAngle = CheckFloat(key);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NAME_SpotOuterAngle:
|
|
||||||
th->SpotOuterAngle = CheckFloat(key);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NAME_FriendlySeeBlocks:
|
case NAME_FriendlySeeBlocks:
|
||||||
CHECK_N(Zd | Zdt)
|
CHECK_N(Zd | Zdt)
|
||||||
th->friendlyseeblocks = CheckInt(key);
|
th->friendlyseeblocks = CheckInt(key);
|
||||||
|
|
Loading…
Reference in a new issue