diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2025-06-06 20:34:44 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2025-06-06 23:03:02 -0500 |
| commit | 15f125ebeee950924c1317abbfdbc600d480ae78 (patch) | |
| tree | 8beb8fbb4afe328c41cea1b1e5c3182bb416bc4a /Source/Core | |
| parent | 316740daede362a144b1a3756cf747e988ead0ab (diff) | |
VideoCommon: change asset loading to return the number of bytes loaded instead of a pass/fail
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoCommon/Assets/CustomAsset.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Assets/CustomAsset.h | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Assets/CustomAsset.cpp b/Source/Core/VideoCommon/Assets/CustomAsset.cpp index 5a9155d829..2b41d60a21 100644 --- a/Source/Core/VideoCommon/Assets/CustomAsset.cpp +++ b/Source/Core/VideoCommon/Assets/CustomAsset.cpp @@ -11,7 +11,7 @@ CustomAsset::CustomAsset(std::shared_ptr<CustomAssetLibrary> library, { } -bool CustomAsset::Load() +std::size_t CustomAsset::Load() { const auto load_information = LoadImpl(m_asset_id); if (load_information.m_bytes_loaded > 0) @@ -19,8 +19,9 @@ bool CustomAsset::Load() std::lock_guard lk(m_info_lock); m_bytes_loaded = load_information.m_bytes_loaded; m_last_loaded_time = load_information.m_load_time; + return m_bytes_loaded; } - return load_information.m_bytes_loaded != 0; + return 0; } std::size_t CustomAsset::Unload() diff --git a/Source/Core/VideoCommon/Assets/CustomAsset.h b/Source/Core/VideoCommon/Assets/CustomAsset.h index dc7d97917c..505be254d8 100644 --- a/Source/Core/VideoCommon/Assets/CustomAsset.h +++ b/Source/Core/VideoCommon/Assets/CustomAsset.h @@ -25,8 +25,8 @@ public: CustomAsset& operator=(const CustomAsset&) = delete; CustomAsset& operator=(CustomAsset&&) = delete; - // Loads the asset from the library returning a pass/fail result - bool Load(); + // Loads the asset from the library returning the number of bytes loaded + std::size_t Load(); // Unloads the asset data, resets the bytes loaded and // returns the number of bytes unloaded |
