diff --git a/src/engine/net/include/halley/net/session/network_session.h b/src/engine/net/include/halley/net/session/network_session.h index 03da7b35f2..b7dadbe6ce 100644 --- a/src/engine/net/include/halley/net/session/network_session.h +++ b/src/engine/net/include/halley/net/session/network_session.h @@ -6,7 +6,7 @@ #include "network_session_messages.h" #include "shared_data.h" #include "network_session_control_messages.h" -#include "connection/network_service.h" +#include "../connection/network_service.h" namespace Halley { class NetworkService; @@ -50,7 +50,7 @@ namespace Halley { virtual void onHosting(); virtual void onConnected(int peerId); virtual void onDisconnected(int peerId); - + private: NetworkService& service; NetworkSessionType type = NetworkSessionType::Undefined; @@ -79,7 +79,7 @@ namespace Halley { void checkForOutboundStateChanges(int ownerId); OutboundNetworkPacket makeUpdateSharedDataPacket(int ownerId); - + OutboundNetworkPacket doMakeControlPacket(NetworkSessionControlMessageType msgType, OutboundNetworkPacket packet); void onConnection(NetworkService::Acceptor& acceptor); @@ -95,7 +95,7 @@ namespace Halley { { return static_cast(doGetMutableSessionSharedData()); } - + const SessionSharedDataType& getSessionSharedData() const { return static_cast(doGetSessionSharedData()); @@ -121,7 +121,7 @@ namespace Halley { { return std::make_unique(); } - + std::unique_ptr makePeerSharedData() override final { return std::make_unique(); diff --git a/src/plugins/metal/src/metal_painter.mm b/src/plugins/metal/src/metal_painter.mm index ae721b8d16..bedf086689 100644 --- a/src/plugins/metal/src/metal_painter.mm +++ b/src/plugins/metal/src/metal_painter.mm @@ -8,7 +8,7 @@ using namespace Halley; MetalPainter::MetalPainter(MetalVideo& video, Resources& resources) - : Painter(resources) + : Painter(video, resources) , video(video) , indexBuffer(nil) {} @@ -43,7 +43,8 @@ [encoder setRenderPipelineState:pipelineState]; // Metal requires the global material to be bound for each material pass, as it has no 'global' state. - static_cast(halleyGlobalMaterial->getDataBlocks().front().getConstantBuffer()).bindVertex(encoder, 0); + // static_cast(halleyGlobalMaterial->getDataBlocks().front().getConstantBuffer()).bindVertex(encoder, 0); + static_cast(getConstantBuffer(halleyGlobalMaterial->getDataBlocks().front())).bindVertex(encoder, 0); // Bind textures int texIndex = 0; @@ -127,7 +128,7 @@ void MetalPainter::setMaterialData(const Material& material) { for (auto& dataBlock : material.getDataBlocks()) { if (dataBlock.getType() != MaterialDataBlockType::SharedExternal) { - static_cast(dataBlock.getConstantBuffer()).bindFragment(encoder, 0); + static_cast(getConstantBuffer(dataBlock)).bindFragment(encoder, 0); } } } diff --git a/src/tools/editor/CMakeLists.txt b/src/tools/editor/CMakeLists.txt index e9cc2e8054..ff0137207f 100644 --- a/src/tools/editor/CMakeLists.txt +++ b/src/tools/editor/CMakeLists.txt @@ -28,7 +28,7 @@ set (editor_sources "src/assets/graph/graph_editor.cpp" "src/assets/graph/render_graph_editor.cpp" "src/assets/graph/ui_graph_node.cpp" - + "src/project/core_api_wrapper.cpp" "src/scene/choose_window.cpp" @@ -115,7 +115,7 @@ set (editor_headers "src/scene/gizmos/scripting/scripting_gizmo_toolbar.h" "src/scene/gizmos/scripting/scripting_gizmo.h" "src/scene/gizmos/scripting/scripting_node_editor.h" - + "src/ui/console_window.h" "src/ui/ecs_window.h" "src/ui/editor_settings_window.h" @@ -143,8 +143,10 @@ set (editor_gen_definitions ) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND USE_METAL EQUAL 1) set(EXTRA_LIBS bz2 z halley-metal) +elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(EXTRA_LIBS bz2 z) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(EXTRA_LIBS pthread) endif() @@ -153,7 +155,7 @@ include_directories(${FREETYPE_INCLUDE_DIR} "../tools/include") halleyProjectCodegen(halley-editor "${editor_sources}" "${editor_headers}" "${editor_resources}" "${editor_gen_definitions}" ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin) add_dependencies(halley-editor halley-cmd halley-core halley-net halley-sdl halley-opengl) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND USE_METAL EQUAL 1) add_dependencies(halley-editor halley-metal) endif() diff --git a/src/tools/editor/src/halley_editor.cpp b/src/tools/editor/src/halley_editor.cpp index ec7927c4b4..d354cea9f8 100644 --- a/src/tools/editor/src/halley_editor.cpp +++ b/src/tools/editor/src/halley_editor.cpp @@ -33,12 +33,12 @@ int HalleyEditor::initPlugins(IPluginRegistry ®istry) #ifdef _WIN32 initDX11Plugin(registry); -#elif __APPLE__ +#elif defined(__APPLE__) && defined(USE_METAL) initMetalPlugin(registry); #else initOpenGLPlugin(registry); #endif - + return HalleyAPIFlags::Video | HalleyAPIFlags::Audio | HalleyAPIFlags::Input | HalleyAPIFlags::Network; } @@ -138,7 +138,7 @@ std::unique_ptr HalleyEditor::loadProject(Path path) project->loadGameResources(getAPI()); preferences->addRecent(path.string()); - + return project; } @@ -153,7 +153,7 @@ std::unique_ptr HalleyEditor::createProject(Path path) } preferences->addRecent(path.string()); - + return project; } diff --git a/src/tools/launcher/CMakeLists.txt b/src/tools/launcher/CMakeLists.txt index 52469d8c79..780930187e 100644 --- a/src/tools/launcher/CMakeLists.txt +++ b/src/tools/launcher/CMakeLists.txt @@ -35,8 +35,10 @@ set (launcher_gen_definitions ) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND USE_METAL EQUAL 1) set(EXTRA_LIBS bz2 z halley-metal) +elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(EXTRA_LIBS bz2 z) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(EXTRA_LIBS pthread) endif() @@ -45,7 +47,7 @@ include_directories(${FREETYPE_INCLUDE_DIR} "../tools/include") halleyProjectCodegen(halley-launcher "${launcher_sources}" "${launcher_headers}" "" "${launcher_gen_definitions}" ${CMAKE_CURRENT_SOURCE_DIR}/bin) add_dependencies(halley-launcher halley-cmd halley-core halley-net halley-sdl halley-opengl) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND USE_METAL EQUAL 1) add_dependencies(halley-launcher halley-metal) endif()