Skip to content

Commit

Permalink
Set dirty flag in teletext dialog if required
Browse files Browse the repository at this point in the history
  • Loading branch information
smallint authored and popcornmix committed Jan 22, 2015
1 parent 4c73ca1 commit db88529
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions xbmc/video/dialogs/GUIDialogTeletext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ CGUIDialogTeletext::~CGUIDialogTeletext()
bool CGUIDialogTeletext::OnAction(const CAction& action)
{
if (m_TextDecoder.HandleAction(action))
{
MarkDirtyRegion();
return true;
}

return CGUIDialog::OnAction(action);
}

bool CGUIDialogTeletext::OnBack(int actionID)
{
m_bClose = true;
MarkDirtyRegion();
return true;
}

Expand All @@ -79,6 +83,12 @@ bool CGUIDialogTeletext::OnMessage(CGUIMessage& message)
return CGUIDialog::OnMessage(message);
}

void CGUIDialogTeletext::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
CGUIDialog::Process(currentTime, dirtyregions);
m_renderRegion = m_vertCoords;
}

void CGUIDialogTeletext::Render()
{
// Do not render if we have no texture
Expand All @@ -93,12 +103,18 @@ void CGUIDialogTeletext::Render()
if (!m_bClose)
{
if (teletextFadeAmount < 100)
{
teletextFadeAmount = std::min(100, teletextFadeAmount + 5);
MarkDirtyRegion();
}
}
else
{
if (teletextFadeAmount > 0)
{
teletextFadeAmount = std::max(0, teletextFadeAmount - 10);
MarkDirtyRegion();
}

if (teletextFadeAmount == 0)
Close();
Expand All @@ -109,6 +125,7 @@ void CGUIDialogTeletext::Render()
{
m_pTxtTexture->Update(m_TextDecoder.GetWidth(), m_TextDecoder.GetHeight(), m_TextDecoder.GetWidth()*4, XB_FMT_A8R8G8B8, textureBuffer, false);
m_TextDecoder.RenderingDone();
MarkDirtyRegion();
}

color_t color = ((color_t)(teletextFadeAmount * 2.55f) & 0xff) << 24 | 0xFFFFFF;
Expand Down Expand Up @@ -184,4 +201,6 @@ void CGUIDialogTeletext::SetCoordinates()
top,
right,
bottom);

MarkDirtyRegion();
}
1 change: 1 addition & 0 deletions xbmc/video/dialogs/GUIDialogTeletext.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class CGUIDialogTeletext : public CGUIDialog
virtual bool OnMessage(CGUIMessage& message);
virtual bool OnAction(const CAction& action);
virtual bool OnBack(int actionID);
virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
virtual void Render();
virtual void OnInitWindow();
virtual void OnDeinitWindow(int nextWindowID);
Expand Down

0 comments on commit db88529

Please sign in to comment.