From f3077ee761db69c2088eba6be61f060d8ad4557c Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 22 May 2020 16:55:58 +0100 Subject: [PATCH] Bitmap and VPictureBanner CWFs --- bitmap.cc | 8 ++++---- vpicturebanner.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bitmap.cc b/bitmap.cc index cd60cdd..7947994 100644 --- a/bitmap.cc +++ b/bitmap.cc @@ -38,13 +38,13 @@ Palette::Palette(UCHAR tBpp) void Palette::argb2yrba(ULONG argb, UCHAR& y, UCHAR& cr, UCHAR& cb, UCHAR& a) { - a = ((argb & 0xFF000000) >> 24); + a = static_cast((argb & 0xFF000000) >> 24); int r = (argb & 0x00FF0000) >> 16; int g = (argb & 0x0000FF00) >> 8; int b = (argb & 0x000000FF); - y = (1052*r + 2065*g + 401*b + 4096*16 + 2048) / 4096; - cr = (1799*r - 1508*g - 291*b + 4096*128 + 2048) / 4096; - cb = (-608*r - 1191*g + 1799*b + 4096*128 + 2048) / 4096; + y = static_cast((1052*r + 2065*g + 401*b + 4096*16 + 2048) / 4096); + cr = static_cast((1799*r - 1508*g - 291*b + 4096*128 + 2048) / 4096); + cb = static_cast((-608*r - 1191*g + 1799*b + 4096*128 + 2048) / 4096); } ULONG Palette::yrba2argb(UCHAR y, UCHAR cr, UCHAR cb, UCHAR a) diff --git a/vpicturebanner.cc b/vpicturebanner.cc index 5a99be4..9d34c2f 100644 --- a/vpicturebanner.cc +++ b/vpicturebanner.cc @@ -111,7 +111,7 @@ void VPictureBanner::processMessage(Message* m) { BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } - else if (y>=(int)area.h-24 && y<=(int)area.h-6) + else if (y >= (static_cast(area.h) - 24) && y <= static_cast(area.h) - 6) { //y coordinate is right! if (x>=7 &&x<=25) -- 2.39.5