From a1e3e17d355b75b1d6c34c1a66beeb92925f0b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 30 Apr 2008 16:07:25 +0000 Subject: [PATCH] * Added 24-bit mode support. * This fixes bug #2182. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25272 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/magnify/Magnify.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/apps/magnify/Magnify.cpp b/src/apps/magnify/Magnify.cpp index 74e82ba247..db3bcd34e5 100644 --- a/src/apps/magnify/Magnify.cpp +++ b/src/apps/magnify/Magnify.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2008, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Updated by Sikosis (beos@gravity24hr.com) @@ -1777,9 +1777,12 @@ TOSMagnify::TOSMagnify(BRect r, TMagnify* parent, color_space space) case B_RGB15_BIG: case B_RGBA15_BIG: case B_RGB16: - case B_RGB16_BIG: + case B_RGB16_BIG: fBytesPerPixel = 2; break; + case B_RGB24: + fBytesPerPixel = 3; + break; case B_RGB32: case B_RGBA32: case B_RGB32_BIG: @@ -1829,18 +1832,16 @@ TOSMagnify::InitObject() fOldBits = (char*)malloc(fBitmap->BitsLength()); if (!fPixel) { - #if B_HOST_IS_BENDIAN - #define native B_RGBA32_BIG - #else - #define native B_RGBA32_LITTLE - #endif - fPixel = new BBitmap(BRect(0,0,0,0), native, true); - #undef native - fPixelView = new BView(BRect(0,0,0,0),NULL,0,0); +#if B_HOST_IS_BENDIAN + fPixel = new BBitmap(BRect(0,0,0,0), B_RGBA32_BIG, true); +#else + fPixel = new BBitmap(BRect(0,0,0,0), B_RGBA32, true); +#endif + fPixelView = new BView(BRect(0,0,0,0), NULL, 0, 0); fPixel->Lock(); fPixel->AddChild(fPixelView); fPixel->Unlock(); - }; + } }