TabIcon::TabIcon(QWidget* parent) : QWidget(parent) , m_tab(0) , m_currentFrame(0) , m_animationRunning(false) , m_audioIconDisplayed(false) { setObjectName(QSL("tab-icon")); if (!s_data) { s_data = new TabIcon::Data; s_data->animationPixmap = QIcon(QSL(":icons/other/loading.png")).pixmap(288, 16); s_data->framesCount = s_data->animationPixmap.width() / s_data->animationPixmap.height(); s_data->audioPlayingPixmap = QIcon::fromTheme(QSL("audio-volume-high"), QIcon(QSL(":icons/other/audioplaying.png"))).pixmap(16); s_data->audioMutedPixmap = QIcon::fromTheme(QSL("audio-volume-muted"), QIcon(QSL(":icons/other/audiomuted.png"))).pixmap(16); } m_updateTimer = new QTimer(this); m_updateTimer->setInterval(ANIMATION_INTERVAL); connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateAnimationFrame())); resize(16, 16); setIcon(IconProvider::emptyWebIcon()); }
void SkyEnemy::tick(double d_time) { if (state != Exploding) theta = theta + thetaVelDirection*thetaVel*d_time; else { timeExploding += d_time; if (timeExploding > explodingDuration) markedForDeletion = 1; } if (state == Midair) { rVel = rVel + g*d_time; r = r + rVelDirection*rVel*d_time; } int maxFrames = (state == Exploding)? 6: 3; updateAnimationFrame(d_time, 100, maxFrames); }
void TabIcon::showLoadingAnimation() { m_currentFrame = 0; updateAnimationFrame(); }
void BulletC::update(DWORD milliseconds, float_t velocity) { move(milliseconds, velocity); doCollisions(); updateAnimationFrame(milliseconds); }