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:
josh 2009-09-28 13:50:07 +00:00
parent 2019bad104
commit e033b0962c

View File

@ -22,6 +22,7 @@
/* switch to the next screensaver mode after this many milliseconds */
#define SSMODE_TIMEOUT_MSEC (1000*45)
#define SCREENSAVER_MAX_RUNTIME (30*60*1000)
static SDL_Event event;
@ -86,6 +87,10 @@ void SSMain::run()
while (SDL_WaitEvent(&event))
{
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)
{
delete m_mode;