Ejemplo n.º 1
0
/*
===============
SV_InitGameProgs

Called on a normal map change, not on a map_restart
===============
*/
void SV_InitGameProgs(void) {
	sv.num_tagheaders = 0;
	sv.num_tags = 0;

	// load the dll or bytecode
	gvm = VM_Create( "qagame", SV_GameSystemCalls, VMI_NATIVE );
	if(!gvm) {
		Com_Error(ERR_FATAL, "VM_Create on game failed");
	}

	SV_InitGameVM(false);
}
Ejemplo n.º 2
0
/*
===================
SV_RestartGameProgs

Called on a map_restart, but not on a normal map change
===================
*/
void SV_RestartGameProgs( void )
{
	if ( !sv_gameDLL )
	{
		return;
	}
	g_game->ShutdownGame( true );
	
	// do a restart instead of a free
	sv_gameDLL = g_moduleMgr->restart( sv_gameDLL, true );
	if ( !sv_gameDLL )
	{
		Com_Error( ERR_FATAL, "VM_Restart on game failed" );
	}
	
	SV_InitGameVM( true );
}
Ejemplo n.º 3
0
/*
===================
SV_RestartGameProgs

Called on a map_restart, but not on a normal map change
===================
*/
void SV_RestartGameProgs(void) {
	if(!gvm) {
		return;
	}
	VM_Call(gvm, GAME_SHUTDOWN, true);

#ifdef USE_PHYSICS
	CMod_PhysicsClearBodies();
#endif
	
	// do a restart instead of a free
	gvm = VM_Restart(gvm);
	if(!gvm) {
		Com_Error(ERR_FATAL, "VM_Restart on game failed");
	}

	SV_InitGameVM(true);
}
Ejemplo n.º 4
0
/*
===============
SV_InitGameProgs

Called on a normal map change, not on a map_restart
===============
*/
void SV_InitGameProgs( void )
{
	// load the dll or bytecode
	sv_gameDLL = g_moduleMgr->load( "qagame" );
	if ( !sv_gameDLL )
	{
		Com_Error( ERR_FATAL, "VM_Create on game failed" );
	}
	g_iFaceMan->registerIFaceUser( &g_game, GAME_API_IDENTSTR );
	if ( !g_game )
	{
		Com_Error( ERR_DROP, "Game module has wrong interface version (%s required)", GAME_API_IDENTSTR );
	}
	g_iFaceMan->registerIFaceUser( &g_gameClients, GAMECLIENTS_API_IDENTSTR );
	if ( !g_gameClients )
	{
		Com_Error( ERR_DROP, "GameClients module has wrong interface version (%s required)", GAMECLIENTS_API_IDENTSTR );
	}
	SV_InitGameVM( false );
}