summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2010-06-27 09:11:58 (GMT)
committermrwastl <mrwastl@users.sourceforge.net>2010-06-27 09:11:58 (GMT)
commit41213178cd97f88fce7ae381768528ae3826f7c3 (patch)
tree8401602c919949df3fc28c6dbf4951849410f397
parentd8f8154bb9967da609354b27e25ae6f47ba6dd27 (diff)
downloadvdr-plugin-graphlcd-0.2.0.tar.gz
vdr-plugin-graphlcd-0.2.0.tar.bz2
draw an 'X' if skin couldn't be loaded0.2.0
-rw-r--r--display.c12
1 files changed, 12 insertions, 0 deletions
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());