From 3a5868b915e54e441984f6a1687c4ad344e44435 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 10 Dec 2014 14:41:43 +0100 Subject: [PATCH] Fixed pixel format conversion from A8 to RGB5A1 Former-commit-id: ae5dbe7dd41f5b2856661820bf40ae93e3556c36 --- src/Nazara/Utility/PixelFormat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Nazara/Utility/PixelFormat.cpp b/src/Nazara/Utility/PixelFormat.cpp index e72e503ba..b6679598d 100644 --- a/src/Nazara/Utility/PixelFormat.cpp +++ b/src/Nazara/Utility/PixelFormat.cpp @@ -87,9 +87,9 @@ namespace nzUInt16* ptr = reinterpret_cast(dst); while (start < end) { - *ptr = (static_cast(c8to5(start[2])) << 11) | - (static_cast(c8to5(start[1])) << 6) | - (static_cast(c8to5(start[0])) << 1) | + *ptr = (static_cast(0x1F) << 11) | + (static_cast(0x1F) << 6) | + (static_cast(0x1F) << 1) | ((*start > 0xF) ? 1 : 0); // > 128 #ifdef NAZARA_BIG_ENDIAN