diff options
-rw-r--r-- | bitmap.c | 12 | ||||
-rw-r--r-- | bitmap.h | 4 | ||||
-rw-r--r-- | render.c | 7 |
3 files changed, 12 insertions, 11 deletions
@@ -1,5 +1,5 @@ /* - * $Id: bitmap.c,v 1.2 2004/12/21 20:26:25 lordjaxom Exp $ + * $Id: bitmap.c,v 1.3 2004/12/28 01:54:02 lordjaxom Exp $ */ #include "bitmap.h" @@ -90,18 +90,18 @@ cText2SkinBitmap::~cText2SkinBitmap() { mBitmaps.clear(); } -cBitmap &cText2SkinBitmap::Get(uint &UpdateIn) { +cBitmap &cText2SkinBitmap::Get(uint &UpdateIn, uint Now) { if (mBitmaps.size() == 1) return *mBitmaps[0]; - time_t upd, cur = time_ms(); + time_t upd; int diff; if (mLastGet == 0) { - mLastGet = cur; + mLastGet = Now; upd = mDelay; - } else if ((diff = cur - mLastGet) >= mDelay) { + } else if ((diff = Now - mLastGet) >= mDelay) { mCurrent = (mCurrent + 1) % mBitmaps.size(); - mLastGet = cur; + mLastGet = Now; upd = mDelay - diff > 1 ? mDelay - diff : 1; } else { upd = mDelay - diff; @@ -1,5 +1,5 @@ /* - * $Id: bitmap.h,v 1.2 2004/12/21 20:26:25 lordjaxom Exp $ + * $Id: bitmap.h,v 1.3 2004/12/28 01:54:02 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_BITMAP_H @@ -30,7 +30,7 @@ public: virtual ~cText2SkinBitmap(); void Reset(void) { mCurrent = 0; mLastGet = 0; } - cBitmap &Get(uint &UpdateIn); + cBitmap &Get(uint &UpdateIn, uint Now); void SetColor(int Index, tColor Color); void SetAlpha(int Alpha); @@ -1,5 +1,5 @@ /* - * $Id: render.c,v 1.5 2004/12/28 01:29:35 lordjaxom Exp $ + * $Id: render.c,v 1.6 2004/12/28 01:54:02 lordjaxom Exp $ */ #include "render.h" @@ -278,7 +278,7 @@ void cText2SkinRender::DrawImage(const txPoint &Pos, const txSize &Size, const t //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)); + mScreen->DrawBitmap(Pos.x, Pos.y, bmp->Get(mUpdateIn, mNow)); } } @@ -457,7 +457,8 @@ void cText2SkinRender::DrawScrolltext(const txPoint &Pos, const txSize &Size, co { //Dprintf("trying to draw scrolltext %s\n", Text.c_str()); if (mScroller == NULL) - mScroller = new cText2SkinScroller(mScreen, Pos.x, Pos.y, Size.w, Size.h, Text.c_str(), Font, Fg ? *Fg : 0, clrTransparent); + mScroller = new cText2SkinScroller(mScreen, Pos.x, Pos.y, Size.w, Size.h, Text.c_str(), + Font, Fg ? *Fg : 0, clrTransparent); else mScroller->DrawText(); } |