From b560da0e0e08d791bbc404da19c394657af816ac Mon Sep 17 00:00:00 2001 From: mrwastl Date: Mon, 24 Oct 2011 20:00:59 +0200 Subject: cImageFile: scaling support for non-ImageMagick files (-> pbm, glcd); serdisp.[ch]: paranoia checks (SetBrightness()!), encapsulation of touch events; cImageCache: syslog message after successful loading of an image; cSkinObject: beauty fix --- glcdskin/cache.c | 3 +++ glcdskin/function.c | 2 +- glcdskin/object.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'glcdskin') diff --git a/glcdskin/cache.c b/glcdskin/cache.c index a0b2929..f0543d9 100644 --- a/glcdskin/cache.c +++ b/glcdskin/cache.c @@ -17,6 +17,8 @@ #include #include +#include + #include "cache.h" #include "skin.h" @@ -102,6 +104,7 @@ cImage * cImageCache::Get(const std::string & path, uint16_t & scalew, uint16_t item = LoadImage(path, scalew, scaleh); if (item) { + syslog(LOG_INFO, "INFO: graphlcd: successfully loaded image '%s'\n", path.c_str()); if (images.size() == size) { images.erase(oldest); diff --git a/glcdskin/function.c b/glcdskin/function.c index 6d96c57..2593f70 100644 --- a/glcdskin/function.c +++ b/glcdskin/function.c @@ -176,7 +176,7 @@ bool cSkinFunction::Parse(const std::string & Text) { if (inExpr == 0) { - syslog(LOG_ERR, "ERROR: Unmatched '%c' in expression", *ptr); + syslog(LOG_ERR, "ERROR: Unmatched '%c' in expression (%s)", *ptr, Text.c_str()); return false; } diff --git a/glcdskin/object.c b/glcdskin/object.c index 7e99092..204b0d4 100644 --- a/glcdskin/object.c +++ b/glcdskin/object.c @@ -484,9 +484,9 @@ void cSkinObject::Render(GLCD::cBitmap * screen) uint16_t xoff = 0; uint16_t yoff = 0; if (scalew || scaleh) { - if (image->Width() < Size().w) { + if (image->Width() < (uint16_t)Size().w) { xoff = (Size().w - image->Width() ) / 2; - } else if (image->Height() < Size().h) { + } else if (image->Height() < (uint16_t)Size().h) { yoff = (Size().h - image->Height() ) / 2; } } -- cgit v1.2.3