|
|
@ -383,6 +383,18 @@ bool SMX_LightsAnimation_Load(const char *gif, int size, int pad, SMX_LightsType |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
double g_fStopAnimatingUntil = -1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SMXAutoPanelAnimations::TemporaryStopAnimating() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Stop animating for 100ms.
|
|
|
|
|
|
|
|
double fStopForSeconds = 1/10.0f; |
|
|
|
|
|
|
|
g_fStopAnimatingUntil = SMX::GetMonotonicTime() + fStopForSeconds; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// A thread to handle setting light animations. We do this in a separate
|
|
|
|
// A thread to handle setting light animations. We do this in a separate
|
|
|
|
// thread rather than in the SMXManager thread so this can be treated as
|
|
|
|
// thread rather than in the SMXManager thread so this can be treated as
|
|
|
|
// if it's external application thread, and it's making normal threaded
|
|
|
|
// if it's external application thread, and it's making normal threaded
|
|
|
@ -407,7 +419,11 @@ private: |
|
|
|
|
|
|
|
|
|
|
|
while(!m_bShutdown) |
|
|
|
while(!m_bShutdown) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
// Check if we've temporarily stopped updating lights.
|
|
|
|
|
|
|
|
bool bSkipUpdate = g_fStopAnimatingUntil > SMX::GetMonotonicTime(); |
|
|
|
|
|
|
|
|
|
|
|
// Run a single panel lights update.
|
|
|
|
// Run a single panel lights update.
|
|
|
|
|
|
|
|
if(!bSkipUpdate) |
|
|
|
UpdateLights(); |
|
|
|
UpdateLights(); |
|
|
|
|
|
|
|
|
|
|
|
// Wait up to 30 FPS, or until we're signalled. We can only be signalled
|
|
|
|
// Wait up to 30 FPS, or until we're signalled. We can only be signalled
|
|
|
|