From ce17cbd2698a5a30809a730b215f0ef8e01f0cca Mon Sep 17 00:00:00 2001 From: SweetId <2630750+SweetId@users.noreply.github.com> Date: Tue, 28 Nov 2023 17:17:19 +0530 Subject: [PATCH] pass argc and argv to Nz::Application --- include/NazaraEditor/Core/Application/BaseApplication.hpp | 2 +- include/NazaraEditor/Editor/Application.hpp | 2 +- src/NazaraEditor/Core/Application/BaseApplication.cpp | 5 +++-- src/NazaraEditor/Editor/Application.cpp | 3 ++- src/NazaraEditor/Editor/main.cpp | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/NazaraEditor/Core/Application/BaseApplication.hpp b/include/NazaraEditor/Core/Application/BaseApplication.hpp index 18fc9a0..ecb2a7e 100644 --- a/include/NazaraEditor/Core/Application/BaseApplication.hpp +++ b/include/NazaraEditor/Core/Application/BaseApplication.hpp @@ -36,7 +36,7 @@ namespace Nz // Editor events NazaraSignal(OnActionRegistered, const EditorAction::Properties&); - EditorBaseApplication(); + EditorBaseApplication(int argc, char** argv); virtual ~EditorBaseApplication(); static EditorBaseApplication* Instance(); diff --git a/include/NazaraEditor/Editor/Application.hpp b/include/NazaraEditor/Editor/Application.hpp index bd0adf5..1585e86 100644 --- a/include/NazaraEditor/Editor/Application.hpp +++ b/include/NazaraEditor/Editor/Application.hpp @@ -8,7 +8,7 @@ namespace NzEditor : public Nz::EditorBaseApplication { public: - Application(); + Application(int argc, char** argv); virtual bool NewLevel() override; }; diff --git a/src/NazaraEditor/Core/Application/BaseApplication.cpp b/src/NazaraEditor/Core/Application/BaseApplication.cpp index b6ef46c..16fa586 100644 --- a/src/NazaraEditor/Core/Application/BaseApplication.cpp +++ b/src/NazaraEditor/Core/Application/BaseApplication.cpp @@ -16,8 +16,9 @@ namespace Nz { EditorBaseApplication* EditorBaseApplication::s_instance = nullptr; - EditorBaseApplication::EditorBaseApplication() - : m_level(this) + EditorBaseApplication::EditorBaseApplication(int argc, char** argv) + : Application(argc, argv) + , m_level(this) , m_engineTextureStretchMode(StretchMode::KeepAspectRatio) { NazaraAssert(s_instance == nullptr, "EditorBaseApplication already exists"); diff --git a/src/NazaraEditor/Editor/Application.cpp b/src/NazaraEditor/Editor/Application.cpp index 4877a8f..f278560 100644 --- a/src/NazaraEditor/Editor/Application.cpp +++ b/src/NazaraEditor/Editor/Application.cpp @@ -18,7 +18,8 @@ namespace NzEditor { - Application::Application() + Application::Application(int argc, char** argv) + : Nz::EditorBaseApplication(argc, argv) { RegisterWindow(); RegisterWindow(); diff --git a/src/NazaraEditor/Editor/main.cpp b/src/NazaraEditor/Editor/main.cpp index a2faede..2c39cf6 100644 --- a/src/NazaraEditor/Editor/main.cpp +++ b/src/NazaraEditor/Editor/main.cpp @@ -24,7 +24,7 @@ int WinMain(int argc, char* argv[]) Nz::EditorLogger logger; - NzEditor::Application app; + NzEditor::Application app(argc, argv); app.SetLogger(logger); ImGui::EnsureContextOnThisThread();