From 41213178cd97f88fce7ae381768528ae3826f7c3 Mon Sep 17 00:00:00 2001 From: mrwastl Date: Sun, 27 Jun 2010 11:11:58 +0200 Subject: draw an 'X' if skin couldn't be loaded --- display.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/display.c b/display.c index f810c4a..ac8c169 100644 --- a/display.c +++ b/display.c @@ -122,7 +122,19 @@ void cGraphLCDDisplay::Action(void) mSkin = GLCD::XmlParse(*mSkinConfig, mSkinConfig->SkinName(), skinFileName); if (!mSkin) { + int skipx = mLcd->Width() >> 3; + int skipy = mLcd->Height() >> 3; + esyslog("graphlcd plugin: ERROR loading skin\n"); + + // draw an 'X' to inform the user that there was a problem with loading the skin + // (better than just leaving an empty screen ...) + mLcd->Clear(); + mScreen->DrawRectangle(0, 0, mLcd->Width()-1, mLcd->Height()-1, GLCD::clrBlack, true); + mScreen->DrawLine(skipx, skipy, mLcd->Width()-1-skipx, mLcd->Height()-1-skipy, GLCD::clrWhite); + mScreen->DrawLine(mLcd->Width()-1-skipx, skipy, skipx, mLcd->Height()-1-skipy, GLCD::clrWhite); + mLcd->SetScreen(mScreen->Data(), mScreen->Width(), mScreen->Height(), mScreen->LineSize()); + mLcd->Refresh(true); return; } mSkin->SetBaseSize(mScreen->Width(), mScreen->Height()); -- cgit v1.2.3