Mercurial > fife-parpg
changeset 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 | d1df6cf5ff23 |
files | engine/core/model/structures/instance.cpp engine/core/util/resource/pool.cpp |
diffstat | 2 files changed, 16 insertions(+), 11 deletions(-) [+] |
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(); + } } }
--- a/engine/core/util/resource/pool.cpp Wed Aug 11 16:52:57 2010 +0000 +++ b/engine/core/util/resource/pool.cpp Fri Aug 13 13:54:02 2010 +0000 @@ -46,7 +46,8 @@ Pool::~Pool() { FL_LOG(_log, LMsg("Pool destroyed: ") << m_name); printStatistics(); - sanityCheck(); + // This is only usefull for debugging + //sanityCheck(); reset(); std::vector<ResourceLoader*>::iterator loader; for (loader = m_loaders.begin(); loader != m_loaders.end(); loader++) {