From 374636168eec412cb65b84bc2890bacd2fa52a4e Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Wed, 20 May 2020 21:30:18 +0100 Subject: [PATCH] 11 CWFs --- osdopenvg.cc | 22 +++++++++++----------- osdopenvg.h | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/osdopenvg.cc b/osdopenvg.cc index abf94b8..25f1e54 100644 --- a/osdopenvg.cc +++ b/osdopenvg.cc @@ -146,7 +146,7 @@ int OsdOpenVG::init() // warning broadcom specific, get display size! display_width = display_height = 0; - if (graphics_get_display_size(0, &display_width, &display_height) < 0) + if (graphics_get_display_size(0, reinterpret_cast(&display_width), reinterpret_cast(&display_height)) < 0) { Log::getInstance()->log("OSD", Log::WARN, "Getting display size failed! (BCM API) "); vgmutex.unlock(); @@ -154,7 +154,7 @@ int OsdOpenVG::init() } Log::getInstance()->log("OSD", Log::NOTICE, "Displaysize is %d x %d ", display_width, display_height); - VC_RECT_T dst_rect = {0, 0, (int32_t)display_width, (int32_t)display_height}; + VC_RECT_T dst_rect = {0, 0, display_width, display_height}; VC_RECT_T src_rect = {0, 0, BACKBUFFER_WIDTH << 16, BACKBUFFER_HEIGHT << 16}; VC_RECT_T src_rect_bg = {0, 0, 16 << 16, 16 << 16}; // VC_RECT_T src_rect_im={0,0,16,16}; @@ -169,12 +169,12 @@ int OsdOpenVG::init() bcm_update = vc_dispmanx_update_start(0); bcm_element = vc_dispmanx_element_add(bcm_update, bcm_display, 2, &dst_rect, 0, - &src_rect, DISPMANX_PROTECTION_NONE, 0, 0, (DISPMANX_TRANSFORM_T) 0); + &src_rect, DISPMANX_PROTECTION_NONE, 0, 0, static_cast(0)); bcm_background = vc_dispmanx_element_add(bcm_update, bcm_display, 0, &dst_rect, bcm_backres, - &src_rect_bg, DISPMANX_PROTECTION_NONE, 0, 0, (DISPMANX_TRANSFORM_T) 0); + &src_rect_bg, DISPMANX_PROTECTION_NONE, 0, 0, static_cast(0)); vc_dispmanx_update_submit_sync(bcm_update); @@ -236,7 +236,7 @@ int OsdOpenVG::init() for (int i = 0; i < fonts->nfont; i++) { - char* s = (char*)FcNameUnparse(fonts->fonts[i]); + char* s = reinterpret_cast(FcNameUnparse(fonts->fonts[i])); if (s) { @@ -1091,8 +1091,8 @@ void OsdOpenVG::executeDrawCommand(SVGCommand& command) { vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); vgGetMatrix(save_matrix); - VGfloat imagewidth = vgGetParameteri((VGImage) command.target.image, VG_IMAGE_WIDTH); - VGfloat imageheight = vgGetParameteri((VGImage) command.target.image, VG_IMAGE_HEIGHT); + VGfloat imagewidth = vgGetParameteri(static_cast(command.target.image), VG_IMAGE_WIDTH); + VGfloat imageheight = vgGetParameteri(static_cast(command.target.image), VG_IMAGE_HEIGHT); //vgScale(command.w,command.h); @@ -1508,10 +1508,10 @@ unsigned int OsdOpenVG::handleOpenVGCommand(OpenVGCommand& command) { VGfloat colorramp[5 * 5]; colorramp[0 + 0 * 5] = 0.f; - colorramp[1 + 0 * 5] = style->red / 255.f; - colorramp[2 + 0 * 5] = style->green / 255.f; - colorramp[3 + 0 * 5] = style->blue / 255.f; - colorramp[4 + 0 * 5] = style->alpha / 255.f; + colorramp[1 + 0 * 5] = static_cast(style->red) / 255; + colorramp[2 + 0 * 5] = static_cast(style->green) / 255; + colorramp[3 + 0 * 5] = static_cast(style->blue) / 255; + colorramp[4 + 0 * 5] = static_cast(style->alpha) / 255; for (int i = 0; i < (style->num_colors - 1); i++) { diff --git a/osdopenvg.h b/osdopenvg.h index 94b2207..4c1b554 100644 --- a/osdopenvg.h +++ b/osdopenvg.h @@ -160,8 +160,8 @@ class OsdOpenVG : public OsdVector /* BCM specific */ - uint32_t display_height{}; - uint32_t display_width{}; + int32_t display_height{}; + int32_t display_width{}; DISPMANX_DISPLAY_HANDLE_T bcm_display; DISPMANX_ELEMENT_HANDLE_T bcm_element; DISPMANX_ELEMENT_HANDLE_T bcm_background; -- 2.39.5