* main_sdl.c: better dedicated server loop.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@186 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2010-06-19 14:50:48 +00:00
parent 257ad7e38d
commit 0f6c0a0c55

View file

@ -66,11 +66,30 @@ int main(int argc, char *argv[])
Host_Init(&parms);
oldtime = Sys_FloatTime();
if (isDedicated)
{
while (1)
{
newtime = Sys_FloatTime ();
time = newtime - oldtime;
while (time < sys_ticrate.value )
{
SDL_Delay(1);
newtime = Sys_FloatTime ();
time = newtime - oldtime;
}
Host_Frame (time);
oldtime = newtime;
}
}
else
while (!done)
{
// TODO: dedicated server loop
while (!isDedicated && !done && SDL_PollEvent (&event))
while (!done && SDL_PollEvent (&event))
{
switch (event.type)
{