mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 09:10:54 +00:00
* main_sdl.c: better dedicated server loop.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@186 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
ea4bad07b8
commit
48f7e6ba51
1 changed files with 20 additions and 1 deletions
|
@ -66,11 +66,30 @@ int main(int argc, char *argv[])
|
||||||
Host_Init(&parms);
|
Host_Init(&parms);
|
||||||
|
|
||||||
oldtime = Sys_FloatTime();
|
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)
|
while (!done)
|
||||||
{
|
{
|
||||||
// TODO: dedicated server loop
|
// TODO: dedicated server loop
|
||||||
|
|
||||||
while (!isDedicated && !done && SDL_PollEvent (&event))
|
while (!done && SDL_PollEvent (&event))
|
||||||
{
|
{
|
||||||
switch (event.type)
|
switch (event.type)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue