mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 01:49:33 -06:00
VideoCommon: change asset loading to return the number of bytes loaded instead of a pass/fail
This commit is contained in:
@ -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);
|
const auto load_information = LoadImpl(m_asset_id);
|
||||||
if (load_information.m_bytes_loaded > 0)
|
if (load_information.m_bytes_loaded > 0)
|
||||||
@ -19,8 +19,9 @@ bool CustomAsset::Load()
|
|||||||
std::lock_guard lk(m_info_lock);
|
std::lock_guard lk(m_info_lock);
|
||||||
m_bytes_loaded = load_information.m_bytes_loaded;
|
m_bytes_loaded = load_information.m_bytes_loaded;
|
||||||
m_last_loaded_time = load_information.m_load_time;
|
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()
|
std::size_t CustomAsset::Unload()
|
||||||
|
@ -25,8 +25,8 @@ public:
|
|||||||
CustomAsset& operator=(const CustomAsset&) = delete;
|
CustomAsset& operator=(const CustomAsset&) = delete;
|
||||||
CustomAsset& operator=(CustomAsset&&) = delete;
|
CustomAsset& operator=(CustomAsset&&) = delete;
|
||||||
|
|
||||||
// Loads the asset from the library returning a pass/fail result
|
// Loads the asset from the library returning the number of bytes loaded
|
||||||
bool Load();
|
std::size_t Load();
|
||||||
|
|
||||||
// Unloads the asset data, resets the bytes loaded and
|
// Unloads the asset data, resets the bytes loaded and
|
||||||
// returns the number of bytes unloaded
|
// returns the number of bytes unloaded
|
||||||
|
Reference in New Issue
Block a user