diff options
| author | hachem <im@hachem.wtf> | 2026-08-20 01:57:44 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-20 02:10:49 +0200 |
| commit | 7d39ee93a6d354e727c7534a18663f1d00d46b0f (patch) | |
| tree | a188023b61d14dcb859e08e6f8f8dd30df11780f /src/core/hdri_manager.cpp | |
| parent | dce67620b95a9555c7db950196b22f1bb88a307b (diff) | |
refactor: trailing return types in core
Diffstat (limited to 'src/core/hdri_manager.cpp')
| -rw-r--r-- | src/core/hdri_manager.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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<CubemapTexture> HDRIManager::load_hdri(const std::string& path) + auto HDRIManager::load_hdri(const std::string& path) -> Ref<CubemapTexture> { 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(); |
