diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2025-05-04 12:14:18 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2025-06-06 23:03:02 -0500 |
| commit | 316740daede362a144b1a3756cf747e988ead0ab (patch) | |
| tree | 8c4b0f6342eaf20f7afbc03f5bc8e81489ad4367 /Source/Core/VideoCommon/Assets/CustomAsset.cpp | |
| parent | 9ec69b5925ea4230077e7f77795b7a0f7a05e963 (diff) | |
VideoCommon: add 'Unload' functionality to CustomAsset
Diffstat (limited to 'Source/Core/VideoCommon/Assets/CustomAsset.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Assets/CustomAsset.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Assets/CustomAsset.cpp b/Source/Core/VideoCommon/Assets/CustomAsset.cpp index c06b184b7f..5a9155d829 100644 --- a/Source/Core/VideoCommon/Assets/CustomAsset.cpp +++ b/Source/Core/VideoCommon/Assets/CustomAsset.cpp @@ -23,6 +23,18 @@ bool CustomAsset::Load() return load_information.m_bytes_loaded != 0; } +std::size_t CustomAsset::Unload() +{ + UnloadImpl(); + std::size_t bytes_loaded = 0; + { + std::lock_guard lk(m_info_lock); + bytes_loaded = m_bytes_loaded; + m_bytes_loaded = 0; + } + return bytes_loaded; +} + CustomAssetLibrary::TimeType CustomAsset::GetLastWriteTime() const { return m_owning_library->GetLastAssetWriteTime(m_asset_id); |
