Mercurial > fife-parpg
diff engine/core/model/structures/instance.cpp @ 588:a46368b3d8a0
* Added checks to setRotation() and setLocation() to prevent performance decrease.
* Commented out the sanityCheck() in pool destructor, it is only usefull for debugging and slows down the engine destruction massively.
author | helios2000@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 13 Aug 2010 13:54:02 +0000 |
parents | 2de93d36ca6d |
children | 4f36c890b1dd |
line wrap: on
line diff
--- a/engine/core/model/structures/instance.cpp Wed Aug 11 16:52:57 2010 +0000 +++ b/engine/core/model/structures/instance.cpp Fri Aug 13 13:54:02 2010 +0000 @@ -219,20 +219,24 @@ } void Instance::setLocation(const Location& loc) { - m_location = loc; - if(isActive()) { - refresh(); - } else { - initializeChanges(); + if(m_location != loc) { + m_location = loc; + if(isActive()) { + refresh(); + } else { + initializeChanges(); + } } } void Instance::setRotation(int rotation) { - m_rotation = rotation; - if(isActive()) { - refresh(); - } else { - initializeChanges(); + if(m_rotation != rotation) { + m_rotation = rotation; + if(isActive()) { + refresh(); + } else { + initializeChanges(); + } } }