From c523e3cde5de3f8db54b8e8736154babe1f295c1 Mon Sep 17 00:00:00 2001 From: Lynix Date: Fri, 18 Nov 2016 01:16:36 +0100 Subject: [PATCH] Utility/Formats: STBLoader will now convert the image to RGB8 if it has no alpha value --- src/Nazara/Utility/Formats/STBLoader.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Nazara/Utility/Formats/STBLoader.cpp b/src/Nazara/Utility/Formats/STBLoader.cpp index 3ca5b3708..42f720abf 100644 --- a/src/Nazara/Utility/Formats/STBLoader.cpp +++ b/src/Nazara/Utility/Formats/STBLoader.cpp @@ -82,6 +82,12 @@ namespace Nz if (parameters.loadFormat != PixelFormatType_Undefined) image->Convert(parameters.loadFormat); + else + { + // Optimize memory usage if possible + if (!image->HasAlpha()) + image->Convert(PixelFormatType_RGB8); + } return true; }