예제 #1
0
파일: host.c 프로젝트: odnarb/manquake
/*
==================
Host_Frame

Runs all active servers
==================
*/
void _Host_Frame (float time)
{
	if (setjmp (host_abortserver))
		return;			// something bad happened, or the server disconnected

// keep the random time dependent
	rand ();

// decide the simulation time
	if (!Host_FilterTime (time))
		return;			// don't run too fast, or packets will flood out

// get new key events
	Sys_SendKeyEvents ();

// process console commands
	Cbuf_Execute ();

	NET_Poll();

// check for commands typed to the host
	Host_GetConsoleCommands ();

	if (sv.active)
		Host_ServerFrame ();
}
예제 #2
0
파일: host.c 프로젝트: Nofe92/HandmadeQuake
void Host_Frame(float  timestep)
{
    if (!Host_FilterTime(timestep))
        return;

    // update game
    // render scene
}
예제 #3
0
void Host_Frame(float timestep)
{
  if (!Host_FilterTime(timestep)) {
    return;
  }

  Sys_SendKeyEvents();

  VID_Update();
}
예제 #4
0
파일: host.c 프로젝트: emileb/xash3d
/*
=================
Host_Frame
=================
*/
void Host_Frame( float time )
{
	if( setjmp( host.abortframe ))
		return;

	Host_InputFrame ();	// input frame

	// decide the simulation time
	if( !Host_FilterTime( time ))
		return;

	Host_GetConsoleCommands ();

	Host_ServerFrame (); // server frame
	Host_ClientFrame (); // client frame

	host.framecount++;
}
예제 #5
0
파일: host.c 프로젝트: ptitSeb/xash3d
/*
=================
Host_Frame
=================
*/
void Host_Frame( float time )
{
	if( setjmp( host.abortframe ))
		return;

	Host_Autosleep();

	// decide the simulation time
	if( !Host_FilterTime( time ))
		return;

	Host_InputFrame ();	// input frame

	Host_GetConsoleCommands ();

	Host_ServerFrame (); // server frame
	if ( host.type != HOST_DEDICATED )
		Host_ClientFrame (); // client frame

	HTTP_Run();

	host.framecount++;
}
예제 #6
0
파일: host.c 프로젝트: libretro/tyrquake
/*
==================
Host_Frame

Runs all active servers
==================
*/
void
_Host_Frame(float time)
{
   /* something bad happened, or the server disconnected */
   if (setjmp(host_abort))
      return;

   /* keep the random time dependent */
   rand();

   /*
    * Decide the simulation time. Don't run too fast, or packets will flood
    * out.
    */
   if (!Host_FilterTime(time))
      return;

   /* get new key events */
   Sys_SendKeyEvents();

   /* allow mice or other external controllers to add commands */
   IN_Commands();

   /* process console commands */
   Cbuf_Execute();

   NET_Poll();

   /* if running the server locally, make intentions now */
   if (sv.active)
      CL_SendCmd();

   //-------------------
   //
   // server operations
   //
   //-------------------

   /* check for commands typed to the host */
   Host_GetConsoleCommands();

   if (sv.active)
      Host_ServerFrame();

   //-------------------
   //
   // client operations
   //
   //-------------------

   /*
    * if running the server remotely, send intentions now after the incoming
    * messages have been read
    */
   if (!sv.active)
      CL_SendCmd();

   host_time += host_frametime;

   /* fetch results from server */
   if (cls.state >= ca_connected)
      CL_ReadFromServer();

   SCR_UpdateScreen();
   CL_RunParticles();

   host_framecount++;
   fps_count++;
}
예제 #7
0
/*
==================
Host_Frame

Runs all active servers
==================
*/
void _Host_Frame (float time)
{
	static double		time1 = 0;
	static double		time2 = 0;
	static double		time3 = 0;
	int			pass1, pass2, pass3;

	if (setjmp (host_abortserver) )
		return;			// something bad happened, or the server disconnected

// keep the random time dependent
	rand ();
	
// decide the simulation time
	if (!Host_FilterTime (time))
		return;			// don't run too fast, or packets will flood out
		
// get new key events
	Sys_SendKeyEvents ();

// allow mice or other external controllers to add commands
	IN_Commands ();

// process console commands
	Cbuf_Execute ();

	NET_Poll();

// if running the server locally, make intentions now
	if (sv.active)
		CL_SendCmd ();
	
//-------------------
//
// server operations
//
//-------------------

// check for commands typed to the host
	Host_GetConsoleCommands ();
	
	if (sv.active)
		Host_ServerFrame ();

//-------------------
//
// client operations
//
//-------------------

// if running the server remotely, send intentions now after
// the incoming messages have been read
	if (!sv.active)
		CL_SendCmd ();

	host_time += host_frametime;

// fetch results from server
	if (cls.state == ca_connected)
	{
		CL_ReadFromServer ();
	}

// update video
	if (host_speeds.value)
		time1 = Sys_FloatTime ();
		
	SCR_UpdateScreen ();

	if (host_speeds.value)
		time2 = Sys_FloatTime ();
		
// update audio
	if (cls.signon == SIGNONS)
	{
		S_Update (r_origin, vpn, vright, vup);
		CL_DecayLights ();
	}
	else
		S_Update (vec3_origin, vec3_origin, vec3_origin, vec3_origin);
	
	// jkrige - fmod sound system (music)
	//CDAudio_Update();
	FMOD_MusicUpdate();
	// jkrige - fmod sound system (music)

	if (host_speeds.value)
	{
		pass1 = (time1 - time3)*1000;
		time3 = Sys_FloatTime ();
		pass2 = (time2 - time1)*1000;
		pass3 = (time3 - time2)*1000;
		Con_Printf ("%3i tot %3i server %3i gfx %3i snd\n",	pass1+pass2+pass3, pass1, pass2, pass3);
	}
	
	host_framecount++;

	fps_count++; // jkrige - fps counter
}
예제 #8
0
/*
==================
Host_Frame

Runs all active servers
==================
*/
void _Host_Frame (double time)
{
	static double		time1 = 0;
	static double		time2 = 0;
	static double		time3 = 0;
	int			pass1, pass2, pass3;

	if (setjmp (host_abortserver) )
		return;			// something bad happened, or the server disconnected

// keep the random time dependent
	rand ();

// decide the simulation time
	if (!Host_FilterTime (time))
	{
#ifdef PROQUAKE_EXTENSION
		// JPG - if we're not doing a frame, still check for lagged moves to send
		if (!sv.active && (cl.movemessages > 2))
			CL_SendLagMove();
#endif
		return;			// don't run too fast, or packets will flood out

	}

// get new key events
#if !defined(MACOSX)
	Sys_SendKeyEvents ();
#endif // This is done in Windows and Linux.  Confirmed from pq350src

// allow mice or other external controllers to add commands
	IN_Commands (); // Baker: This is ONLY joystick

// process console commands
	Cbuf_Execute ();

	NET_Poll();

// if running the server locally, make intentions now
	if (sv.active)
		CL_SendCmd ();  // This is where mouse input is read
#ifdef WINDOWS_SCROLLWHEEL_PEEK
	else if (con_forcedup && key_dest == key_game) // Allows console scrolling when con_forcedup
		IN_MouseWheel ();	// Grab mouse wheel input
#endif

//-------------------
//
// server operations
//
//-------------------

// check for commands typed to the host
	Host_GetConsoleCommands ();

	if (sv.active)
		Host_ServerFrame ();

//-------------------
//
// client operations
//
//-------------------

// if running the server remotely, send intentions now after
// the incoming messages have been read
	if (!sv.active)
		CL_SendCmd ();

	host_time += host_frametime;

// fetch results from server
	if (cls.state == ca_connected)
		CL_ReadFromServer ();

	if (host_speeds.value)
		time1 = Sys_DoubleTime ();

// update video
	SCR_UpdateScreen ();

	if (host_speeds.value)
		time2 = Sys_DoubleTime ();

	if (cls.signon == SIGNONS)
	{
		// update audio
		S_Update (r_origin, vpn, vright, vup);
		CL_DecayLights ();
	}
	else
	{
		S_Update (vec3_origin, vec3_origin, vec3_origin, vec3_origin);
	}

#ifdef PSP_MP3_SUPPORT
	if (bmg_type_changed == true)
	{
#endif
		CDAudio_Update();
#ifdef PSP_MP3_SUPPORT
		bmg_type_changed = false;
	}
#endif

	if (host_speeds.value)
	{
		pass1 = (time1 - time3)*1000;
		time3 = Sys_DoubleTime ();
		pass2 = (time2 - time1)*1000;
		pass3 = (time3 - time2)*1000;
		Con_Printf ("%3i tot %3i server %3i gfx %3i snd\n", pass1+pass2+pass3, pass1, pass2, pass3);
	}

#ifdef SUPPORTS_DEMO_CONTROLS
	if (!cls.demoplayback && cl_demorewind.value)
	{
		Cvar_SetValueByRef (&cl_demorewind, 0);
		Con_Printf ("Demorewind is only enabled during playback\n");
	}
#endif

	host_framecount++;
	//frame speed counter
	fps_count++;//muff
}