Beispiel #1
0
/*
===============
CL_InitClientMove

===============
*/
void CL_InitClientMove( void )
{
	int	i;

	Pmove_Init ();

	clgame.pmove->server = false;	// running at client
	clgame.pmove->movevars = &clgame.movevars;
	clgame.pmove->runfuncs = false;

	Mod_SetupHulls( clgame.player_mins, clgame.player_maxs );

	// enumerate client hulls
	for( i = 0; i < MAX_MAP_HULLS; i++ )
	{
		if( clgame.dllFuncs.pfnGetHullBounds( i, clgame.player_mins[i], clgame.player_maxs[i] ))
			MsgDev( D_NOTE, "CL: hull%i, player_mins: %g %g %g, player_maxs: %g %g %g\n", i,
			clgame.player_mins[i][0], clgame.player_mins[i][1], clgame.player_mins[i][2],
			clgame.player_maxs[i][0], clgame.player_maxs[i][1], clgame.player_maxs[i][2] );
	}

	Q_memcpy( clgame.pmove->player_mins, clgame.player_mins, sizeof( clgame.player_mins ));
	Q_memcpy( clgame.pmove->player_maxs, clgame.player_maxs, sizeof( clgame.player_maxs ));

	// common utilities
	clgame.pmove->PM_Info_ValueForKey = Info_ValueForKey;
	clgame.pmove->PM_Particle = pfnParticle;
	clgame.pmove->PM_TestPlayerPosition = pfnTestPlayerPosition;
	clgame.pmove->Con_NPrintf = Con_NPrintf;
	clgame.pmove->Con_DPrintf = Con_DPrintf;
	clgame.pmove->Con_Printf = Con_Printf;
	clgame.pmove->Sys_FloatTime = Sys_DoubleTime;
	clgame.pmove->PM_StuckTouch = pfnStuckTouch;
	clgame.pmove->PM_PointContents = pfnPointContents;
	clgame.pmove->PM_TruePointContents = pfnTruePointContents;
	clgame.pmove->PM_HullPointContents = pfnHullPointContents; 
	clgame.pmove->PM_PlayerTrace = pfnPlayerTrace;
	clgame.pmove->PM_TraceLine = pfnTraceLine;
	clgame.pmove->RandomLong = Com_RandomLong;
	clgame.pmove->RandomFloat = Com_RandomFloat;
	clgame.pmove->PM_GetModelType = pfnGetModelType;
	clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;	
	clgame.pmove->PM_HullForBsp = pfnHullForBsp;
	clgame.pmove->PM_TraceModel = pfnTraceModel;
	clgame.pmove->COM_FileSize = COM_FileSize;
	clgame.pmove->COM_LoadFile = COM_LoadFile;
	clgame.pmove->COM_FreeFile = COM_FreeFile;
	clgame.pmove->memfgets = COM_MemFgets;
	clgame.pmove->PM_PlaySound = pfnPlaySound;
	clgame.pmove->PM_TraceTexture = pfnTraceTexture;
	clgame.pmove->PM_PlaybackEventFull = pfnPlaybackEventFull;
	clgame.pmove->PM_PlayerTraceEx = pfnPlayerTraceEx;
	clgame.pmove->PM_TestPlayerPositionEx = pfnTestPlayerPositionEx;
	clgame.pmove->PM_TraceLineEx = pfnTraceLineEx;
	clgame.pmove->PM_TraceSurface = pfnTraceSurface;

	// initalize pmove
	clgame.dllFuncs.pfnPlayerMoveInit( clgame.pmove );
}
/*
====================
SV_Init
====================
*/
void SV_Init (void)
{
	Sys_Printf ("Host_Init\n");

	Memory_Init (host_parms->membase, host_parms->memsize);
	Cbuf_Init ();
	Cmd_Init ();

	COM_Init ();
	FS_Init ();

	PR_Init ();
	Mod_Init ();

	SV_InitNet ();

	SV_InitLocal ();
	Pmove_Init ();

	Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
	host_hunklevel = Hunk_LowMark ();

	Cbuf_InsertText ("exec server.cfg\n");
	Cbuf_Execute ();
	// unlock the early-set cvars after init
	Cvar_UnlockAll ();

	host_initialized = true;

	Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
	Con_Printf ("%4.1f megabyte heap\n", host_parms->memsize/(1024*1024.0));
	Con_Printf ("======== HexenWorld Initialized ========\n");

	// process command line arguments
	Cmd_StuffCmds_f ();
	Cbuf_Execute ();

	// if a map wasn't specified on the command line, spawn demo1.map
	if (sv.state == ss_dead)
		Cmd_ExecuteString ("map demo1", src_command);
	if (sv.state == ss_dead)
		SV_Error ("Couldn't spawn a server");
}
Beispiel #3
0
/*
===============
SV_InitClientMove

===============
*/
void SV_InitClientMove( void )
{
    int	i;

    Pmove_Init ();

    svgame.pmove->server = true;
    svgame.pmove->movevars = &svgame.movevars;
    svgame.pmove->runfuncs = false;

    Mod_SetupHulls( svgame.player_mins, svgame.player_maxs );

    // enumerate client hulls
    for( i = 0; i < MAX_MAP_HULLS; i++ )
    {
        if( svgame.dllFuncs.pfnGetHullBounds( i, svgame.player_mins[i], svgame.player_maxs[i] ))
            MsgDev( D_NOTE, "SV: hull%i, player_mins: %g %g %g, player_maxs: %g %g %g\n", i,
                    svgame.player_mins[i][0], svgame.player_mins[i][1], svgame.player_mins[i][2],
                    svgame.player_maxs[i][0], svgame.player_maxs[i][1], svgame.player_maxs[i][2] );
    }

    Q_memcpy( svgame.pmove->player_mins, svgame.player_mins, sizeof( svgame.player_mins ));
    Q_memcpy( svgame.pmove->player_maxs, svgame.player_maxs, sizeof( svgame.player_maxs ));

    // common utilities
    svgame.pmove->PM_Info_ValueForKey = Info_ValueForKey;
    svgame.pmove->PM_Particle = pfnParticle;
    svgame.pmove->PM_TestPlayerPosition = pfnTestPlayerPosition;
    svgame.pmove->Con_NPrintf = Con_NPrintf;
    svgame.pmove->Con_DPrintf = Con_DPrintf;
    svgame.pmove->Con_Printf = Con_Printf;
    svgame.pmove->Sys_FloatTime = Sys_DoubleTime;
    svgame.pmove->PM_StuckTouch = pfnStuckTouch;
    svgame.pmove->PM_PointContents = pfnPointContents;
    svgame.pmove->PM_TruePointContents = pfnTruePointContents;
    svgame.pmove->PM_HullPointContents = pfnHullPointContents;
    svgame.pmove->PM_PlayerTrace = pfnPlayerTrace;
    svgame.pmove->PM_TraceLine = pfnTraceLine;
    svgame.pmove->RandomLong = Com_RandomLong;
    svgame.pmove->RandomFloat = Com_RandomFloat;
    svgame.pmove->PM_GetModelType = pfnGetModelType;
    svgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
    svgame.pmove->PM_HullForBsp = pfnHullForBsp;
    svgame.pmove->PM_TraceModel = pfnTraceModel;
    svgame.pmove->COM_FileSize = COM_FileSize;
    svgame.pmove->COM_LoadFile = COM_LoadFile;
    svgame.pmove->COM_FreeFile = COM_FreeFile;
    svgame.pmove->memfgets = COM_MemFgets;
    svgame.pmove->PM_PlaySound = pfnPlaySound;
    svgame.pmove->PM_TraceTexture = pfnTraceTexture;
    svgame.pmove->PM_PlaybackEventFull = pfnPlaybackEventFull;
    svgame.pmove->PM_PlayerTraceEx = pfnPlayerTraceEx;
    svgame.pmove->PM_TestPlayerPositionEx = pfnTestPlayerPositionEx;
    svgame.pmove->PM_TraceLineEx = pfnTraceLineEx;
    svgame.pmove->PM_TraceSurface = pfnTraceSurface;
#ifdef DLL_LOADER // w32-compatible ABI
    if( host.enabledll && Loader_GetDllHandle( svgame.hInstance ) )
    {
        svgame.pmove->PM_PlayerTrace = pfnPlayerTrace_w32;
        svgame.pmove->PM_PlayerTraceEx = pfnPlayerTraceEx_w32;
    }
#endif

    // initalize pmove
    svgame.dllFuncs.pfnPM_Init( svgame.pmove );
}