added SCREENSAVER_MAX_RUNTIME to SSMain.cc
git-svn-id: svn://anubis/dwscr/trunk@117 5bef9df8-b654-44bb-925b-0ff18baa8f8c
This commit is contained in:
parent
2019bad104
commit
e033b0962c
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
/* switch to the next screensaver mode after this many milliseconds */
|
/* switch to the next screensaver mode after this many milliseconds */
|
||||||
#define SSMODE_TIMEOUT_MSEC (1000*45)
|
#define SSMODE_TIMEOUT_MSEC (1000*45)
|
||||||
|
#define SCREENSAVER_MAX_RUNTIME (30*60*1000)
|
||||||
|
|
||||||
static SDL_Event event;
|
static SDL_Event event;
|
||||||
|
|
||||||
@ -86,6 +87,10 @@ void SSMain::run()
|
|||||||
while (SDL_WaitEvent(&event))
|
while (SDL_WaitEvent(&event))
|
||||||
{
|
{
|
||||||
elapsed_msec = SDL_GetTicks(); /* get the time the event occurred at */
|
elapsed_msec = SDL_GetTicks(); /* get the time the event occurred at */
|
||||||
|
#if SCREENSAVER_MAX_RUNTIME > 0
|
||||||
|
if (elapsed_msec >= SCREENSAVER_MAX_RUNTIME)
|
||||||
|
goto RET;
|
||||||
|
#endif
|
||||||
if (elapsed_msec - lastChanged_msec > SSMODE_TIMEOUT_MSEC)
|
if (elapsed_msec - lastChanged_msec > SSMODE_TIMEOUT_MSEC)
|
||||||
{
|
{
|
||||||
delete m_mode;
|
delete m_mode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user