Skip to content

Commit

Permalink
Allow for enabling/disabling the sprite slice9 at runtime (#8800)
Browse files Browse the repository at this point in the history
  • Loading branch information
JCash committed Apr 15, 2024
1 parent 899d29e commit 520861f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion engine/gamesys/src/gamesys/components/comp_sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,13 @@ namespace dmGameSystem
{
return dmGameObject::PROPERTY_RESULT_UNSUPPORTED_OPERATION;
}
return SetProperty(set_property, params.m_Value, component->m_Slice9, SPRITE_PROP_SLICE);

dmGameObject::PropertyResult result = SetProperty(set_property, params.m_Value, component->m_Slice9, SPRITE_PROP_SLICE);
if (dmGameObject::PROPERTY_RESULT_OK == result)
{
component->m_UseSlice9 = sum(component->m_Slice9) != 0;
}
return result;
}
else if (params.m_PropertyId == SPRITE_PROP_CURSOR)
{
Expand Down

0 comments on commit 520861f

Please sign in to comment.