From 2aeec22ef88030196217e9a724169e1f99ff5bee Mon Sep 17 00:00:00 2001 From: Henrique Santiago Date: Thu, 3 Jan 2013 04:24:07 -0200 Subject: [PATCH] Fix items draw inside uiitem --- modules/client_terminal/commands.lua | 6 ++++++ src/otclient/item.cpp | 11 +---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/modules/client_terminal/commands.lua b/modules/client_terminal/commands.lua index 77815955..678e9782 100644 --- a/modules/client_terminal/commands.lua +++ b/modules/client_terminal/commands.lua @@ -86,3 +86,9 @@ function autoReloadModule(name) reloadEvent() end +function createDebugUIItem(id) + local uiitem = g_ui.createWidget('Item', rootWidget) + uiitem:setPosition({x= 200, y = 200 }) + uiitem:setItemId(id) + uiitem:show() +end diff --git a/src/otclient/item.cpp b/src/otclient/item.cpp index 7f2bd685..54c600f1 100644 --- a/src/otclient/item.cpp +++ b/src/otclient/item.cpp @@ -65,12 +65,6 @@ void Item::draw(const Point& dest, float scaleFactor, bool animate, LightView *l // determine animation phase int animationPhase = calculateAnimationPhase(animate); - if(getAnimationPhases() > 1) { - if(animate) - animationPhase = (g_clock.millis() % (Otc::ITEM_TICKS_PER_FRAME * getAnimationPhases())) / Otc::ITEM_TICKS_PER_FRAME; - else - animationPhase = getAnimationPhases()-1; - } // determine x,y,z patterns int xPattern = 0, yPattern = 0, zPattern = 0; @@ -359,12 +353,9 @@ int Item::calculateAnimationPhase(bool animate) int Item::getExactSize(int layer, int xPattern, int yPattern, int zPattern, int animationPhase) { - int exactSize = 0; calculatePatterns(xPattern, yPattern, zPattern); animationPhase = calculateAnimationPhase(true); - for(layer = 0; layer < getLayers(); ++layer) - exactSize = std::max(exactSize, Thing::getExactSize(layer, xPattern, yPattern, zPattern, animationPhase)); - return exactSize; + return Thing::getExactSize(0, xPattern, yPattern, zPattern, animationPhase); } const ThingTypePtr& Item::getThingType()