|
|
@@ -91,15 +91,21 @@ void StaticSprite2D::SetSprite(Sprite2D* sprite)
|
|
|
void StaticSprite2D::SetDrawRect(const Rect& rect)
|
|
|
{
|
|
|
drawRect_ = rect;
|
|
|
- useDrawRect_ = true;
|
|
|
- sourceBatchesDirty_ = true;
|
|
|
+
|
|
|
+ if(useDrawRect_)
|
|
|
+ {
|
|
|
+ sourceBatchesDirty_ = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void StaticSprite2D::SetTextureRect(const Rect& rect)
|
|
|
{
|
|
|
textureRect_ = rect;
|
|
|
- useTextureRect_ = true;
|
|
|
- sourceBatchesDirty_ = true;
|
|
|
+
|
|
|
+ if(useTextureRect_)
|
|
|
+ {
|
|
|
+ sourceBatchesDirty_ = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void StaticSprite2D::SetBlendMode(BlendMode blendMode)
|
|
|
@@ -166,6 +172,27 @@ void StaticSprite2D::SetUseHotSpot(bool useHotSpot)
|
|
|
UpdateDrawRect();
|
|
|
}
|
|
|
|
|
|
+void StaticSprite2D::SetUseDrawRect(bool useDrawRect)
|
|
|
+{
|
|
|
+ if (useDrawRect == useDrawRect_)
|
|
|
+ return;
|
|
|
+
|
|
|
+ useDrawRect_ = useDrawRect;
|
|
|
+ sourceBatchesDirty_ = true;
|
|
|
+ MarkNetworkUpdate();
|
|
|
+ UpdateDrawRect();
|
|
|
+}
|
|
|
+
|
|
|
+void StaticSprite2D::SetUseTextureRect(bool useTextureRect)
|
|
|
+{
|
|
|
+ if (useTextureRect == useTextureRect_)
|
|
|
+ return;
|
|
|
+
|
|
|
+ useTextureRect_ = useTextureRect;
|
|
|
+ sourceBatchesDirty_ = true;
|
|
|
+ MarkNetworkUpdate();
|
|
|
+}
|
|
|
+
|
|
|
void StaticSprite2D::SetHotSpot(const Vector2& hotspot)
|
|
|
{
|
|
|
if (hotspot == hotSpot_)
|