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; }
void Item::drawToImage(Point dest, ImagePtr image) { if(m_clientId == 0) return; int xPattern = 0, yPattern = 0, zPattern = 0; calculatePatterns(xPattern, yPattern, zPattern); rawGetThingType()->drawToImage(dest, xPattern, yPattern, zPattern, image); }
void Item::draw(const Point& dest, float scaleFactor, bool animate, LightView *lightView) { if(m_clientId == 0) return; // determine animation phase int animationPhase = calculateAnimationPhase(animate); // determine x,y,z patterns int xPattern = 0, yPattern = 0, zPattern = 0; calculatePatterns(xPattern, yPattern, zPattern); rawGetThingType()->draw(dest, scaleFactor, 0, xPattern, yPattern, zPattern, animationPhase, lightView); }
void Item::draw(const Point& dest, float scaleFactor, bool animate) { if(m_clientId == 0) return; // 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; calculatePatterns(xPattern, yPattern, zPattern); rawGetThingType()->draw(dest, scaleFactor, 0, xPattern, yPattern, zPattern, animationPhase); }
void Item::draw(const Point& dest, float scaleFactor, bool animate, LightView *lightView) { if(m_clientId == 0) return; // determine animation phase int animationPhase = calculateAnimationPhase(animate); // determine x,y,z patterns int xPattern = 0, yPattern = 0, zPattern = 0; calculatePatterns(xPattern, yPattern, zPattern); if(m_color != Color::alpha) g_painter->setColor(m_color); rawGetThingType()->draw(dest, scaleFactor, 0, xPattern, yPattern, zPattern, animationPhase, lightView); /// Sanity check /// This is just to ensure that we don't overwrite some color and /// screw up the whole rendering. if(m_color != Color::alpha) g_painter->resetColor(); }
int Item::getExactSize(int layer, int xPattern, int yPattern, int zPattern, int animationPhase) { calculatePatterns(xPattern, yPattern, zPattern); animationPhase = calculateAnimationPhase(true); return Thing::getExactSize(layer, xPattern, yPattern, zPattern, animationPhase); }