Mercurial > fife-parpg
comparison 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 |
comparison
equal
deleted
inserted
replaced
587:2de93d36ca6d | 588:a46368b3d8a0 |
---|---|
217 bool Instance::isActive() const { | 217 bool Instance::isActive() const { |
218 return bool(m_activity); | 218 return bool(m_activity); |
219 } | 219 } |
220 | 220 |
221 void Instance::setLocation(const Location& loc) { | 221 void Instance::setLocation(const Location& loc) { |
222 m_location = loc; | 222 if(m_location != loc) { |
223 if(isActive()) { | 223 m_location = loc; |
224 refresh(); | 224 if(isActive()) { |
225 } else { | 225 refresh(); |
226 initializeChanges(); | 226 } else { |
227 initializeChanges(); | |
228 } | |
227 } | 229 } |
228 } | 230 } |
229 | 231 |
230 void Instance::setRotation(int rotation) { | 232 void Instance::setRotation(int rotation) { |
231 m_rotation = rotation; | 233 if(m_rotation != rotation) { |
232 if(isActive()) { | 234 m_rotation = rotation; |
233 refresh(); | 235 if(isActive()) { |
234 } else { | 236 refresh(); |
235 initializeChanges(); | 237 } else { |
238 initializeChanges(); | |
239 } | |
236 } | 240 } |
237 } | 241 } |
238 | 242 |
239 void Instance::setId(const std::string& identifier) { | 243 void Instance::setId(const std::string& identifier) { |
240 m_id = identifier; | 244 m_id = identifier; |