Fix ItemDrop drawable rendering after added caching

also added poly logging for drops
This commit is contained in:
Kae 2023-08-18 18:28:04 +10:00
parent 0c2015118b
commit 49147c8be5

View File

@ -252,6 +252,12 @@ void ItemDrop::update(float dt, uint64_t) {
m_movementController.tickSlave(dt);
}
}
if (world()->isClient()) {
SpatialLogger::logPoly("world",
m_movementController.collisionBody(),
(canTake() ? Color::Green : Color::Red).toRgba());
}
}
bool ItemDrop::shouldDestroy() const {
@ -270,9 +276,9 @@ void ItemDrop::render(RenderCallback* renderCallback) {
}
EntityRenderLayer renderLayer = m_mode.get() == Mode::Taken ? RenderLayerForegroundTile : RenderLayerItemDrop;
Vec2F dropPosition = position();
for (auto& drawable : *m_drawables) {
drawable.position = dropPosition;
renderCallback->addDrawable(drawable, renderLayer);
for (Drawable drawable : *m_drawables) {
drawable.position += dropPosition;
renderCallback->addDrawable(move(drawable), renderLayer);
}
}