Mercurial > fife-parpg
comparison engine/core/view/camera.cpp @ 10:ab09325f901e
Camera was attached to instance on a different layer, resulting in strange scrolling. Fixed it, and added a check to prevent this happening again (attach-to-other-layer fails and logs a warning).
author | jwt@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sun, 06 Jul 2008 17:13:06 +0000 |
parents | 4a0efb7baf70 |
children | 40a7c9618ade |
comparison
equal
deleted
inserted
replaced
9:983c0af2a1e1 | 10:ab09325f901e |
---|---|
341 } | 341 } |
342 } | 342 } |
343 } | 343 } |
344 | 344 |
345 void Camera::attach(Instance *instance) { | 345 void Camera::attach(Instance *instance) { |
346 // fail if the layers aren't the same | |
347 if (m_location.getLayer()->getId() != instance->getLocation().getLayer()->getId()) { | |
348 FL_WARN(_log, "Tried to attach camera to instance on different layer."); | |
349 return ; | |
350 } | |
346 m_attachedto = instance; | 351 m_attachedto = instance; |
347 } | 352 } |
348 | 353 |
349 void Camera::detach() { | 354 void Camera::detach() { |
350 m_attachedto = NULL; | 355 m_attachedto = NULL; |