diff options
| author | OmniTroid <davidskoland@gmail.com> | 2017-05-21 21:44:41 +0200 |
|---|---|---|
| committer | OmniTroid <davidskoland@gmail.com> | 2017-05-21 21:44:41 +0200 |
| commit | b30131a922290da9e9f83d09e0ee33bcfb29db30 (patch) | |
| tree | d2608c08709b5d245c9edb14ebe0cf84adf88dcd | |
| parent | 1e0531a3d34372b765315898bcb3a8855e1a2c8c (diff) | |
fixed a code error and renamed flipped_movie
| -rw-r--r-- | aocharmovie.cpp | 12 | ||||
| -rw-r--r-- | aocharmovie.h | 2 | ||||
| -rw-r--r-- | aomovie.cpp | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/aocharmovie.cpp b/aocharmovie.cpp index d77ecb2d..6ad2969c 100644 --- a/aocharmovie.cpp +++ b/aocharmovie.cpp @@ -16,8 +16,6 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_ preanim_timer = new QTimer(this); preanim_timer->setSingleShot(true); - this->setMovie(m_movie); - connect(m_movie, SIGNAL(frameChanged(int)), this, SLOT(frame_change(int))); connect(preanim_timer, SIGNAL(timeout()), this, SLOT(timer_done())); } @@ -44,14 +42,14 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) QImageReader *reader = new QImageReader(gif_path); - flipped_movie.clear(); + movie_frames.clear(); QImage f_image = reader->read(); while (!f_image.isNull()) { if (m_flipped) - flipped_movie.append(f_image.mirrored(true, false)); + movie_frames.append(f_image.mirrored(true, false)); else - flipped_movie.append(f_image); + movie_frames.append(f_image); f_image = reader->read(); } @@ -153,9 +151,9 @@ void AOCharMovie::combo_resize(int w, int h) void AOCharMovie::frame_change(int n_frame) { - if (flipped_movie.size() > n_frame) + if (movie_frames.size() > n_frame) { - QPixmap f_pixmap = QPixmap::fromImage(flipped_movie.at(n_frame)); + QPixmap f_pixmap = QPixmap::fromImage(movie_frames.at(n_frame)); this->setPixmap(f_pixmap.scaled(this->width(), this->height())); } diff --git a/aocharmovie.h b/aocharmovie.h index 4cb4f26c..8bc0bc18 100644 --- a/aocharmovie.h +++ b/aocharmovie.h @@ -29,7 +29,7 @@ private: AOApplication *ao_app; QMovie *m_movie; - QVector<QImage> flipped_movie; + QVector<QImage> movie_frames; QTimer *preanim_timer; const int time_mod = 62; diff --git a/aomovie.cpp b/aomovie.cpp index 57147041..90c37010 100644 --- a/aomovie.cpp +++ b/aomovie.cpp @@ -10,6 +10,8 @@ AOMovie::AOMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_parent) m_movie = new QMovie(); + this->setMovie(m_movie); + connect(m_movie, SIGNAL(frameChanged(int)), this, SLOT(frame_change(int))); } |
