5 |
5 |
6 #include "engine_interface.h" |
6 #include "engine_interface.h" |
7 #include "game_view.h" |
7 #include "game_view.h" |
8 #include "hwengine.h" |
8 #include "hwengine.h" |
9 #include "preview_acceptor.h" |
9 #include "preview_acceptor.h" |
10 |
|
11 namespace Engine {}; // namespace Engine |
|
12 |
10 |
13 static QObject* previewacceptor_singletontype_provider( |
11 static QObject* previewacceptor_singletontype_provider( |
14 QQmlEngine* engine, QJSEngine* scriptEngine) { |
12 QQmlEngine* engine, QJSEngine* scriptEngine) { |
15 Q_UNUSED(scriptEngine) |
13 Q_UNUSED(scriptEngine) |
16 |
14 |
22 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); |
20 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); |
23 QGuiApplication app(argc, argv); |
21 QGuiApplication app(argc, argv); |
24 |
22 |
25 QQmlApplicationEngine engine; |
23 QQmlApplicationEngine engine; |
26 |
24 |
|
25 qRegisterMetaType<EngineInstance::SimpleEventType>(); |
|
26 qRegisterMetaType<EngineInstance::LongEventType>(); |
|
27 qRegisterMetaType<EngineInstance::LongEventState>(); |
|
28 qRegisterMetaType<EngineInstance::PositionedEventType>(); |
|
29 |
27 qmlRegisterSingletonType<PreviewAcceptor>( |
30 qmlRegisterSingletonType<PreviewAcceptor>( |
28 "Hedgewars.Engine", 1, 0, "PreviewAcceptor", |
31 "Hedgewars.Engine", 1, 0, "PreviewAcceptor", |
29 previewacceptor_singletontype_provider); |
32 previewacceptor_singletontype_provider); |
30 qmlRegisterType<HWEngine>("Hedgewars.Engine", 1, 0, "HWEngine"); |
33 qmlRegisterType<HWEngine>("Hedgewars.Engine", 1, 0, "HWEngine"); |
31 qmlRegisterType<GameView>("Hedgewars.Engine", 1, 0, "GameView"); |
34 qmlRegisterType<GameView>("Hedgewars.Engine", 1, 0, "GameView"); |