author | unc0rr |
Tue, 02 Jan 2018 23:45:18 +0100 | |
branch | qmlfrontend |
changeset 12881 | b544bbbd0696 |
parent 12868 | fe16fa088b69 |
permissions | -rw-r--r-- |
12862 | 1 |
#ifndef HWENGINE_H |
2 |
#define HWENGINE_H |
|
3 |
||
12863
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
12862
diff
changeset
|
4 |
#include <QList> |
12862 | 5 |
#include <QObject> |
6 |
||
7 |
#include "flib.h" |
|
12868 | 8 |
#include "gameconfig.h" |
12862 | 9 |
|
10 |
class QQmlEngine; |
|
12866 | 11 |
class PreviewImageProvider; |
12 |
class RunQueue; |
|
12862 | 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 |
||
12863
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
12862
diff
changeset
|
23 |
Q_INVOKABLE void getPreview(); |
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
12862
diff
changeset
|
24 |
Q_INVOKABLE void runQuickGame(); |
0c6fb706f747
More refactoring in attempt to move away from frontlib
unc0rr
parents:
12862
diff
changeset
|
25 |
|
12862 | 26 |
signals: |
27 |
void previewIsRendering(); |
|
28 |
void previewImageChanged(); |
|
29 |
void previewHogCountChanged(int count); |
|
12866 | 30 |
void gameFinished(); |
12862 | 31 |
|
32 |
public slots: |
|
33 |
||
34 |
private: |
|
35 |
QQmlEngine* m_engine; |
|
12866 | 36 |
PreviewImageProvider* m_previewProvider; |
37 |
RunQueue* m_runQueue; |
|
12868 | 38 |
GameConfig m_gameConfig; |
12881
b544bbbd0696
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)
unc0rr
parents:
12868
diff
changeset
|
39 |
QByteArray m_seed; |
12862 | 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 |