My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 2: [Prototype 1] Clone instance for Sprite is only using shallow cloning
1 person starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  Chiemdu...@gmail.com


 
Project Member Reported by Chiemdu...@gmail.com, Nov 15, 2011
We had a problem when drawing an Animation many times on screen. When the Character class get the Animation from SpriteManager, it only gets the address of the Sprite. When we draw many times, the frame counting in Animation increase in each Character draw because the all the Sprites are the same instance.

We had to use IClonable and MemberwiseClone to do a shallow cloning, which is only clone values, not references. This is unsafe and may cause many problems with other classes. 



Powered by Google Project Hosting