From b20235a7311c1302afe2a64a3e39e50c9e69a726 Mon Sep 17 00:00:00 2001 From: redstrate <54911369+redstrate@users.noreply.github.com> Date: Wed, 12 May 2021 10:59:30 -0400 Subject: [PATCH] Update macOS and Metal backends for the new changes --- engine/gfx/metal/src/gfx_metal.mm | 6 +++--- platforms/mac/file.mm | 4 ++-- tools/common/src/commoneditor.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/gfx/metal/src/gfx_metal.mm b/engine/gfx/metal/src/gfx_metal.mm index 1515534..37c6c16 100755 --- a/engine/gfx/metal/src/gfx_metal.mm +++ b/engine/gfx/metal/src/gfx_metal.mm @@ -454,7 +454,7 @@ GFXPipeline* GFXMetal::create_graphics_pipeline(const GFXGraphicsPipelineCreateI } else { const auto vertex_path = info.shaders.vertex_src.as_path().string(); - auto file = file::open(file::internal_domain / vertex_path); + auto file = prism::open_file(prism::internal_domain / vertex_path); if(file != std::nullopt) { vertex_src = file->read_as_string(); } else { @@ -486,7 +486,7 @@ GFXPipeline* GFXMetal::create_graphics_pipeline(const GFXGraphicsPipelineCreateI } else { const auto fragment_path = info.shaders.fragment_src.as_path().string(); - auto file = file::open(file::internal_domain / fragment_path); + auto file = prism::open_file(prism::internal_domain / fragment_path); if(file != std::nullopt) { fragment_src = file->read_as_string(); } else { @@ -659,7 +659,7 @@ GFXPipeline* GFXMetal::create_compute_pipeline(const GFXComputePipelineCreateInf } else { const auto compute_path = info.compute_src.as_path().string(); - auto file = file::open(file::internal_domain / compute_path); + auto file = prism::open_file(prism::internal_domain / compute_path); if(file != std::nullopt) { compute_src = file->read_as_string(); } else { diff --git a/platforms/mac/file.mm b/platforms/mac/file.mm index 98e723a..14af39e 100755 --- a/platforms/mac/file.mm +++ b/platforms/mac/file.mm @@ -20,7 +20,7 @@ inline std::string clean_path(const std::string_view path) { return p; } -void file::set_domain_path(const Domain domain, const Path path) { +void prism::set_domain_path(const prism::domain domain, const prism::path path) { NSBundle* bundle = [NSBundle mainBundle]; NSString* resourceFolderPath = [bundle resourcePath]; @@ -34,7 +34,7 @@ void file::set_domain_path(const Domain domain, const Path path) { domain_data[static_cast(domain)] = clean_path([[[url absoluteURL] absoluteString] cStringUsingEncoding:NSUTF8StringEncoding]); } -file::Path file::get_writeable_directory() { +prism::path prism::get_writeable_directory() { NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString* resourceFolderPath = paths[0]; diff --git a/tools/common/src/commoneditor.cpp b/tools/common/src/commoneditor.cpp index c59b0a4..b1df649 100755 --- a/tools/common/src/commoneditor.cpp +++ b/tools/common/src/commoneditor.cpp @@ -49,7 +49,7 @@ const std::map imToPl = { CommonEditor::CommonEditor(std::string id) : id(id) { #ifdef PLATFORM_MACOS - file::set_domain_path(file::domain::App, "../../../data"); + prism::set_domain_path(prism::domain::app, "../../../data"); #else prism::set_domain_path(prism::domain::app, "data"); #endif