diff options
-rw-r--r-- | render.c | 16 | ||||
-rw-r--r-- | render.h | 4 | ||||
-rw-r--r-- | xml/object.h | 4 | ||||
-rw-r--r-- | xml/parser.c | 37 |
4 files changed, 32 insertions, 29 deletions
@@ -1,5 +1,5 @@ /* - * $Id: render.c,v 1.27 2005/01/23 12:27:15 lordjaxom Exp $ + * $Id: render.c,v 1.28 2005/01/26 20:42:41 lordjaxom Exp $ */ #include "render.h" @@ -163,8 +163,8 @@ void cText2SkinRender::DrawObject(const cxObject *Object) switch (Object->Type()) { case cxObject::image: - DrawImage(Object->Pos(), Object->Size(), Object->Bg(), Object->Fg(), Object->Alpha(), - Object->Colors(), Object->Path()); + DrawImage(Object->Pos(), Object->Size(), Object->Bg(), Object->Fg(), Object->Mask(), + Object->Alpha(), Object->Colors(), Object->Path()); break; case cxObject::text: @@ -222,7 +222,7 @@ void cText2SkinRender::DrawObject(const cxObject *Object) uint maxitems = areasize.h / itemheight; uint yoffset = 0; - SetMaxItems(maxitems); Dprintf("setmaxitems %d\n", maxitems); + SetMaxItems(maxitems); //Dprintf("setmaxitems %d\n", maxitems); for (uint i = 0; i < maxitems; ++i, yoffset += itemheight) { for (uint j = 1; j < Object->Objects(); ++j) { const cxObject *o = Object->GetObject(j); @@ -325,18 +325,18 @@ void cText2SkinRender::DrawObject(const cxObject *Object) } void cText2SkinRender::DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg, - const tColor *Fg, int Alpha, int Colors, const std::string &Path) + const tColor *Fg, const tColor *Mask, int Alpha, int Colors, + const std::string &Path) { cText2SkinBitmap *bmp; - Dprintf("trying to draw image %s to %dx%d - alpha %d\n", ImagePath(Path).c_str(), Pos.x, - Pos.y, Alpha); + //Dprintf("trying to draw image %s to %dx%d - alpha %d\n", ImagePath(Path).c_str(), Pos.x, Pos.y, Alpha); if ((bmp = cText2SkinBitmap::Load(ImagePath(Path), Alpha, Size.h > 1 ? Size.h : 0, Size.w > 1 ? Size.w : 0, Colors)) != NULL) { //Dprintf("success loading image\n"); if (Bg) bmp->SetColor(0, *Bg); if (Fg) bmp->SetColor(1, *Fg); - mScreen->DrawBitmap(Pos.x, Pos.y, bmp->Get(mUpdateIn, mNow)); + mScreen->DrawBitmap(Pos.x, Pos.y, bmp->Get(mUpdateIn, mNow), Mask); } } @@ -1,5 +1,5 @@ /* - * $Id: render.h,v 1.11 2005/01/20 20:45:46 lordjaxom Exp $ + * $Id: render.h,v 1.12 2005/01/26 20:42:41 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_RENDER_H @@ -85,7 +85,7 @@ protected: void DrawBackground(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, int Alpha, const std::string &Path); void DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, - int Alpha, int Colors, const std::string &Path); + const tColor *Mask, int Alpha, int Colors, const std::string &Path); void DrawText(const txPoint &Pos, const txSize &Size, const tColor *Fg, const std::string &Text, const cFont *Font, int Align); void DrawMarquee(const txPoint &Pos, const txSize &Size, const tColor *Fg, diff --git a/xml/object.h b/xml/object.h index fca86f2..bbc37a0 100644 --- a/xml/object.h +++ b/xml/object.h @@ -1,5 +1,5 @@ /* - * $Id: object.h,v 1.5 2005/01/01 23:44:36 lordjaxom Exp $ + * $Id: object.h,v 1.6 2005/01/26 20:39:12 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_XML_OBJECT_H @@ -73,6 +73,7 @@ private: int mArc; std::string mFg; std::string mBg; + std::string mMask; std::string mMark; std::string mActive; std::string mKeep; @@ -122,6 +123,7 @@ public: const cFont *Font(void) const; const tColor *Fg(void) const; const tColor *Bg(void) const; + const tColor *Mask(void) const; const tColor *Mark(void) const; const tColor *Active(void) const; const tColor *Keep(void) const; diff --git a/xml/parser.c b/xml/parser.c index 0f5a2d4..f573398 100644 --- a/xml/parser.c +++ b/xml/parser.c @@ -1,5 +1,5 @@ /* - * $Id: parser.c,v 1.8 2005/01/20 14:46:12 lordjaxom Exp $ + * $Id: parser.c,v 1.9 2005/01/26 20:39:12 lordjaxom Exp $ */ #include "xml/parser.h" @@ -129,30 +129,31 @@ bool xStartElem(const std::string &name, std::map<std::string,std::string> &attr else { object = new cxObject(display); if (object->ParseType(name)) { - ATTRIB_OPT_NUMBER("x1", object->mPos1.x); - ATTRIB_OPT_NUMBER("y1", object->mPos1.y); - ATTRIB_OPT_NUMBER("x2", object->mPos2.x); - ATTRIB_OPT_NUMBER("y2", object->mPos2.y); - ATTRIB_OPT_FUNC ("condition", object->ParseCondition); + ATTRIB_OPT_NUMBER("x1", object->mPos1.x); + ATTRIB_OPT_NUMBER("y1", object->mPos1.y); + ATTRIB_OPT_NUMBER("x2", object->mPos2.x); + ATTRIB_OPT_NUMBER("y2", object->mPos2.y); + ATTRIB_OPT_FUNC ("condition", object->ParseCondition); if (name == "image") { - ATTRIB_OPT_NUMBER("x", object->mPos1.x); - ATTRIB_OPT_NUMBER("y", object->mPos1.y); - ATTRIB_OPT_NUMBER("x", object->mPos2.x); - ATTRIB_OPT_NUMBER("y", object->mPos2.y); - ATTRIB_OPT_NUMBER("alpha", object->mAlpha); - ATTRIB_OPT_NUMBER("colors", object->mColors); - ATTRIB_OPT_STRING("color", object->mFg); - ATTRIB_OPT_STRING("bgColor", object->mBg); - ATTRIB_MAN_FUNC ("path", object->mPath.Parse); + ATTRIB_OPT_NUMBER("x", object->mPos1.x); + ATTRIB_OPT_NUMBER("y", object->mPos1.y); + ATTRIB_OPT_NUMBER("x", object->mPos2.x); + ATTRIB_OPT_NUMBER("y", object->mPos2.y); + ATTRIB_OPT_NUMBER("alpha", object->mAlpha); + ATTRIB_OPT_NUMBER("colors", object->mColors); + ATTRIB_OPT_STRING("color", object->mFg); + ATTRIB_OPT_STRING("bgColor", object->mBg); + ATTRIB_OPT_STRING("maskColor", object->mMask); + ATTRIB_MAN_FUNC ("path", object->mPath.Parse); } else if (name == "text" || name == "marquee" || name == "blink" || name == "scrolltext") { - ATTRIB_OPT_STRING("color", object->mFg); - ATTRIB_OPT_FUNC ("align", object->ParseAlignment); - ATTRIB_OPT_FUNC ("font", object->ParseFontFace); + ATTRIB_OPT_STRING("color", object->mFg); + ATTRIB_OPT_FUNC ("align", object->ParseAlignment); + ATTRIB_OPT_FUNC ("font", object->ParseFontFace); if (name == "blink") { ATTRIB_OPT_STRING("blinkColor", object->mBg); |