aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorin1tiate <radwoodward@vikings.grayson.edu>2021-08-13 03:23:12 -0500
committerin1tiate <radwoodward@vikings.grayson.edu>2021-08-13 03:23:12 -0500
commit3bcf01bb21c60c05d52bf53828bf8361b3234a2b (patch)
treea531e4586fb150b2f6ee8e36e56138282ebc1637 /include
parent2a18c1cdec54a324c6ba9834d6e6b05cc46f2535 (diff)
asynchronously load animations for bigly performant gainz
Diffstat (limited to 'include')
-rw-r--r--include/aolayer.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/aolayer.h b/include/aolayer.h
index ffbd6da..b890715 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