author | unc0rr |
Wed, 10 Jan 2018 23:49:47 +0100 | |
branch | qmlfrontend |
changeset 12890 | 9c259fb4d405 |
parent 12876 | b544bbbd0696 |
permissions | -rw-r--r-- |
12857 | 1 |
#ifndef HWENGINE_H |
2 |
#define HWENGINE_H |
|
3 |
||
12858
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
12857
diff
changeset
|
4 |
#include <QList> |
12857 | 5 |
#include <QObject> |
6 |
||
7 |
#include "flib.h" |
|
12863 | 8 |
#include "gameconfig.h" |
12857 | 9 |
|
10 |
class QQmlEngine; |
|
12861 | 11 |
class PreviewImageProvider; |
12 |
class RunQueue; |
|
12857 | 13 |
|
14 |
class HWEngine : public QObject { |
|
15 |
Q_OBJECT |
|
16 |
||
17 |
public: |
|
18 |
explicit HWEngine(QQmlEngine* engine, QObject* parent = nullptr); |
|
19 |
~HWEngine(); |
|
20 |
||
21 |
static void exposeToQML(); |
|
22 |
||
12858
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
12857
diff
changeset
|
23 |
Q_INVOKABLE void getPreview(); |
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
12857
diff
changeset
|
24 |
Q_INVOKABLE void runQuickGame(); |
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
12857
diff
changeset
|
25 |
|
12857 | 26 |
signals: |
27 |
void previewIsRendering(); |
|
28 |
void previewImageChanged(); |
|
29 |
void previewHogCountChanged(int count); |
|
12861 | 30 |
void gameFinished(); |
12857 | 31 |
|
32 |
public slots: |
|
33 |
||
34 |
private: |
|
35 |
QQmlEngine* m_engine; |
|
12861 | 36 |
PreviewImageProvider* m_previewProvider; |
37 |
RunQueue* m_runQueue; |
|
12863 | 38 |
GameConfig m_gameConfig; |
12876
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
12863
diff
changeset
|
39 |
QByteArray m_seed; |
12857 | 40 |
|
41 |
static void guiMessagesCallback(void* context, MessageType mt, const char* msg, uint32_t len); |
|
42 |
||
43 |
private slots: |
|
44 |
void engineMessageHandler(MessageType mt, const QByteArray& msg); |
|
45 |
}; |
|
46 |
||
47 |
#endif // HWENGINE_H |