Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion build_scripts/premake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CPP_VERSION = "C++20"
SOLUTION_NAME = "spartan"
EXECUTABLE_NAME = "spartan"
SOURCE_DIR = "../source"
PHASMA_MCP_DIR = "../third_party/PhasmaMCP"
LIBRARY_DIR = "../third_party/libraries"
OBJ_DIR = "../binaries/obj"
TARGET_DIR = "../binaries"
Expand Down Expand Up @@ -103,7 +104,12 @@ function spartan_project_configuration()
files {
SOURCE_DIR .. "/**.h", SOURCE_DIR .. "/**.cpp",
SOURCE_DIR .. "/**.hpp", SOURCE_DIR .. "/**.inl",
SOURCE_DIR .. "/**.rc"
SOURCE_DIR .. "/**.rc",
PHASMA_MCP_DIR .. "/include/**.h",
PHASMA_MCP_DIR .. "/include/**.hpp",
PHASMA_MCP_DIR .. "/src/**.cpp",
PHASMA_MCP_DIR .. "/third_party/**.h",
PHASMA_MCP_DIR .. "/third_party/**.hpp"
}

if ARG_API_GRAPHICS == "d3d12" then
Expand All @@ -119,11 +125,13 @@ function spartan_project_configuration()
filter { "system:windows" }
includedirs {
SOURCE_DIR, SOURCE_DIR .. "/runtime", SOURCE_DIR .. "/runtime/Core", SOURCE_DIR .. "/editor",
PHASMA_MCP_DIR .. "/include", PHASMA_MCP_DIR .. "/third_party",
"../third_party/sdl", "../third_party/assimp", "../third_party/physx", "../third_party/free_image",
"../third_party/free_type", "../third_party/renderdoc",
"../third_party/meshoptimizer", "../third_party/dxc", "../third_party/openxr",
"../third_party/lua", "../third_party/lua/lua"
}
links { "ws2_32" }
linkoptions {
"/LIBPATH:" .. path.getabsolute("../third_party/libraries"),
"/NODEFAULTLIB:MSVCRT.lib", -- block dynamic crt (using static runtime)
Expand All @@ -135,9 +143,15 @@ function spartan_project_configuration()
filter { "system:linux" }
includedirs {
SOURCE_DIR, SOURCE_DIR .. "/runtime", SOURCE_DIR .. "/runtime/Core", SOURCE_DIR .. "/editor",
PHASMA_MCP_DIR .. "/include", PHASMA_MCP_DIR .. "/third_party",
"/usr/include/SDL3", "/usr/include/assimp", "/usr/include/physx",
"/usr/include/freetype2", "/usr/include/renderdoc"
}
links { "pthread" }

filter { "files:" .. PHASMA_MCP_DIR .. "/src/**.cpp" }
flags { "NoPCH" }
defines { "WIN32_LEAN_AND_MEAN", "NOMINMAX" }

-- Vulkan-specific includes (Windows only)
filter { "system:windows" }
Expand Down
9 changes: 9 additions & 0 deletions source/editor/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//= INCLUDES ====================================
#include "pch.h"
#include "Editor.h"
#include "EditorMcpServer.h"
#include "GeneralWindows.h"
#include "WorldPreviews.h"
#include "Widgets/MenuBar.h"
Expand Down Expand Up @@ -114,10 +115,18 @@ Editor::Editor(const vector<string>& args)
SP_SUBSCRIBE_TO_EVENT(spartan::EventType::Sdl, SP_EVENT_HANDLER_VARIANT_STATIC(process_event));

GeneralWindows::Initialize(this);

m_mcp_server = make_unique<EditorMcpServer>();
if (!m_mcp_server->Start(args))
{
m_mcp_server.reset();
}
}

Editor::~Editor()
{
m_mcp_server.reset();

WorldPreviews::Shutdown();

if (ImGui::GetCurrentContext())
Expand Down
1 change: 1 addition & 0 deletions source/editor/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ class Editor
void BeginWindow();

std::vector<std::shared_ptr<Widget>> m_widgets;
std::unique_ptr<class EditorMcpServer> m_mcp_server;
};
Loading
Loading