Skip to content

Commit

Permalink
Fix texture asset prefer linear metadata saving
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksigron committed Oct 2, 2024
1 parent 244c75a commit 5572a98
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions engine/src/Resources/AssetLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ void CreateTextureMetadataJson(rapidjson::Document& document, uint64_t hash, con

rapidjson::Value genMipsValue(metadata.generateMipmaps);
document.AddMember("generate_mipmaps", genMipsValue, alloc);

rapidjson::Value linearValue(metadata.preferLinear);
document.AddMember("prefer_linear", linearValue, alloc);
}

int32_t LoadTextureMetadata(const rapidjson::Document& document, Array<TextureAssetMetadata>& metadataArray)
Expand All @@ -53,6 +56,10 @@ int32_t LoadTextureMetadata(const rapidjson::Document& document, Array<TextureAs
if (genMipmapsItr != document.MemberEnd() && genMipmapsItr->value.IsBool())
metadata.generateMipmaps = genMipmapsItr->value.GetBool();

auto preferLinearItr = document.FindMember("prefer_linear");
if (preferLinearItr != document.MemberEnd() && preferLinearItr->value.IsBool())
metadata.preferLinear = preferLinearItr->value.GetBool();

int32_t index = static_cast<int32_t>(metadataArray.GetCount());
metadataArray.PushBack(metadata);
return index;
Expand Down

0 comments on commit 5572a98

Please sign in to comment.