From 5464b3e184ee1e72380ad136a48db8bf815fd641 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 23 Mar 2013 22:50:13 +0100 Subject: [PATCH] Optimized some format conversions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to kristofjé Former-commit-id: f7c0e5da41b7b7b4c967d7ae812b6da517761823 --- src/Nazara/Utility/PixelFormat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nazara/Utility/PixelFormat.cpp b/src/Nazara/Utility/PixelFormat.cpp index f42404313..e8e3d632d 100644 --- a/src/Nazara/Utility/PixelFormat.cpp +++ b/src/Nazara/Utility/PixelFormat.cpp @@ -16,7 +16,7 @@ namespace inline nzUInt8 c4to8(nzUInt8 c) { - return c * (255/15); + return c >> 4; } inline nzUInt8 c5to4(nzUInt8 c) @@ -31,7 +31,7 @@ namespace inline nzUInt8 c8to4(nzUInt8 c) { - return c * (15.f/255.f); + return c << 4; } inline nzUInt8 c8to5(nzUInt8 c)