aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 20e7404..3fd2324 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -461,9 +461,11 @@ namespace QuickMedia {
// TODO: Only do this for items that are not visible, do not loop all items.
// TODO: Improve performance! right now it can use up to 5-7% cpu with a lot of items!
for(auto &body_item : items) {
- if(elapsed_time_sec - body_item->last_drawn_time >= 1.5) {
+ if(elapsed_time_sec - body_item->last_drawn_time >= 1.5)
+ clear_body_item_cache(body_item.get());
+ // The embedded item might or might not refer to another item in |items|, so we have to make sure we also check it
+ if(body_item->embedded_item && elapsed_time_sec - body_item->embedded_item->last_drawn_time >= 1.5)
clear_body_item_cache(body_item.get());
- }
}
}