diff --git a/builder/builder.cpp b/builder/builder.cpp index 1d35371cf..23a0cf165 100644 --- a/builder/builder.cpp +++ b/builder/builder.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include @@ -13,6 +13,7 @@ Builder::Builder() { connect(AssetManager::instance(), &AssetManager::importFinished, this, &Builder::onImportFinished, Qt::QueuedConnection); + connect(AssetManager::instance(), &AssetManager::buildSuccessful, this, &Builder::onBuildSuccessful, Qt::QueuedConnection); } void Builder::setPlatform(const TString &platform) { @@ -30,7 +31,7 @@ void Builder::setPlatform(const TString &platform) { project->setCurrentPlatform(m_platformsToBuild.top()); m_platformsToBuild.pop(); - CodeBuilder *builder = project->currentBuilder(); + NativeCodeBuilder *builder = project->currentBuilder(); if(builder) { builder->convertFile(nullptr); } @@ -39,23 +40,15 @@ void Builder::setPlatform(const TString &platform) { } } -void Builder::package(const TString &target) { - Url info(target); - TString pak = info.absoluteDir(); -#if defined(Q_OS_MAC) - pak = target; - if(ProjectSettings::instance()->currentPlatformName() == "desktop") { - pak += "/Contents/MacOS"; - } -#endif - pak += "/base.pak"; +bool Builder::package(const TString &target) { + TString pak = target + "/base.pak"; - aInfo() << "Packaging Assets to:" << pak; + aInfo() << "Packaging Assets to:" << pak << target; zipFile zf = zipOpen(pak.data(), 0); if(!zf) { aError() << "Can't open package."; - return; + return false; } StringList list(File::list(ProjectSettings::instance()->importPath())); @@ -70,7 +63,7 @@ void Builder::package(const TString &target) { if(!inFile.open(File::ReadOnly)) { zipClose(zf, nullptr); aError() << "Can't open input file."; - return; + return false; } zip_fileinfo zi = {0}; @@ -85,17 +78,34 @@ void Builder::package(const TString &target) { } zipClose(zf, nullptr); + + aInfo() << "Packaging Done."; + return true; } void Builder::onImportFinished() { ProjectSettings *project = ProjectSettings::instance(); - TString platform = project->currentPlatformName(); - TString targetPath = project->targetPath() + "/" + platform; + + NativeCodeBuilder *builder = project->currentBuilder(); + + if(builder) { + if(builder->packagingMode() == NativeCodeBuilder::Before) { + package(project->cachePath() + "/" + project->currentPlatformName()); + } + + builder->buildProject(); + } +} + +void Builder::onBuildSuccessful() { + ProjectSettings *project = ProjectSettings::instance(); + TString targetPath = project->targetPath() + "/" + project->currentPlatformName(); if(!File::exists(targetPath) && !File::mkPath(targetPath)) { aDebug() << "Unable to create build directory at:" << targetPath; } + // Clean install dir for(auto &it : File::list(targetPath)) { File::remove(it); } @@ -108,10 +118,11 @@ void Builder::onImportFinished() { if(result) { aInfo() << "New build copied to:" << targetPath; - if(!project->currentBuilder()->isBundle(platform)) { - package(targetPath + "/" + project->projectName()); - - aInfo() << "Packaging Done."; + // Package after + NativeCodeBuilder *builder = project->currentBuilder(); + if(builder && builder->packagingMode() == NativeCodeBuilder::After) { + // Package right to install dir + package(targetPath); } if(!m_platformsToBuild.empty()) { diff --git a/builder/builder.h b/builder/builder.h index 22b14ee2c..736237121 100644 --- a/builder/builder.h +++ b/builder/builder.h @@ -13,10 +13,11 @@ class Builder : public QObject { void setPlatform(const TString &platform); - void package(const TString &target); + bool package(const TString &target); public slots: void onImportFinished(); + void onBuildSuccessful(); private: std::stack m_platformsToBuild; diff --git a/builder/main.cpp b/builder/main.cpp index 44b5f872b..9a0d040ea 100644 --- a/builder/main.cpp +++ b/builder/main.cpp @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) { ProjectSettings::instance()->loadSettings(); ProjectSettings::instance()->loadPlatforms(); - if(!PluginManager::instance()->rescanProject(ProjectSettings::instance()->pluginsPath().data())) { + if(!PluginManager::instance()->rescanProject(ProjectSettings::instance()->pluginsPath())) { aWarning() << "Not all plugins were loaded."; } PluginManager::instance()->initSystems(); diff --git a/config.h b/config.h index 0aa24235b..f66b74ee0 100644 --- a/config.h +++ b/config.h @@ -23,15 +23,15 @@ static const char *gIndex("index"); static const char *gRhi("rhi"); #if defined(Q_OS_WIN) -static const char *gShared("dll"); +static const char *gShared(".dll"); static const char *gPrefix(""); -static const char *gApplication("exe"); +static const char *gApplication(".exe"); #elif defined(Q_OS_MAC) -static const char *gShared("dylib"); +static const char *gShared(".dylib"); static const char *gPrefix("lib"); -static const char *gApplication("app"); +static const char *gApplication(".app"); #elif defined(Q_OS_UNIX) -static const char *gShared("so"); +static const char *gShared(".so"); static const char *gPrefix("lib"); static const char *gApplication(""); #endif diff --git a/engine/engine.qbs b/engine/engine.qbs index 1b615b1d2..de673d44c 100644 --- a/engine/engine.qbs +++ b/engine/engine.qbs @@ -24,6 +24,8 @@ Project { "../thirdparty/freetype/include", "../thirdparty/assimp/include", "../thirdparty/pugixml/src", + "../thirdparty/metal/metal-cpp", + "../thirdparty/metal/metal-cpp-extensions", "includes/components", "includes/resources", "includes/adapters", @@ -150,18 +152,24 @@ Project { cpp.separateDebugInformation: qbs.buildVariant === "release" Properties { - condition: engine.desktop + condition: qbs.targetOS.contains("windows") || (qbs.targetOS.contains("linux") && !qbs.targetOS.contains("android")) files: outer.concat(["src/adapters/platformadaptor.cpp", "src/adapters/desktopadaptor.cpp"]) } Properties { condition: qbs.targetOS.contains("android") - files: outer.concat(["src/adapters/mobileadaptor.cpp"]) + files: outer.concat(["src/adapters/platformadaptor.cpp", "src/adapters/mobileadaptor.cpp"]) cpp.defines: ["THUNDER_MOBILE"] Android.ndk.appStl: engine.ANDROID_STL Android.ndk.platform: engine.ANDROID } + Properties { + condition: qbs.targetOS.contains("darwin") && !(qbs.targetOS.contains("ios") || qbs.targetOS.contains("tvos")) + files: outer.concat(["src/adapters/platformadaptor.cpp", "src/adapters/mobileadaptor.cpp", "src/adapters/appleplatform.mm"]) + cpp.defines: ["THUNDER_MOBILE", "TARGET_OS_OSX"] + } + Properties { condition: qbs.targetOS.contains("ios") files: outer.concat(["src/adapters/platformadaptor.cpp", "src/adapters/mobileadaptor.cpp", "src/adapters/appleplatform.mm"]) diff --git a/engine/includes/adapters/desktopadaptor.h b/engine/includes/adapters/desktopadaptor.h index 06c9cd7ae..f1c9916a8 100644 --- a/engine/includes/adapters/desktopadaptor.h +++ b/engine/includes/adapters/desktopadaptor.h @@ -8,21 +8,19 @@ struct GLFWmonitor; class DesktopAdaptor : public PlatformAdaptor { public: - DesktopAdaptor(const TString &rhi); + DesktopAdaptor(); virtual ~DesktopAdaptor() {} bool init() override; - void update() override; - bool start() override; - void stop() override; + void update() override; - void destroy() override; + void loop() override; - bool isValid() override; + void destroy() override; bool key(Input::KeyCode code) const override; bool keyPressed(Input::KeyCode code) const override; @@ -76,7 +74,7 @@ class DesktopAdaptor : public PlatformAdaptor { GLFWwindow *m_pWindow; GLFWmonitor *m_pMonitor; - TString m_rhi; + bool m_noOpenGL; static Vector4 s_mousePosition; static Vector4 s_oldMousePosition; diff --git a/engine/includes/adapters/handlers/defaultfilehandler.h b/engine/includes/adapters/handlers/defaultfilehandler.h index 9fd5b337c..33451039e 100644 --- a/engine/includes/adapters/handlers/defaultfilehandler.h +++ b/engine/includes/adapters/handlers/defaultfilehandler.h @@ -22,9 +22,6 @@ class DefaultFileHandler : public FileHandler { try { for(const auto &entry : std::filesystem::recursive_directory_iterator(path)) { list.push_back(TString(entry.path().string()).replace('\\', '/')); - if(entry.is_directory()) { - listFilesRecursive(list, entry); - } } } catch (const std::filesystem::filesystem_error &ex) { aError() << "Error:" << ex.what(); @@ -48,7 +45,12 @@ class DefaultFileHandler : public FileHandler { } bool remove(const char *path) override { - return std::filesystem::remove(path); + try { + return std::filesystem::remove(path); + } catch (const std::filesystem::filesystem_error &) { + return false; + } + return true; } bool rename(const char *origin, const char *target) override { diff --git a/engine/includes/adapters/mobileadaptor.h b/engine/includes/adapters/mobileadaptor.h index eff01d45c..729f078fa 100644 --- a/engine/includes/adapters/mobileadaptor.h +++ b/engine/includes/adapters/mobileadaptor.h @@ -17,12 +17,8 @@ class MobileAdaptor : public PlatformAdaptor { bool start() override; - void stop() override; - void destroy() override; - bool isValid() override; - TString locationLocalDir() const override; uint32_t screenWidth() const override; diff --git a/engine/includes/adapters/platformadaptor.h b/engine/includes/adapters/platformadaptor.h index 98da7fcd3..fb2f8a2b5 100644 --- a/engine/includes/adapters/platformadaptor.h +++ b/engine/includes/adapters/platformadaptor.h @@ -2,7 +2,6 @@ #define PLATFORMADAPTER_H #include -#include #include @@ -20,12 +19,10 @@ class ENGINE_EXPORT PlatformAdaptor { virtual bool start() = 0; - virtual void stop() = 0; + virtual void loop(); virtual void destroy() = 0; - virtual bool isValid() = 0; - virtual uint32_t screenWidth() const = 0; virtual uint32_t screenHeight() const = 0; diff --git a/engine/includes/editor/assetmanager.h b/engine/includes/editor/assetmanager.h index 721673940..3b5e077d0 100644 --- a/engine/includes/editor/assetmanager.h +++ b/engine/includes/editor/assetmanager.h @@ -70,7 +70,7 @@ class ENGINE_EXPORT AssetManager : public QObject { public slots: void reimport(); - void onBuildSuccessful(CodeBuilder *builder); + void onBuildSuccessful(bool flag, CodeBuilder *builder); void checkImportSettings(AssetConverterSettings *settings); @@ -88,7 +88,7 @@ public slots: void prefabCreated(uint32_t uuid, uint32_t clone); - void buildSuccessful(); + void buildSuccessful(bool flag); protected slots: void onPerform(); diff --git a/engine/includes/editor/codebuilder.h b/engine/includes/editor/codebuilder.h index f36de0179..183a485e6 100644 --- a/engine/includes/editor/codebuilder.h +++ b/engine/includes/editor/codebuilder.h @@ -22,7 +22,6 @@ class ENGINE_EXPORT CodeBuilder : public AssetConverter { virtual void rescanSources(const TString &path); virtual bool isEmpty() const; - virtual bool isBundle(const TString &platform) const; void makeOutdated(); bool isOutdated() const; @@ -31,7 +30,7 @@ class ENGINE_EXPORT CodeBuilder : public AssetConverter { ReturnCode convertFile(AssetConverterSettings *) override; - void buildSuccessful(); + void buildSuccessful(bool flag); private: AssetConverterSettings *createSettings() override; @@ -43,6 +42,8 @@ class ENGINE_EXPORT CodeBuilder : public AssetConverter { void updateTemplate(const TString &src, const TString &dst); + void copyTempalte(const TString &src, const TString &dst); + protected: std::map m_values; diff --git a/engine/includes/editor/editorplatform.h b/engine/includes/editor/editorplatform.h index edf5a9fe1..abb0d5c95 100644 --- a/engine/includes/editor/editorplatform.h +++ b/engine/includes/editor/editorplatform.h @@ -40,12 +40,8 @@ class ENGINE_EXPORT EditorPlatform : public PlatformAdaptor { bool start() override { return true; } - void stop() override {} - void destroy() override {} - bool isValid() override { return true; } - bool key(Input::KeyCode) const override; bool keyPressed(Input::KeyCode) const override; bool keyReleased(Input::KeyCode) const override; diff --git a/engine/includes/editor/nativecodebuilder.h b/engine/includes/editor/nativecodebuilder.h index 31fe79d13..c331f7013 100644 --- a/engine/includes/editor/nativecodebuilder.h +++ b/engine/includes/editor/nativecodebuilder.h @@ -14,17 +14,35 @@ class ENGINE_EXPORT NativeCodeBuilder : public CodeBuilder { A_SLOT(NativeCodeBuilder::onBuildFinished) ) +public: + enum RHI { + Invalid, + OpenGL, + Vulkan, + Metal + }; + + enum PackagingMode { + None, + Before, + After + }; + public: NativeCodeBuilder(); + virtual PackagingMode packagingMode() const { return After; } + virtual bool isEmbedded() const { return false; } + virtual RHI defaultRhi() const { return OpenGL; } + + bool buildProject() override; + protected: // slots void onReadOutput(); void onReadError(); virtual void onBuildFinished(int exitCode); - bool buildProject() override; - protected: TString templatePath() const override { return ":/Templates/Native_Behaviour.cpp"; } @@ -36,15 +54,29 @@ class ENGINE_EXPORT NativeCodeBuilder : public CodeBuilder { void generateLoader(const TString &dst, const StringList &modules); - TString formatList(const StringList &list) const; - - bool isBundle(const TString &platform) const override; + TString formatList(const StringList &list, const TString &pref, const TString &suff, const TString &sep) const; protected: - StringList m_includePath; + StringList m_incPath; StringList m_libPath; StringList m_libs; + TString m_incPref; + TString m_incSuff; + TString m_incSep; + + TString m_libPref; + TString m_libSuff; + TString m_libSep; + + TString m_libsPref; + TString m_libsSuff; + TString m_libsSep; + + TString m_filePref; + TString m_fileSuff; + TString m_fileSep; + Process m_process; TString m_artifact; diff --git a/engine/includes/editor/projectsettings.h b/engine/includes/editor/projectsettings.h index c0e9cb31a..44c20e9e3 100644 --- a/engine/includes/editor/projectsettings.h +++ b/engine/includes/editor/projectsettings.h @@ -8,6 +8,7 @@ #include class CodeBuilder; +class NativeCodeBuilder; class ENGINE_EXPORT ProjectSettings : public Object { A_OBJECT(ProjectSettings, Object, Editor) @@ -61,7 +62,7 @@ class ENGINE_EXPORT ProjectSettings : public Object { TString generatedPath() const; TString pluginsPath() const; - TString manifestFile() const; + TString platformsPath() const; TString sdkPath() const; TString resourcePath() const; @@ -78,7 +79,7 @@ class ENGINE_EXPORT ProjectSettings : public Object { void setCurrentPlatform(const TString &platform = TString()); TString currentPlatformName() const; - CodeBuilder *currentBuilder(const TString &platform = TString()) const; + NativeCodeBuilder *currentBuilder(const TString &platform = TString()) const; void reportTypes(const std::set &types); @@ -123,6 +124,7 @@ class ENGINE_EXPORT ProjectSettings : public Object { TString m_iconPath; TString m_generatedPath; TString m_pluginsPath; + TString m_platformsPath; TString m_sdkPath; TString m_resourcePath; @@ -130,7 +132,7 @@ class ENGINE_EXPORT ProjectSettings : public Object { TString m_myProjectsPath; - TString m_manifestFile; + TString m_firstMap; diff --git a/engine/includes/engine.h b/engine/includes/engine.h index d58f2817b..310a99494 100644 --- a/engine/includes/engine.h +++ b/engine/includes/engine.h @@ -9,7 +9,6 @@ class System; class Actor; class Scene; -class Component; class ResourceSystem; class RenderSystem; class Resource; diff --git a/engine/includes/resources/mesh.h b/engine/includes/resources/mesh.h index 5b9e87cdd..554f1ca19 100644 --- a/engine/includes/resources/mesh.h +++ b/engine/includes/resources/mesh.h @@ -69,6 +69,7 @@ class ENGINE_EXPORT Mesh : public Resource { void setDefaultMaterial(Material *material, int sub = 0); void recalcNormals(); + void recalcTangents(); void recalcBounds(); diff --git a/engine/includes/resources/texture.h b/engine/includes/resources/texture.h index 27f67f0f4..64cbaee1e 100644 --- a/engine/includes/resources/texture.h +++ b/engine/includes/resources/texture.h @@ -161,6 +161,7 @@ class ENGINE_EXPORT Texture : public Resource { int32_t dwordAlignedLineSize(int32_t width, int32_t bpp); uint8_t components() const; + uint8_t bytesPerChannel() const; protected: Texture::Sides m_sides; diff --git a/engine/includes/system.h b/engine/includes/system.h index 7e7e71099..20429c26b 100644 --- a/engine/includes/system.h +++ b/engine/includes/system.h @@ -3,6 +3,8 @@ #include +class Component; + class ENGINE_EXPORT System : public ObjectSystem { public: enum ThreadPolicy { diff --git a/engine/includes/systems/rendersystem.h b/engine/includes/systems/rendersystem.h index c2ed5a524..7458d9ee2 100644 --- a/engine/includes/systems/rendersystem.h +++ b/engine/includes/systems/rendersystem.h @@ -49,6 +49,12 @@ class ENGINE_EXPORT RenderSystem : public System { virtual QWindow *createRhiWindow(Viewport *viewport); #endif + static void *windowHandle(); + static void setWindowHandle(void *handle); + +protected: + static void *m_windowHandle; + private: static int32_t m_registered; diff --git a/engine/src/adapters/appleplatform.mm b/engine/src/adapters/appleplatform.mm index fd648a674..3a32c5826 100644 --- a/engine/src/adapters/appleplatform.mm +++ b/engine/src/adapters/appleplatform.mm @@ -5,7 +5,7 @@ } const char *assetsLocation() { - return [[NSBundle.mainBundle.resourcePath stringByAppendingString:@"/assets"] cStringUsingEncoding:NSASCIIStringEncoding]; + return [[NSBundle.mainBundle.resourcePath stringByAppendingString:@"/base.pak"] cStringUsingEncoding:NSASCIIStringEncoding]; } const char *appBundle() { diff --git a/engine/src/adapters/desktopadaptor.cpp b/engine/src/adapters/desktopadaptor.cpp index ca499cf7e..dfe5f53d2 100644 --- a/engine/src/adapters/desktopadaptor.cpp +++ b/engine/src/adapters/desktopadaptor.cpp @@ -1,21 +1,19 @@ #include "adapters/desktopadaptor.h" + #ifdef _WIN32 #include #include -#elif __APPLE__ - #include -#endif -#ifdef __GNUC__ +#elif __GNUC__ #include #include #endif #include +#include #include #include #include -#include #include #include @@ -24,17 +22,19 @@ #define CONFIG_NAME "config.json" +#define NONE -1 +#define RELEASE 0 +#define PRESS 1 +#define REPEAT 2 + namespace { const char *gScreenWidth("screen.width"); const char *gScreenHeight("screen.height"); const char *gScreenWindowed("screen.windowed"); const char *gScreenVsync("screen.vsync"); -}; -#define NONE -1 -#define RELEASE 0 -#define PRESS 1 -#define REPEAT 2 + const char *gRhi(".rhi"); +}; Vector4 DesktopAdaptor::s_mousePosition = Vector4(); Vector4 DesktopAdaptor::s_oldMousePosition = Vector4(); @@ -53,10 +53,10 @@ static std::unordered_map s_MouseButtons; static TString s_inputString; -DesktopAdaptor::DesktopAdaptor(const TString &rhi) : +DesktopAdaptor::DesktopAdaptor() : m_pWindow(nullptr), m_pMonitor(nullptr), - m_rhi(rhi) { + m_noOpenGL(false) { Log::setHandler(new DesktopLogHandler()); } @@ -68,22 +68,13 @@ bool DesktopAdaptor::init() { return false; } - if(m_rhi == "RenderVK") { - glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); - } else { - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - } - - glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); - return true; } void DesktopAdaptor::update() { - glfwSwapBuffers(m_pWindow); + if(!m_noOpenGL) { + glfwSwapBuffers(m_pWindow); + } s_inputString.clear(); @@ -108,8 +99,15 @@ void DesktopAdaptor::update() { s_mouseScrollDelta = 0.0f; PlatformAdaptor::update(); +} + +void DesktopAdaptor::loop() { + while(!glfwWindowShouldClose(m_pWindow)) { + Timer::update(); + Engine::update(); - glfwPollEvents(); + glfwPollEvents(); + } } bool DesktopAdaptor::start() { @@ -188,38 +186,45 @@ bool DesktopAdaptor::start() { } } - s_windowed = Engine::value(gScreenWindowed, s_windowed).toBool(); + TString rhi = Engine::value(gRhi, "").toString(); + m_noOpenGL = (rhi == "RenderVK"); + + if(m_noOpenGL) { + glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); + } else { + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5); + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); + } + + glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); + + s_windowed = true;Engine::value(gScreenWindowed, s_windowed).toBool(); s_vSync = Engine::value(gScreenVsync, s_vSync).toBool(); m_pWindow = glfwCreateWindow(s_width, s_height, Engine::applicationName().data(), (s_windowed) ? nullptr : m_pMonitor, nullptr); if(!m_pWindow) { - stop(); + glfwTerminate(); return false; } - glfwSwapInterval(s_vSync); - glfwSetCharCallback(m_pWindow, charCallback); glfwSetKeyCallback(m_pWindow, keyCallback); glfwSetMouseButtonCallback(m_pWindow, buttonCallback); glfwSetScrollCallback(m_pWindow, scrollCallback); glfwSetCursorPosCallback(m_pWindow, cursorPositionCallback); - glfwMakeContextCurrent(m_pWindow); + if(!m_noOpenGL) { + glfwSwapInterval(s_vSync); + glfwMakeContextCurrent(m_pWindow); + } return true; } -void DesktopAdaptor::stop() { - glfwTerminate(); -} - void DesktopAdaptor::destroy() { - -} - -bool DesktopAdaptor::isValid() { - return !glfwWindowShouldClose(m_pWindow); + glfwTerminate(); } bool DesktopAdaptor::key(Input::KeyCode code) const { diff --git a/engine/src/adapters/mobileadaptor.cpp b/engine/src/adapters/mobileadaptor.cpp index 6038d6b6b..e514a293d 100644 --- a/engine/src/adapters/mobileadaptor.cpp +++ b/engine/src/adapters/mobileadaptor.cpp @@ -1,4 +1,5 @@ #include "adapters/mobileadaptor.h" +#include "systems/rendersystem.h" #include @@ -60,7 +61,6 @@ class DefaultHandler : public LogHandler { #define REPEAT 2 static GLFMDisplay *s_display = nullptr; -static Engine *s_engine = nullptr; static std::unordered_map s_keys; static std::unordered_map> s_touches; @@ -168,16 +168,13 @@ int keyToInput(int key) { } void onFrame(GLFMDisplay *display) { - if(s_engine) { - Timer::update(); - - s_engine->update(); - } + Timer::update(); + Engine::update(); glfmSwapBuffers(display); } -void onCreate(GLFMDisplay *, int width, int height) { +void onCreate(GLFMDisplay *display, int width, int height) { MobileAdaptor::s_width = width; MobileAdaptor::s_height = height; @@ -197,9 +194,13 @@ void onCreate(GLFMDisplay *, int width, int height) { #endif #endif - s_engine = new Engine(path); +#if defined(__APPLE__) + if(glfmIsMetalSupported(display)) { + RenderSystem::setWindowHandle(glfmGetMetalView(display)); + } +#endif - thunderMain(s_engine); + thunderMain(new Engine(path)); } void onResize(GLFMDisplay *, int width, int height) { @@ -284,11 +285,15 @@ void glfmMain(GLFMDisplay *display) { s_display = display; glfmSetDisplayConfig(s_display, - GLFMRenderingAPIOpenGLES3, - GLFMColorFormatRGBA8888, - GLFMDepthFormat16, - GLFMStencilFormatNone, - GLFMMultisampleNone); +#ifdef __APPLE__ + GLFMRenderingAPIMetal, +#else + GLFMRenderingAPIOpenGLES3, +#endif + GLFMColorFormatRGBA8888, + GLFMDepthFormatNone, + GLFMStencilFormatNone, + GLFMMultisampleNone); glfmSetRenderFunc(s_display, onFrame); glfmSetSurfaceCreatedFunc(s_display, onCreate); @@ -346,18 +351,10 @@ bool MobileAdaptor::start() { return true; } -void MobileAdaptor::stop() { - -} - void MobileAdaptor::destroy() { } -bool MobileAdaptor::isValid() { - return true; -} - TString MobileAdaptor::locationLocalDir() const { #ifdef __ANDROID__ return reinterpret_cast(glfmGetAndroidActivity(s_display))->internalDataPath; diff --git a/engine/src/adapters/platformadaptor.cpp b/engine/src/adapters/platformadaptor.cpp index 2cd2810e4..a6fa8fa13 100644 --- a/engine/src/adapters/platformadaptor.cpp +++ b/engine/src/adapters/platformadaptor.cpp @@ -4,6 +4,10 @@ void PlatformAdaptor::update() { } +void PlatformAdaptor::loop() { + +} + bool PlatformAdaptor::key(Input::KeyCode code) const { A_UNUSED(code); return false; diff --git a/engine/src/editor/assetmanager.cpp b/engine/src/editor/assetmanager.cpp index 4d29847fe..1c98d0f4b 100644 --- a/engine/src/editor/assetmanager.cpp +++ b/engine/src/editor/assetmanager.cpp @@ -223,7 +223,7 @@ void AssetManager::reimport() { m_timer->start(10); } -void AssetManager::onBuildSuccessful(CodeBuilder *builder) { +void AssetManager::onBuildSuccessful(bool flag, CodeBuilder *builder) { for(auto &it : builder->sources()) { AssetConverterSettings *settings = fetchSettings(it); if(settings) { @@ -231,7 +231,7 @@ void AssetManager::onBuildSuccessful(CodeBuilder *builder) { } } - emit buildSuccessful(); + emit buildSuccessful(flag); } void AssetManager::removeResource(const TString &source) { @@ -486,7 +486,8 @@ void AssetManager::onPerform() { for(CodeBuilder *it : std::as_const(m_builders)) { it->rescanSources(m_projectManager->contentPath()); - if(!it->isEmpty()) { + NativeCodeBuilder *native = dynamic_cast(it); + if(!it->isEmpty() && (native == nullptr || (native == m_projectManager->currentBuilder() && m_projectManager->targetPath().isEmpty()))) { if(it->isOutdated()) { result = true; diff --git a/engine/src/editor/baseassetprovider.cpp b/engine/src/editor/baseassetprovider.cpp index 96b0d00fb..f9bb6c091 100644 --- a/engine/src/editor/baseassetprovider.cpp +++ b/engine/src/editor/baseassetprovider.cpp @@ -119,8 +119,10 @@ void BaseAssetProvider::removeResource(const TString &source) { Engine::unloadResource(source); TString uuid = asset->unregisterAsset(source); - File::remove(project->importPath() + "/" + uuid); - File::remove(project->iconPath() + "/" + uuid + ".png"); + if(!uuid.isEmpty()) { + File::remove(project->importPath() + "/" + uuid); + File::remove(project->iconPath() + "/" + uuid + ".png"); + } File::remove(src + "." + gMetaExt); File::remove(src); diff --git a/engine/src/editor/codebuilder.cpp b/engine/src/editor/codebuilder.cpp index b80a1fde6..f48409ce6 100644 --- a/engine/src/editor/codebuilder.cpp +++ b/engine/src/editor/codebuilder.cpp @@ -26,7 +26,6 @@ bool BuilderSettings::isCode() const { CodeBuilder::CodeBuilder() : m_outdated(false) { - m_values["${Identifier_Prefix}"] = "org.tunderengine"; } void CodeBuilder::init() { @@ -42,8 +41,8 @@ AssetConverter::ReturnCode CodeBuilder::convertFile(AssetConverterSettings *) { return Skipped; } -void CodeBuilder::buildSuccessful() { - AssetManager::instance()->onBuildSuccessful(this); +void CodeBuilder::buildSuccessful(bool flag) { + AssetManager::instance()->onBuildSuccessful(flag, this); } AssetConverterSettings *CodeBuilder::createSettings() { @@ -111,7 +110,7 @@ void CodeBuilder::updateTemplate(const TString &src, const TString &dst) { begin = row; TString key = data.mid(index + 3).trimmed().toStdString(); - TString value = m_values[key]; + TString value = m_values[TString("$") + key]; if(!value.isEmpty()) { out += value; } @@ -124,14 +123,22 @@ void CodeBuilder::updateTemplate(const TString &src, const TString &dst) { File::mkPath(Url(dst).dir()); - file.setFileName(dst.data()); - if(file.open(QFile::WriteOnly | QFile::Text | QFile::Truncate)) { - file.write(out.data()); - file.close(); + File outFile(dst); + if(outFile.open(File::WriteOnly)) { + outFile.write(out); + outFile.close(); } } } +void CodeBuilder::copyTempalte(const TString &src, const TString &dst) { + if(!File::exists(dst)) { + File::mkPath(Url(dst).dir()); + + QFile::copy(src.data(), dst.data()); + } +} + const TString CodeBuilder::persistentAsset() const { return ""; } @@ -174,10 +181,6 @@ bool CodeBuilder::isEmpty() const { return m_sources.empty(); } -bool CodeBuilder::isBundle(const TString &) const { - return false; -} - void CodeBuilder::makeOutdated() { m_outdated = true; } diff --git a/engine/src/editor/editorsettings.cpp b/engine/src/editor/editorsettings.cpp index 6c6bf6ac6..a5528ba4c 100644 --- a/engine/src/editor/editorsettings.cpp +++ b/engine/src/editor/editorsettings.cpp @@ -59,7 +59,7 @@ void EditorSettings::loadSettings() { } } } else { - aError() << "Unable to load settings"; + aWarning() << "Unable to load settings"; } blockSignals(false); diff --git a/engine/src/editor/nativecodebuilder.cpp b/engine/src/editor/nativecodebuilder.cpp index 1c517ec3e..051d8068d 100644 --- a/engine/src/editor/nativecodebuilder.cpp +++ b/engine/src/editor/nativecodebuilder.cpp @@ -15,25 +15,55 @@ namespace { const char *gLibraryPaths("${libraryPaths}"); const char *gLibraries("${libraries}"); - const char *gFilesList("{FilesList}"); + const char *gFilesList("${FilesList}"); - const char *gLibrariesList("{LibrariesList}"); - const char *gEditorLibrariesList("{EditorLibrariesList}"); + const char *gLibrariesList("${LibrariesList}"); + const char *gEditorLibrariesList("${EditorLibrariesList}"); - const char *gRegisterModules("{RegisterModules}"); - const char *gModuleIncludes("{ModuleIncludes}"); + const char *gRegisterModules("${RegisterModules}"); + const char *gModuleIncludes("${ModuleIncludes}"); - const char *gRegisterComponents("{RegisterComponents}"); - const char *gUnregisterComponents("{UnregisterComponents}"); - const char *gComponentNames("{ComponentNames}"); - const char *gIncludes("{Includes}"); + const char *gRegisterComponents("${RegisterComponents}"); + const char *gUnregisterComponents("${UnregisterComponents}"); + const char *gComponentNames("${ComponentNames}"); + const char *gIncludes("${Includes}"); } NativeCodeBuilder::NativeCodeBuilder() { - connect(&m_process, _SIGNAL(finished(int)), this, _SLOT(onBuildFinished(int)) ); connect(&m_process, _SIGNAL(readyReadStandardOutput()), this, _SLOT(onReadOutput()) ); connect(&m_process, _SIGNAL(readyReadStandardError()), this, _SLOT(onReadError()) ); + ProjectSettings *project = ProjectSettings::instance(); + + TString idName = project->projectName().remove(' ').toLower(); + idName.remove('_'); + m_values["${idName}"] = idName; + + m_incPref = TString(12, ' ') + "\""; m_incSuff = "\""; m_incSep = ","; + m_libPref = TString(12, ' ') + "\""; m_libSuff = "\""; m_libSep = ","; + m_libsPref = TString(12, ' ') + "\""; m_libsSuff = "\""; m_libsSep = ","; + m_filePref = TString(12, ' ') + "\""; m_fileSuff = "\""; m_fileSep = ","; + + TString sdk(project->sdkPath()); + + m_incPath.push_back(sdk + "/include/engine"); + m_incPath.push_back(sdk + "/include/modules"); + m_incPath.push_back(sdk + "/include/next"); + m_incPath.push_back(sdk + "/include/next/math"); + m_incPath.push_back(sdk + "/include/next/core"); + + m_libs.push_back("engine"); + m_libs.push_back("next"); + m_libs.push_back("physfs"); + m_libs.push_back("glfm"); + m_libs.push_back("bullet"); + m_libs.push_back("bullet3"); + m_libs.push_back("rendergl"); + m_libs.push_back("freetype"); + m_libs.push_back("uikit"); + m_libs.push_back("media"); + m_libs.push_back("angel"); + m_libs.push_back("angelscript"); } bool NativeCodeBuilder::buildProject() { @@ -41,13 +71,15 @@ bool NativeCodeBuilder::buildProject() { } void NativeCodeBuilder::onBuildFinished(int exitCode) { - if(exitCode == 0 && ProjectSettings::instance()->targetPath().isEmpty()) { - PluginManager::instance()->reloadPlugin(m_artifact); + if(exitCode == 0) { + if(ProjectSettings::instance()->targetPath().isEmpty()) { + PluginManager::instance()->reloadPlugin(m_artifact); + } + } - aInfo() << name() << "Build finished"; + aInfo() << name() << "Build finished"; + buildSuccessful(exitCode == 0); - buildSuccessful(); - } m_outdated = false; } @@ -64,12 +96,14 @@ void NativeCodeBuilder::generateProject() { ProjectSettings *mgr = ProjectSettings::instance(); + m_project = mgr->generatedPath() + "/"; + m_values[gSdkPath] = mgr->sdkPath(); - m_values[gIncludePaths] = formatList(m_includePath); - m_values[gLibraryPaths] = formatList(m_libPath); - m_values[gLibraries] = formatList(m_libs); - m_values[gFilesList] = formatList(StringList(m_sources.begin(), m_sources.end())); + m_values[gIncludePaths] = formatList(m_incPath, m_incPref, m_incSuff, m_incSep); + m_values[gLibraryPaths] = formatList(m_libPath, m_libPref, m_libSuff, m_libSep); + m_values[gLibraries] = formatList(m_libs, m_libsPref, m_libsSuff, m_libsSep); + m_values[gFilesList] = formatList(StringList(m_sources.begin(), m_sources.end()), m_filePref, m_fileSuff, m_fileSep); const MetaObject *meta = mgr->metaObject(); for(int i = 0; i < meta->propertyCount(); i++) { @@ -162,12 +196,12 @@ void NativeCodeBuilder::generateLoader(const TString &dst, const StringList &mod updateTemplate(dst + "/application.cpp", project() + "application.cpp"); } -TString NativeCodeBuilder::formatList(const StringList &list) const { +TString NativeCodeBuilder::formatList(const StringList &list, const TString &pref, const TString &suff, const TString &sep) const { TString result; for(int i = 0; i < list.size(); ++i) { - result += TString(12, ' ') + "\"" + (*std::next(list.begin(), i)) + "\""; + result += pref + (*std::next(list.begin(), i)) + suff; if(i < (list.size() - 1)) { - result += ','; + result += sep; } result += "\n"; } @@ -187,10 +221,3 @@ void NativeCodeBuilder::parseLogs(const TString &log) { } } } - -bool NativeCodeBuilder::isBundle(const TString &platform) const { - if(platform == "desktop") { - return false; - } - return true; -} diff --git a/engine/src/editor/pluginmanager.cpp b/engine/src/editor/pluginmanager.cpp index c025ba08c..9ab0df3a5 100644 --- a/engine/src/editor/pluginmanager.cpp +++ b/engine/src/editor/pluginmanager.cpp @@ -53,7 +53,7 @@ PluginManager::PluginManager() : m_initialWhiteList.push_back("MotionTools"); m_initialWhiteList.push_back("ParticleTools"); m_initialWhiteList.push_back("PipelineTools"); - m_initialWhiteList.push_back("QbsTools"); + m_initialWhiteList.push_back("BuildTools"); m_initialWhiteList.push_back("ShaderTools"); m_initialWhiteList.push_back("TextEditor"); m_initialWhiteList.push_back("TextureTools"); @@ -164,12 +164,12 @@ void PluginManager::init(Engine *engine) { QString uiKit; #if defined(Q_OS_UNIX)/* && !defined(Q_OS_MAC)*/ - uiKit = QCoreApplication::applicationDirPath() + "/../lib/uikit-editor." + gShared; + uiKit = QCoreApplication::applicationDirPath() + "/../lib/uikit-editor" + gShared; #else - uiKit = QCoreApplication::applicationDirPath() + "/uikit-editor." + gShared; + uiKit = QCoreApplication::applicationDirPath() + "/uikit-editor" + gShared; #endif - loadPlugin((QCoreApplication::applicationDirPath() + "/uikit-editor." + gShared).toStdString()); + loadPlugin((QCoreApplication::applicationDirPath() + "/uikit-editor" + gShared).toStdString()); rescanPath((QCoreApplication::applicationDirPath() + "/plugins").toStdString()); } @@ -339,7 +339,7 @@ bool PluginManager::rescanPath(const TString &path) { bool result = true; for(auto &it : File::list(path)) { Url url(it); - if(url.suffix() == gShared) { + if(TString(".") + url.suffix() == gShared) { result &= loadPlugin(it); } } diff --git a/engine/src/editor/projectsettings.cpp b/engine/src/editor/projectsettings.cpp index 6a54638ed..760325305 100644 --- a/engine/src/editor/projectsettings.cpp +++ b/engine/src/editor/projectsettings.cpp @@ -13,7 +13,7 @@ #include "config.h" #include "editor/assetmanager.h" -#include "editor/codebuilder.h" +#include "editor/nativecodebuilder.h" #include "editor/editorplatform.h" #include "editor/pluginmanager.h" @@ -70,13 +70,12 @@ void ProjectSettings::init(const TString &project, const TString &target) { m_contentPath = path.absoluteDir() + "/" + gContent; m_pluginsPath = path.absoluteDir() + "/" + gPlugins; m_cachePath = path.absoluteDir() + "/" + gCache; + m_platformsPath = path.absoluteDir() + "/" + gPlatforms; m_importPath = m_cachePath + "/" + gImport; m_iconPath = m_cachePath + "/" + gThumbnails; m_generatedPath = m_cachePath + "/" + gGenerated; - m_manifestFile = path.absoluteDir() + "/" + gPlatforms + "/android/AndroidManifest.xml"; - EditorPlatform::instance().setImportPath(m_importPath); File::mkPath(m_contentPath); @@ -138,8 +137,6 @@ void ProjectSettings::loadSettings() { } } } - - m_autoModules.insert("RenderGL"); } blockSignals(false); @@ -311,8 +308,8 @@ TString ProjectSettings::pluginsPath() const { return m_pluginsPath; } -TString ProjectSettings::manifestFile() const { - return m_manifestFile; +TString ProjectSettings::platformsPath() const { + return m_platformsPath; } TString ProjectSettings::sdkPath() const { @@ -334,6 +331,16 @@ TString ProjectSettings::myProjectsPath() const { StringList ProjectSettings::modules() const { std::set result = m_autoModules; result.insert(m_modules.begin(), m_modules.end()); + NativeCodeBuilder *builder = currentBuilder(); + if(builder) { + switch(builder->defaultRhi()) { + case NativeCodeBuilder::OpenGL: result.insert("RenderGL"); break; + case NativeCodeBuilder::Vulkan: result.insert("RenderVK"); break; + case NativeCodeBuilder::Metal: result.insert("RenderMT"); break; + default: break; + } + } + return StringList(result.begin(), result.end()); } @@ -350,7 +357,17 @@ std::map &ProjectSettings::plugins() { } void ProjectSettings::setCurrentPlatform(const TString &platform) { - m_currentPlatform = (platform.isEmpty()) ? "desktop" : platform; + if(platform.isEmpty()) { +#if defined(Q_OS_WIN) + m_currentPlatform = "windows"; +#elif defined(Q_OS_MAC) + m_currentPlatform = "macos"; +#elif defined(Q_OS_UNIX) + m_currentPlatform = "linux"; +#endif + } else { + m_currentPlatform = platform; + } m_importPath = m_cachePath + (platform.isEmpty() ? "" : TString("/") + m_currentPlatform) + TString("/") + gImport; EditorPlatform::instance().setImportPath(m_importPath); @@ -362,11 +379,11 @@ TString ProjectSettings::currentPlatformName() const { return m_currentPlatform; } -CodeBuilder *ProjectSettings::currentBuilder(const TString &platform) const { +NativeCodeBuilder *ProjectSettings::currentBuilder(const TString &platform) const { TString key(platform.isEmpty() ? m_currentPlatform : platform); auto it = m_supportedPlatforms.find(key); if(it != m_supportedPlatforms.end()) { - return it->second; + return dynamic_cast(it->second); } return nullptr; } diff --git a/engine/src/engine.cpp b/engine/src/engine.cpp index 248a77b28..6024bf992 100644 --- a/engine/src/engine.cpp +++ b/engine/src/engine.cpp @@ -53,7 +53,6 @@ namespace { static const char *gObjects("objects"); static const char *gEntry(".entry"); - static const char *gRhi(".rhi"); static const char *gCompany(".company"); static const char *gProject(".project"); @@ -198,7 +197,7 @@ bool Engine::init() { #ifdef THUNDER_MOBILE return setPlatformAdaptor(new MobileAdaptor); #else - return setPlatformAdaptor(new DesktopAdaptor(value(gRhi, "").toString())); + return setPlatformAdaptor(new DesktopAdaptor); #endif } /*! @@ -214,7 +213,6 @@ bool Engine::start() { for(auto it : m_pool) { if(!it->m_system->init()) { aError() << "Failed to initialize system:" << it->m_system->name(); - m_platform->stop(); return false; } } @@ -222,7 +220,6 @@ bool Engine::start() { for(auto it : m_serial) { if(!it->init()) { aError() << "Failed to initialize system:" << it->name(); - m_platform->stop(); return false; } } @@ -232,17 +229,11 @@ bool Engine::start() { TString path = value(gEntry, "").toString(); if(loadScene(path, false) == nullptr) { aError() << "Unable to load first scene:" << path; - m_platform->stop(); return false; } -#ifndef THUNDER_MOBILE - while(m_platform->isValid()) { - Timer::update(); - update(); - } - m_platform->stop(); -#endif + m_platform->loop(); + return true; } /*! diff --git a/engine/src/gizmos.cpp b/engine/src/gizmos.cpp index 99ca95a4c..39d08a0e5 100644 --- a/engine/src/gizmos.cpp +++ b/engine/src/gizmos.cpp @@ -131,6 +131,7 @@ void Gizmos::drawBox(const Vector3 ¢er, const Vector3 &size, const Vector4 & 1, 6, 2, 1, 5, 6, // right }); mesh.setColors(Vector4Vector(mesh.vertices().size(), color)); + mesh.setUv0(Vector2Vector(mesh.vertices().size(), Vector2())); s_solid->batchMesh(mesh, &transform); } @@ -234,6 +235,7 @@ void Gizmos::drawSphere(const Vector3 ¢er, float radius, const Vector4 &colo mesh.setVertices(vertices); mesh.setIndices(indices); mesh.setColors(Vector4Vector(mesh.vertices().size(), color)); + mesh.setUv0(Vector2Vector(mesh.vertices().size(), Vector2())); s_solid->batchMesh(mesh, &transform); } @@ -256,6 +258,7 @@ void Gizmos::drawSolidArc(const Vector3 ¢er, float radius, float start, floa } mesh.setIndices(indices); mesh.setColors(Vector4Vector(size, color)); + mesh.setUv0(Vector2Vector(mesh.vertices().size(), Vector2())); Matrix4 t(transform); t[12] += center.x; @@ -274,6 +277,7 @@ void Gizmos::drawLines(const Vector3Vector &points, const IndexVector &indices, mesh.setVertices(points); mesh.setIndices(indices); mesh.setColors(Vector4Vector(points.size(), color)); + mesh.setUv0(Vector2Vector(mesh.vertices().size(), Vector2())); s_wire->batchMesh(mesh, &transform); } @@ -295,6 +299,7 @@ void Gizmos::drawArc(const Vector3 ¢er, float radius, float start, float ang } mesh.setIndices(indices); mesh.setColors(Vector4Vector(size, color)); + mesh.setUv0(Vector2Vector(mesh.vertices().size(), Vector2())); Matrix4 t(transform); t[12] += center.x; @@ -329,6 +334,7 @@ void Gizmos::drawRectangle(const Vector3 ¢er, const Vector2 &size, const Vec 0, 1, 1, 2, 2, 3, 3, 0 }); mesh.setColors(Vector4Vector(mesh.vertices().size(), color)); + mesh.setUv0(Vector2Vector(mesh.vertices().size(), Vector2())); s_wire->batchMesh(mesh, &transform); } @@ -356,6 +362,7 @@ void Gizmos::drawWireBox(const Vector3 ¢er, const Vector3 &size, const Vecto 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7}); mesh.setColors(Vector4Vector(mesh.vertices().size(), color)); + mesh.setUv0(Vector2Vector(mesh.vertices().size(), Vector2())); s_wire->batchMesh(mesh, &transform); } @@ -368,6 +375,7 @@ void Gizmos::drawWireMesh(Mesh &mesh, const Vector4 &color, const Matrix4 &trans m.setVertices(mesh.vertices()); m.setIndices(mesh.indices()); m.setColors(Vector4Vector(m.vertices().size(), color)); + mesh.setUv0(Vector2Vector(mesh.vertices().size(), Vector2())); s_wire->batchMesh(m, &transform); } diff --git a/engine/src/resources/mesh.cpp b/engine/src/resources/mesh.cpp index 36fc5049f..fd5aea17f 100644 --- a/engine/src/resources/mesh.cpp +++ b/engine/src/resources/mesh.cpp @@ -261,7 +261,7 @@ int Mesh::indexCount(int sub) const { return m_indices.size() - (m_offsets.empty() ? 0 : m_offsets[offsetId]); } /*! - Recalculates the normals of the Mesh from the triangles and vertices. + Recalculates normals of the Mesh from the triangles and vertices. */ void Mesh::recalcNormals() { m_normals.clear(); @@ -277,12 +277,73 @@ void Mesh::recalcNormals() { m_normals[index2] += n; m_normals[index3] += n; } - for(auto it : m_normals) { + for(auto &it : m_normals) { it.normalize(); } switchState(ToBeUpdated); } +/*! + Recalculates tangents of the Mesh from the triangles and UV's. +*/ +void Mesh::recalcTangents() { + m_tangents.clear(); + m_tangents.resize(m_vertices.size()); + + for(uint32_t i = 0; i < m_indices.size(); i += 3) { + uint32_t index1 = m_indices[i]; + uint32_t index2 = m_indices[i + 1]; + uint32_t index3 = m_indices[i + 2]; + + const Vector3& v1 = m_vertices[index1]; + const Vector3& v2 = m_vertices[index2]; + const Vector3& v3 = m_vertices[index3]; + + const Vector2& w1 = m_uv0[index1]; + const Vector2& w2 = m_uv0[index2]; + const Vector2& w3 = m_uv0[index3]; + + Vector3 edge1 = v2 - v1; + Vector3 edge2 = v3 - v1; + Vector2 deltaUV1 = w2 - w1; + Vector2 deltaUV2 = w3 - w1; + + float det = deltaUV1.x * deltaUV2.y - deltaUV2.x * deltaUV1.y; + if(fabs(det) < 1e-6f) { + Vector3 arbitrary; + if(fabs(m_normals[index1].x) > 0.1f) { + arbitrary = Vector3(m_normals[index1].y, -m_normals[index1].x, 0.0f); + } else { + arbitrary = Vector3(0.0f, m_normals[index1].z, -m_normals[index1].y); + } + + arbitrary.normalize(); + + m_tangents[index1] = arbitrary; + m_tangents[index2] = arbitrary; + m_tangents[index3] = arbitrary; + continue; + } + + float invDet = 1.0f / det; + + Vector3 tangent = (edge1 * deltaUV2.y - edge2 * deltaUV1.y) * invDet; + + m_tangents[index1] += tangent; + m_tangents[index2] += tangent; + m_tangents[index3] += tangent; + } + + for(size_t i = 0; i < m_vertices.size(); i++) { + const Vector3& n = m_normals[i]; + Vector3& t = m_tangents[i]; + + t = t - n * n.dot(t); + t.normalize(); + } + + switchState(ToBeUpdated); +} /*! Generates bound box according new geometry. */ @@ -391,7 +452,7 @@ void Mesh::loadUserData(const VariantMap &data) { i++; vertexData = (*i).toByteArray(); m_vertices.resize(vCount); - memcpy(m_vertices.data(), &vertexData[0], sizeof(Vector3) * vCount); + memcpy(m_vertices.data(), &vertexData[0], sizeof(Vector3) * vCount); for(uint32_t i = 0; i < vCount; i++) { min.x = MIN(min.x, m_vertices[i].x); min.y = MIN(min.y, m_vertices[i].y); diff --git a/engine/src/resources/texture.cpp b/engine/src/resources/texture.cpp index 7c19e5c5a..8fa001808 100644 --- a/engine/src/resources/texture.cpp +++ b/engine/src/resources/texture.cpp @@ -363,12 +363,23 @@ bool Texture::isArray() const { uint8_t Texture::components() const { switch(m_format) { case R8: return 1; - case RGB8: case R11G11B10Float: return 3; default: break; } return 4; } +/*! + \internal + Returns bytes per pixel +*/ +uint8_t Texture::bytesPerChannel() const { + switch(m_format) { + case RGBA16Float: return 2; + case RGBA32Float: return 4; + default: break; + } + return 1; +} /*! \internal */ @@ -415,13 +426,7 @@ void Texture::setMaxCubemapSize(uint32_t size) { \internal */ int32_t Texture::sizeRGB(int32_t width, int32_t height, int32_t depth) const { - int32_t s = 1; - switch(m_format) { - case RGBA32Float: s = 4; break; - case RGBA16Float: s = 2; break; - default: break; - } - return width * height * depth * components() * s; + return width * height * depth * components() * bytesPerChannel(); } /*! \internal diff --git a/engine/src/systems/rendersystem.cpp b/engine/src/systems/rendersystem.cpp index ea15277cc..cea6b62c1 100644 --- a/engine/src/systems/rendersystem.cpp +++ b/engine/src/systems/rendersystem.cpp @@ -35,6 +35,7 @@ #include "pipelinecontext.h" int32_t RenderSystem::m_registered = 0; +void *RenderSystem::m_windowHandle = nullptr; std::list RenderSystem::m_lightComponents; std::list RenderSystem::m_renderableComponents; @@ -203,3 +204,11 @@ QWindow *RenderSystem::createRhiWindow(Viewport *viewport) { return nullptr; } #endif + +void *RenderSystem::windowHandle() { + return m_windowHandle; +} + +void RenderSystem::setWindowHandle(void *handle) { + m_windowHandle = handle; +} diff --git a/modules/editor/CMakeLists.txt b/modules/editor/CMakeLists.txt index 18b264b53..664a6648b 100644 --- a/modules/editor/CMakeLists.txt +++ b/modules/editor/CMakeLists.txt @@ -7,7 +7,7 @@ add_subdirectory(iostools) add_subdirectory(motiontools) add_subdirectory(particletools) add_subdirectory(pipelinetools) -add_subdirectory(qbstools) +add_subdirectory(buildtools) add_subdirectory(shadertools) add_subdirectory(spineimporter) add_subdirectory(texturetools) diff --git a/modules/editor/qbstools/CMakeLists.txt b/modules/editor/buildtools/CMakeLists.txt similarity index 98% rename from modules/editor/qbstools/CMakeLists.txt rename to modules/editor/buildtools/CMakeLists.txt index d129ba5df..f29772924 100644 --- a/modules/editor/qbstools/CMakeLists.txt +++ b/modules/editor/buildtools/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) -project(qbstools) +project(buildtools) file(GLOB ${PROJECT_NAME}_srcFiles "*.cpp" @@ -47,7 +47,6 @@ if (desktop) target_link_libraries(${PROJECT_NAME} PRIVATE next-editor engine-editor - Qt5::Core Qt5::Gui ) diff --git a/modules/editor/buildtools/buildtools.cpp b/modules/editor/buildtools/buildtools.cpp new file mode 100644 index 000000000..20086b7ea --- /dev/null +++ b/modules/editor/buildtools/buildtools.cpp @@ -0,0 +1,73 @@ +#include "buildtools.h" + +#include + +#include "converter/vsbuilder.h" +#include "converter/androidbuilder.h" +#include "converter/xcodebuilder.h" +#include "converter/linuxbuilder.h" + +static const char *meta = \ +"{" +" \"module\": \"BuildTools\"," +" \"version\": \"1.0\"," +" \"description\": \"Build Tools plugin\"," +" \"author\": \"Evgeniy Prikazchikov\"," +" \"objects\": {" +" \"AndroidBuilder\": \"converter\"," +" \"XcodeBuilder\": \"converter\"," +" \"VsBuilder\": \"converter\"," +" \"LinuxBuilder\": \"converter\"" +" }" +"}"; + +Module *moduleCreate(Engine *engine) { + return new BuildTools(engine); +} + +BuildTools::BuildTools(Engine *engine) : + Module(engine) { +} + +const char *BuildTools::metaInfo() const { + return meta; +} + +void *BuildTools::getObject(const char *name) { +#ifdef Q_OS_WINDOWS + if(TString("VsBuilder") == name) { + static VsBuilder *builder = nullptr; + if(builder == nullptr) { + builder = new VsBuilder; + } + return builder; + } +#endif +#ifdef Q_OS_OSX + if(TString("XcodeBuilder") == name) { + static XcodeBuilder *builder = nullptr; + if(builder == nullptr) { + builder = new XcodeBuilder; + } + return builder; + } +#endif +#ifdef Q_OS_LINUX + if(TString("LinuxBuilder") == name) { + static LinuxBuilder *builder = nullptr; + if(builder == nullptr) { + builder = new LinuxBuilder; + } + return builder; + } +#endif + if(TString("AndroidBuilder") == name) { + static AndroidBuilder *builder = nullptr; + if(builder == nullptr) { + builder = new AndroidBuilder; + } + return builder; + } + + return nullptr; +} diff --git a/modules/editor/iostools/iostools.h b/modules/editor/buildtools/buildtools.h similarity index 60% rename from modules/editor/iostools/iostools.h rename to modules/editor/buildtools/buildtools.h index 920d3a617..8044e4101 100644 --- a/modules/editor/iostools/iostools.h +++ b/modules/editor/buildtools/buildtools.h @@ -1,11 +1,11 @@ -#ifndef IOSTOOLS_H -#define IOSTOOLS_H +#ifndef BUILDTOOLS_H +#define BUILDTOOLS_H #include -class IosTools : public Module { +class BuildTools : public Module { public: - IosTools(Engine *engine); + BuildTools(Engine *engine); const char *metaInfo() const override; @@ -17,4 +17,4 @@ extern "C" { MODULE_EXPORT Module *moduleCreate(Engine *engine); } -#endif // IOSTOOLS_H +#endif // BUILDTOOLS_H diff --git a/modules/editor/qbstools/qbstools.qbs b/modules/editor/buildtools/buildtools.qbs similarity index 62% rename from modules/editor/qbstools/qbstools.qbs rename to modules/editor/buildtools/buildtools.qbs index 5c8325fcb..09472e68f 100644 --- a/modules/editor/qbstools/qbstools.qbs +++ b/modules/editor/buildtools/buildtools.qbs @@ -1,7 +1,7 @@ import qbs Project { - id: qbstools + id: buildtools property stringList srcFiles: [ "*.cpp", "converter/*.cpp", @@ -19,24 +19,28 @@ Project { "../../../thirdparty/next/inc", "../../../thirdparty/next/inc/math", "../../../thirdparty/next/inc/core", + "../../../thirdparty/zlib/src", + "../../../thirdparty/minizip" ] DynamicLibrary { - name: "qbstools" - condition: qbstools.desktop - files: qbstools.srcFiles + name: "buildtools" + condition: buildtools.desktop + files: buildtools.srcFiles Depends { name: "cpp" } Depends { name: "bundle" } Depends { name: "next-editor" } Depends { name: "engine-editor" } - Depends { name: "Qt"; submodules: ["core", "gui"]; } + Depends { name: "minizip" } + Depends { name: "zlib-editor" } + Depends { name: "Qt"; submodules: ["gui"]; } bundle.isBundle: false cpp.defines: ["SHARED_DEFINE"] - cpp.includePaths: qbstools.incPaths - cpp.cxxLanguageVersion: qbstools.languageVersion - cpp.cxxStandardLibrary: qbstools.standardLibrary - cpp.minimumMacosVersion: qbstools.osxVersion + cpp.includePaths: buildtools.incPaths + cpp.cxxLanguageVersion: buildtools.languageVersion + cpp.cxxStandardLibrary: buildtools.standardLibrary + cpp.minimumMacosVersion: buildtools.osxVersion Properties { condition: qbs.targetOS.contains("linux") @@ -45,15 +49,15 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { name: "Install Plugin" fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] qbs.install: true - qbs.installDir: qbstools.PLUGINS_PATH - qbs.installPrefix: qbstools.PREFIX + qbs.installDir: buildtools.PLUGINS_PATH + qbs.installPrefix: buildtools.PREFIX } } } diff --git a/modules/editor/buildtools/converter/androidbuilder.cpp b/modules/editor/buildtools/converter/androidbuilder.cpp new file mode 100644 index 000000000..d32e16226 --- /dev/null +++ b/modules/editor/buildtools/converter/androidbuilder.cpp @@ -0,0 +1,389 @@ +#include "androidbuilder.h" +#include "config.h" + +#include +#include + +#include +#include +#include + +#include + +namespace { + const char *gAndroidJava("Builder/Android/Java_Path"); + const char *gAndroidSdk("Builder/Android/SDK_Path"); + const char *gAndroidNdk("Builder/Android/NDK_Path"); + const char *gEditorPath("editor=Path"); + + const char *gSdkVersion("29"); +} + +AndroidBuilder::AndroidBuilder() { + setName("[AndroidBuilder]"); + + EditorSettings *settings = EditorSettings::instance(); + + settings->registerValue(gAndroidJava, "", gEditorPath); + settings->registerValue(gAndroidSdk, "", gEditorPath); + settings->registerValue(gAndroidNdk, "", gEditorPath); + + m_libs.push_back("atomic"); + m_libs.push_back("m"); + m_libs.push_back("EGL"); + m_libs.push_back("GLESv3"); + m_libs.push_back("android"); + m_libs.push_back("log"); +} + +bool AndroidBuilder::buildProject() { + if(m_outdated && !m_process.isRunning()) { + EditorSettings *settings = EditorSettings::instance(); + + TString sdkPath = settings->value(gAndroidSdk).toString(); + if(sdkPath.isEmpty()) { + aCritical() << name() << "Can't find the Android SDK by the path:" << sdkPath; + return false; + } + + TString ndkPath = settings->value(gAndroidNdk).toString(); + if(ndkPath.isEmpty()) { + aCritical() << name() << "Can't find the Android NDK by the path:" << ndkPath; + return false; + } + + TString toolChains = ndkPath + "/toolchains/llvm/prebuilt/windows-x86_64"; + + TString javaPath = EditorSettings::instance()->value(gAndroidJava).toString(); + if(javaPath.isEmpty()) { + aCritical() << name() << "Can't find the Java by the path:" << javaPath; + return false; + } + javaPath += "/bin"; + + TString buildTools = sdkPath + "/build-tools/35.0.0"; + + generateProject(); + + ProjectSettings *mgr = ProjectSettings::instance(); + m_projectPath = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/release"; + m_artifact = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/base.apk"; + m_keystorePath = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/debug.keystore"; + + File::mkPath(m_projectPath); + + m_process.setWorkingDirectory(m_project); + + static const StringList archs = {"arm64", "x86_64"}; + + bool result = true; + for(auto &it : archs) { + result &= compileNative(toolChains, it); + } + if(!result) { + return false; + } + + compileResources(buildTools); + + if(!linkResources(buildTools, sdkPath)) { + return false; + } + + if(!package()) { + return false; + } + + if(!makeKeystore(javaPath)) { + return false; + } + + // Connect on last step + connect(&m_process, _SIGNAL(finished(int)), this, _SLOT(onBuildFinished(int))); + + if(!signPackage(javaPath, buildTools)) { + return false; + } + } + + return true; +} + +void AndroidBuilder::generateProject() { + NativeCodeBuilder::generateProject(); + + ProjectSettings *mgr = ProjectSettings::instance(); + + updateTemplate(":/templates/android/AndroidManifest.xml", mgr->platformsPath() + "/android/AndroidManifest.xml"); + updateTemplate(":/templates/android/res/xml/backup_rules.xml", mgr->platformsPath() + "/android/res/xml/backup_rules.xml"); + updateTemplate(":/templates/android/res/values/strings.xml", mgr->platformsPath() + "/android/res/values/strings.xml"); + + File::mkDir(mgr->platformsPath() + "/android/res"); + + StringList res = { + "/android/res/mipmap-anydpi/ic_launcher.xml", + "/android/res/mipmap-anydpi/ic_launcher_round.xml", + "/android/res/drawable/ic_launcher_background.xml", + "/android/res/drawable/ic_launcher_foreground.xml" + }; + + for(auto &it : res) { + copyTempalte(TString(":/templates") + it, mgr->platformsPath() + it); + } +} + +bool AndroidBuilder::compileNative(const TString &tools, const TString &arch) { + TString dir = m_projectPath + "/" + arch; + if(!File::exists(dir) && !File::mkDir(dir)) { + return false; + } + + StringList args; + + TString profile = (arch == "arm64") ? "aarch64" : arch; + + args.push_back(TString("--target=") + profile + "-linux-androideabi" + gSdkVersion); + args.push_back(TString("--sysroot=") + tools + "/sysroot"); + args.push_back("-fPIC"); + args.push_back("-g"); + args.push_back("-shared"); + args.push_back("-std=c++17"); + args.push_back("-O2"); + + args.push_back("-DTHUNDER_MOBILE"); + args.push_back("-DANDROID"); + args.push_back("-D_FORTIFY_SOURCE=2"); + + args.push_back("-fdata-sections"); + args.push_back("-ffunction-sections"); + args.push_back("-funwind-tables"); + args.push_back("-fstack-protector-strong"); + args.push_back("-fno-limit-debug-info"); + args.push_back("-no-canonical-prefixes"); + args.push_back("-static-libstdc++"); + args.push_back("-Qunused-arguments"); + args.push_back("-Wl,-soname,libapplication.so"); + args.push_back("-Wl,--build-id=sha1"); + args.push_back("-Wl,--no-undefined-version"); + args.push_back("-Wl,--fatal-warnings"); + args.push_back("-Wl,--no-undefined"); + args.push_back("-Wl,--strip-debug"); // To remove debug information + args.push_back("-Wformat"); + args.push_back("-Werror=format-security"); + + args.push_back("application.cpp"); + args.push_back("-o"); + args.push_back(m_projectPath + "/" + arch + "/libapplication.so"); + + for(auto &it : m_incPath) { + args.push_back(TString("-I") + it); + } + + args.push_back(TString("-L") + ProjectSettings::instance()->sdkPath() + "/android/" + arch + "/static"); + + for(auto &it : m_libs) { + args.push_back(TString("-l") + it); + } + + if(m_process.start(tools + "/bin/clang++" + gApplication, args) && m_process.waitForStarted()) { + aInfo() << name() << "Compiling application for:" << arch; + return m_process.waitForFinished(); + } + + return false; +} + +bool AndroidBuilder::compileResources(const TString &tools) { + ProjectSettings *mgr = ProjectSettings::instance(); + + TString compiled = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/compiled"; + + File::mkDir(compiled); + + compiled += '/'; +#ifdef Q_OS_WINDOWS + compiled.replace('/', '\\'); +#endif + + for(auto &it : File::list(mgr->platformsPath() + "/android/res")) { + if(File::isDir(it)) { + continue; + } +#ifdef Q_OS_WINDOWS + it.replace('/', '\\'); +#endif + StringList args; + + args.push_back("compile"); + args.push_back(it); + args.push_back("-o"); + args.push_back(compiled); + + if(m_process.start(tools + "/aapt2" + gApplication, args) && m_process.waitForStarted()) { + aInfo() << name() << "Compiling resource:" << it; + m_process.waitForFinished(); + } + } + + return true; +} + +bool AndroidBuilder::linkResources(const TString &tools, const TString &sdk) { + ProjectSettings *mgr = ProjectSettings::instance(); + + StringList args; + + args.push_back("link"); + args.push_back("-o"); + args.push_back(m_artifact); + args.push_back("-I"); + args.push_back(sdk + "/platforms/android-" + gSdkVersion + "/android.jar"); + args.push_back("--manifest"); + args.push_back(mgr->platformsPath() + "/android/AndroidManifest.xml"); + args.push_back("--min-sdk-version"); + args.push_back(gSdkVersion); + args.push_back("--target-sdk-version"); + args.push_back("30"); + args.push_back("--version-code"); + args.push_back("1"); + args.push_back("--version-name"); + args.push_back(mgr->projectVersion()); + + for(auto &it : File::list(mgr->cachePath() + "/" + mgr->currentPlatformName() + "/compiled")) { + args.push_back(it); + } + + args.push_back("--auto-add-overlay"); + + if(m_process.start(tools + "/aapt2" + gApplication, args) && m_process.waitForStarted()) { + aInfo() << name() << "Linking Resources."; + return m_process.waitForFinished(); + } + + return false; +} + +bool AndroidBuilder::makeKeystore(const TString &java) { + if(File::exists(m_keystorePath)) { + return true; + } + + StringList args; + + args.push_back("-genkey"); + args.push_back("-v"); + args.push_back("-keystore"); + args.push_back(m_keystorePath); + args.push_back("-alias"); + args.push_back("androiddebugkey"); + args.push_back("-keyalg"); + args.push_back("RSA"); + args.push_back("-keysize"); + args.push_back("2048"); + args.push_back("-validity"); + args.push_back("10000"); + args.push_back("-storepass"); + args.push_back("android"); + args.push_back("-keypass"); + args.push_back("android"); + args.push_back("-dname"); + args.push_back("\"CN=Android Debug,O=Android,C=US\""); + + if(m_process.start(java + "/keytool" + gApplication, args) && m_process.waitForStarted()) { + aInfo() << name() << "Generate temporary keystore for signing."; + return m_process.waitForFinished(); + } + + return false; +} + +bool AndroidBuilder::signPackage(const TString &java, const TString &tools) { + ProjectSettings *mgr = ProjectSettings::instance(); + + StringList args; + + TString out = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/signed.apk"; + + args.push_back("-Xmx1024M"); + args.push_back("-Xss1m"); + args.push_back("-jar"); + args.push_back(tools + "/lib/apksigner.jar"); + args.push_back("sign"); + args.push_back("--ks"); + args.push_back(m_keystorePath); + args.push_back("--ks-pass"); + args.push_back("pass:android"); + args.push_back("--out"); + args.push_back(out); + args.push_back(m_artifact); + + mgr->setArtifacts({ out }); + + if(m_process.start(java + "/java" + gApplication, args) && m_process.waitForStarted()) { + aInfo() << name() << "Package signing."; + return m_process.waitForFinished(); + } + + return false; +} + +bool AndroidBuilder::package() { + zipFile zf = zipOpen(m_artifact.data(), APPEND_STATUS_ADDINZIP); + if(!zf) { + aError() << "Can't open package."; + return false; + } + + aInfo() << name() << "Assets packaging."; + + zip_fileinfo zi = {0}; + + StringList list(File::list(ProjectSettings::instance()->importPath())); + for(auto &it : list) { + Url info(it); + + File inFile(it); + if(!inFile.open(File::ReadOnly)) { + zipClose(zf, nullptr); + aError() << "Can't open input file."; + return false; + } + + zipOpenNewFileInZip(zf, (TString("assets/") + info.name()).data(), &zi, nullptr, 0, nullptr, 0, nullptr, Z_DEFLATED, Z_DEFAULT_COMPRESSION); + + ByteArray data(inFile.readAll()); + inFile.close(); + + zipWriteInFileInZip(zf, data.data(), data.size()); + zipCloseFileInZip(zf); + } + + aInfo() << name() << "Native code packaging."; + + for(auto &it : File::list(m_projectPath)) { + if(File::isDir(it)) { + continue; + } + + File inFile(it); + if(!inFile.open(File::ReadOnly)) { + zipClose(zf, nullptr); + aError() << "Can't open input file."; + return false; + } + + TString dir = Url(it).dir().split('/').back(); + + zipOpenNewFileInZip(zf, (TString("lib/") + ((dir == "arm64") ? "arm64-v8a" : dir) + "/libapplication.so").data(), &zi, nullptr, 0, nullptr, 0, nullptr, Z_DEFLATED, Z_NO_COMPRESSION); + + ByteArray data(inFile.readAll()); + inFile.close(); + + zipWriteInFileInZip(zf, data.data(), data.size()); + zipCloseFileInZip(zf); + } + + zipClose(zf, nullptr); + + return true; +} diff --git a/modules/editor/buildtools/converter/androidbuilder.h b/modules/editor/buildtools/converter/androidbuilder.h new file mode 100644 index 000000000..4408a86ac --- /dev/null +++ b/modules/editor/buildtools/converter/androidbuilder.h @@ -0,0 +1,38 @@ +#ifndef ANDROIDBUILDER_H +#define ANDROIDBUILDER_H + +#include + +class AndroidBuilder : public NativeCodeBuilder { + A_OBJECT(AndroidBuilder, NativeCodeBuilder, Core) + +public: + AndroidBuilder(); + +protected: + bool buildProject() override; + + bool compileNative(const TString &tools, const TString &arch); + + bool compileResources(const TString &tools); + bool linkResources(const TString &tools, const TString &sdk); + + bool makeKeystore(const TString &java); + bool signPackage(const TString &java, const TString &tools); + + bool package(); + + StringList platforms() const override { return {"android"}; } + + void generateProject() override; + + PackagingMode packagingMode() const override { return None; } + bool isEmbedded() const override { return true; } + +private: + TString m_projectPath; + TString m_keystorePath; + +}; + +#endif // ANDROIDBUILDER_H diff --git a/modules/editor/buildtools/converter/linuxbuilder.cpp b/modules/editor/buildtools/converter/linuxbuilder.cpp new file mode 100644 index 000000000..136bd858a --- /dev/null +++ b/modules/editor/buildtools/converter/linuxbuilder.cpp @@ -0,0 +1,92 @@ +#include "linuxbuilder.h" + +#include + +#include +#include +#include + +#include +#include + +namespace { + const char *gEditorSuffix("-editor"); + +#ifndef NDEBUG + const char *gMode("release"); +#else + const char *gMode("debug"); +#endif +} + +LinuxBuilder::LinuxBuilder() { + setName("[LinuxBuilder]"); + + connect(&m_process, _SIGNAL(finished(int)), this, _SLOT(onBuildFinished(int))); + + m_libs.push_back("vorbis"); + m_libs.push_back("vorbisfile"); + m_libs.push_back("ogg"); + m_libs.push_back("zlib"); +} + +bool LinuxBuilder::isEmpty() const { + return (ProjectSettings::instance()->currentPlatformName() != "linux"); +} + +bool LinuxBuilder::buildProject() { + if(m_outdated && !m_process.isRunning()) { + aInfo() << name() << "Build started."; + + generateProject(); + + ProjectSettings *mgr = ProjectSettings::instance(); + + TString product = mgr->projectName(); + TString path = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/" + gMode + "/"; + + File::mkPath(path); + + m_libPath.clear(); + if(mgr->targetPath().isEmpty()) { + m_artifact = path + gPrefix + product + gShared; + } else { + m_libPath.push_back(ProjectSettings::instance()->sdkPath() + "/linux/x86/static"); + m_artifact = path + product; + } + + mgr->setArtifacts({ m_artifact }); + + StringList args; + for(auto &it : m_incPath) { + args.push_back(TString("-I") + it); + } + + for(auto &it : m_libPath) { + args.push_back(TString("-L") + it); + } + + for(auto &it : m_libs) { + args.push_back(TString("-l") + it); + } + + args.push_back("-std=c++20"); +#ifdef NDEBUG + args.push_back("-O3"); +#endif + if(mgr->targetPath().isEmpty()) { + args.push_back("plugin.cpp"); + } else { + args.push_back("application.cpp"); + } + args.push_back("-o"); + args.push_back(m_artifact); + + m_process.setWorkingDirectory(m_project); + if(m_process.start("clang", args) && !m_process.waitForStarted()) { + aError() << name() << "Failed to start process."; + return false; + } + } + return true; +} diff --git a/modules/editor/buildtools/converter/linuxbuilder.h b/modules/editor/buildtools/converter/linuxbuilder.h new file mode 100644 index 000000000..9f13085e0 --- /dev/null +++ b/modules/editor/buildtools/converter/linuxbuilder.h @@ -0,0 +1,21 @@ +#ifndef LINUXBUILDER_H +#define LINUXBUILDER_H + +#include +#include + +class LinuxBuilder : public NativeCodeBuilder { + A_OBJECT(LinuxBuilder, NativeCodeBuilder, Core) + +public: + LinuxBuilder(); + +protected: + bool isEmpty() const override; + + bool buildProject() override; + + StringList platforms() const override { return {"linux"}; } +}; + +#endif // LINUXBUILDER_H diff --git a/modules/editor/buildtools/converter/vsbuilder.cpp b/modules/editor/buildtools/converter/vsbuilder.cpp new file mode 100644 index 000000000..ff084b678 --- /dev/null +++ b/modules/editor/buildtools/converter/vsbuilder.cpp @@ -0,0 +1,87 @@ +#include "vsbuilder.h" + +#include +#include +#include +#include + +#include +#include + +namespace { + const char *gEditorSuffix("-editor"); + +#ifndef _DEBUG + const char *gMode("Release"); +#else + const char *gMode("Debug"); +#endif +} + +VsBuilder::VsBuilder() { + setName("[VsBuilder]"); + + connect(&m_process, _SIGNAL(finished(int)), this, _SLOT(onBuildFinished(int))); + + TString vswherePath("C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"); + + if(File::exists(vswherePath)) { + Process vswhere; + if(vswhere.start(vswherePath, {"-latest", "-property", "installationPath"})) { + if(vswhere.waitForStarted() && vswhere.waitForFinished()) { + m_vsPath = vswhere.readAllStandardOutput().trimmed(); + if(!m_vsPath.isEmpty()) { + m_vsPath.replace('\\', '/'); + m_vsPath += "/Msbuild/Current/Bin/MSBuild.exe"; + } + } + } + } + + m_filePref = " "; m_fileSep = ""; +} + +bool VsBuilder::buildProject() { + if(m_outdated && !m_process.isRunning()) { + generateProject(); + + ProjectSettings *mgr = ProjectSettings::instance(); + + StringList args; + + TString product = mgr->projectName(); + TString path = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/" + gMode + "/"; + if(mgr->targetPath().isEmpty()) { + product += gEditorSuffix; + m_artifact = path + gPrefix + product + gShared; + args = {"project-editor.vcxproj", TString("/p:Configuration=") + gMode, "/p:Platform=\"x64\"", "/verbosity:minimal", "/nologo"}; + } else { + m_artifact = path + product + gApplication; + args = {"project.vcxproj", TString("/p:Configuration=") + gMode, "/p:Platform=\"x64\"", "/verbosity:minimal", "/nologo"}; + } + mgr->setArtifacts({ m_artifact }); + + ProcessEnvironment env = ProcessEnvironment::systemEnvironment(); + env.insert("VSLANG", "1033"); + + m_process.setProcessEnvironment(env); + m_process.setWorkingDirectory(m_project); + if(!m_process.start(m_vsPath, args) || !m_process.waitForStarted()) { + aError() << name() << "Failed to start process"; + return false; + } + } + return true; +} + +void VsBuilder::generateProject() { + NativeCodeBuilder::generateProject(); + + ProjectSettings *mgr = ProjectSettings::instance(); + + m_project = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/"; + + updateTemplate(":/templates/windows/project.sln", m_project + mgr->projectName() + ".sln"); + updateTemplate(":/templates/windows/project.vcxproj", m_project + "project.vcxproj"); + updateTemplate(":/templates/windows/project-editor.vcxproj", m_project + "project-editor.vcxproj"); +} diff --git a/modules/editor/buildtools/converter/vsbuilder.h b/modules/editor/buildtools/converter/vsbuilder.h new file mode 100644 index 000000000..a89bbe61b --- /dev/null +++ b/modules/editor/buildtools/converter/vsbuilder.h @@ -0,0 +1,24 @@ +#ifndef VSBUILDER_H +#define VSBUILDER_H + +#include + +class VsBuilder : public NativeCodeBuilder { + A_OBJECT(VsBuilder, NativeCodeBuilder, Core) + +public: + VsBuilder(); + +protected: + bool buildProject() override; + + StringList platforms() const override { return {"windows"}; } + + void generateProject() override; + +protected: + TString m_vsPath; + +}; + +#endif // VSBUILDER_H diff --git a/modules/editor/buildtools/converter/xcodebuilder.cpp b/modules/editor/buildtools/converter/xcodebuilder.cpp new file mode 100644 index 000000000..eedbd6b14 --- /dev/null +++ b/modules/editor/buildtools/converter/xcodebuilder.cpp @@ -0,0 +1,167 @@ +#include "xcodebuilder.h" + +#include + +#include +#include + +namespace { + const char *gPlatformName("${platformName}"); + const char *gDeviceFamily("${deviceFamily}"); + const char *gSdkName("${sdkName}"); + const char *gAppIcon("${appIcon}"); + const char *gLaunchImage("${launchImage}"); + + const char *gPlatformsPath("${platformsPath}"); + const char *gCachePath("${cachePath}"); +#ifdef NDEBUG + const char *gMode("Release"); +#else + const char *gMode("Debug"); +#endif +}; + +XcodeBuilder::XcodeBuilder() { + setName("[XcodeBuilder]"); + + connect(&m_process, _SIGNAL(finished(int)), this, _SLOT(onBuildFinished(int))); +} + +bool XcodeBuilder::buildProject() { + if(m_outdated && !m_process.isRunning()) { + m_process.setWorkingDirectory(m_project); + + ProjectSettings *mgr = ProjectSettings::instance(); + + m_values[gPlatformsPath] = mgr->platformsPath(); + m_values[gCachePath] = mgr->cachePath(); + + generateProject(); + + TString path = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/"; + + StringList args; + args.push_back("clean"); + if(mgr->targetPath().isEmpty()) { + args.push_back("build"); + } else { + args.push_back("archive"); + } + args.push_back("-project"); + args.push_back(mgr->projectName() + ".xcodeproj"); + args.push_back("-scheme"); + if(mgr->targetPath().isEmpty()) { + args.push_back(mgr->projectName() + "-editor"); + args.push_back("-configuration"); + args.push_back(gMode); + + m_artifact = path + "build/lib" + mgr->projectName() + "-editor.dylib"; + } else { + args.push_back(mgr->projectName()); + args.push_back("-archivePath"); + + m_artifact = path + "build/" + mgr->projectName() + ".xcarchive"; + args.push_back(m_artifact); + } + + mgr->setArtifacts({ m_artifact }); + + m_process.setWorkingDirectory(m_project); + + if(m_process.start("xcodebuild", args) && m_process.waitForStarted()) { + aInfo() << name() << "Build Project."; + return m_process.waitForFinished(); + } + } + + return true; +} + +void XcodeBuilder::generateProject() { + NativeCodeBuilder::generateProject(); + + ProjectSettings *mgr = ProjectSettings::instance(); + + if(mgr->currentPlatformName() == "tvos") { + m_values[gSdkName] = "appletvos"; + m_values[gPlatformName] = "tvos"; + m_values[gDeviceFamily] = "3"; + m_values[gAppIcon] = "Brand Assets"; + m_values[gLaunchImage] = ""; + } else if(mgr->currentPlatformName() == "ios") { + m_values[gSdkName] = "iphoneos"; + m_values[gPlatformName] = "ios"; + m_values[gDeviceFamily] = "1,2"; + m_values[gAppIcon] = "AppIcon"; + m_values[gLaunchImage] = ""; + } else { + m_values[gSdkName] = "macosx"; + m_values[gDeviceFamily] = ""; + m_values[gPlatformName] = "macos"; + m_values[gAppIcon] = "AppIcon"; + m_values[gLaunchImage] = ""; + } + + m_project = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/"; + + if(mgr->currentPlatformName() == "macos") { + updateTemplate(":/templates/xcode/desktop.pbxproj", m_project + mgr->projectName() + ".xcodeproj/project.pbxproj"); + updateTemplate(":/templates/xcode/macos.plist", m_project + "Info.plist"); + } else { + updateTemplate(":/templates/xcode/mobile.pbxproj", m_project + mgr->projectName() + ".xcodeproj/project.pbxproj"); + updateTemplate(":/templates/xcode/LaunchScreen.storyboard", m_project + "LaunchScreen.storyboard"); + updateTemplate(":/templates/xcode/ios.plist", m_project + "Info.plist"); + } + + StringList res; + + if(mgr->currentPlatformName() == "tvos") { + res = { + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json", + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json", + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json", + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json", + + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json", + + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json", + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json", + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/1.png", + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/2.png", + + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json", + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json", + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/1.png", + "/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/2.png", + + "/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json", + "/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/1.png", + "/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/2.png", + + "/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json", + "/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/1.png", + "/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/2.png", + "/tvos/Assets.xcassets/Brand Assets.brandassets/Contents.json", + + "/tvos/Assets.xcassets/Contents.json", + }; + } if(mgr->currentPlatformName() == "ios") { + res = { + "/ios/Assets.xcassets/Contents.json", + "/ios/Assets.xcassets/AppIcon.appiconset/Contents.json", + "/ios/Assets.xcassets/AppIcon.appiconset/Dark.png", + "/ios/Assets.xcassets/AppIcon.appiconset/Default.png", + "/ios/Assets.xcassets/AppIcon.appiconset/Tinted.png" + }; + } if(mgr->currentPlatformName() == "macos") { + res = { + "/macos/Assets.xcassets/Contents.json", + "/macos/Assets.xcassets/AppIcon.appiconset/Contents.json", + "/macos/Assets.xcassets/AppIcon.appiconset/1024.png" + }; + } + + for(auto &it : res) { + copyTempalte(TString(":/templates/xcode") + it, mgr->platformsPath() + it); + } +} diff --git a/modules/editor/iostools/converter/xcodebuilder.h b/modules/editor/buildtools/converter/xcodebuilder.h similarity index 57% rename from modules/editor/iostools/converter/xcodebuilder.h rename to modules/editor/buildtools/converter/xcodebuilder.h index d454b06c3..21b59e214 100644 --- a/modules/editor/iostools/converter/xcodebuilder.h +++ b/modules/editor/buildtools/converter/xcodebuilder.h @@ -3,8 +3,6 @@ #include -#include - class XcodeBuilder : public NativeCodeBuilder { public: XcodeBuilder(); @@ -14,7 +12,11 @@ class XcodeBuilder : public NativeCodeBuilder { void generateProject() override; - StringList platforms() const override { return {"ios", "tvos"}; } + StringList platforms() const override { return {"macos", "ios", "tvos"}; } + + PackagingMode packagingMode() const override { return Before; } + + RHI defaultRhi() const override { return Metal; } }; diff --git a/modules/editor/buildtools/templates.qrc b/modules/editor/buildtools/templates.qrc new file mode 100644 index 000000000..34b974834 --- /dev/null +++ b/modules/editor/buildtools/templates.qrc @@ -0,0 +1,49 @@ + + + templates/windows/project.sln + templates/windows/project.vcxproj + templates/windows/project-editor.vcxproj + templates/android/AndroidManifest.xml + templates/android/res/drawable/ic_launcher_background.xml + templates/android/res/drawable/ic_launcher_foreground.xml + templates/android/res/mipmap-anydpi/ic_launcher.xml + templates/android/res/mipmap-anydpi/ic_launcher_round.xml + templates/android/res/values/strings.xml + templates/android/res/xml/backup_rules.xml + templates/xcode/ios.plist + templates/xcode/macos.plist + templates/xcode/LaunchScreen.storyboard + templates/xcode/mobile.pbxproj + templates/xcode/desktop.pbxproj + templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Contents.json + templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Dark.png + templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Default.png + templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Tinted.png + templates/xcode/ios/Assets.xcassets/Contents.json + templates/xcode/macos/Assets.xcassets/AppIcon.appiconset/Contents.json + templates/xcode/macos/Assets.xcassets/AppIcon.appiconset/1024.png + templates/xcode/macos/Assets.xcassets/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/1.png + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/2.png + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/1.png + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/2.png + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/1.png + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/2.png + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/1.png + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/2.png + templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Contents.json + templates/xcode/tvos/Assets.xcassets/Contents.json + + diff --git a/modules/editor/buildtools/templates/android/AndroidManifest.xml b/modules/editor/buildtools/templates/android/AndroidManifest.xml new file mode 100644 index 000000000..f4f842389 --- /dev/null +++ b/modules/editor/buildtools/templates/android/AndroidManifest.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/editor/buildtools/templates/android/res/drawable/ic_launcher_background.xml b/modules/editor/buildtools/templates/android/res/drawable/ic_launcher_background.xml new file mode 100644 index 000000000..6a7d550d3 --- /dev/null +++ b/modules/editor/buildtools/templates/android/res/drawable/ic_launcher_background.xml @@ -0,0 +1,9 @@ + + + diff --git a/modules/editor/buildtools/templates/android/res/drawable/ic_launcher_foreground.xml b/modules/editor/buildtools/templates/android/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 000000000..65b668cc1 --- /dev/null +++ b/modules/editor/buildtools/templates/android/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,14 @@ + + + + diff --git a/modules/editor/buildtools/templates/android/res/mipmap-anydpi/ic_launcher.xml b/modules/editor/buildtools/templates/android/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 000000000..6f3b755bf --- /dev/null +++ b/modules/editor/buildtools/templates/android/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/modules/editor/buildtools/templates/android/res/mipmap-anydpi/ic_launcher_round.xml b/modules/editor/buildtools/templates/android/res/mipmap-anydpi/ic_launcher_round.xml new file mode 100644 index 000000000..6f3b755bf --- /dev/null +++ b/modules/editor/buildtools/templates/android/res/mipmap-anydpi/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/modules/editor/buildtools/templates/android/res/values/strings.xml b/modules/editor/buildtools/templates/android/res/values/strings.xml new file mode 100644 index 000000000..e31941cf6 --- /dev/null +++ b/modules/editor/buildtools/templates/android/res/values/strings.xml @@ -0,0 +1,3 @@ + + ${projectName} + \ No newline at end of file diff --git a/modules/editor/buildtools/templates/android/res/xml/backup_rules.xml b/modules/editor/buildtools/templates/android/res/xml/backup_rules.xml new file mode 100644 index 000000000..4df925582 --- /dev/null +++ b/modules/editor/buildtools/templates/android/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/modules/editor/buildtools/templates/windows/project-editor.vcxproj b/modules/editor/buildtools/templates/windows/project-editor.vcxproj new file mode 100644 index 000000000..9f73bdedd --- /dev/null +++ b/modules/editor/buildtools/templates/windows/project-editor.vcxproj @@ -0,0 +1,193 @@ + + + + x64 + + + + Debug + x64 + + + Release + x64 + + + + {C2CA44EE-F82E-3479-9821-ED479D172429} + Win32Proj + 10.0.26100.0 + x64 + ${projectName}-editor + NoUpgrade + + + + DynamicLibrary + MultiByte + v143 + + + DynamicLibrary + MultiByte + v143 + + + + + + + + + + <_ProjectFileVersion>10.0.20506.1 + Debug\ + ${projectName}-editor.dir\Debug\ + ${projectName}-editor + .dll + true + true + Release\ + ${projectName}-editor.dir\Release\ + ${projectName}-editor + .dll + false + true + + + + + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + $(IntDir) + EnableFastChecks + ProgramDatabase + Sync + + + Disabled + stdcpp17 + + + Disabled + NotUsing + + + MultiThreadedDebugDLL + true + + + + + false + %(PreprocessorDefinitions);WIN32;_WINDOWS;SHARED_DEFINE;CMAKE_INTDIR="Debug" + $(IntDir) + false + + + %(PreprocessorDefinitions);WIN32;_DEBUG;_WINDOWS;SHARED_DEFINE;CMAKE_INTDIR=\"Debug\" + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + + + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + $(ProjectDir)/$(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + uikit-editor.lib;angel-editor.lib;bullet-editor.lib;media-editor.lib;motiontools.lib;network-editor.lib;particletools.lib;pipelinetools.lib;qbstools.lib;rendergl-editor.lib;shadertools.lib;spineimporter.lib;texteditor.lib;texturetools.lib;tiledimporter.lib;timeline.lib;webtools.lib;next-editor.lib;engine-editor.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib + ${sdkPath}/windows/x86_64/lib;${sdkPath}/windows/x86_64/bin;${sdkPath}/windows/x86_64/bin/plugins;%(AdditionalLibraryDirectories) + %(AdditionalOptions) /machine:x64 + + + true + %(IgnoreSpecificDefaultLibraries) + + + ./Debug/mine-editor.lib + + + ./Debug/mine-editor.pdb + + + + + + + false + + + + + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + $(IntDir) + Default + Sync + + + AnySuitable + stdcpp17 + + + MaxSpeed + NotUsing + + + MultiThreadedDLL + true + + + + + false + %(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;SHARED_DEFINE;CMAKE_INTDIR="Release" + $(IntDir) + + + false + + + %(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;SHARED_DEFINE;CMAKE_INTDIR=\"Release\" + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + + + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + $(ProjectDir)/$(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + uikit-editor.lib;angel-editor.lib;bullet-editor.lib;media-editor.lib;motiontools.lib;network-editor.lib;particletools.lib;pipelinetools.lib;qbstools.lib;rendergl-editor.lib;shadertools.lib;spineimporter.lib;texteditor.lib;texturetools.lib;tiledimporter.lib;timeline.lib;webtools.lib;next-editor.lib;engine-editor.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib + ${sdkPath}/windows/x86_64/lib;${sdkPath}/windows/x86_64/bin;${sdkPath}/windows/x86_64/bin/plugins;%(AdditionalLibraryDirectories) + %(AdditionalOptions) /machine:x64 + + + false + %(IgnoreSpecificDefaultLibraries) + + + ./Release/mine-editor.lib + + + ./Release/mine-editor.pdb + + + + + + + false + + + + +${FilesList} + + + + + + diff --git a/modules/editor/buildtools/templates/windows/project.sln b/modules/editor/buildtools/templates/windows/project.sln new file mode 100644 index 000000000..0ad789a70 --- /dev/null +++ b/modules/editor/buildtools/templates/windows/project.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36518.9 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "${projectName}", "project.vcxproj", "{9F09DA67-0DB2-3605-AFBD-8B6E4AD0DE14}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "${projectName}-editor", "project-editor.vcxproj", "{C2CA44EE-F82E-3479-9821-ED479D172429}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9F09DA67-0DB2-3605-AFBD-8B6E4AD0DE14}.Debug|x64.ActiveCfg = Debug|x64 + {9F09DA67-0DB2-3605-AFBD-8B6E4AD0DE14}.Debug|x64.Build.0 = Debug|x64 + {9F09DA67-0DB2-3605-AFBD-8B6E4AD0DE14}.Release|x64.ActiveCfg = Release|x64 + {9F09DA67-0DB2-3605-AFBD-8B6E4AD0DE14}.Release|x64.Build.0 = Release|x64 + {C2CA44EE-F82E-3479-9821-ED479D172429}.Debug|x64.ActiveCfg = Debug|x64 + {C2CA44EE-F82E-3479-9821-ED479D172429}.Debug|x64.Build.0 = Debug|x64 + {C2CA44EE-F82E-3479-9821-ED479D172429}.Release|x64.ActiveCfg = Release|x64 + {C2CA44EE-F82E-3479-9821-ED479D172429}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2FE48E5E-2E8D-31F2-9318-20A805EE013B} + EndGlobalSection +EndGlobal diff --git a/modules/editor/buildtools/templates/windows/project.vcxproj b/modules/editor/buildtools/templates/windows/project.vcxproj new file mode 100644 index 000000000..980d0a3de --- /dev/null +++ b/modules/editor/buildtools/templates/windows/project.vcxproj @@ -0,0 +1,193 @@ + + + + x64 + + + + Debug + x64 + + + Release + x64 + + + + {9F09DA67-0DB2-3605-AFBD-8B6E4AD0DE14} + Win32Proj + 10.0.26100.0 + x64 + ${projectName} + NoUpgrade + + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + <_ProjectFileVersion>10.0.20506.1 + Debug\ + ${projectName}.dir\Debug\ + ${projectName} + .exe + true + true + Release\ + ${projectName}.dir\Release\ + ${projectName} + .exe + false + true + + + + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + $(IntDir) + EnableFastChecks + ProgramDatabase + Sync + + + Disabled + stdcpp17 + + + Disabled + NotUsing + + + MultiThreadedDebugDLL + true + + + + + false + %(PreprocessorDefinitions);WIN32;_WINDOWS;CMAKE_INTDIR="Debug" + $(IntDir) + false + + + %(PreprocessorDefinitions);WIN32;_DEBUG;_WINDOWS;CMAKE_INTDIR=\"Debug\" + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + + + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + $(ProjectDir)/$(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + bullet.lib;rendergl.lib;uikit.lib;engine.lib;next.lib;physfs.lib;freetype.lib;angelscript.lib;bullet3.lib;zlib.lib;glfw.lib;glad.lib;Shell32.lib;User32.lib;Gdi32.lib;Advapi32.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib + ${sdkPath}/windows/x86_64/static;%(AdditionalLibraryDirectories) + %(AdditionalOptions) /machine:x64 + + + true + %(IgnoreSpecificDefaultLibraries) + + + ./Debug/mine.lib + + + ./Debug/mine.pdb + + + Windows + + + false + + + + + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + $(IntDir) + Default + Sync + + + AnySuitable + stdcpp17 + + + MaxSpeed + NotUsing + + + MultiThreadedDLL + true + + + + + false + %(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR="Release" + $(IntDir) + + + false + + + %(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR=\"Release\" + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + + + ${sdkPath}/include/engine;${sdkPath}/include/modules;${sdkPath}/include/next;${sdkPath}/include/next/math;${sdkPath}/include/next/core;${sdkPath}/include/next/anim;%(AdditionalIncludeDirectories) + $(ProjectDir)/$(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + ${libraries}bullet.lib;rendergl.lib;uikit.lib;engine.lib;next.lib;physfs.lib;freetype.lib;angelscript.lib;bullet3.lib;zlib.lib;glfw.lib;glad.lib;Shell32.lib;User32.lib;Gdi32.lib;Advapi32.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib + ${sdkPath}/windows/x86_64/static;%(AdditionalLibraryDirectories) + %(AdditionalOptions) /machine:x64 + + + false + %(IgnoreSpecificDefaultLibraries) + + + ./Release/mine.lib + + + ./Release/mine.pdb + + + Windows + + + + + false + + + + + +${FilesList} + + + + + + diff --git a/modules/editor/iostools/templates/LaunchScreen.storyboard b/modules/editor/buildtools/templates/xcode/LaunchScreen.storyboard similarity index 100% rename from modules/editor/iostools/templates/LaunchScreen.storyboard rename to modules/editor/buildtools/templates/xcode/LaunchScreen.storyboard diff --git a/modules/editor/buildtools/templates/xcode/desktop.pbxproj b/modules/editor/buildtools/templates/xcode/desktop.pbxproj new file mode 100644 index 000000000..e506ab59c --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/desktop.pbxproj @@ -0,0 +1,599 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 04830BC82EEBE1A000654D02 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04830BC72EEBE1A000654D02 /* Carbon.framework */; }; + 049B70D02ED383710082C7C2 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 049B70CE2ED383710082C7C2 /* Metal.framework */; }; + 049B70D12ED383710082C7C2 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 049B70CF2ED383710082C7C2 /* MetalKit.framework */; }; + 049B70F82ED4819C0082C7C2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 049B70F72ED4819C0082C7C2 /* Cocoa.framework */; }; + 04A84C012ED9DD6E00D534D4 /* base.pak in Resources */ = {isa = PBXBuildFile; fileRef = 04A84C002ED9DD6E00D534D4 /* base.pak */; }; + 049B70FA2ED481DF0082C7C2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 049B70F92ED481DF0082C7C2 /* IOKit.framework */; }; + C03F228C22F4A09200366493 /* ../generated/plugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C03F228B22F4A09200366493 /* ../generated/plugin.cpp */; }; + C03F228E22F4A09F00366493 /* ../generated/application.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C03F228D22F4A09F00366493 /* ../generated/application.cpp */; }; + C03F22A722F4A55600366493 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C03F22A622F4A55600366493 /* CoreGraphics.framework */; }; + C03F22A922F4A56E00366493 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C03F22A822F4A56E00366493 /* QuartzCore.framework */; }; + C03F22AB22F4A58100366493 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C03F22AA22F4A58100366493 /* Foundation.framework */; }; + C099B0C222F5977200EE7EAB /* libz.1.1.3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = C099B0C122F5977200EE7EAB /* libz.1.1.3.tbd */; }; + C05464FC23012CDC00AEE963 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C05464FB23012CDC00AEE963 /* Assets.xcassets */; }; + BBD9E635A32A4086B9B4B90D /* ../generated/plugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6872193B3DE4504904D4BA0 /* ../generated/plugin.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 04830BC72EEBE1A000654D02 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; + 049B70CE2ED383710082C7C2 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; }; + 049B70CF2ED383710082C7C2 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; }; + 049B70F72ED4819C0082C7C2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 049B70F92ED481DF0082C7C2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + 04A84C002ED9DD6E00D534D4 /* base.pak */ = {isa = PBXFileReference; lastKnownFileType = file; path = base.pak; sourceTree = SOURCE_ROOT; }; + C03F227222F4A00900366493 /* ${projectName}.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ${projectName}.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C03F228B22F4A09200366493 /* ../generated/plugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ../generated/plugin.cpp; sourceTree = SOURCE_ROOT; }; + C03F228D22F4A09F00366493 /* ../generated/application.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ../generated/application.cpp; sourceTree = SOURCE_ROOT; }; + C03F22A622F4A55600366493 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + C03F22A822F4A56E00366493 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + C03F22AA22F4A58100366493 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + C05464FB23012CDC00AEE963 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ${platformsPath}/${platformName}/Assets.xcassets; sourceTree = ""; }; + C099B0C122F5977200EE7EAB /* libz.1.1.3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.1.1.3.tbd; path = usr/lib/libz.1.1.3.tbd; sourceTree = SDKROOT; }; + D6872193B3DE4504904D4BA0 /* ../generated/plugin.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = ../generated/plugin.cpp; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 322CD30682E64F438C83A306 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C03F226F22F4A00800366493 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 049B70F82ED4819C0082C7C2 /* Cocoa.framework in Frameworks */, + 049B70D02ED383710082C7C2 /* Metal.framework in Frameworks */, + 049B70D12ED383710082C7C2 /* MetalKit.framework in Frameworks */, + 049B70FA2ED481DF0082C7C2 /* IOKit.framework in Frameworks */, + C099B0C222F5977200EE7EAB /* libz.1.1.3.tbd in Frameworks */, + C03F22AB22F4A58100366493 /* Foundation.framework in Frameworks */, + C03F22A922F4A56E00366493 /* QuartzCore.framework in Frameworks */, + C03F22A722F4A55600366493 /* CoreGraphics.framework in Frameworks */, + 04830BC82EEBE1A000654D02 /* Carbon.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C03F226922F4A00800366493 = { + isa = PBXGroup; + children = ( + C03F227422F4A00900366493 /* ${projectName} */, + B9D34E69C8BF4D8981EFFCBD /* ${projectName}-editor */, + C03F227322F4A00900366493 /* Products */, + C03F228F22F4A4F300366493 /* Frameworks */, + ); + sourceTree = ""; + }; + C03F227322F4A00900366493 /* Products */ = { + isa = PBXGroup; + children = ( + C03F227222F4A00900366493 /* ${projectName}.app */, + C04CF766E6B4F0B85977A95 /* lib${projectName}-editor.dylib */, + ); + name = Products; + sourceTree = ""; + }; + C03F227422F4A00900366493 /* ${projectName} */ = { + isa = PBXGroup; + children = ( + C05464FB23012CDC00AEE963 /* Assets.xcassets */, + 04A84C002ED9DD6E00D534D4 /* base.pak */, + C03F228D22F4A09F00366493 /* ../generated/application.cpp */, + C03F228B22F4A09200366493 /* ../generated/plugin.cpp */, + ); + path = ${projectName}; + sourceTree = ""; + }; + B9D34E69C8BF4D8981EFFCBD /* ${projectName}-editor */ = { + isa = PBXGroup; + children = ( + D6872193B3DE4504904D4BA0 /* ../generated/plugin.cpp */, + ); + name = "${projectName}-editor"; + sourceTree = ""; + }; + C03F228F22F4A4F300366493 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 049B70F92ED481DF0082C7C2 /* IOKit.framework */, + 049B70F72ED4819C0082C7C2 /* Cocoa.framework */, + 049B70CF2ED383710082C7C2 /* MetalKit.framework */, + 049B70CE2ED383710082C7C2 /* Metal.framework */, + 04830BC72EEBE1A000654D02 /* Carbon.framework */, + C099B0C122F5977200EE7EAB /* libz.1.1.3.tbd */, + C03F22AA22F4A58100366493 /* Foundation.framework */, + C03F22A822F4A56E00366493 /* QuartzCore.framework */, + C03F22A622F4A55600366493 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C03F227122F4A00800366493 /* ${projectName} */ = { + isa = PBXNativeTarget; + buildConfigurationList = C03F228822F4A02900366493 /* Build configuration list for PBXNativeTarget "${projectName}" */; + buildPhases = ( + C03F226E22F4A00800366493 /* Sources */, + C03F226F22F4A00800366493 /* Frameworks */, + C03F227022F4A00800366493 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ${projectName}; + productName = ${projectName}; + productReference = C03F227222F4A00900366493 /* ${projectName}.app */; + productType = "com.apple.product-type.application"; + }; + F8CEDE2FC2C5384A6064ACFF /* ${projectName}-editor */ = { + isa = PBXNativeTarget; + buildConfigurationList = 34266BA08907493282C99C1A /* Build configuration list for PBXNativeTarget "${projectName}-editor" */; + buildPhases = ( + 16EFB3AA2CD84DFDBB3E2B53 /* Sources */, + 322CD30682E64F438C83A306 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "${projectName}-editor"; + productName = "${projectName}-editor"; + productReference = 1C04CF766E6B4F0B85977A95 /* lib${projectName}-editor.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C03F226A22F4A00800366493 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + C03F227122F4A00800366493 = { + CreatedOnToolsVersion = 10.2.1; + }; + }; + }; + buildConfigurationList = C03F226D22F4A00800366493 /* Build configuration list for PBXProject "${projectName}" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = C03F226922F4A00800366493; + productRefGroup = C03F227322F4A00900366493 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C03F227122F4A00800366493 /* ${projectName} */, + F8CEDE2FC2C5384A6064ACFF /* ${projectName}-editor */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C03F227022F4A00800366493 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C05464FC23012CDC00AEE963 /* Assets.xcassets in Resources */, + 04A84C012ED9DD6E00D534D4 /* base.pak in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 16EFB3AA2CD84DFDBB3E2B53 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BBD9E635A32A4086B9B4B90D /* ../generated/plugin.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C03F226E22F4A00800366493 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C03F228E22F4A09F00366493 /* ../generated/application.cpp in Sources */, + C03F228C22F4A09200366493 /* ../generated/plugin.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + C03F228622F4A02900366493 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_BITCODE = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "THUNDER_MOBILE"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "${sdkPath}/include/engine", + "${sdkPath}/include/modules", + "${sdkPath}/include/next", + "${sdkPath}/include/next/math", + "${sdkPath}/include/next/core", + ); + IPHONEOS_DEPLOYMENT_TARGET = 12.2; + LIBRARY_SEARCH_PATHS = ""; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ""; + SDKROOT = ${sdkName}; + }; + name = Debug; + }; + C03F228722F4A02900366493 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_BITCODE = NO; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = "THUNDER_MOBILE"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "${sdkPath}/include/engine", + "${sdkPath}/include/modules", + "${sdkPath}/include/next", + "${sdkPath}/include/next/math", + "${sdkPath}/include/next/core", + ); + IPHONEOS_DEPLOYMENT_TARGET = 12.2; + LIBRARY_SEARCH_PATHS = ""; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ""; + SDKROOT = ${sdkName}; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C03F228922F4A02900366493 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "${appIcon}"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "${launchImage}"; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + OTHER_LDFLAGS = ( + "-L${sdkPath}/${platformName}/arm64/static/", + "-langel", + "-langelscript", + "-lengine", + "-lfreetype", + "-lglfm", + "-lmedia", + "-lnext", + "-lphysfs", + "-lrendermt", + "-lbullet", + "-lbullet3", + "-luikit", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.thunderengine.${idName}; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "${deviceFamily}"; + }; + name = Debug; + }; + C03F228A22F4A02900366493 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "${appIcon}"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "${launchImage}"; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + OTHER_LDFLAGS = ( + "-L${sdkPath}/${platformName}/arm64/static/", + "-langel", + "-langelscript", + "-lengine", + "-lfreetype", + "-lglfm", + "-lmedia", + "-lnext", + "-lphysfs", + "-lrendermt", + "-lbullet", + "-lbullet3", + "-luikit", + ); + PRODUCT_BUNDLE_IDENTIFIER = org.thunderengine.${idName}; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "${deviceFamily}"; + }; + name = Release; + }; + A494F34C8E6842F49F90A9D9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = arm64; + CONFIGURATION_BUILD_DIR = "${cachePath}/${platformName}/build"; + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DYLIB_COMPATIBILITY_VERSION = ""; + DYLIB_CURRENT_VERSION = ""; + EXECUTABLE_PREFIX = lib; + EXECUTABLE_SUFFIX = .dylib; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_PREPROCESSOR_DEFINITIONS = ( + SHARED_DEFINE, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + "${sdkPath}/include/engine", + "${sdkPath}/include/modules", + "${sdkPath}/include/next", + "${sdkPath}/include/next/math", + "${sdkPath}/include/next/core", + ); + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/plugins", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + LIBRARY_STYLE = DYNAMIC; + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = ( + "-L${sdkPath}/macos/arm64/bin/WorldEditor.app/Contents/MacOS", + "-L${sdkPath}/macos/arm64/bin/WorldEditor.app/Contents/MacOS/plugins", + "-luikit-editor", + "-langel-editor", + "-lbullet-editor", + "-lmedia-editor", + "-lmotiontools", + "-lnetwork-editor", + "-lparticletools", + "-lpipelinetools", + "-lshadertools", + "-lspineimporter", + "-ltexteditor", + "-ltexturetools", + "-ltiledimporter", + "-ltimeline", + "-lwebtools", + "-lnext-editor", + "-lengine-editor", + ); + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "${projectName}-editor"; + SECTORDER_FLAGS = ""; + USE_HEADERMAP = NO; + WARNING_CFLAGS = "$(inherited)"; + }; + name = Release; + }; + E799E7E6404F4139A7CCF7E6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = arm64; + CONFIGURATION_BUILD_DIR = "${cachePath}/${platformName}/build"; + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DYLIB_COMPATIBILITY_VERSION = ""; + DYLIB_CURRENT_VERSION = ""; + EXECUTABLE_PREFIX = lib; + EXECUTABLE_SUFFIX = .dylib; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + SHARED_DEFINE, + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + "${sdkPath}/include/engine", + "${sdkPath}/include/modules", + "${sdkPath}/include/next", + "${sdkPath}/include/next/math", + "${sdkPath}/include/next/core", + "${sdkPath}/include/next/anim", + "$(inherited)", + ); + INSTALL_PATH = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/plugins", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + LIBRARY_STYLE = DYNAMIC; + OTHER_LDFLAGS = ( + "-L${sdkPath}/macos/arm64/bin/WorldEditor.app/Contents/MacOS", + "-L${sdkPath}/macos/arm64/bin/WorldEditor.app/Contents/MacOS/plugins", + "-luikit-editor", + "-langel-editor", + "-lbullet-editor", + "-lmedia-editor", + "-lmotiontools", + "-lnetwork-editor", + "-lparticletools", + "-lpipelinetools", + "-lshadertools", + "-lspineimporter", + "-ltexteditor", + "-ltexturetools", + "-ltiledimporter", + "-ltimeline", + "-lwebtools", + "-lnext-editor", + "-lengine-editor", + ); + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "${projectName}-editor"; + SECTORDER_FLAGS = ""; + USE_HEADERMAP = NO; + WARNING_CFLAGS = "$(inherited)"; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 34266BA08907493282C99C1A /* Build configuration list for PBXNativeTarget "${projectName}-editor" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E799E7E6404F4139A7CCF7E6 /* Debug */, + A494F34C8E6842F49F90A9D9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C03F226D22F4A00800366493 /* Build configuration list for PBXProject "${projectName}" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C03F228622F4A02900366493 /* Debug */, + C03F228722F4A02900366493 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C03F228822F4A02900366493 /* Build configuration list for PBXNativeTarget "${projectName}" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C03F228922F4A02900366493 /* Debug */, + C03F228A22F4A02900366493 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C03F226A22F4A00800366493 /* Project object */; +} diff --git a/modules/editor/iostools/templates/Info.plist b/modules/editor/buildtools/templates/xcode/ios.plist similarity index 91% rename from modules/editor/iostools/templates/Info.plist rename to modules/editor/buildtools/templates/xcode/ios.plist index 558c4f265..cf213b0cf 100644 --- a/modules/editor/iostools/templates/Info.plist +++ b/modules/editor/buildtools/templates/xcode/ios.plist @@ -2,7 +2,7 @@ - CFBundleDevelopmentRegion + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) @@ -20,8 +20,8 @@ 1 LSRequiresIPhoneOS - UILaunchStoryboardName - LaunchScreen + UILaunchStoryboardName + LaunchScreen UIRequiredDeviceCapabilities opengles-3 diff --git a/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Contents.json b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..882245da8 --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "filename" : "Default.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "Dark.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "filename" : "Tinted.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Dark.png b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Dark.png new file mode 100644 index 000000000..a5c511209 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Dark.png differ diff --git a/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Default.png b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Default.png new file mode 100644 index 000000000..0b1c437a6 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Default.png differ diff --git a/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Tinted.png b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Tinted.png new file mode 100644 index 000000000..74887dd66 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/AppIcon.appiconset/Tinted.png differ diff --git a/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/Contents.json b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/ios/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/modules/editor/buildtools/templates/xcode/macos.plist b/modules/editor/buildtools/templates/xcode/macos.plist new file mode 100644 index 000000000..1874acb3b --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/macos.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.thunderengine.${idName} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHighResolutionCapable + + NSPrincipalClass + NSApplication + NSApplicationPresentationMode + fullScreen + + \ No newline at end of file diff --git a/modules/editor/buildtools/templates/xcode/macos/Assets.xcassets/AppIcon.appiconset/1024.png b/modules/editor/buildtools/templates/xcode/macos/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 000000000..0b1c437a6 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/macos/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/modules/editor/buildtools/templates/xcode/macos/Assets.xcassets/AppIcon.appiconset/Contents.json b/modules/editor/buildtools/templates/xcode/macos/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..10d55f31b --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/macos/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,59 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "filename" : "1024.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/modules/editor/buildtools/templates/xcode/macos/Assets.xcassets/Contents.json b/modules/editor/buildtools/templates/xcode/macos/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/macos/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/modules/editor/iostools/templates/project.pbxproj b/modules/editor/buildtools/templates/xcode/mobile.pbxproj similarity index 73% rename from modules/editor/iostools/templates/project.pbxproj rename to modules/editor/buildtools/templates/xcode/mobile.pbxproj index 25b8599bc..50d98870b 100644 --- a/modules/editor/iostools/templates/project.pbxproj +++ b/modules/editor/buildtools/templates/xcode/mobile.pbxproj @@ -8,31 +8,39 @@ /* Begin PBXBuildFile section */ C029CA3122F9EB5E00E3857A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C029CA3022F9EB5E00E3857A /* LaunchScreen.storyboard */; }; - C03F228C22F4A09200366493 /* plugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C03F228B22F4A09200366493 /* plugin.cpp */; }; - C03F228E22F4A09F00366493 /* application.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C03F228D22F4A09F00366493 /* application.cpp */; }; + C03F228C22F4A09200366493 /* ../generated/plugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C03F228B22F4A09200366493 /* ../generated/plugin.cpp */; }; + C03F228E22F4A09F00366493 /* ../generated/application.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C03F228D22F4A09F00366493 /* ../generated/application.cpp */; }; + 04A84B772ED74A4C00D534D4 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04A84B762ED74A4C00D534D4 /* CoreMotion.framework */; }; + 04A84B792ED74A7400D534D4 /* CoreHaptics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04A84B782ED74A7400D534D4 /* CoreHaptics.framework */; }; + 049B70D02ED383710082C7C2 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 049B70CE2ED383710082C7C2 /* Metal.framework */; }; + 049B70D12ED383710082C7C2 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 049B70CF2ED383710082C7C2 /* MetalKit.framework */; }; C03F22A322F4A53500366493 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C03F22A222F4A53500366493 /* OpenGLES.framework */; }; C03F22A522F4A54700366493 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C03F22A422F4A54700366493 /* UIKit.framework */; }; C03F22A722F4A55600366493 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C03F22A622F4A55600366493 /* CoreGraphics.framework */; }; C03F22A922F4A56E00366493 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C03F22A822F4A56E00366493 /* QuartzCore.framework */; }; C03F22AB22F4A58100366493 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C03F22AA22F4A58100366493 /* Foundation.framework */; }; C099B0C222F5977200EE7EAB /* libz.1.1.3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = C099B0C122F5977200EE7EAB /* libz.1.1.3.tbd */; }; - C0BC6E6C22F6AF6200B4C7E1 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = C0BC6E6B22F6AF6200B4C7E1 /* assets */; }; - C05464FC23012CDC00AEE963 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C05464FB23012CDC00AEE963 /* Assets.xcassets */; }; + C05464FC23012CDC00AEE963 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C05464FB23012CDC00AEE963 /* Assets.xcassets */; }; + 04A84C012ED9DD6E00D534D4 /* base.pak in Resources */ = {isa = PBXBuildFile; fileRef = 04A84C002ED9DD6E00D534D4 /* base.pak */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 049B70CE2ED383710082C7C2 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; }; + 049B70CF2ED383710082C7C2 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; }; + 04A84B762ED74A4C00D534D4 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; + 04A84B782ED74A7400D534D4 /* CoreHaptics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreHaptics.framework; path = System/Library/Frameworks/CoreHaptics.framework; sourceTree = SDKROOT; }; C029CA3022F9EB5E00E3857A /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; C03F227222F4A00900366493 /* ${projectName}.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ${projectName}.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C03F228B22F4A09200366493 /* plugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = plugin.cpp; sourceTree = SOURCE_ROOT; }; - C03F228D22F4A09F00366493 /* application.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = application.cpp; sourceTree = SOURCE_ROOT; }; + C03F228B22F4A09200366493 /* ../generated/plugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ../generated/plugin.cpp; sourceTree = SOURCE_ROOT; }; + C03F228D22F4A09F00366493 /* ../generated/application.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ../generated/application.cpp; sourceTree = SOURCE_ROOT; }; C03F22A222F4A53500366493 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; C03F22A422F4A54700366493 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; C03F22A622F4A55600366493 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; C03F22A822F4A56E00366493 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; C03F22AA22F4A58100366493 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + C05464FB23012CDC00AEE963 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ${platformsPath}/${platformName}/Assets.xcassets; sourceTree = ""; }; C099B0C122F5977200EE7EAB /* libz.1.1.3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.1.1.3.tbd; path = usr/lib/libz.1.1.3.tbd; sourceTree = SDKROOT; }; - C0BC6E6B22F6AF6200B4C7E1 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = ../../{platformName}/assets; sourceTree = ""; }; - C05464FB23012CDC00AEE963 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ../../../platforms/{platformName}/Assets.xcassets; sourceTree = ""; }; + 04A84C002ED9DD6E00D534D4 /* base.pak */ = {isa = PBXFileReference; lastKnownFileType = file; path = base.pak; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -40,6 +48,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 049B70D02ED383710082C7C2 /* Metal.framework */, + 04A84B772ED74A4C00D534D4 /* CoreMotion.framework in Frameworks */, + 04A84B792ED74A7400D534D4 /* CoreHaptics.framework in Frameworks */, + 049B70D12ED383710082C7C2 /* MetalKit.framework */, C099B0C222F5977200EE7EAB /* libz.1.1.3.tbd in Frameworks */, C03F22AB22F4A58100366493 /* Foundation.framework in Frameworks */, C03F22A922F4A56E00366493 /* QuartzCore.framework in Frameworks */, @@ -74,9 +86,9 @@ children = ( C05464FB23012CDC00AEE963 /* Assets.xcassets */, C029CA3022F9EB5E00E3857A /* LaunchScreen.storyboard */, - C0BC6E6B22F6AF6200B4C7E1 /* assets */, - C03F228D22F4A09F00366493 /* application.cpp */, - C03F228B22F4A09200366493 /* plugin.cpp */, + 04A84C002ED9DD6E00D534D4 /* base.pak */, + C03F228D22F4A09F00366493 /* ../generated/application.cpp */, + C03F228B22F4A09200366493 /* ../generated/plugin.cpp */, ); path = ${projectName}; sourceTree = ""; @@ -84,11 +96,15 @@ C03F228F22F4A4F300366493 /* Frameworks */ = { isa = PBXGroup; children = ( + 04A84B782ED74A7400D534D4 /* CoreHaptics.framework */, + 04A84B762ED74A4C00D534D4 /* CoreMotion.framework */, + 049B70CF2ED383710082C7C2 /* MetalKit.framework */, + 049B70CE2ED383710082C7C2 /* Metal.framework */, C099B0C122F5977200EE7EAB /* libz.1.1.3.tbd */, C03F22AA22F4A58100366493 /* Foundation.framework */, C03F22A822F4A56E00366493 /* QuartzCore.framework */, C03F22A622F4A55600366493 /* CoreGraphics.framework */, - C03F22A422F4A54700366493 /* UIKit.framework */, + C03F22A422F4A54700366493 /* UIKit.framework */, C03F22A222F4A53500366493 /* OpenGLES.framework */, ); name = Frameworks; @@ -128,7 +144,7 @@ }; }; }; - buildConfigurationList = C03F226D22F4A00800366493 /* Build configuration list for PBXProject "{projectName}" */; + buildConfigurationList = C03F226D22F4A00800366493 /* Build configuration list for PBXProject "${projectName}" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; @@ -152,7 +168,7 @@ buildActionMask = 2147483647; files = ( C05464FC23012CDC00AEE963 /* Assets.xcassets in Resources */, - C0BC6E6C22F6AF6200B4C7E1 /* assets in Resources */, + 04A84C012ED9DD6E00D534D4 /* base.pak in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -163,8 +179,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C03F228E22F4A09F00366493 /* application.cpp in Sources */, - C03F228C22F4A09200366493 /* plugin.cpp in Sources */, + C03F228E22F4A09F00366493 /* ../generated/application.cpp in Sources */, + C03F228C22F4A09200366493 /* ../generated/plugin.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -222,6 +238,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "${sdkPath}/include/engine", + "${sdkPath}/include/modules", "${sdkPath}/include/next", "${sdkPath}/include/next/math", "${sdkPath}/include/next/core", @@ -285,6 +302,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( "${sdkPath}/include/engine", + "${sdkPath}/include/modules", "${sdkPath}/include/next", "${sdkPath}/include/next/math", "${sdkPath}/include/next/core", @@ -316,7 +334,7 @@ "$(PROJECT_DIR)", ); OTHER_LDFLAGS = ( - "-L${sdkPath}/{platformName}/arm64/lib/", + "-L${sdkPath}/${platformName}/arm64/static/", "-langel", "-langelscript", "-lengine", @@ -325,9 +343,12 @@ "-lmedia", "-lnext", "-lphysfs", - "-lrendergl", + "-lrendermt", + "-lbullet", + "-lbullet3", + "-luikit", ); - PRODUCT_BUNDLE_IDENTIFIER = ${Identifier_Prefix}.${projectName}; + PRODUCT_BUNDLE_IDENTIFIER = org.thunderengine.${idName}; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "${deviceFamily}"; }; @@ -338,10 +359,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "${appIcon}"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "${launchImage}"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = ( + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); @@ -350,7 +371,7 @@ "$(PROJECT_DIR)", ); OTHER_LDFLAGS = ( - "-L${sdkPath}/{platformName}/arm64/lib/", + "-L${sdkPath}/${platformName}/arm64/static/", "-langel", "-langelscript", "-lengine", @@ -359,9 +380,12 @@ "-lmedia", "-lnext", "-lphysfs", - "-lrendergl", + "-lrendermt", + "-lbullet", + "-lbullet3", + "-luikit", ); - PRODUCT_BUNDLE_IDENTIFIER = ${Identifier_Prefix}.${projectName}; + PRODUCT_BUNDLE_IDENTIFIER = org.thunderengine.${idName}; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "${deviceFamily}"; }; diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..48ecb4fa4 --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json new file mode 100644 index 000000000..3d73e5f8c --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Contents.json @@ -0,0 +1,14 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..48ecb4fa4 --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/1.png b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/1.png new file mode 100644 index 000000000..31eb3e987 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/1.png differ diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/2.png b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/2.png new file mode 100644 index 000000000..66d7b32f2 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/2.png differ diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..9c3501f8d --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "1.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "2.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json new file mode 100644 index 000000000..3d73e5f8c --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Contents.json @@ -0,0 +1,14 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/1.png b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/1.png new file mode 100644 index 000000000..d928d7964 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/1.png differ diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/2.png b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/2.png new file mode 100644 index 000000000..52e1f6392 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/2.png differ diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..9c3501f8d --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "1.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "2.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Contents.json new file mode 100644 index 000000000..f47ba43da --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "filename" : "App Icon - App Store.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "1280x768" + }, + { + "filename" : "App Icon.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "400x240" + }, + { + "filename" : "Top Shelf Image Wide.imageset", + "idiom" : "tv", + "role" : "top-shelf-image-wide", + "size" : "2320x720" + }, + { + "filename" : "Top Shelf Image.imageset", + "idiom" : "tv", + "role" : "top-shelf-image", + "size" : "1920x720" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/1.png b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/1.png new file mode 100644 index 000000000..80682b8ed Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/1.png differ diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/2.png b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/2.png new file mode 100644 index 000000000..4971672d9 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/2.png differ diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 000000000..9c3501f8d --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "1.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "2.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/1.png b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/1.png new file mode 100644 index 000000000..989f597e2 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/1.png differ diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/2.png b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/2.png new file mode 100644 index 000000000..a278ae8f1 Binary files /dev/null and b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/2.png differ diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 000000000..e2bdd6956 --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Brand Assets.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "1.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "filename" : "2.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + }, + "properties" : { + "template-rendering-intent" : "original" + } +} diff --git a/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Contents.json b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/modules/editor/buildtools/templates/xcode/tvos/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/modules/editor/editor.qbs b/modules/editor/editor.qbs index 603fb59c9..831f5a587 100644 --- a/modules/editor/editor.qbs +++ b/modules/editor/editor.qbs @@ -3,11 +3,10 @@ Project { references: [ "grapheditor", - "iostools", "motiontools", "particletools", "pipelinetools", - "qbstools", + "buildtools", "shadertools", "spineimporter", "texturetools", diff --git a/modules/editor/iostools/CMakeLists.txt b/modules/editor/iostools/CMakeLists.txt deleted file mode 100644 index 9c4dd99bc..000000000 --- a/modules/editor/iostools/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -project(iostools) - -file(GLOB ${PROJECT_NAME}_srcFiles - "*.cpp" - "converter/*.cpp" - "*.qrc" - "*.h" - "converter/*.h" -) - -set(${PROJECT_NAME}_incPaths - "../../../" - "../../../engine/includes" - "../../../engine/includes/resources" - "../../../engine/includes/editor" - "../../../thirdparty/next/inc" - "../../../thirdparty/next/inc/math" - "../../../thirdparty/next/inc/core" -) - -if (desktop AND APPLE) - add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_srcFiles}) - - target_link_libraries(${PROJECT_NAME} PRIVATE - next-editor - engine-editor - Qt5::Core - Qt5::Gui - ) - - target_compile_definitions(${PROJECT_NAME} PRIVATE - SHARED_DEFINE - ) - - target_include_directories(iostools PRIVATE ${${PROJECT_NAME}_incPaths}) - - set_target_properties(${PROJECT_NAME} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PLUGINS_PATH}" - ) - - install(TARGETS ${PROJECT_NAME} - DESTINATION "${PLUGINS_PATH}" - ) - -endif () diff --git a/modules/editor/iostools/converter/xcodebuilder.cpp b/modules/editor/iostools/converter/xcodebuilder.cpp deleted file mode 100644 index 0a70fde78..000000000 --- a/modules/editor/iostools/converter/xcodebuilder.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include "xcodebuilder.h" - -#include - -#include - -#include - -namespace { - const char *gPlatformName("${platformName}"); - const char *gDeviceFamily("${deviceFamily}"); - const char *gSdkName("${sdkName}"); - const char *gAppIcon("${appIcon}"); - const char *gLaunchImage("${launchImage}"); -}; - -// instruments -s devices -// xcodebuild clean archive -project Match3.xcodeproj -scheme Match3 -archivePath $PWD/build/Match3.xcarchive -// xcodebuild -exportArchive -archivePath $PWD/build/Match3.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build - -XcodeBuilder::XcodeBuilder() { - setName("[XcodeBuilder]"); - -} - -bool XcodeBuilder::buildProject() { - if(m_outdated && !m_process.isRunning()) { - ProjectSettings *mgr = ProjectSettings::instance(); - - m_project = mgr->generatedPath() + "/"; - m_process.setWorkingDirectory(m_project); - - generateProject(); - - m_outdated = false; - } - - return true; -} - -void XcodeBuilder::generateProject() { - NativeCodeBuilder::generateProject(); - - ProjectSettings *mgr = ProjectSettings::instance(); - - if(mgr->currentPlatformName() == "tvos") { - m_values[gSdkName] = "appletvos"; - m_values[gPlatformName] = "tvos"; - m_values[gDeviceFamily] = "3"; - m_values[gAppIcon] = "App Icon & Top Shelf Image"; - m_values[gLaunchImage] = "LaunchImage"; - } else { - m_values[gSdkName] = "iphoneos"; - m_values[gPlatformName] = "ios"; - m_values[gDeviceFamily] = "1,2"; - m_values[gAppIcon] = "AppIcon"; - m_values[gLaunchImage] = ""; - } - - updateTemplate(":/templates/project.pbxproj", m_project + mgr->projectName() + ".xcodeproj/project.pbxproj"); - updateTemplate(":/templates/LaunchScreen.storyboard", m_project + "LaunchScreen.storyboard"); - updateTemplate(":/templates/Info.plist", m_project + "Info.plist"); -} diff --git a/modules/editor/iostools/iostools.cpp b/modules/editor/iostools/iostools.cpp deleted file mode 100644 index 3e72150ec..000000000 --- a/modules/editor/iostools/iostools.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "iostools.h" - -#include - -#include "converter/xcodebuilder.h" - -static const char *meta = \ -"{" -" \"module\": \"iOSTools\"," -" \"version\": \"1.0\"," -" \"description\": \"iOS Tools plugin\"," -" \"author\": \"Evgeniy Prikazchikov\"," -" \"objects\": {" -" \"XcodeBuilder\": \"converter\"" -" }" -"}"; - -Module *moduleCreate(Engine *engine) { - return new IosTools(engine); -} - -IosTools::IosTools(Engine *engine) : - Module(engine) { -} - -const char *IosTools::metaInfo() const { - return meta; -} - -void *IosTools::getObject(const char *) { - static XcodeBuilder *builder = nullptr; - if(builder == nullptr) { - builder = new XcodeBuilder; - } - return builder; -} diff --git a/modules/editor/iostools/iostools.qbs b/modules/editor/iostools/iostools.qbs deleted file mode 100644 index 0840c64c8..000000000 --- a/modules/editor/iostools/iostools.qbs +++ /dev/null @@ -1,54 +0,0 @@ -import qbs - -Project { - id: iostools - property stringList srcFiles: [ - "*.cpp", - "converter/*.cpp", - "*.qrc", - "*.h", - "converter/*.h", - ] - - property stringList incPaths: [ - "../../../", - "../../../engine/includes", - "../../../engine/includes/resources", - "../../../engine/includes/components", - "../../../engine/includes/editor", - "../../../thirdparty/next/inc", - "../../../thirdparty/next/inc/math", - "../../../thirdparty/next/inc/core", - ] - - DynamicLibrary { - name: "iostools" - condition: iostools.desktop && qbs.targetOS.contains("darwin") - files: iostools.srcFiles - Depends { name: "cpp" } - Depends { name: "bundle" } - Depends { name: "next-editor" } - Depends { name: "engine-editor" } - Depends { name: "Qt"; submodules: ["core", "gui"]; } - bundle.isBundle: false - - cpp.defines: ["SHARED_DEFINE"] - cpp.includePaths: iostools.incPaths - cpp.cxxLanguageVersion: iostools.languageVersion - cpp.cxxStandardLibrary: iostools.standardLibrary - cpp.minimumMacosVersion: iostools.osxVersion - - Properties { - condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" - } - - Group { - name: "Install Plugin" - fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] - qbs.install: true - qbs.installDir: iostools.PLUGINS_PATH - qbs.installPrefix: iostools.PREFIX - } - } -} diff --git a/modules/editor/iostools/templates.qrc b/modules/editor/iostools/templates.qrc deleted file mode 100644 index 1c192d5a7..000000000 --- a/modules/editor/iostools/templates.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - templates/Info.plist - templates/LaunchScreen.storyboard - templates/project.pbxproj - - diff --git a/modules/editor/motiontools/converter/animationcontrollergraph.cpp b/modules/editor/motiontools/converter/animationcontrollergraph.cpp index 802901220..5c585f319 100644 --- a/modules/editor/motiontools/converter/animationcontrollergraph.cpp +++ b/modules/editor/motiontools/converter/animationcontrollergraph.cpp @@ -17,6 +17,7 @@ AnimationControllerGraph::AnimationControllerGraph() : m_version = AnimationControllerBuilder::version(); if(m_nodeTypes.empty()) { + GraphNode::registerClassFactory(Engine::resourceSystem()); StateNode::registerClassFactory(Engine::resourceSystem()); BaseState::registerClassFactory(Engine::resourceSystem()); EntryState::registerClassFactory(Engine::resourceSystem()); diff --git a/modules/editor/motiontools/motiontools.cpp b/modules/editor/motiontools/motiontools.cpp index 3c23c4ff6..9f1d03829 100644 --- a/modules/editor/motiontools/motiontools.cpp +++ b/modules/editor/motiontools/motiontools.cpp @@ -11,7 +11,7 @@ static const char *meta = \ "{" " \"module\": \"MotionTools\"," " \"version\": \"1.0\"," -" \"description\": \"Tiled Importer plugin\"," +" \"description\": \"Animation Tools plugin\"," " \"author\": \"Evgeniy Prikazchikov\"," " \"objects\": {" " \"AnimationBuilderSettings\": \"converter\"," diff --git a/modules/editor/motiontools/motiontools.qbs b/modules/editor/motiontools/motiontools.qbs index f52c16381..198c48d9c 100644 --- a/modules/editor/motiontools/motiontools.qbs +++ b/modules/editor/motiontools/motiontools.qbs @@ -52,7 +52,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/editor/particletools/particletools.qbs b/modules/editor/particletools/particletools.qbs index d1b382957..400da7c71 100644 --- a/modules/editor/particletools/particletools.qbs +++ b/modules/editor/particletools/particletools.qbs @@ -57,7 +57,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/editor/pipelinetools/pipelinetools.qbs b/modules/editor/pipelinetools/pipelinetools.qbs index b94346d70..30f9fb069 100644 --- a/modules/editor/pipelinetools/pipelinetools.qbs +++ b/modules/editor/pipelinetools/pipelinetools.qbs @@ -52,7 +52,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/editor/qbstools/converter/qbsbuilder.cpp b/modules/editor/qbstools/converter/qbsbuilder.cpp deleted file mode 100644 index 9eec4d495..000000000 --- a/modules/editor/qbstools/converter/qbsbuilder.cpp +++ /dev/null @@ -1,277 +0,0 @@ -#include "qbsbuilder.h" - -#include - -#include -#include -#include -#include - -#include - -#include -#include - -namespace { - const char *gEditorSuffix("-editor"); - - // Android specific - const char *gManifestFile("${manifestFile}"); - const char *gResourceDir("${resourceDir}"); - const char *gAssetsPaths("${assetsPath}"); - - const char *gQBSProfile("Builder/QBS/Profile"); - const char *gQBSPath("Builder/QBS/Path"); - - const char *gAndroidJava("Builder/Android/Java_Path"); - const char *gAndroidSdk("Builder/Android/SDK_Path"); - const char *gAndroidNdk("Builder/Android/NDK_Path"); - - #ifndef _DEBUG - const char *gMode = "release"; - #else - const char *gMode = "debug"; - #endif -}; - -QbsBuilder::QbsBuilder() { - setName("[QbsBuilder]"); - - m_settings.push_back("--settings-dir"); - m_settings.push_back((QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/..").toStdString()); - - EditorSettings *settings = EditorSettings::instance(); - - settings->registerValue(gAndroidJava, "", "editor=Path"); - settings->registerValue(gAndroidSdk, "", "editor=Path"); - settings->registerValue(gAndroidNdk, "", "editor=Path"); - - settings->registerValue(gQBSPath, "", "editor=FilePath"); - -#if defined(Q_OS_WIN) - settings->registerValue(gQBSProfile, "MSVC2019-x64"); -#elif defined(Q_OS_MAC) - settings->registerValue(gQBSProfile, "xcode-macosx-x86_64"); -#elif defined(Q_OS_UNIX) - settings->registerValue(gQBSProfile, "clang"); -#endif -} - -bool QbsBuilder::buildProject() { - if(m_outdated && !m_process.isRunning()) { - aInfo() << name() << "Build started."; - - m_qbsPath = EditorSettings::instance()->value(gQBSPath).toString(); - - ProjectSettings *mgr = ProjectSettings::instance(); - if(m_qbsPath.isEmpty()) { - TString suffix; - #if defined(Q_OS_WIN) - suffix += TString(".") + gApplication; - #endif - m_qbsPath = mgr->sdkPath() + "/tools/qbs/bin/qbs" + suffix; - } - - if(!File::exists(m_qbsPath)) { - aCritical() << name() << "Can't find the QBS Tool by the path:" << m_qbsPath; - } - - m_project = mgr->generatedPath() + "/"; - m_process.setWorkingDirectory(m_project); - - builderInit(); - generateProject(); - - TString platform = mgr->currentPlatformName(); - TString product = mgr->projectName(); - TString path = mgr->cachePath() + "/" + platform + "/" + gMode + "/install-root/"; - if(mgr->targetPath().isEmpty()) { - product += gEditorSuffix; - m_artifact = path + gPrefix + product + "." + gShared; - } else { - if(platform == "android") { - m_artifact = path + "com." + mgr->projectCompany() + "." + mgr->projectName() + ".apk"; - } else { - m_artifact = path + mgr->projectName() + "." + gApplication; - } - } - mgr->setArtifacts({ m_artifact }); - TString profile = getProfile(platform); - TString architecture = getArchitectures(platform).front(); - { - StringList args; - args.push_back("resolve"); - for(auto &it : m_settings) { - args.push_back(it); - } - args.push_back(TString("profile:") + profile); - args.push_back(TString("config:") + gMode); - args.push_back(TString("qbs.architecture:") + architecture); - - Process qbs; - qbs.setWorkingDirectory(m_project); - - if(qbs.start(m_qbsPath, args) && qbs.waitForStarted() && qbs.waitForFinished()) { - aInfo() << name() << "Resolved:" << qbs.readAllStandardOutput(); - } - } - { - StringList args; - args.push_back("build"); - for(auto &it : m_settings) { - args.push_back(it); - } - args.push_back("--build-directory"); - args.push_back(TString("../") + platform); - - args.push_back("--products"); - args.push_back(product); - args.push_back(TString("profile:") + profile); - - args.push_back(TString("config:") + gMode); - args.push_back(TString("qbs.architecture:") + architecture); - - if(m_process.start(m_qbsPath, args) && !m_process.waitForStarted()) { - aError() << name() << "Failed:" << m_process.readAllStandardError() << m_qbsPath; - return false; - } - } - } - return true; -} - -void QbsBuilder::builderInit() { - EditorSettings *settings = EditorSettings::instance(); - if(!checkProfiles()) { - { - StringList args; - args.push_back("setup-toolchains"); - args.push_back("--detect"); - for(auto &it : m_settings) { - args.push_back(it); - } - - Process qbs; - qbs.setWorkingDirectory(m_project); - if(qbs.start(m_qbsPath, args) && qbs.waitForStarted()) { - qbs.waitForFinished(); - } - } - { - TString sdk = settings->value(gAndroidSdk).toString(); - if(!sdk.isEmpty()) { - StringList args; - args.push_back("setup-android"); - for(auto &it : m_settings) { - args.push_back(it); - } - args.push_back("--sdk-dir"); - args.push_back(sdk); - - args.push_back("--ndk-dir"); - args.push_back(settings->value(gAndroidNdk).toString()); - args.push_back("android"); - - Process qbs; - ProcessEnvironment env = ProcessEnvironment::systemEnvironment(); - env.insert("JAVA_HOME", settings->value(gAndroidJava).toString()); - qbs.setProcessEnvironment(env); - - qbs.setWorkingDirectory(m_project); - if(qbs.start(m_qbsPath, args) && qbs.waitForStarted()) { - qbs.waitForFinished(); - } - } - } - } -} - -bool QbsBuilder::checkProfiles() { - StringList profiles; - ProjectSettings *mgr = ProjectSettings::instance(); - for(const TString &p : mgr->platforms()) { - profiles.push_back(getProfile(p)); - } - - StringList args; - args.push_back("config"); - args.push_back("--list"); - for(auto &it : m_settings) { - args.push_back(it); - } - - Process qbs; - qbs.setWorkingDirectory(m_project); - - if(qbs.start(m_qbsPath, args) && qbs.waitForStarted() && qbs.waitForFinished()) { - TString data = qbs.readAllStandardOutput(); - parseLogs(data); - - bool result = true; - for(auto &it : profiles) { - result &= data.contains(it); - } - return result; - } - return false; -} - -void QbsBuilder::generateProject() { - NativeCodeBuilder::generateProject(); - - // Android specific settings - ProjectSettings *mgr = ProjectSettings::instance(); - m_values[gManifestFile] = mgr->manifestFile(); - m_values[gResourceDir] = Url(mgr->manifestFile()).dir() + "/res"; - m_values[gAssetsPaths] = mgr->importPath(); - - updateTemplate(":/templates/project.qbs", m_project + mgr->projectName() + ".qbs"); - -#if defined(Q_OS_WIN) - StringList args; - args.push_back("generate"); - args.push_back("-g"); - args.push_back("visualstudio2022"); - args.push_back(TString("config:") + gMode); - args.push_back(TString("qbs.architecture:") + getArchitectures(mgr->currentPlatformName()).front()); - - Process qbs; - qbs.setWorkingDirectory(m_project); - - if(qbs.start(m_qbsPath, args) && qbs.waitForStarted()) { - qbs.waitForFinished(); - } -#endif -} - -TString QbsBuilder::getProfile(const TString &platform) const { - TString profile; - if(platform == "desktop") { - profile = EditorSettings::instance()->value(gQBSProfile).toString(); - } else if(platform == "android") { - profile = "android"; - } else if(platform == "ios") { - profile = "xcode-iphoneos-arm64"; - } else if(platform == "tvos") { - profile = "xcode-appletvos-arm64"; - } - - return profile; -} - -StringList QbsBuilder::getArchitectures(const TString &platform) const { - StringList architectures; - - if(platform == "desktop") { - architectures.push_back("x86_64"); - } else if(platform == "android") { - architectures.push_back("x86"); - architectures.push_back("armv7a"); - } - - if(platform == "ios" || platform == "tvos") { - architectures.push_back("arm64"); - } - - return architectures; -} diff --git a/modules/editor/qbstools/converter/qbsbuilder.h b/modules/editor/qbstools/converter/qbsbuilder.h deleted file mode 100644 index f4095abec..000000000 --- a/modules/editor/qbstools/converter/qbsbuilder.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef QBSBUILDER_H -#define QBSBUILDER_H - -#include - -#include - -class QbsBuilder : public NativeCodeBuilder { - A_OBJECT(QbsBuilder, NativeCodeBuilder, Core) - -public: - QbsBuilder(); - -protected: - void builderInit(); - - bool buildProject() override; - - StringList platforms() const override { return {"desktop", "android"}; } - - TString getProfile(const TString &platform) const; - StringList getArchitectures(const TString &platform) const; - - void generateProject() override; - - bool checkProfiles(); - -protected: - TString m_qbsPath; - - StringList m_settings; - -}; - -#endif // QBSBUILDER_H diff --git a/modules/editor/qbstools/qbstools.cpp b/modules/editor/qbstools/qbstools.cpp deleted file mode 100644 index b168ebbce..000000000 --- a/modules/editor/qbstools/qbstools.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "qbstools.h" - -#include - -#include "converter/qbsbuilder.h" - -static const char *meta = \ -"{" -" \"module\": \"QbsTools\"," -" \"version\": \"1.0\"," -" \"description\": \"Qbs Tools plugin\"," -" \"author\": \"Evgeniy Prikazchikov\"," -" \"objects\": {" -" \"QbsBuilder\": \"converter\"" -" }" -"}"; - -Module *moduleCreate(Engine *engine) { - return new QbsTools(engine); -} - -QbsTools::QbsTools(Engine *engine) : - Module(engine) { -} - -const char *QbsTools::metaInfo() const { - return meta; -} - -void *QbsTools::getObject(const char *) { - static QbsBuilder *builder = nullptr; - if(builder == nullptr) { - builder = new QbsBuilder; - } - return builder; -} diff --git a/modules/editor/qbstools/qbstools.h b/modules/editor/qbstools/qbstools.h deleted file mode 100644 index 0d7a77d63..000000000 --- a/modules/editor/qbstools/qbstools.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef QBSTOOLS_H -#define QBSTOOLS_H - -#include - -class QbsTools : public Module { -public: - QbsTools(Engine *engine); - - const char *metaInfo() const override; - - void *getObject(const char *name) override; - -}; - -extern "C" { - MODULE_EXPORT Module *moduleCreate(Engine *engine); -} - -#endif // QBSTOOLS_H diff --git a/modules/editor/qbstools/templates.qrc b/modules/editor/qbstools/templates.qrc deleted file mode 100644 index c39e1a219..000000000 --- a/modules/editor/qbstools/templates.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - templates/project.qbs - - diff --git a/modules/editor/qbstools/templates/project.qbs b/modules/editor/qbstools/templates/project.qbs deleted file mode 100644 index 5b47a87d9..000000000 --- a/modules/editor/qbstools/templates/project.qbs +++ /dev/null @@ -1,157 +0,0 @@ -import qbs - -Project { - id: project - property string platform: { - var arch = qbs.architecture; - if(qbs.targetOS.contains("darwin") || qbs.targetOS.contains("android")) { - arch = "arm64" - } else { - arch = "x86_64" - } - return "/" + qbs.targetOS[0] + "/" + arch; - } - - property string sdkPath: "${sdkPath}" - property stringList includePaths: [ - sdkPath + "/include/engine", - sdkPath + "/include/modules", - sdkPath + "/include/next", - sdkPath + "/include/next/math", - sdkPath + "/include/next/core", - sdkPath + "/include/next/anim" - ] - property bool desktop: !qbs.targetOS.contains("android") && !qbs.targetOS.contains("ios") && !qbs.targetOS.contains("tvos") - property bool isAndroid: qbs.targetOS.contains("android") - property bool isBundle: qbs.targetOS.contains("darwin") - - DynamicLibrary { - condition: desktop - name: "${projectName}-editor" - files: [ - "plugin.cpp", - //+{FilesList} - //-{FilesList} - ] - Depends { name: "cpp" } - cpp.cxxLanguageVersion: "c++17" - cpp.defines: ["SHARED_DEFINE"] - cpp.includePaths: project.includePaths - cpp.libraryPaths: [ ${libraryPaths} - project.sdkPath + project.platform + "/lib", - project.sdkPath + project.platform + "/bin", - project.sdkPath + project.platform + "/bin/plugins" - ] - cpp.dynamicLibraries: [ - //+{EditorLibrariesList} - //-{EditorLibrariesList} - "next-editor", - "engine-editor" - ] - - Group { - name: "Install Plugin" - fileTagsFilter: "dynamiclibrary" - qbs.install: true - qbs.installDir: "" - qbs.installPrefix: "" - } - } - - Application { - name: "${projectName}" - consoleApplication: false - - files: [ - "application.cpp", - "plugin.cpp", - //+{FilesList} - //-{FilesList} - ] - Depends { name: "cpp" } - Depends { name: "bundle" } - - bundle.identifierPrefix: "${Identifier_Prefix}" - cpp.cxxLanguageVersion: "c++14" - cpp.includePaths: project.includePaths - cpp.libraryPaths: [ ${libraryPaths} - project.sdkPath + project.platform + "/static" - ] - - cpp.staticLibraries: [ - //+{LibrariesList} - //-{LibrariesList} - "engine", - "next", - "physfs", - "freetype", - "angelscript", - "bullet3" - ] - - Properties { - condition: desktop - cpp.staticLibraries: outer.concat([ - "zlib", - "glfw", - "glad" - ]) - } - Properties { - condition: !desktop - cpp.staticLibraries: outer.concat([ - "glfm" - ]) - } - - Properties { - condition: qbs.targetOS[0] === "windows" - cpp.dynamicLibraries: [ "Shell32", "User32", "Gdi32", "Advapi32", "opengl32" ] - } - Properties { - condition: qbs.targetOS[0] === "linux" - cpp.dynamicLibraries: [ "X11", "Xrandr", "Xi", "Xxf86vm", "Xcursor", "Xinerama", "dl", "pthread" ] - } - Properties { - condition: qbs.targetOS[0] === "macos" - cpp.weakFrameworks: [ "OpenGL", "Cocoa", "CoreVideo", "IOKit" ] - } - Properties { - condition: qbs.targetOS[0] === "ios" - cpp.weakFrameworks: [ "OpenGLES", "UIKit", "CoreGraphics", "Foundation", "QuartzCore" ] - cpp.dynamicLibraries: [ "z" ] - cpp.defines: outer.concat([ "THUNDER_MOBILE" ]) - cpp.minimumIosVersion: "10.0" - } - Properties { - condition: qbs.targetOS[0] === "tvos" - cpp.weakFrameworks: [ "OpenGLES", "UIKit", "CoreGraphics", "Foundation", "QuartzCore" ] - cpp.dynamicLibraries: [ "z" ] - cpp.defines: outer.concat([ "THUNDER_MOBILE" ]) - cpp.minimumTvosVersion: "10.0" - } - Properties { - condition: qbs.targetOS[0] === "android" - Android.ndk.appStl: "c++_shared" - Android.ndk.platform: "android-21" - Android.sdk.packageName: "com.${companyName}.${projectName}" - Android.sdk.manifestFile: "${manifestFile}" - Android.sdk.assetsDir: "${assetsPath}" - Android.sdk.resourcesDir: "${resourceDir}" - cpp.dynamicLibraries: [ "log", "android", "EGL", "GLESv3", "z" ] - cpp.defines: outer.concat([ "THUNDER_MOBILE" ]) - cpp.cxxStandardLibrary: "libc++" - Depends { productTypes: ["android.nativelibrary"] } - } - - Group { - name: "Install Application" - qbs.install: true - qbs.installDir: "" - qbs.installSourceBase: product.buildDirectory - qbs.installPrefix: "" - - fileTagsFilter: isForAndroid ? ["android.apk"] : (project.isBundle ? ["bundle.content"] : ["application"]) - } - } -} diff --git a/modules/editor/shadertools/converter/shaderbuilder.cpp b/modules/editor/shadertools/converter/shaderbuilder.cpp index ad1a04af9..7d43833dd 100644 --- a/modules/editor/shadertools/converter/shaderbuilder.cpp +++ b/modules/editor/shadertools/converter/shaderbuilder.cpp @@ -15,6 +15,7 @@ #include #include +#include #include "../../config.h" @@ -359,7 +360,8 @@ void ShaderBuilder::compileData(VariantMap &data) { uint32_t version = 430; bool es = false; - if(ProjectSettings::instance()->currentPlatformName() != "desktop") { + NativeCodeBuilder *builder = ProjectSettings::instance()->currentBuilder(); + if(builder->isEmbedded()) { version = 300; es = true; } @@ -528,7 +530,8 @@ bool ShaderBuilder::parseShaderFormat(const TString &path, VariantMap &user, int define += "\n#define USE_GBUFFER"; - if(materialType == Material::Surface && ProjectSettings::instance()->currentPlatformName() == "desktop") { + NativeCodeBuilder *builder = ProjectSettings::instance()->currentBuilder(); + if(builder && !builder->isEmbedded()) { define += "\n#define USE_SSBO"; } diff --git a/modules/editor/shadertools/converter/shadergraph.cpp b/modules/editor/shadertools/converter/shadergraph.cpp index 55fc7cd0c..171a6e6b8 100644 --- a/modules/editor/shadertools/converter/shadergraph.cpp +++ b/modules/editor/shadertools/converter/shadergraph.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -69,6 +70,8 @@ ShaderGraph::ShaderGraph() : m_version = ShaderBuilder::version(); if(m_nodeTypes.empty()) { + GraphNode::registerClassFactory(Engine::resourceSystem()); + ShaderRootNode::registerClassFactory(Engine::resourceSystem()); scanForCustomFunctions(); @@ -490,7 +493,8 @@ VariantMap ShaderGraph::data(bool editor, ShaderRootNode *root) { define += "\n#define ORIGIN_TOP"; } - if(root->materialType() == ShaderRootNode::Surface && ProjectSettings::instance()->currentPlatformName() == "desktop") { + NativeCodeBuilder *builder = ProjectSettings::instance()->currentBuilder(); + if(root->materialType() == ShaderRootNode::Surface && builder && !builder->isEmbedded()) { define += "\n#define USE_SSBO"; } diff --git a/modules/editor/shadertools/converter/spirvconverter.h b/modules/editor/shadertools/converter/spirvconverter.h index e8560fb3b..979128007 100644 --- a/modules/editor/shadertools/converter/spirvconverter.h +++ b/modules/editor/shadertools/converter/spirvconverter.h @@ -136,6 +136,8 @@ class SpirVConverter { int32_t type; + int32_t size; + TString name; }; @@ -256,10 +258,12 @@ class SpirVConverter { for(int32_t i = 0; i < resources.uniform_buffers.size(); i++) { int id = resources.uniform_buffers[i].id; int bind = msl.get_automatic_msl_resource_binding(id); + auto type = msl.get_type(resources.uniform_buffers[i].type_id); TString name = msl.get_name(id); for(auto &it : inputs) { if(it.name == name && it.type == Uniform) { it.location = bind; + it.size = msl.get_declared_struct_size(type); } } } @@ -267,10 +271,12 @@ class SpirVConverter { for(int32_t i = 0; i < resources.storage_buffers.size(); i++) { int id = resources.storage_buffers[i].id; int bind = msl.get_automatic_msl_resource_binding(id); + auto type = msl.get_type(resources.uniform_buffers[i].type_id); TString name = msl.get_name(id); for(auto &it : inputs) { if(it.name == name && it.type == Uniform) { it.location = bind; + it.size = msl.get_declared_struct_size(type); } } } diff --git a/modules/editor/shadertools/shaders/Default.frag b/modules/editor/shadertools/shaders/Default.frag index 68876e9e0..892c40d91 100644 --- a/modules/editor/shadertools/shaders/Default.frag +++ b/modules/editor/shadertools/shaders/Default.frag @@ -2,6 +2,7 @@ #pragma flags +#define NO_INSTANCE #include "ShaderLayout.h" layout(location = 0) out vec4 rgb; diff --git a/modules/editor/shadertools/shaders/Static.vert b/modules/editor/shadertools/shaders/Static.vert index 7dd8b119f..adaac6d07 100644 --- a/modules/editor/shadertools/shaders/Static.vert +++ b/modules/editor/shadertools/shaders/Static.vert @@ -30,7 +30,6 @@ layout(location = 7) flat out int _instanceOffset; void main(void) { #pragma offset - #pragma instance #pragma objectId diff --git a/modules/editor/shadertools/shadertools.qbs b/modules/editor/shadertools/shadertools.qbs index 506330237..1adb4d805 100644 --- a/modules/editor/shadertools/shadertools.qbs +++ b/modules/editor/shadertools/shadertools.qbs @@ -61,7 +61,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/editor/spineimporter/spineimporter.qbs b/modules/editor/spineimporter/spineimporter.qbs index f6c13da5a..d2d31caa5 100644 --- a/modules/editor/spineimporter/spineimporter.qbs +++ b/modules/editor/spineimporter/spineimporter.qbs @@ -46,7 +46,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/editor/texteditor/editor/textwidget.cpp b/modules/editor/texteditor/editor/textwidget.cpp index 4f25827fc..0d66afe37 100644 --- a/modules/editor/texteditor/editor/textwidget.cpp +++ b/modules/editor/texteditor/editor/textwidget.cpp @@ -38,7 +38,12 @@ namespace { const char *gSpaces("Editors/Text_Editor/Indents/Use_Spaces"); const char *gTabSize("Editors/Text_Editor/Indents/Tab_Size"); +#ifdef __APPLE__ + const char *gDefaultFont("Menlo"); +#else const char *gDefaultFont("Source Code Pro"); +#endif + }; TextWidget::TextWidget(QWidget *parent) : @@ -138,13 +143,14 @@ void TextWidget::saveFile(const QString &path) { void TextWidget::checkClassMap() { for(auto &it : PluginManager::instance()->extensions("converter")) { AssetConverter *converter = reinterpret_cast(PluginManager::instance()->getPluginObject(it)); - - for(TString &format : converter->suffixes()) { - if(format.toLower() == Url(m_fileName.toStdString()).suffix()) { - CodeBuilder *builder = dynamic_cast(converter); - if(builder) { - m_classModel = builder->classMap(); - return; + if(converter) { + for(TString &format : converter->suffixes()) { + if(format.toLower() == Url(m_fileName.toStdString()).suffix()) { + CodeBuilder *builder = dynamic_cast(converter); + if(builder) { + m_classModel = builder->classMap(); + return; + } } } } diff --git a/modules/editor/texteditor/texteditor.qbs b/modules/editor/texteditor/texteditor.qbs index e442a5fcc..30801e81b 100644 --- a/modules/editor/texteditor/texteditor.qbs +++ b/modules/editor/texteditor/texteditor.qbs @@ -47,7 +47,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/editor/texturetools/texturetools.qbs b/modules/editor/texturetools/texturetools.qbs index b8fe61408..cd9e58db4 100644 --- a/modules/editor/texturetools/texturetools.qbs +++ b/modules/editor/texturetools/texturetools.qbs @@ -51,7 +51,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/editor/tiledimporter/tiledimporter.qbs b/modules/editor/tiledimporter/tiledimporter.qbs index 711b7f14f..462c1826c 100644 --- a/modules/editor/tiledimporter/tiledimporter.qbs +++ b/modules/editor/tiledimporter/tiledimporter.qbs @@ -46,7 +46,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/editor/timeline/timeline.qbs b/modules/editor/timeline/timeline.qbs index f6bedaa8d..76067ea6d 100644 --- a/modules/editor/timeline/timeline.qbs +++ b/modules/editor/timeline/timeline.qbs @@ -55,7 +55,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/editor/webtools/converter/emscriptenbuilder.cpp b/modules/editor/webtools/converter/emscriptenbuilder.cpp index 4772ec17f..25ec85e10 100644 --- a/modules/editor/webtools/converter/emscriptenbuilder.cpp +++ b/modules/editor/webtools/converter/emscriptenbuilder.cpp @@ -2,8 +2,6 @@ #include -#include - #include #include @@ -17,36 +15,18 @@ namespace { EmscriptenBuilder::EmscriptenBuilder() { setName("[EmscriptenBuilder]"); + connect(&m_process, _SIGNAL(finished(int)), this, _SLOT(onBuildFinished(int))); + EditorSettings *settings = EditorSettings::instance(); settings->registerValue(gEmscriptenPath, "", "editor=Path"); - TString sdk(ProjectSettings::instance()->sdkPath()); - - m_includePath.push_back(sdk + "/include/engine"); - m_includePath.push_back(sdk + "/include/modules"); - m_includePath.push_back(sdk + "/include/next"); - m_includePath.push_back(sdk + "/include/next/math"); - m_includePath.push_back(sdk + "/include/next/core"); + m_libPath.push_back(ProjectSettings::instance()->sdkPath() + "/emscripten/x86/static"); - m_libPath.push_back(sdk + "/emscripten/x86/static"); - - m_libs.push_back("engine"); - m_libs.push_back("next"); - m_libs.push_back("physfs"); - m_libs.push_back("zlib"); - m_libs.push_back("glfm"); - m_libs.push_back("bullet"); - m_libs.push_back("bullet3"); - m_libs.push_back("rendergl"); - m_libs.push_back("freetype"); - m_libs.push_back("uikit"); - m_libs.push_back("media"); m_libs.push_back("vorbis"); m_libs.push_back("vorbisfile"); m_libs.push_back("ogg"); - m_libs.push_back("angel"); - m_libs.push_back("angelscript"); + m_libs.push_back("zlib"); } bool EmscriptenBuilder::isEmpty() const { @@ -58,38 +38,17 @@ bool EmscriptenBuilder::buildProject() { aInfo() << name() << "Build started."; m_emPath = EditorSettings::instance()->value(gEmscriptenPath).toString(); - - ProcessEnvironment env = ProcessEnvironment::systemEnvironment(); - #ifdef _WIN32 - env.insert("EMSDK", m_emPath); - env.insert("EMSDK_PYTHON", m_emPath + "\\python\\3.9.2-nuget_64bit\\python.exe"); - env.insert("EMSDK_NODE", m_emPath + "\\node\\16.20.0_64bit\\bin\\node.exe"); - env.insert("JAVA_HOME", m_emPath + "\\java\\8.152_64bit"); - m_binary = m_emPath + "/upstream/emscripten/emcc.bat"; - - TString path = env.value("PATH") + ";"; - path += m_emPath + ";"; - path += m_emPath + "\\upstream\\emscripten;"; - path += m_emPath + "\\node\\16.20.0_64bit\\bin"; - - env.insert("PATH", path); #endif - - m_process.setProcessEnvironment(env); - if(m_emPath.isEmpty() || !File::exists(m_binary)) { aError() << name() << "Unable to find Emscripten SDK at:" << m_emPath; return false; } - ProjectSettings *mgr = ProjectSettings::instance(); - - m_project = mgr->generatedPath() + "/"; - generateProject(); + ProjectSettings *mgr = ProjectSettings::instance(); m_artifact = mgr->cachePath() + "/" + mgr->currentPlatformName() + "/release"; File::mkPath(m_artifact); @@ -99,8 +58,22 @@ bool EmscriptenBuilder::buildProject() { m_artifact + "/application.js", m_artifact + "/application.wasm"}); + ProcessEnvironment env = ProcessEnvironment::systemEnvironment(); +#ifdef _WIN32 + env.insert("EMSDK", m_emPath); + env.insert("EMSDK_PYTHON", m_emPath + "\\python\\3.9.2-nuget_64bit\\python.exe"); + env.insert("EMSDK_NODE", m_emPath + "\\node\\16.20.0_64bit\\bin\\node.exe"); + env.insert("JAVA_HOME", m_emPath + "\\java\\8.152_64bit"); + + TString path = env.value("PATH") + ";"; + path += m_emPath + ";"; + path += m_emPath + "\\upstream\\emscripten;"; + path += m_emPath + "\\node\\16.20.0_64bit\\bin"; + + env.insert("PATH", path); +#endif StringList args; - for(auto &it : m_includePath) { + for(auto &it : m_incPath) { args.push_back(TString("-I") + it); } @@ -126,9 +99,10 @@ bool EmscriptenBuilder::buildProject() { args.push_back("--preload-file"); args.push_back("../webgl/assets@/"); + m_process.setProcessEnvironment(env); m_process.setWorkingDirectory(m_project); if(m_process.start(m_binary, args) && !m_process.waitForStarted()) { - aError() << name() << "Failed to start process"; + aError() << name() << "Failed to start process."; return false; } } @@ -137,11 +111,10 @@ bool EmscriptenBuilder::buildProject() { void EmscriptenBuilder::onBuildFinished(int exitCode) { if(exitCode == 0) { - TString targetFile(m_artifact + "/application.html"); - - File::remove(targetFile); - QFile::copy(":/application.html", targetFile.data()); - QFile::setPermissions(targetFile.data(), QFileDevice::WriteOwner); + updateTemplate(":/application.html", m_artifact + "/application.html"); } - NativeCodeBuilder::onBuildFinished(exitCode); + + aInfo() << name() << "Build finished."; + buildSuccessful(exitCode == 0); + m_outdated = false; } diff --git a/modules/editor/webtools/converter/emscriptenbuilder.h b/modules/editor/webtools/converter/emscriptenbuilder.h index 50ddd6992..51c31a9f4 100644 --- a/modules/editor/webtools/converter/emscriptenbuilder.h +++ b/modules/editor/webtools/converter/emscriptenbuilder.h @@ -20,7 +20,11 @@ class EmscriptenBuilder : public NativeCodeBuilder { StringList platforms() const override { return {"webgl"}; } + PackagingMode packagingMode() const override { return None; } + +protected: TString m_emPath; + TString m_binary; }; diff --git a/modules/editor/webtools/webtools.qbs b/modules/editor/webtools/webtools.qbs index ec1e4a965..f966cddfc 100644 --- a/modules/editor/webtools/webtools.qbs +++ b/modules/editor/webtools/webtools.qbs @@ -46,7 +46,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/media/media.qbs b/modules/media/media.qbs index 4c615ac00..8b89c40c0 100644 --- a/modules/media/media.qbs +++ b/modules/media/media.qbs @@ -63,7 +63,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") cpp.weakFrameworks: ["OpenAL"] - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/network/network.qbs b/modules/network/network.qbs index 86c9431f3..46f0618ea 100644 --- a/modules/network/network.qbs +++ b/modules/network/network.qbs @@ -50,7 +50,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" cpp.libraryPaths: [ "/opt/homebrew/opt/openssl/lib" ] } diff --git a/modules/physics/bullet/bullet.qbs b/modules/physics/bullet/bullet.qbs index 0124cd369..0c7234517 100644 --- a/modules/physics/bullet/bullet.qbs +++ b/modules/physics/bullet/bullet.qbs @@ -58,7 +58,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" cpp.commonCompilerFlags: "-Wno-argument-outside-range" } diff --git a/modules/renders/rendergl/rendergl.qbs b/modules/renders/rendergl/rendergl.qbs index 8b983d73f..5bb274218 100644 --- a/modules/renders/rendergl/rendergl.qbs +++ b/modules/renders/rendergl/rendergl.qbs @@ -60,12 +60,6 @@ Project { cpp.rpaths: "$ORIGIN/../../lib" } - Properties { - condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" - cpp.weakFrameworks: ["OpenGL"] - } - Group { name: "Install Dynamic RenderGL" fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] @@ -88,6 +82,7 @@ Project { StaticLibrary { name: "rendergl" + condition: !qbs.targetOS.contains("darwin") files: rendergl.srcFiles Depends { name: "cpp" } Depends { name: "bundle" } @@ -121,11 +116,6 @@ Project { ]) } - Properties { - condition: qbs.targetOS.contains("darwin") - cpp.weakFrameworks: ["OpenGL"] - } - Group { name: "Install Static RenderGL" fileTagsFilter: product.type diff --git a/modules/renders/rendermt/includes/rendermtsystem.h b/modules/renders/rendermt/includes/rendermtsystem.h index 7c0e67e35..084cd390a 100644 --- a/modules/renders/rendermt/includes/rendermtsystem.h +++ b/modules/renders/rendermt/includes/rendermtsystem.h @@ -5,10 +5,12 @@ #include -#include "wrappermt.h" - class Engine; +namespace MTK { + class View; +} + class RenderMtSystem : public RenderSystem { public: RenderMtSystem(Engine *engine); @@ -18,7 +20,9 @@ class RenderMtSystem : public RenderSystem { void update(World *world) override; - void setCurrentView(MTK::View *view, MTL::CommandBuffer *cmd); + void setCurrentView(MTK::View *view); + + void createMetalWindow(); #ifdef SHARED_DEFINE QWindow *createRhiWindow(Viewport *viewport) override; @@ -29,8 +33,6 @@ class RenderMtSystem : public RenderSystem { MTK::View *m_currentView; - MTL::CommandBuffer *m_currentBuffer; - }; #endif // RENDERMTSYSTEM_H diff --git a/modules/renders/rendermt/rendermt.qbs b/modules/renders/rendermt/rendermt.qbs index 98cecd7cb..2d4e0b6f8 100644 --- a/modules/renders/rendermt/rendermt.qbs +++ b/modules/renders/rendermt/rendermt.qbs @@ -46,7 +46,7 @@ Project { cpp.cxxLanguageVersion: rendermt.languageVersion cpp.cxxStandardLibrary: rendermt.standardLibrary cpp.minimumMacosVersion: rendermt.osxVersion - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" cpp.weakFrameworks: ["Metal", "MetalKit"] cpp.objcFlags: ["-fmodules", "-fcxx-modules"] cpp.objcxxFlags: ["-fmodules", "-fcxx-modules"] diff --git a/modules/renders/rendermt/src/rendermtsystem.cpp b/modules/renders/rendermt/src/rendermtsystem.cpp index adb48ba24..41cf3444b 100644 --- a/modules/renders/rendermt/src/rendermtsystem.cpp +++ b/modules/renders/rendermt/src/rendermtsystem.cpp @@ -14,6 +14,7 @@ #include "commandbuffermt.h" #include "wrappermt.h" +#include "viewdelegate.h" #include @@ -22,8 +23,7 @@ static int32_t registered = 0; RenderMtSystem::RenderMtSystem(Engine *engine) : RenderSystem(), m_engine(engine), - m_currentView(nullptr), - m_currentBuffer(nullptr) { + m_currentView(nullptr) { PROFILE_FUNCTION(); @@ -81,29 +81,37 @@ void RenderMtSystem::update(World *world) { PipelineContext *context = pipelineContext(); if(context && CommandBufferMt::isInited()) { - CommandBufferMt *cmd = static_cast(context->buffer()); + NS::AutoreleasePool *pool = NS::AutoreleasePool::alloc()->init(); + MTL::CommandBuffer *cmdMt = WrapperMt::queue()->commandBuffer(); + + MTK::View *view = reinterpret_cast(RenderSystem::windowHandle()); + if(view) { + setCurrentView(view); + } RenderTargetMt *defaultTarget = static_cast(context->defaultTarget()); - defaultTarget->setNativeHandle(m_currentView->currentRenderPassDescriptor()); - cmd->begin(m_currentBuffer); - + CommandBufferMt *cmd = static_cast(context->buffer()); + cmd->begin(cmdMt); RenderSystem::update(world); - cmd->end(); + + CA::MetalDrawable *drawable = m_currentView->currentDrawable(); + if(drawable) { + cmdMt->presentDrawable(drawable); + cmdMt->commit(); + } + + pool->release(); } - } -void RenderMtSystem::setCurrentView(MTK::View *view, MTL::CommandBuffer *cmd) { +void RenderMtSystem::setCurrentView(MTK::View *view) { m_currentView = view; - m_currentBuffer = cmd; } #if defined(SHARED_DEFINE) -#include "viewdelegate.h" - #include #include diff --git a/modules/renders/rendermt/src/resources/computeshadermt.cpp b/modules/renders/rendermt/src/resources/computeshadermt.cpp index a92fd0afd..80a181aed 100644 --- a/modules/renders/rendermt/src/resources/computeshadermt.cpp +++ b/modules/renders/rendermt/src/resources/computeshadermt.cpp @@ -99,11 +99,10 @@ bool ComputeInstanceMt::bind(CommandBufferMt *buffer, MTL::ComputeCommandEncoder uint32_t size = shader->uniformSize(); if(size) { if(m_data == nullptr) { - m_data = WrapperMt::device()->newBuffer(m_uniformBuffer, size, MTL::ResourceStorageModeManaged); + m_data = WrapperMt::device()->newBuffer(m_uniformBuffer, size, MTL::ResourceStorageModeShared); } if(m_uniformDirty) { - m_data->didModifyRange(NS::Range::Make(0, size)); m_uniformDirty = false; } diff --git a/modules/renders/rendermt/src/resources/materialmt.cpp b/modules/renders/rendermt/src/resources/materialmt.cpp index ae2a06ea6..d6246813a 100644 --- a/modules/renders/rendermt/src/resources/materialmt.cpp +++ b/modules/renders/rendermt/src/resources/materialmt.cpp @@ -171,6 +171,13 @@ void MaterialMt::loadUserData(const VariantMap &data) { } } + if(pair.second == FragmentVisibility) { + m_layers |= Material::Visibility; + if(m_layers & Opaque) { + //m_layers |= Material::Shadowcast; + } + } + m_pipelineFunctions[pair.second] = shader; } } @@ -380,12 +387,11 @@ bool MaterialInstanceMt::bind(CommandBufferMt &buffer, uint32_t layer, const Glo // Global buffer { if(m_globalBuffer == nullptr) { - m_globalBuffer = WrapperMt::device()->newBuffer(sizeof(Global), MTL::ResourceStorageModeManaged); + m_globalBuffer = WrapperMt::device()->newBuffer(sizeof(Global), MTL::ResourceStorageModeShared); } uint8_t *ptr = reinterpret_cast(m_globalBuffer->contents()); if(ptr) { memcpy(ptr, &global, sizeof(Global)); - m_globalBuffer->didModifyRange(NS::Range::Make(0, sizeof(Global))); } if(m_globalVertextLocation >= 0) { @@ -404,12 +410,11 @@ bool MaterialInstanceMt::bind(CommandBufferMt &buffer, uint32_t layer, const Glo if(m_instanceBuffer) { m_instanceBuffer->release(); } - m_instanceBuffer = WrapperMt::device()->newBuffer(localBuffer.size(), MTL::ResourceStorageModeManaged); + m_instanceBuffer = WrapperMt::device()->newBuffer(localBuffer.size(), MTL::ResourceStorageModeShared); } uint8_t *ptr = reinterpret_cast(m_instanceBuffer->contents()); if(ptr) { memcpy(ptr, localBuffer.data(), localBuffer.size()); - m_instanceBuffer->didModifyRange(NS::Range::Make(0, localBuffer.size())); } if(m_localVertextLocation >= 0) { @@ -428,11 +433,23 @@ bool MaterialInstanceMt::bind(CommandBufferMt &buffer, uint32_t layer, const Glo } } - MTL::DepthStencilState *state = material->depthStencilState(); - if(state) { - encoder->setDepthStencilState(state); - if(material->m_stencilState.enabled) { - encoder->setStencilReferenceValue(material->m_stencilState.reference); + if(material->m_depthState.enabled) { + MTL::DepthStencilState *state = material->depthStencilState(); + if(state) { + encoder->setDepthStencilState(state); + if(material->m_stencilState.enabled) { + encoder->setStencilReferenceValue(material->m_stencilState.reference); + } + } + } + + if(material->m_doubleSided) { + encoder->setCullMode(MTL::CullModeNone); + } else { + if(layer & Material::Shadowcast || material->m_materialType == Material::LightFunction) { + encoder->setCullMode(MTL::CullModeFront); + } else { + encoder->setCullMode(MTL::CullModeBack); } } diff --git a/modules/renders/rendermt/src/resources/meshmt.cpp b/modules/renders/rendermt/src/resources/meshmt.cpp index d558ddc1d..ba715d06e 100644 --- a/modules/renders/rendermt/src/resources/meshmt.cpp +++ b/modules/renders/rendermt/src/resources/meshmt.cpp @@ -85,10 +85,8 @@ void MeshMt::update() { size_t size = sizeof(uint32_t) * indices().size(); - m_indexBuffer = WrapperMt::device()->newBuffer(size, MTL::ResourceStorageModeManaged); + m_indexBuffer = WrapperMt::device()->newBuffer(size, MTL::ResourceStorageModeShared); memcpy(m_indexBuffer->contents(), indices().data(), size); - - m_indexBuffer->didModifyRange(NS::Range::Make(0, size)); } if(!vertices().empty()) { @@ -109,7 +107,7 @@ void MeshMt::update() { m_vertexBuffer->release(); } - m_vertexBuffer = WrapperMt::device()->newBuffer(size, MTL::ResourceStorageModeManaged); + m_vertexBuffer = WrapperMt::device()->newBuffer(size, MTL::ResourceStorageModeShared); } uint8_t *ptr = reinterpret_cast(m_vertexBuffer->contents()); @@ -148,7 +146,5 @@ void MeshMt::update() { m_weightsSize = sizeof(Vector4) * vCount; memcpy(&ptr[offset], weights().data(), m_weightsSize); } - - m_vertexBuffer->didModifyRange(NS::Range::Make(0, size)); } } diff --git a/modules/renders/rendermt/src/resources/texturemt.cpp b/modules/renders/rendermt/src/resources/texturemt.cpp index 05b393727..23643b31b 100644 --- a/modules/renders/rendermt/src/resources/texturemt.cpp +++ b/modules/renders/rendermt/src/resources/texturemt.cpp @@ -80,7 +80,7 @@ void TextureMt::updateTexture() { } else { textureDesc->setTextureType(m_depth == 1 ? MTL::TextureType2D : MTL::TextureType3D); } - textureDesc->setStorageMode(MTL::StorageModeManaged); + textureDesc->setStorageMode(MTL::StorageModeShared); textureDesc->setUsage(isRender() ? (MTL::TextureUsageRenderTarget | MTL::TextureUsageShaderRead) : (MTL::ResourceUsageSample | MTL::ResourceUsageRead)); @@ -160,7 +160,7 @@ void TextureMt::uploadTexture(uint32_t slice) { uint32_t h = (m_height >> i); uint32_t d = cube ? (m_depth >> i) : 1; - int rowSize = w * components(); + int rowSize = w * components() * bytesPerChannel(); switch(m_compress) { case Texture::BC1: rowSize = ((w + 3) / 4) * 8; break; case Texture::BC3: diff --git a/modules/renders/rendermt/src/viewdeleate.cpp b/modules/renders/rendermt/src/viewdeleate.cpp index c00821d38..54b3c30f3 100644 --- a/modules/renders/rendermt/src/viewdeleate.cpp +++ b/modules/renders/rendermt/src/viewdeleate.cpp @@ -1,12 +1,13 @@ #include "viewdelegate.h" #include "rendermtsystem.h" + +#include + #if defined(SHARED_DEFINE) #include "editor/viewport/viewport.h" #endif -extern "C" NS::String* NSTemporaryDirectory( void ); - ViewDelegate::ViewDelegate(RenderMtSystem *system, Viewport *viewport) : m_render(system), m_viewport(viewport) { @@ -14,71 +15,13 @@ ViewDelegate::ViewDelegate(RenderMtSystem *system, Viewport *viewport) : } void ViewDelegate::drawInMTKView(MTK::View *view) { - NS::AutoreleasePool *pool = NS::AutoreleasePool::alloc()->init(); -#if defined(SHARED_DEFINE) - NS::String* _pTraceSaveFilePath; - if(frame == -1) { - MTL::CaptureManager* pCaptureManager = MTL::CaptureManager::sharedCaptureManager(); - bool success = pCaptureManager->supportsDestination( MTL::CaptureDestinationGPUTraceDocument ); - if ( !success ) - { - __builtin_printf( "Capture support is not enabled\n"); - assert( false ); - } - - char filename[NAME_MAX]; - std::time_t now; - std::time( &now ); - std::strftime( filename, NAME_MAX, "capture-%H-%M-%S_%m-%d-%y.gputrace", std::localtime( &now ) ); - - _pTraceSaveFilePath = NSTemporaryDirectory()->stringByAppendingString( NS::String::string( filename, NS::UTF8StringEncoding ) ); - NS::URL *pURL = NS::URL::alloc()->initFileURLWithPath( _pTraceSaveFilePath ); - - MTL::CaptureDescriptor* pCaptureDescriptor = MTL::CaptureDescriptor::alloc()->init(); - - pCaptureDescriptor->setDestination( MTL::CaptureDestinationGPUTraceDocument ); - pCaptureDescriptor->setOutputURL( pURL ); - pCaptureDescriptor->setCaptureObject( WrapperMt::device() ); - - NS::Error *pError = nullptr; - - success = pCaptureManager->startCapture( pCaptureDescriptor, &pError ); - if ( !success ) - { - assert( false ); - } - - pURL->release(); - pCaptureDescriptor->release(); - - m_captureInprogress = true; - } - frame++; -#endif - MTL::CommandBuffer *cmd = WrapperMt::queue()->commandBuffer(); - - m_render->setCurrentView(view, cmd); + m_render->setCurrentView(view); // Render cycle here #if defined(SHARED_DEFINE) m_viewport->onDraw(); +#else + Timer::update(); + Engine::update(); #endif - CA::MetalDrawable *drawable = view->currentDrawable(); - if(drawable) { - cmd->presentDrawable(drawable); - cmd->commit(); - } -#if defined(SHARED_DEFINE) - if(m_captureInprogress) { - MTL::CaptureManager* pCaptureManager = MTL::CaptureManager::sharedCaptureManager(); - pCaptureManager->stopCapture(); - - NS::String* pOpenCmd = NS::MakeConstantString( "open " )->stringByAppendingString( _pTraceSaveFilePath ); - system( pOpenCmd->utf8String() ); - - m_captureInprogress = false; - } -#endif - - pool->release(); } diff --git a/modules/renders/rendermt/src/wrappermt.cpp b/modules/renders/rendermt/src/wrappermt.cpp index 4d01c85c9..a79a930de 100644 --- a/modules/renders/rendermt/src/wrappermt.cpp +++ b/modules/renders/rendermt/src/wrappermt.cpp @@ -4,16 +4,22 @@ #define CA_PRIVATE_IMPLEMENTATION #include "wrappermt.h" +#include "resources/texture.h" MTL::Device *WrapperMt::s_device = nullptr; MTL::CommandQueue *WrapperMt::s_queue = nullptr; MTL::Device *WrapperMt::device() { - if(s_device == nullptr) - { + if(s_device == nullptr) { s_device = MTL::CreateSystemDefaultDevice(); + if(s_device->supportsFeatureSet(MTL::FeatureSet_iOS_GPUFamily4_v1) || s_device->supportsFeatureSet(MTL::FeatureSet_iOS_GPUFamily3_v1)) { + Texture::setMaxTextureSize(16384); // Common for A9 chips and newer + } else if(s_device->supportsFeatureSet(MTL::FeatureSet_iOS_GPUFamily2_v2) || s_device->supportsFeatureSet(MTL::FeatureSet_iOS_GPUFamily1_v2)) { + Texture::setMaxTextureSize(8192); + } + s_queue = s_device->newCommandQueue(); } diff --git a/modules/uikit/src/components/image.cpp b/modules/uikit/src/components/image.cpp index 9fe43b1c5..2bf969a52 100644 --- a/modules/uikit/src/components/image.cpp +++ b/modules/uikit/src/components/image.cpp @@ -12,7 +12,7 @@ namespace { const char *gOverride("mainTexture"); const char *gColor("mainColor"); - const char *gDefaultSprite(".embedded/DefaultSprite.shader"); + const char *gDefaultSprite(".embedded/DefaultUI.shader"); }; /*! diff --git a/modules/uikit/uikit.qbs b/modules/uikit/uikit.qbs index f544f4b2c..865639fd4 100644 --- a/modules/uikit/uikit.qbs +++ b/modules/uikit/uikit.qbs @@ -65,6 +65,12 @@ Project { cpp.rpaths: "$ORIGIN/../lib" } + Properties { + condition: qbs.targetOS.contains("darwin") + cpp.sonamePrefix: "@executable_path" + cpp.commonCompilerFlags: "-Wno-argument-outside-range" + } + Group { name: "Install Dynamic uikit" fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] diff --git a/modules/vms/angel/angel.qbs b/modules/vms/angel/angel.qbs index 3cd802b6a..c99b95e22 100644 --- a/modules/vms/angel/angel.qbs +++ b/modules/vms/angel/angel.qbs @@ -60,7 +60,7 @@ Project { Properties { condition: qbs.targetOS.contains("darwin") - cpp.sonamePrefix: "@executable_path" + cpp.sonamePrefix: "@executable_path/plugins" } Group { diff --git a/modules/vms/angel/src/converters/angelbuilder.cpp b/modules/vms/angel/src/converters/angelbuilder.cpp index 0109b89e3..761e4e1b3 100644 --- a/modules/vms/angel/src/converters/angelbuilder.cpp +++ b/modules/vms/angel/src/converters/angelbuilder.cpp @@ -114,7 +114,8 @@ bool AngelBuilder::buildProject() { } } - if(mod->Build() >= 0) { + int code = mod->Build(); + if(code >= 0) { TString destination = ProjectSettings::instance()->importPath() + "/" + persistentUUID(); File dst(destination.data()); @@ -132,10 +133,9 @@ bool AngelBuilder::buildProject() { } m_classModel->update(); - - buildSuccessful(); } + buildSuccessful(code >= 0); m_outdated = false; mod->Discard(); diff --git a/thirdparty/glfm/glfm.qbs b/thirdparty/glfm/glfm.qbs index d78a4413a..cd0493b0a 100644 --- a/thirdparty/glfm/glfm.qbs +++ b/thirdparty/glfm/glfm.qbs @@ -17,7 +17,7 @@ Project { StaticLibrary { name: "glfm" - condition: !glfm.desktop + condition: !glfm.desktop || qbs.targetOS.contains("darwin") files: glfm.srcFiles Depends { name: "cpp" } Depends { name: "bundle" } @@ -42,7 +42,7 @@ Project { } Properties { - condition: qbs.targetOS.contains("ios") || qbs.targetOS.contains("tvos") + condition: qbs.targetOS.contains("ios") || qbs.targetOS.contains("tvos") || qbs.targetOS.contains("darwin") files: outer.concat(["src/glfm_apple.m"]) } diff --git a/thirdparty/next/src/os/aprocess.cpp b/thirdparty/next/src/os/aprocess.cpp index 0eb885210..8893d4ca6 100644 --- a/thirdparty/next/src/os/aprocess.cpp +++ b/thirdparty/next/src/os/aprocess.cpp @@ -367,8 +367,6 @@ bool Process::startDetached(const TString &program, const StringList &arguments, void Process::monitorProcess() { while(m_ptr->m_state == State::Running) { - readOutput(); - #ifdef _WIN32 DWORD waitResult = WaitForSingleObject(m_ptr->m_processHandle, 100); if(waitResult == WAIT_OBJECT_0) { @@ -377,10 +375,15 @@ void Process::monitorProcess() { m_ptr->m_exitCode = static_cast(exitCode); m_ptr->setState(State::Finished); + readOutput(); finished(m_ptr->m_exitCode); break; + } else if (waitResult == WAIT_TIMEOUT) { + readOutput(); } #else + readOutput(); + if(m_ptr->m_pid > 0) { int status; pid_t result = waitpid(m_ptr->m_pid, &status, WNOHANG); @@ -392,13 +395,14 @@ void Process::monitorProcess() { } m_ptr->setState(State::Finished); + readOutput(); finished(m_ptr->m_exitCode); break; } } -#endif std::this_thread::sleep_for(std::chrono::milliseconds(100)); +#endif } } @@ -408,7 +412,7 @@ void Process::readOutput() { #ifdef _WIN32 DWORD bytesRead; if(PeekNamedPipe(m_ptr->m_stdoutRead, nullptr, 0, nullptr, &bytesRead, nullptr) && bytesRead > 0) { - if (ReadFile(m_ptr->m_stdoutRead, buffer, sizeof(buffer) - 1, &bytesRead, nullptr) && bytesRead > 0) { + if(ReadFile(m_ptr->m_stdoutRead, buffer, sizeof(buffer) - 1, &bytesRead, nullptr) && bytesRead > 0) { buffer[bytesRead] = '\0'; m_ptr->m_stdoutBuffer += buffer; @@ -430,7 +434,7 @@ void Process::readOutput() { buffer[bytesRead] = '\0'; m_ptr->m_stdoutBuffer += buffer; - readyReadStandardOutput(); + readyReadStandardOutput(); } bytesRead = read(m_ptr->m_stderrPipe[0], buffer, sizeof(buffer) - 1); diff --git a/worldeditor/bin/editor/materials/debug.shader b/worldeditor/bin/editor/materials/debug.shader index e7a96d1f3..bf1dd98ab 100644 --- a/worldeditor/bin/editor/materials/debug.shader +++ b/worldeditor/bin/editor/materials/debug.shader @@ -14,10 +14,8 @@ layout(location = 2) in vec4 color; layout(location = 3) in vec3 normal; layout(location = 4) in vec3 tangent; -layout(location = 0) out vec4 _vertex; -layout(location = 1) out vec2 _uv0; -layout(location = 2) out vec4 _color; -layout(location = 3) flat out int _instanceOffset; +layout(location = 0) out vec2 _uv0; +layout(location = 1) flat out int _instanceOffset; #include "ShaderLayout.h" @@ -26,11 +24,12 @@ void main(void) { #pragma instance - _vertex = modelMatrix() * vec4(vertex, 1.0); - - _color = color; + vec4 pos = modelMatrix() * vec4(vertex, 1.0); +#ifdef ORIGIN_TOP + pos.y = -pos.y; +#endif _uv0 = uv0; - gl_Position = _vertex; + gl_Position = pos; } ]]> = _vertex.z) ? _color : vec4(_color.xyz, _color.w * 0.25); + rgb = _color;//(depth >= _vertex.z) ? _color : vec4(_color.xyz, _color.w * 0.25); } ]]> diff --git a/worldeditor/bin/engine/materials/AreaLight.shader b/worldeditor/bin/engine/materials/AreaLight.shader index 5d5f2fb5e..4516307d0 100644 --- a/worldeditor/bin/engine/materials/AreaLight.shader +++ b/worldeditor/bin/engine/materials/AreaLight.shader @@ -1,43 +1,22 @@ - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - + + + diff --git a/worldeditor/bin/engine/materials/AreaLight.shader.set b/worldeditor/bin/engine/materials/AreaLight.shader.set index 5592fe95a..9f46a8b44 100644 --- a/worldeditor/bin/engine/materials/AreaLight.shader.set +++ b/worldeditor/bin/engine/materials/AreaLight.shader.set @@ -1,11 +1,14 @@ { - "guid": "{221b771e-538e-4b87-843e-a0eabf95a0ee}", - "md5": "{219aa659-b312-eff6-a589-5c46d0b03b94}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{221b771e-538e-4b87-843e-a0eabf95a0ee}", + "id": -739152766, + "md5": "{48762514-dbcd-0861-3e50-073b321e12c4}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/Blur.shader b/worldeditor/bin/engine/materials/Blur.shader index 6566bb99d..e12c8664d 100644 --- a/worldeditor/bin/engine/materials/Blur.shader +++ b/worldeditor/bin/engine/materials/Blur.shader @@ -1,11 +1,12 @@ - + + - - - - - - + + + + + + - - + + diff --git a/worldeditor/bin/engine/materials/Blur.shader.set b/worldeditor/bin/engine/materials/Blur.shader.set index 3b8595328..6140250ab 100644 --- a/worldeditor/bin/engine/materials/Blur.shader.set +++ b/worldeditor/bin/engine/materials/Blur.shader.set @@ -1,11 +1,14 @@ { - "guid": "{2fe592f2-6f2b-4cfa-b3b9-b45b922be3f6}", - "md5": "{009b374f-c1d6-51d7-ae41-938fa8d36c3c}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{2fe592f2-6f2b-4cfa-b3b9-b45b922be3f6}", + "id": -498711965, + "md5": "{dc451c47-2296-8b81-21d0-1c160e3b9c76}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/BlurOcclusion.shader b/worldeditor/bin/engine/materials/BlurOcclusion.shader index 8523d66fa..4c8608766 100644 --- a/worldeditor/bin/engine/materials/BlurOcclusion.shader +++ b/worldeditor/bin/engine/materials/BlurOcclusion.shader @@ -1,6 +1,7 @@ - + + - + - + diff --git a/worldeditor/bin/engine/materials/BlurOcclusion.shader.set b/worldeditor/bin/engine/materials/BlurOcclusion.shader.set index f318dc4d6..2b939d99e 100644 --- a/worldeditor/bin/engine/materials/BlurOcclusion.shader.set +++ b/worldeditor/bin/engine/materials/BlurOcclusion.shader.set @@ -1,11 +1,14 @@ { - "guid": "{130f26db-150d-4537-b5bf-556fbb96a743}", - "md5": "{8fe08625-28a4-bc61-e967-ee205bc4c16d}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{130f26db-150d-4537-b5bf-556fbb96a743}", + "id": -898252867, + "md5": "{f1bd3656-d930-5b87-b209-20a4728f1aa8}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/DOF.shader b/worldeditor/bin/engine/materials/DOF.shader index 09ad8914d..edea3da3e 100644 --- a/worldeditor/bin/engine/materials/DOF.shader +++ b/worldeditor/bin/engine/materials/DOF.shader @@ -1,12 +1,13 @@ - + + - - - - - - - + + + + + + + - + diff --git a/worldeditor/bin/engine/materials/DOF.shader.set b/worldeditor/bin/engine/materials/DOF.shader.set index 594a73299..f88445a38 100644 --- a/worldeditor/bin/engine/materials/DOF.shader.set +++ b/worldeditor/bin/engine/materials/DOF.shader.set @@ -1,10 +1,14 @@ { "guid": "{e7ca9c30-adb0-4cfb-a86a-a21c3cf7bd15}", - "md5": "{2dda0611-4441-6bfc-d12e-8575a43a16aa}", + "id": 1795057695, + "md5": "{0c9b3201-6a6a-1d7c-e46f-51d411282066}", + "meta": { + }, "settings": { "CurrentRHI": 1 }, "subitems": { }, + "type": "Material", "version": 14 } \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/DefaultFont.shader b/worldeditor/bin/engine/materials/DefaultFont.shader index 2d7a9c20b..90702f800 100644 --- a/worldeditor/bin/engine/materials/DefaultFont.shader +++ b/worldeditor/bin/engine/materials/DefaultFont.shader @@ -1,42 +1,10 @@ - + + - - - + + + - - - - + + + + diff --git a/worldeditor/bin/engine/materials/DefaultFont.shader.set b/worldeditor/bin/engine/materials/DefaultFont.shader.set index 24993a476..cb42a5cfc 100644 --- a/worldeditor/bin/engine/materials/DefaultFont.shader.set +++ b/worldeditor/bin/engine/materials/DefaultFont.shader.set @@ -1,11 +1,14 @@ { - "guid": "{3dc2e738-995a-46c9-be8b-f1e91c0bf49b}", - "md5": "{e5e02e81-0436-14dd-3d19-15e38e05d66d}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{3dc2e738-995a-46c9-be8b-f1e91c0bf49b}", + "id": 167253962, + "md5": "{427fe1fd-be8c-f3d0-7805-75de271af0ad}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/DefaultMesh.shader b/worldeditor/bin/engine/materials/DefaultMesh.shader index a5e1cca6c..cb2107193 100644 --- a/worldeditor/bin/engine/materials/DefaultMesh.shader +++ b/worldeditor/bin/engine/materials/DefaultMesh.shader @@ -1,5 +1,6 @@ - - + + + - - + + diff --git a/worldeditor/bin/engine/materials/DefaultMesh.shader.set b/worldeditor/bin/engine/materials/DefaultMesh.shader.set index 8e0d80e28..3c6f4aa4f 100644 --- a/worldeditor/bin/engine/materials/DefaultMesh.shader.set +++ b/worldeditor/bin/engine/materials/DefaultMesh.shader.set @@ -1,11 +1,14 @@ { - "guid": "{00000000-0402-0000-0000-000000000000}", - "md5": "{d8524e94-637d-71e1-1a8c-feaf2c6b3a0e}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 12 -} + "guid": "{00000000-0402-0000-0000-000000000000}", + "id": -199006543, + "md5": "{fb440d5c-7dd1-f6b4-073f-6dd1fd0a1dfc}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/DefaultPostEffect.shader b/worldeditor/bin/engine/materials/DefaultPostEffect.shader index 2a9752c66..a4d6f52e4 100644 --- a/worldeditor/bin/engine/materials/DefaultPostEffect.shader +++ b/worldeditor/bin/engine/materials/DefaultPostEffect.shader @@ -1,8 +1,9 @@ - + + - + - - + - +]]> + diff --git a/worldeditor/bin/engine/materials/DefaultPostEffect.shader.set b/worldeditor/bin/engine/materials/DefaultPostEffect.shader.set index 5ba15080c..6207dff95 100644 --- a/worldeditor/bin/engine/materials/DefaultPostEffect.shader.set +++ b/worldeditor/bin/engine/materials/DefaultPostEffect.shader.set @@ -1,11 +1,14 @@ { - "guid": "{f266f6d5-e71e-4c55-a6ef-13d039fe211d}", - "md5": "{dc365a73-1942-3be6-8aeb-6138bc89a237}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{f266f6d5-e71e-4c55-a6ef-13d039fe211d}", + "id": -959416957, + "md5": "{d7d983e9-313c-f3d5-a6a8-109e09c21f46}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/DefaultSprite.shader b/worldeditor/bin/engine/materials/DefaultSprite.shader index 6f06e9d69..025a27320 100644 --- a/worldeditor/bin/engine/materials/DefaultSprite.shader +++ b/worldeditor/bin/engine/materials/DefaultSprite.shader @@ -1,7 +1,8 @@ - + + - - + + - - - + + + diff --git a/worldeditor/bin/engine/materials/DefaultSprite.shader.set b/worldeditor/bin/engine/materials/DefaultSprite.shader.set index 3db489f06..1dc5d10ce 100644 --- a/worldeditor/bin/engine/materials/DefaultSprite.shader.set +++ b/worldeditor/bin/engine/materials/DefaultSprite.shader.set @@ -1,11 +1,14 @@ { - "guid": "{00000000-0401-0000-0000-000000000000}", - "md5": "{88802af5-3600-d8ca-c387-67c3d2bdd510}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 12 -} + "guid": "{00000000-0401-0000-0000-000000000000}", + "id": -924211950, + "md5": "{20b7b852-4fd0-185f-e4d4-b59e4f7582f6}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/DefaultUI.shader b/worldeditor/bin/engine/materials/DefaultUI.shader new file mode 100644 index 000000000..49dc8d6d4 --- /dev/null +++ b/worldeditor/bin/engine/materials/DefaultUI.shader @@ -0,0 +1,39 @@ + + + + + + + + + + + diff --git a/worldeditor/bin/engine/materials/DefaultUI.shader.set b/worldeditor/bin/engine/materials/DefaultUI.shader.set new file mode 100644 index 000000000..cb7740c50 --- /dev/null +++ b/worldeditor/bin/engine/materials/DefaultUI.shader.set @@ -0,0 +1,14 @@ +{ + "guid": "{a53a4410-bd77-43a3-a9ff-7fc7cb3a9ce6}", + "id": -2079157772, + "md5": "{0626883a-7f50-f7f4-5376-002d06141f96}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/DirectLight.shader b/worldeditor/bin/engine/materials/DirectLight.shader index 442b87013..8655e0184 100644 --- a/worldeditor/bin/engine/materials/DirectLight.shader +++ b/worldeditor/bin/engine/materials/DirectLight.shader @@ -1,44 +1,20 @@ - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + diff --git a/worldeditor/bin/engine/materials/DirectLight.shader.set b/worldeditor/bin/engine/materials/DirectLight.shader.set index 742b93741..cdef5d53b 100644 --- a/worldeditor/bin/engine/materials/DirectLight.shader.set +++ b/worldeditor/bin/engine/materials/DirectLight.shader.set @@ -1,11 +1,14 @@ { - "guid": "{d72bbfb4-b00c-4419-aab3-77d234d12ae5}", - "md5": "{8787d2d6-1610-781c-580b-94c2d9a51aa0}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{d72bbfb4-b00c-4419-aab3-77d234d12ae5}", + "id": -758630957, + "md5": "{6da617ce-654e-0489-9dcb-ca56a0ac2549}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/Downsample.shader b/worldeditor/bin/engine/materials/Downsample.shader index 4e3c521b4..ea40a43b8 100644 --- a/worldeditor/bin/engine/materials/Downsample.shader +++ b/worldeditor/bin/engine/materials/Downsample.shader @@ -1,6 +1,7 @@ - + + - + - + diff --git a/worldeditor/bin/engine/materials/Downsample.shader.set b/worldeditor/bin/engine/materials/Downsample.shader.set index c810c56a1..15e34effc 100644 --- a/worldeditor/bin/engine/materials/Downsample.shader.set +++ b/worldeditor/bin/engine/materials/Downsample.shader.set @@ -1,11 +1,14 @@ { - "guid": "{875c0a7c-7354-407c-b562-37a119a06d68}", - "md5": "{5e692bfd-2a2a-0815-34a9-b893f68c0e5c}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{875c0a7c-7354-407c-b562-37a119a06d68}", + "id": 957026304, + "md5": "{f064ac67-e3b6-3d6b-ca9b-bae64b9371c4}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/FXAA.shader b/worldeditor/bin/engine/materials/FXAA.shader index acf2c0daa..592ff5939 100644 --- a/worldeditor/bin/engine/materials/FXAA.shader +++ b/worldeditor/bin/engine/materials/FXAA.shader @@ -1,6 +1,7 @@ - + + - + - + diff --git a/worldeditor/bin/engine/materials/FXAA.shader.set b/worldeditor/bin/engine/materials/FXAA.shader.set index 1db913db6..de44204ae 100644 --- a/worldeditor/bin/engine/materials/FXAA.shader.set +++ b/worldeditor/bin/engine/materials/FXAA.shader.set @@ -1,11 +1,14 @@ { - "guid": "{b4bf4ecf-59bc-4a01-804e-4f3f569ff029}", - "md5": "{2d6e9b75-d216-9e7f-75b0-8a8270c24e85}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{b4bf4ecf-59bc-4a01-804e-4f3f569ff029}", + "id": 1123713500, + "md5": "{e49bf54c-e984-5814-3fe9-8f67cf0d7d18}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/Frame.shader b/worldeditor/bin/engine/materials/Frame.shader index ae7a76dbc..e9120e12a 100644 --- a/worldeditor/bin/engine/materials/Frame.shader +++ b/worldeditor/bin/engine/materials/Frame.shader @@ -1,12 +1,13 @@ - + + - - - - - - - + + + + + + + - - - + + diff --git a/worldeditor/bin/engine/materials/Frame.shader.set b/worldeditor/bin/engine/materials/Frame.shader.set index 3914655a6..bacfd6ffb 100644 --- a/worldeditor/bin/engine/materials/Frame.shader.set +++ b/worldeditor/bin/engine/materials/Frame.shader.set @@ -1,11 +1,14 @@ { - "guid": "{c517d382-bdde-45da-965d-084586143437}", - "md5": "{2c0386a3-15da-0fbc-99e5-4cd191c7b3cb}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{c517d382-bdde-45da-965d-084586143437}", + "id": 108806336, + "md5": "{d66d1ce2-a505-2bd4-0962-da6790f02995}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/IblReflections.shader b/worldeditor/bin/engine/materials/IblReflections.shader index b00c13b69..573b1511c 100644 --- a/worldeditor/bin/engine/materials/IblReflections.shader +++ b/worldeditor/bin/engine/materials/IblReflections.shader @@ -1,33 +1,14 @@ - + + - - - - - - - + + + + + + + - - - + + + diff --git a/worldeditor/bin/engine/materials/IblReflections.shader.set b/worldeditor/bin/engine/materials/IblReflections.shader.set index 6f223c9d4..6afea8678 100644 --- a/worldeditor/bin/engine/materials/IblReflections.shader.set +++ b/worldeditor/bin/engine/materials/IblReflections.shader.set @@ -1,11 +1,14 @@ { - "guid": "{5e4508d5-001a-4e02-86ee-bd153566d25b}", - "md5": "{d476db02-7220-9293-0b0f-1fcf3717dc36}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{5e4508d5-001a-4e02-86ee-bd153566d25b}", + "id": 1186284011, + "md5": "{ed9e9c87-1319-003b-5a49-d77122b780e3}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/Link.shader b/worldeditor/bin/engine/materials/Link.shader index d014f217d..73bbb95b5 100644 --- a/worldeditor/bin/engine/materials/Link.shader +++ b/worldeditor/bin/engine/materials/Link.shader @@ -1,5 +1,6 @@ - - + + + - - - + + + diff --git a/worldeditor/bin/engine/materials/Link.shader.set b/worldeditor/bin/engine/materials/Link.shader.set index b050508eb..f4ec6a474 100644 --- a/worldeditor/bin/engine/materials/Link.shader.set +++ b/worldeditor/bin/engine/materials/Link.shader.set @@ -1,11 +1,14 @@ { - "guid": "{2b555a77-2cc6-40e1-b82b-5ff2815d64e1}", - "md5": "{ead3dec6-b61b-32ac-0581-b7d0caf29291}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{2b555a77-2cc6-40e1-b82b-5ff2815d64e1}", + "id": 1617526769, + "md5": "{aea40998-80f9-3d32-4888-a4c16a4dd4e6}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/PointLight.shader b/worldeditor/bin/engine/materials/PointLight.shader index 905d87eec..34136ca7b 100644 --- a/worldeditor/bin/engine/materials/PointLight.shader +++ b/worldeditor/bin/engine/materials/PointLight.shader @@ -1,41 +1,20 @@ - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + diff --git a/worldeditor/bin/engine/materials/PointLight.shader.set b/worldeditor/bin/engine/materials/PointLight.shader.set index 79293457d..290436d91 100644 --- a/worldeditor/bin/engine/materials/PointLight.shader.set +++ b/worldeditor/bin/engine/materials/PointLight.shader.set @@ -1,11 +1,14 @@ { - "guid": "{831d1e59-1034-4fd7-b753-cfdc27d0205f}", - "md5": "{e50b9955-57f0-a565-279d-c5862a12eb48}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{831d1e59-1034-4fd7-b753-cfdc27d0205f}", + "id": -1495992482, + "md5": "{15d88e9c-0655-fa58-629e-c8f70d4a4463}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/SSAO.shader b/worldeditor/bin/engine/materials/SSAO.shader index 209d3357b..98b27bd60 100644 --- a/worldeditor/bin/engine/materials/SSAO.shader +++ b/worldeditor/bin/engine/materials/SSAO.shader @@ -1,40 +1,14 @@ - + + - - - - - - - + + + + + + + - - + + diff --git a/worldeditor/bin/engine/materials/SSAO.shader.set b/worldeditor/bin/engine/materials/SSAO.shader.set index 5b90bbdea..488cc5993 100644 --- a/worldeditor/bin/engine/materials/SSAO.shader.set +++ b/worldeditor/bin/engine/materials/SSAO.shader.set @@ -1,11 +1,14 @@ { - "guid": "{6f5727bb-6c06-421c-a2bf-952ad9c0d401}", - "md5": "{d6c0e7e2-f97d-9da1-30c1-a60d68992cb3}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{6f5727bb-6c06-421c-a2bf-952ad9c0d401}", + "id": 1422159182, + "md5": "{f8b3f90d-a313-4991-a6f9-290c35c3f690}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/SSLR.shader b/worldeditor/bin/engine/materials/SSLR.shader index c5595cb97..af90558b9 100644 --- a/worldeditor/bin/engine/materials/SSLR.shader +++ b/worldeditor/bin/engine/materials/SSLR.shader @@ -1,33 +1,11 @@ - + + - - - - + + + + - - + + diff --git a/worldeditor/bin/engine/materials/SSLR.shader.set b/worldeditor/bin/engine/materials/SSLR.shader.set index 920280c8e..a0401f7f2 100644 --- a/worldeditor/bin/engine/materials/SSLR.shader.set +++ b/worldeditor/bin/engine/materials/SSLR.shader.set @@ -1,11 +1,14 @@ { - "guid": "{18a2c9e1-7584-46e2-88b1-e744f2932552}", - "md5": "{bf7518ab-d0d5-28a6-f1d5-8ad755d0199e}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{18a2c9e1-7584-46e2-88b1-e744f2932552}", + "id": -1235381774, + "md5": "{6747c57d-bfe1-e4b1-f920-d6f385aa28f1}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/SpotLight.shader b/worldeditor/bin/engine/materials/SpotLight.shader index 0f8c53ad6..016e7b51e 100644 --- a/worldeditor/bin/engine/materials/SpotLight.shader +++ b/worldeditor/bin/engine/materials/SpotLight.shader @@ -1,41 +1,20 @@ - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + diff --git a/worldeditor/bin/engine/materials/SpotLight.shader.set b/worldeditor/bin/engine/materials/SpotLight.shader.set index f72ef1d32..cb8279da0 100644 --- a/worldeditor/bin/engine/materials/SpotLight.shader.set +++ b/worldeditor/bin/engine/materials/SpotLight.shader.set @@ -1,11 +1,14 @@ { - "guid": "{e131575e-3eed-4ed7-8c2c-95dda7b99e1d}", - "md5": "{a9595302-ca02-62e2-79fe-39f5d2228193}", - "settings": { - "CurrentRHI": 1 - }, - "subitems": { - }, - "type": 48, - "version": 11 -} + "guid": "{e131575e-3eed-4ed7-8c2c-95dda7b99e1d}", + "id": 1547364227, + "md5": "{0753e85b-7baf-8fbe-227f-a4f366a1ad3b}", + "meta": { + }, + "settings": { + "CurrentRHI": 1 + }, + "subitems": { + }, + "type": "Material", + "version": 14 +} \ No newline at end of file diff --git a/worldeditor/bin/engine/materials/Tonemap.shader b/worldeditor/bin/engine/materials/Tonemap.shader index cbb119e36..52a33e745 100644 --- a/worldeditor/bin/engine/materials/Tonemap.shader +++ b/worldeditor/bin/engine/materials/Tonemap.shader @@ -1,7 +1,8 @@ - + + - - + + - + diff --git a/worldeditor/bin/engine/materials/Tonemap.shader.set b/worldeditor/bin/engine/materials/Tonemap.shader.set index d62caeb38..360d8547a 100644 --- a/worldeditor/bin/engine/materials/Tonemap.shader.set +++ b/worldeditor/bin/engine/materials/Tonemap.shader.set @@ -1,10 +1,14 @@ { "guid": "{09d8cb41-d721-43f5-93d1-668a3a20e280}", + "id": -727672286, "md5": "{ea9901b4-eaa0-fa63-02c0-1b99564ccf4b}", + "meta": { + }, "settings": { "CurrentRHI": 1 }, "subitems": { }, + "type": "Material", "version": 14 } \ No newline at end of file diff --git a/worldeditor/src/main/mainwindow.cpp b/worldeditor/src/main/mainwindow.cpp index fdc3b47d5..cc5120e37 100644 --- a/worldeditor/src/main/mainwindow.cpp +++ b/worldeditor/src/main/mainwindow.cpp @@ -10,8 +10,6 @@ #include #include -#include - #include // Misc @@ -24,7 +22,7 @@ #include #include #include -#include +#include #include "documentmodel.h" @@ -309,7 +307,7 @@ void MainWindow::onOpenProject(const QString &path) { m_editorSettings->loadSettings(); if(!PluginManager::instance()->rescanProject(m_projectSettings->pluginsPath())) { - m_projectSettings->currentBuilder("desktop")->makeOutdated(); + m_projectSettings->currentBuilder(m_projectSettings->currentPlatformName())->makeOutdated(); } AssetManager::instance()->rescan();