From bcdc3e990e37427f439fb8260fac46b986acf191 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 5 Apr 2018 21:21:53 +0200 Subject: [PATCH] CCDraw: add debug output to identify errors in relevant item types --- src/gui/components/cc_draw.cpp | 14 ++++++++++---- src/gui/components/cc_draw.h | 2 +- src/gui/components/cc_types.h | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 0e60cd00f..663fe52f3 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -424,17 +424,23 @@ bool CCDraw::CheckFbData(const cc_fbdata_t& fbdata, const char* func, const int if ( (fbdata.x < 0 || fbdata.y < 0) || (end >= (int32_t)frameBuffer->getScreenWidth(true)*(int32_t)frameBuffer->getScreenHeight(true)) ) { - dprintf(DEBUG_NORMAL, "[CCDraw] ERROR! Position < 0 or > FB end [%s - %d]\n\tx = %d y = %d\n\tdx = %d dy = %d\n", + dprintf(DEBUG_NORMAL, "[CCDraw] ERROR! Position < 0 or > FB end [%s - %d]\n\tx = %d y = %d\n\tdx = %d dy = %d\n item: %s [type: %d]\n", func, line, fbdata.x, fbdata.y, - fbdata.dx, fbdata.dy); + fbdata.dx, fbdata.dy, + cc_item_type.name.c_str(), + cc_item_type.id + ); return false; } if (fbdata.dx == 0 || fbdata.dy == 0) { - dprintf(DEBUG_DEBUG,"[CCDraw]\t[%s - %d], INFO! dx and/or dy = 0, tx = %d, y = %d, dx = %d, dy = %d\n", + dprintf(DEBUG_DEBUG,"[CCDraw]\t[%s - %d], INFO! dx and/or dy = 0, tx = %d, y = %d, dx = %d, dy = %d\n item: %s [type: %d]\n", func, line, fbdata.x, fbdata.y, - fbdata.dx, fbdata.dy); + fbdata.dx, fbdata.dy, + cc_item_type.name.c_str(), + cc_item_type.id + ); return false; } return true; diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 083ceb40b..4d327e15e 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2012-2017, Thilo Graf 'dbt' + Copyright (C) 2012-2018, Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index d957ef5a1..ac592511c 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -238,7 +238,7 @@ typedef struct button_label_cc class CCTypes { protected: - ///property: define of item type, see cc_types.h for possible types + ///property: define of item type, see above for possible types cc_type_t cc_item_type; public: