summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp')
-rw-r--r--Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp b/Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp
index 8a78fed490..7b6420088f 100644
--- a/Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp
+++ b/Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp
@@ -6,7 +6,7 @@
#include <algorithm>
#include "Common/Logging/Log.h"
-#include "VideoCommon/Assets/CustomTextureData.h"
+#include "VideoCommon/Assets/TextureAsset.h"
namespace VideoCommon
{
@@ -26,16 +26,26 @@ std::size_t GetAssetSize(const CustomTextureData& data)
}
} // namespace
CustomAssetLibrary::LoadInfo CustomAssetLibrary::LoadGameTexture(const AssetID& asset_id,
- CustomTextureData* data)
+ TextureData* data)
{
const auto load_info = LoadTexture(asset_id, data);
if (load_info.m_bytes_loaded == 0)
return {};
+ if (data->m_type != TextureData::Type::Type_Texture2D)
+ {
+ ERROR_LOG_FMT(
+ VIDEO,
+ "Custom asset '{}' is not a valid game texture, it is expected to be a 2d texture "
+ "but was a '{}'.",
+ asset_id, data->m_type);
+ return {};
+ }
+
// Note: 'LoadTexture()' ensures we have a level loaded
- for (std::size_t slice_index = 0; slice_index < data->m_slices.size(); slice_index++)
+ for (std::size_t slice_index = 0; slice_index < data->m_texture.m_slices.size(); slice_index++)
{
- auto& slice = data->m_slices[slice_index];
+ auto& slice = data->m_texture.m_slices[slice_index];
const auto& first_mip = slice.m_levels[0];
// Verify that each mip level is the correct size (divide by 2 each time).