diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-08-20 18:12:22 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-20 18:12:22 -0500 |
| commit | 9d2e00ee11900c7a599b4bc6652a28445987a142 (patch) | |
| tree | a531e4586fb150b2f6ee8e36e56138282ebc1637 /include/aolayer.h | |
| parent | 1bf12a919c89919f958354582721dd68b2af1070 (diff) | |
| parent | 3bcf01bb21c60c05d52bf53828bf8361b3234a2b (diff) | |
Merge pull request #582 from AttorneyOnline/async-anim-load
Fully asynchronous animation loading
Diffstat (limited to 'include/aolayer.h')
| -rw-r--r-- | include/aolayer.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/aolayer.h b/include/aolayer.h index ffbd6dac..b8907152 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -8,6 +8,8 @@ #include <QTimer> #include <QBitmap> #include <QtConcurrent/QtConcurrentRun> +#include <QMutex> +#include <QWaitCondition> class AOApplication; class VPath; @@ -140,11 +142,17 @@ protected: // Center the QLabel in the viewport based on the dimensions of f_pixmap void center_pixmap(QPixmap f_pixmap); - // Populates the frame and delay vectors with the next frame's data. +private: + // Populates the frame and delay vectors. + void populate_vectors(); + + // used in populate_vectors void load_next_frame(); + bool exit_loop; //awful solution but i'm not fucking using QThread + QFuture<void> frame_loader; + QMutex mutex; + QWaitCondition frameAdded; - // used in load_next_frame - QFuture<void> future; signals: void done(); @@ -243,4 +251,5 @@ public: StickerLayer(QWidget *p_parent, AOApplication *p_ao_app); void load_image(QString p_charname); }; + #endif // AOLAYER_H |
