mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 07:43:57 +02:00
Fix drawInFront bugs
This commit is contained in:
parent
5995c3717f
commit
56aac35348
2 changed files with 7 additions and 2 deletions
|
@ -315,9 +315,9 @@ public:
|
|||
|
||||
// Main scene / item managment interface reset/update/kill
|
||||
void resetPayload(const PayloadPointer& payload);
|
||||
void resetCell(ItemCell cell, bool _small) { _cell = cell; _key.setSmaller(_small); }
|
||||
void resetCell(ItemCell cell = INVALID_CELL, bool _small = false) { _cell = cell; _key.setSmaller(_small); }
|
||||
void update(const UpdateFunctorPointer& updateFunctor); // communicate update to payload
|
||||
void kill() { _payload.reset(); _key._flags.reset(); _cell = INVALID_CELL; } // forget the payload, key, cell
|
||||
void kill() { _payload.reset(); resetCell(); _key._flags.reset(); } // forget the payload, key, cell
|
||||
|
||||
// Check heuristic key
|
||||
const ItemKey& getKey() const { return _key; }
|
||||
|
|
|
@ -104,6 +104,8 @@ void Scene::resetItems(const ItemIDs& ids, Payloads& payloads) {
|
|||
if (newKey.isSpatial()) {
|
||||
auto newCell = _masterSpatialTree.resetItem(oldCell, oldKey, item.getBound(), resetID, newKey);
|
||||
item.resetCell(newCell, newKey.isSmall());
|
||||
} else {
|
||||
_masterNonspatialSet.insert(resetID);
|
||||
}
|
||||
|
||||
// next loop
|
||||
|
@ -152,10 +154,13 @@ void Scene::updateItems(const ItemIDs& ids, UpdateFunctors& functors) {
|
|||
} else {
|
||||
if (newKey.isSpatial()) {
|
||||
_masterNonspatialSet.erase(updateID);
|
||||
|
||||
auto newCell = _masterSpatialTree.resetItem(oldCell, oldKey, item.getBound(), updateID, newKey);
|
||||
item.resetCell(newCell, newKey.isSmall());
|
||||
} else {
|
||||
_masterSpatialTree.removeItem(oldCell, oldKey, updateID);
|
||||
item.resetCell();
|
||||
|
||||
_masterNonspatialSet.insert(updateID);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue