Exemple #1
0
//===========================================================================
//
// Parameter:               -
// Returns:                 -
// Changes Globals:     -
//===========================================================================
void AAS_Shutdown(void)
{
	// Ridah, do each of the worlds
	int             i;

	for(i = 0; i < MAX_AAS_WORLDS; i++)
	{
		AAS_SetCurrentWorld(i);

		// Ridah, kill the route-table data
		AAS_RT_ShutdownRouteTable();

		AAS_ShutdownAlternativeRouting();
		AAS_DumpBSPData();
		//free routing caches
		AAS_FreeRoutingCaches();
		//free aas link heap
		AAS_FreeAASLinkHeap();
		//free aas linked entities
		AAS_FreeAASLinkedEntities();
		//free the aas data
		AAS_DumpAASData();

		if(i == 0)
		{
			//free the entities
			if((*aasworld).entities)
			{
				FreeMemory((*aasworld).entities);
			}
		}

		//clear the (*aasworld) structure
		memset(&(*aasworld), 0, sizeof(aas_t));
		//aas has not been initialized
		(*aasworld).initialized = qfalse;
	}

	//NOTE: as soon as a new .bsp file is loaded the .bsp file memory is
	// freed an reallocated, so there's no need to free that memory here
	//print shutdown
	botimport.Print(PRT_MESSAGE, "AAS shutdown.\n");
}								//end of the function AAS_Shutdown
Exemple #2
0
//===========================================================================
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
void AAS_Shutdown(void)
{
	AAS_ShutdownAlternativeRouting();
	//
	AAS_DumpBSPData();
	//free routing caches
	AAS_FreeRoutingCaches();
	//free aas link heap
	AAS_FreeAASLinkHeap();
	//free aas linked entities
	AAS_FreeAASLinkedEntities();
	//free the aas data
	AAS_DumpAASData();
	//free the entities
	if (aasworld.entities) FreeMemory(aasworld.entities);
	//clear the aasworld structure
	Com_Memset(&aasworld, 0, sizeof(aas_t));
	//aas has not been initialized
	aasworld.initialized = qfalse;
	//NOTE: as soon as a new .bsp file is loaded the .bsp file memory is
	// freed an reallocated, so there's no need to free that memory here
	//print shutdown
	botimport.Print(PRT_MESSAGE, "AAS shutdown.\n");
} //end of the function AAS_Shutdown