Made max amount of thumbnail generated per frame for performance

This commit is contained in:
Antoine Pilote
2024-08-13 00:34:10 -04:00
parent d35a7dad34
commit 01a7db2132
3 changed files with 32 additions and 3 deletions

View File

@@ -326,7 +326,11 @@ namespace Nuake
const auto fileType = file->GetFileType();
if (fileType == FileType::Material)
{
textureImage = ThumbnailManager::Get().GetThumbnail(file->GetRelativePath());
auto image = ThumbnailManager::Get().GetThumbnail(file->GetRelativePath());
if (image)
{
textureImage = image;
}
}
else if (fileType == FileType::Image)
{
@@ -355,7 +359,11 @@ namespace Nuake
}
else if (fileType == FileType::Prefab)
{
textureImage = ThumbnailManager::Get().GetThumbnail(file->GetRelativePath());
auto image = ThumbnailManager::Get().GetThumbnail(file->GetRelativePath());
if (image)
{
textureImage = image;
}
}
ImGui::SetCursorPos(prevCursor);
@@ -918,6 +926,8 @@ namespace Nuake
ImGui::EndChild();
}
ThumbnailManager::Get().OnEndFrame();
ImGui::EndChild();
}
ImGui::End();