minor fixes

This commit is contained in:
ohyzha
2024-08-03 15:41:59 +03:00
parent 837861d6f2
commit dcf6e72f96
9 changed files with 14 additions and 16 deletions

View File

@@ -34,12 +34,12 @@ endif()
if (WIN32)
set(TRIPLET x64-windows-static-md-release CACHE INTERNAL "triplet")
elseif(UNIX)
elseif(UNIX AND NOT APPLE)
set(TRIPLET x64-linux CACHE INTERNAL "triplet")
elseif(APPLE)
set(TRIPLET x64-osx CACHE INTERNAL "triplet")
else()
message(FATAL_ERROR "Unknown OS, can't build msdfgen")
set(TRIPLET arm64-osx CACHE INTERNAL "triplet")
elseif(IOS)
set(TRIPLET arm64-ios CACHE INTERNAL "triplet")
endif()
execute_process(COMMAND ${VCPKG_EXECUTABLE} install freetype:${TRIPLET} libpng:${TRIPLET})
@@ -92,4 +92,3 @@ function(LinkMsdf TARGET)
endif()
endforeach()
endfunction()

View File

@@ -17,6 +17,7 @@ function(SetWarningSettings TARGET)
target_compile_options(${TARGET} PRIVATE -Wall -Wno-unknown-pragmas)
elseif (WIN32)
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS "/wd4068")
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "/ignore:4099")
endif()

View File

@@ -47,6 +47,6 @@ namespace OpenVulkano
Array<char> ResourceLoaderAppDirLinux::GetResource(const std::string& resourceName)
{
return Utils::ReadFile(resourceName, true);
return Utils::ReadFile(GetAppDir() + resourceName, true);
}
}

View File

@@ -15,9 +15,9 @@ namespace OpenVulkano
public:
virtual ~ResourceLoader() = default;
virtual Array<char> GetResource(const std::string& resourceName) = 0;
[[nodiscard]] virtual Array<char> GetResource(const std::string& resourceName) = 0;
virtual std::string GetResourcePath(const std::string& resourceName) { return ""; }
[[nodiscard]] virtual std::string GetResourcePath(const std::string& resourceName) { return ""; }
static ResourceLoader& GetInstance();

View File

@@ -45,6 +45,6 @@ namespace OpenVulkano
Array<char> ResourceLoaderAppDirWindows::GetResource(const std::string& resourceName)
{
return Utils::ReadFile(resourceName);
return Utils::ReadFile(GetAppDir() + resourceName);
}
}

View File

@@ -188,17 +188,16 @@ namespace OpenVulkano::Scene
#endif
}
void Geometry::SetIndices(const uint32_t* data, uint32_t size, uint32_t indicesOffset) const
void Geometry::SetIndices(const uint32_t* data, uint32_t size, uint32_t dstOffset) const
{
for(uint32_t i = 0; i < size; i++)
{
if (indexType == VertexIndexType::UINT16)
{
static_cast<uint16_t*>(indices)[i + indicesOffset] = static_cast<uint16_t>(data[i]);
static_cast<uint16_t*>(indices)[i + dstOffset] = static_cast<uint16_t>(data[i]);
}
else
{
static_cast<uint32_t*>(indices)[i + indicesOffset] = data[i];
{ static_cast<uint32_t*>(indices)[i + dstOffset] = data[i];
}
}
}

View File

@@ -60,7 +60,7 @@ namespace OpenVulkano
void Init(aiMesh* mesh);
void SetIndices(const uint32_t* data, uint32_t size, uint32_t indicesOffset = 0) const;
void SetIndices(const uint32_t* data, uint32_t size, uint32_t dstOffset = 0) const;
void Close() override;

View File

@@ -124,7 +124,7 @@ namespace OpenVulkano::Scene
else
{
// throw ? replace with ? character (if available) ?
Logger::RENDER->error(fmt::format("Could not find glyph for character {}", c));
Logger::RENDER->error("Could not find glyph for character {}", c);
}
}
}

View File

@@ -19,7 +19,6 @@ namespace OpenVulkano::Vulkan
class VulkanTexture : public Scene::RenderTexture, public IRecordable, public Image
{
public:
static inline vk::SamplerCreateInfo DEFAULT_SAMPLER_CONFIG { {}, vk::Filter::eLinear, vk::Filter::eLinear };
vk::Sampler m_sampler;
vk::DescriptorSet m_descriptorSet;