Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make CApplication::FrameMove conditional to cleanup ProcessRenderLoop

  • Loading branch information...
commit 87b682734e78ae67d714c49ddeb9f0182a51fd81 1 parent d7c1426
Jonathan Marshall authored
55 xbmc/Application.cpp
View
@@ -2574,44 +2574,45 @@ void CApplication::UpdateLCD()
#endif
}
-void CApplication::FrameMove()
+void CApplication::FrameMove(bool processEvents)
{
MEASURE_FUNCTION;
- // currently we calculate the repeat time (ie time from last similar keypress) just global as fps
- float frameTime = m_frameTime.GetElapsedSeconds();
- m_frameTime.StartZero();
- // never set a frametime less than 2 fps to avoid problems when debuggin and on breaks
- if( frameTime > 0.5 ) frameTime = 0.5;
-
- g_graphicsContext.Lock();
- // check if there are notifications to display
- CGUIDialogKaiToast *toast = (CGUIDialogKaiToast *)g_windowManager.GetWindow(WINDOW_DIALOG_KAI_TOAST);
- if (toast && toast->DoWork())
+ if (processEvents)
{
- if (!toast->IsDialogRunning())
+ // currently we calculate the repeat time (ie time from last similar keypress) just global as fps
+ float frameTime = m_frameTime.GetElapsedSeconds();
+ m_frameTime.StartZero();
+ // never set a frametime less than 2 fps to avoid problems when debuggin and on breaks
+ if( frameTime > 0.5 ) frameTime = 0.5;
+
+ g_graphicsContext.Lock();
+ // check if there are notifications to display
+ CGUIDialogKaiToast *toast = (CGUIDialogKaiToast *)g_windowManager.GetWindow(WINDOW_DIALOG_KAI_TOAST);
+ if (toast && toast->DoWork())
{
- toast->Show();
+ if (!toast->IsDialogRunning())
+ {
+ toast->Show();
+ }
}
- }
- g_graphicsContext.Unlock();
+ g_graphicsContext.Unlock();
- UpdateLCD();
+ UpdateLCD();
#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
- // Read the input from a remote
- g_RemoteControl.Update();
+ // Read the input from a remote
+ g_RemoteControl.Update();
#endif
- // process input actions
- CWinEvents::MessagePump();
- ProcessHTTPApiButtons();
- ProcessRemote(frameTime);
- ProcessGamepad(frameTime);
- ProcessEventServer(frameTime);
- m_pInertialScrollingHandler->ProcessInertialScroll(frameTime);
-
- // Process events and animate controls
+ // process input actions
+ CWinEvents::MessagePump();
+ ProcessHTTPApiButtons();
+ ProcessRemote(frameTime);
+ ProcessGamepad(frameTime);
+ ProcessEventServer(frameTime);
+ m_pInertialScrollingHandler->ProcessInertialScroll(frameTime);
+ }
if (!m_bStop)
g_windowManager.Process(CTimeUtils::GetFrameTime());
g_windowManager.FrameMove();
2  xbmc/Application.h
View
@@ -86,7 +86,7 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
CApplication(void);
virtual ~CApplication(void);
virtual bool Initialize();
- virtual void FrameMove();
+ virtual void FrameMove(bool processEvents);
virtual void Render();
virtual bool RenderNoPresent();
virtual void Preflight();
2  xbmc/XBApplicationEx.cpp
View
@@ -117,7 +117,7 @@ INT CXBApplicationEx::Run()
try
{
#endif
- if (!m_bStop) FrameMove();
+ if (!m_bStop) FrameMove(true);
//reset exception count
frameMoveExceptionCount = 0;
2  xbmc/dialogs/GUIDialogProgress.cpp
View
@@ -106,7 +106,7 @@ void CGUIDialogProgress::ProgressKeys()
{
if (m_bRunning)
{
- g_application.FrameMove();
+ g_application.FrameMove(true);
}
}
7 xbmc/guilib/GUIWindowManager.cpp
View
@@ -33,7 +33,6 @@
#include "addons/Skin.h"
#include "GUITexture.h"
#include "windowing/WindowingFactory.h"
-#include "utils/TimeUtils.h"
using namespace std;
@@ -630,12 +629,8 @@ void CGUIWindowManager::ProcessRenderLoop(bool renderOnly /*= false*/)
{
m_iNested++;
if (!renderOnly)
- {
m_pCallback->Process();
- m_pCallback->FrameMove();
- } else {
- Process(CTimeUtils::GetFrameTime());
- }
+ m_pCallback->FrameMove(!renderOnly);
m_pCallback->Render();
m_iNested--;
}
2  xbmc/guilib/IWindowManagerCallback.h
View
@@ -36,7 +36,7 @@ class IWindowManagerCallback
IWindowManagerCallback(void);
virtual ~IWindowManagerCallback(void);
- virtual void FrameMove() = 0;
+ virtual void FrameMove(bool processEvents) = 0;
virtual void Render() = 0;
virtual void Process() = 0;
};
Please sign in to comment.
Something went wrong with that request. Please try again.