diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-09-15 14:26:57 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-09-15 14:26:57 +0300 |
| commit | 4db114007456f12c77f002cac4e26cd3f6917638 (patch) | |
| tree | f0d3538d5cc5139817bb81223f94b7090111e9ef /include | |
| parent | 68082309bef636ee7843fbe9d7898c2d40192d36 (diff) | |
Add a bunch of cool refactors to support variable speed percentage
Partially bring back the differing [Time] duration variable, however, the speed of the image will not be adjusted to accomodate it due to the need for using m_reader to read through every frame to determine the final full delay value (which tanks performance).
Comment all the functions for the charmovie in aocharmovie.h
Diffstat (limited to 'include')
| -rw-r--r-- | include/aocharmovie.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/include/aocharmovie.h b/include/aocharmovie.h index c852bb36..b8b73b7e 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -17,22 +17,44 @@ class AOCharMovie : public QLabel public: AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app); - void play(QString p_char, QString p_emote, QString emote_prefix); + //Set the movie's image to provided paths, preparing for playback. + void load_image(QString p_char, QString p_emote, QString emote_prefix); + + //Start playback of the movie (if animated). + void play(); + + //Play a hat.gif - style preanimation void play_pre(QString p_char, QString p_emote, int duration); + + //Play a (b)normal.gif - style animation (talking) void play_talking(QString p_char, QString p_emote); + + //Play an (a)normal.gif - style animation (not talking) void play_idle(QString p_char, QString p_emote); + //Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a provided QImage QPixmap get_pixmap(QImage image); + + //Set the movie's frame to provided pixmap void set_frame(QPixmap f_pixmap); + //Stop the movie, clearing the image void stop(); + //Set the m_flipped variable to true/false void set_flipped(bool p_flipped) {m_flipped = p_flipped;} + //Set the movie's playback speed (between 10% and 1000%) + void set_speed(int modifier) {speed = qMax(10, qMin(modifier, 1000));} + + //Move the label itself around void move(int ax, int ay); + //This is somewhat pointless now as there's no "QMovie" object to resize, aka no "combo" to speak of void combo_resize(int w, int h); + //Return the frame delay adjusted for speed + int get_frame_delay(int delay); private: AOApplication *ao_app; @@ -54,6 +76,8 @@ private: int frame = 0; int max_frames = 0; + int speed = 100; + bool m_flipped = false; bool play_once = true; |
