Update AMFImporter_Postprocess.cpp

Use memcpy
pull/5656/head
Kim Kulling 2024-07-06 08:31:12 +02:00 committed by GitHub
parent ff593b4092
commit 76fb4fa6fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 8 deletions

View File

@ -224,14 +224,8 @@ size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string &
}
// Create format hint.
converted_texture.FormatHint[0] = 'r';
converted_texture.FormatHint[1] = 'g';
converted_texture.FormatHint[2] = 'b';
converted_texture.FormatHint[3] = 'a';
converted_texture.FormatHint[4] = '0';
converted_texture.FormatHint[5] = '0';
converted_texture.FormatHint[6] = '0';
converted_texture.FormatHint[7] = '0';
constexpr char templateColor[] = "rgba0000";
memcpy(converted_texture.FormatHint, templateColor, 8);
if (!r.empty()) converted_texture.FormatHint[4] = '8';
if (!g.empty()) converted_texture.FormatHint[5] = '8';
if (!b.empty()) converted_texture.FormatHint[6] = '8';