aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-15 02:17:44 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-15 02:17:44 +0300
commit68082309bef636ee7843fbe9d7898c2d40192d36 (patch)
treef08e346d791d8a450bd670fecd65645a11a5dcb2 /include
parent5419641c1ebe1e8749ad6e78b82c11cbd1bc13b7 (diff)
parent37d192b4300efd1c2f3e35b2efb40e93ec99fa03 (diff)
Merge branch 'charmovie_overhaul'
Diffstat (limited to 'include')
-rw-r--r--include/aocharmovie.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/include/aocharmovie.h b/include/aocharmovie.h
index f54f5105..c852bb36 100644
--- a/include/aocharmovie.h
+++ b/include/aocharmovie.h
@@ -1,11 +1,12 @@
#ifndef AOCHARMOVIE_H
#define AOCHARMOVIE_H
-#include <QMovie>
+#include <QImageReader>
#include <QLabel>
#include <QTimer>
#include <QDebug>
#include <QImageReader>
+#include <QElapsedTimer>
class AOApplication;
@@ -21,37 +22,47 @@ public:
void play_talking(QString p_char, QString p_emote);
void play_idle(QString p_char, QString p_emote);
- void set_flipped(bool p_flipped) {m_flipped = p_flipped;}
+ QPixmap get_pixmap(QImage image);
+ void set_frame(QPixmap f_pixmap);
void stop();
+ void set_flipped(bool p_flipped) {m_flipped = p_flipped;}
+
void move(int ax, int ay);
void combo_resize(int w, int h);
+
private:
AOApplication *ao_app;
- QMovie *m_movie;
- QVector<QImage> movie_frames;
+ QVector<QPixmap> movie_frames;
+ QVector<int> movie_delays;
QTimer *preanim_timer;
+ QTimer *ticker;
+ QString last_path;
+ QImageReader *m_reader = new QImageReader();
+ QElapsedTimer actual_time;
const int time_mod = 60;
// These are the X and Y values before they are fixed based on the sprite's width.
int x = 0;
int y = 0;
- bool m_flipped = false;
+ int frame = 0;
+ int max_frames = 0;
+ bool m_flipped = false;
bool play_once = true;
signals:
void done();
private slots:
- void frame_change(int n_frame);
- void timer_done();
+ void preanim_done();
+ void movie_ticker();
};
#endif // AOCHARMOVIE_H