Debug sprite sharing
This commit is contained in:
parent
c43069eec7
commit
4d49f58809
@ -252,7 +252,7 @@ namespace SpriteLibrary
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool MirrorVertically = false;
|
public bool MirrorVertically = false;
|
||||||
|
|
||||||
SpriteController MySpriteController;
|
internal SpriteController MySpriteController;
|
||||||
private bool _Destroying = false;
|
private bool _Destroying = false;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If the Sprite is in the middle of being Destroyed, this is set to true. When a Sprite is
|
/// If the Sprite is in the middle of being Destroyed, this is set to true. When a Sprite is
|
||||||
|
@ -976,6 +976,7 @@ namespace SpriteLibrary
|
|||||||
{
|
{
|
||||||
//If we get here, we do not have it in our list. Add it to this controller and then return it
|
//If we get here, we do not have it in our list. Add it to this controller and then return it
|
||||||
AddSprite(Found);
|
AddSprite(Found);
|
||||||
|
//Console.WriteLine("Found A Sprite in another controller:" + Found.SpriteName);
|
||||||
return Found;
|
return Found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1003,6 +1004,7 @@ namespace SpriteLibrary
|
|||||||
/// <param name="SpriteToAdd">The sprite to add to the sprite-controller</param>
|
/// <param name="SpriteToAdd">The sprite to add to the sprite-controller</param>
|
||||||
public void AddSprite(Sprite SpriteToAdd)
|
public void AddSprite(Sprite SpriteToAdd)
|
||||||
{
|
{
|
||||||
|
SpriteToAdd.MySpriteController = this;
|
||||||
Sprites.Add(SpriteToAdd);
|
Sprites.Add(SpriteToAdd);
|
||||||
AddSpriteToLinkedControllers(SpriteToAdd);
|
AddSpriteToLinkedControllers(SpriteToAdd);
|
||||||
SortSprites();
|
SortSprites();
|
||||||
@ -1017,7 +1019,11 @@ namespace SpriteLibrary
|
|||||||
if (SpriteToAdd.SpriteName == "") return; //We only add named sprites
|
if (SpriteToAdd.SpriteName == "") return; //We only add named sprites
|
||||||
Sprite found = SpriteFromName(SpriteToAdd.SpriteName);
|
Sprite found = SpriteFromName(SpriteToAdd.SpriteName);
|
||||||
if (found == null)
|
if (found == null)
|
||||||
Sprites.Add(SpriteToAdd);
|
{
|
||||||
|
Sprite Clone = new Sprite(SpriteToAdd,true);
|
||||||
|
Clone.MySpriteController = this;
|
||||||
|
Sprites.Add(Clone);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user