Fixed light selection checks.

This commit is contained in:
Leonardo Zide 2023-08-27 10:19:07 -07:00
parent 5f3eb69ae7
commit 4e09ceaf7d

View file

@ -146,10 +146,21 @@ public:
{ {
if (Selected) if (Selected)
{ {
if (IsPointLight()) switch (mLightType)
{
case lcLightType::Point:
mState |= LC_LIGHT_POSITION_SELECTED; mState |= LC_LIGHT_POSITION_SELECTED;
else break;
mState |= LC_LIGHT_SELECTION_MASK;
case lcLightType::Spot:
case lcLightType::Directional:
mState |= LC_LIGHT_POSITION_SELECTED | LC_LIGHT_TARGET_SELECTED;
break;
case lcLightType::Area:
mState |= LC_LIGHT_POSITION_SELECTED | LC_LIGHT_TARGET_SELECTED | LC_LIGHT_UPVECTOR_SELECTED;
break;
}
} }
else else
mState &= ~(LC_LIGHT_SELECTION_MASK | LC_LIGHT_FOCUS_MASK); mState &= ~(LC_LIGHT_SELECTION_MASK | LC_LIGHT_FOCUS_MASK);
@ -179,7 +190,7 @@ public:
case LC_LIGHT_SECTION_UPVECTOR: case LC_LIGHT_SECTION_UPVECTOR:
if (Selected) if (Selected)
{ {
if (!IsPointLight()) if (IsAreaLight())
mState |= LC_LIGHT_UPVECTOR_SELECTED; mState |= LC_LIGHT_UPVECTOR_SELECTED;
} }
else else
@ -237,7 +248,7 @@ public:
case LC_LIGHT_SECTION_UPVECTOR: case LC_LIGHT_SECTION_UPVECTOR:
if (Focused) if (Focused)
{ {
if (!IsPointLight()) if (IsAreaLight())
mState |= LC_LIGHT_UPVECTOR_SELECTED | LC_LIGHT_UPVECTOR_FOCUSED; mState |= LC_LIGHT_UPVECTOR_SELECTED | LC_LIGHT_UPVECTOR_FOCUSED;
} }
else else