From 7d39ee93a6d354e727c7534a18663f1d00d46b0f Mon Sep 17 00:00:00 2001 From: hachem Date: Thu, 20 Aug 2026 01:57:44 +0200 Subject: refactor: trailing return types in core --- src/core/hdri_manager.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core/hdri_manager.cpp') diff --git a/src/core/hdri_manager.cpp b/src/core/hdri_manager.cpp index 1a5521e..605dcf6 100644 --- a/src/core/hdri_manager.cpp +++ b/src/core/hdri_manager.cpp @@ -3,7 +3,7 @@ namespace Donut { - Ref HDRIManager::load_hdri(const std::string& path) + auto HDRIManager::load_hdri(const std::string& path) -> Ref { auto it = m_hdri_cache.find(path); if (it != m_hdri_cache.end()) @@ -14,7 +14,7 @@ namespace Donut DONUT_INFO("Loading HDRI: {}", path); auto hdri = CubemapTexture::create_from_hdri(path); - + if (hdri) { m_hdri_cache[path] = hdri; @@ -26,7 +26,7 @@ namespace Donut return hdri; } - void HDRIManager::set_current_hdri(const std::string& path) + auto HDRIManager::set_current_hdri(const std::string& path) -> void { auto hdri = load_hdri(path); if (hdri) @@ -38,12 +38,12 @@ namespace Donut DONUT_ERROR("Failed to set current HDRI: {}", path); } - std::string HDRIManager::get_hdri_name(const std::string& path) const + auto HDRIManager::get_hdri_name(const std::string& path) const -> std::string { std::filesystem::path file_path(path); std::string filename = file_path.stem().string(); std::string name = filename; - + for (size_t i = 0; i < name.length(); ++i) { if (name[i] == '_') @@ -51,11 +51,11 @@ namespace Donut else if (i == 0 || name[i-1] == ' ') name[i] = std::toupper(name[i]); } - + return name; } - void HDRIManager::clear_cache() + auto HDRIManager::clear_cache() -> void { m_hdri_cache.clear(); m_current_hdri.reset(); -- cgit v1.3