From 49147c8be51cd71e34a862615e18955bd3abeca5 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Fri, 18 Aug 2023 18:28:04 +1000 Subject: [PATCH] Fix ItemDrop drawable rendering after added caching also added poly logging for drops --- source/game/StarItemDrop.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/game/StarItemDrop.cpp b/source/game/StarItemDrop.cpp index 4e9feeb..895e4bb 100644 --- a/source/game/StarItemDrop.cpp +++ b/source/game/StarItemDrop.cpp @@ -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); } }