Skip to content

Commit

Permalink
Image::Encode: fixed image flipping
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent authored and MikhailGorobets committed Aug 14, 2024
1 parent 5cf2406 commit 7ef6821
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TextureLoader/src/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ void Image::Encode(const EncodeInfo& Info, IDataBlob** ppEncodedData)
const auto* pData = reinterpret_cast<const Uint8*>(Info.pData);
auto Stride = Info.Stride;
std::vector<Uint8> ConvertedData;
if (!((Info.TexFormat == TEX_FORMAT_RGBA8_UNORM || Info.TexFormat == TEX_FORMAT_RGBA8_UNORM_SRGB) && Info.KeepAlpha))
if (!((Info.TexFormat == TEX_FORMAT_RGBA8_UNORM || Info.TexFormat == TEX_FORMAT_RGBA8_UNORM_SRGB) && Info.KeepAlpha && !Info.FlipY))
{
ConvertedData = ConvertImageData(Info.Width, Info.Height, reinterpret_cast<const Uint8*>(Info.pData), Info.Stride, Info.TexFormat, TEX_FORMAT_RGBA8_UNORM, Info.KeepAlpha, Info.FlipY);
pData = ConvertedData.data();
Expand Down

0 comments on commit 7ef6821

Please sign in to comment.