History

Fixes to problems with meta-types

ksuprynowicz committed 4 years ago

Commit 50a6a631 parent 33c86078 files · +43 −15Browse files

Showing the changes to interface/src/scripting/PlatformInfoScriptingInterface.cpp (1 of 8 files). Show all

Unified · Split

interface/src/scripting/PlatformInfoScriptingInterface.cpp+8−0
@@ -1,6 +1,7 @@
11 //
22 // Created by Nissim Hadar on 2018/12/28
33 // Copyright 2013-2016 High Fidelity, Inc.
4+// Copyright 2022 Overte e.V.
45 //
56 // Distributed under the Apache License, Version 2.0.
67 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -12,6 +13,7 @@ · 5 unmodified lines
1213
1314 #include <platform/Platform.h>
1415 #include <platform/Profiler.h>
16+#include <ScriptEngineCast.h>
1517
1618 #ifdef Q_OS_WIN
1719 #include <Windows.h>
@@ -19,6 +21,12 @@ · 1 unmodified line
1921 #include <sstream>
2022 #endif
2123
24+STATIC_SCRIPT_INITIALIZER(+[](ScriptManager* manager){
25+ auto scriptEngine = manager->engine().get();
26+
27+ scriptRegisterMetaType(scriptEngine, scriptValueFromEnumClass<PlatformInfoScriptingInterface::PlatformTier>, scriptValueToEnumClass<PlatformInfoScriptingInterface::PlatformTier>, "PlatformTier");
28+});
29+
2230 PlatformInfoScriptingInterface* PlatformInfoScriptingInterface::getInstance() {
2331 static PlatformInfoScriptingInterface sharedInstance;
2432 return &sharedInstance;