mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
* 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:
parent
257ad7e38d
commit
0f6c0a0c55
1 changed files with 20 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue