Source/ThunderBeast/QuakeToon/qcommon/files.c
void FS_AddGameDirectory (char *dir)
{
	int				i;
	searchpath_t	*search;
	pack_t			*pak;
	char			pakfile[MAX_OSPATH];

	strcpy (fs_gamedir, dir);

	//
	// add the directory to the search path
	//
	search = Z_Malloc (sizeof(searchpath_t));
	strcpy (search->filename, dir);
	search->next = fs_searchpaths;
	fs_searchpaths = search;

	//
	// add any pak files in the format pak0.pak pak1.pak, ...
	//
	for (i=0; i<10; i++)
	{
		Com_sprintf (pakfile, sizeof(pakfile), "%s/pak%i.pak", dir, i);
		pak = FS_LoadPackFile (pakfile);
		if (!pak)
			continue;
		search = Z_Malloc (sizeof(searchpath_t));
		search->pack = pak;
		search->next = fs_searchpaths;
		fs_searchpaths = search;		
	}


}
/*
================
FS_AddGameDirectory

Sets fs_gamedir, adds the directory to the head of the path,
then loads and adds pak1.pak pak2.pak ... 
================
*/
FS_AddGameDirectory
Sets fs_gamedir, adds the directory to the head of the path,
then loads and adds pak1.pak pak2.pak
FS_AddGameDirectory Sets fs_gamedir adds the directory to the head of the path then loads and adds pak1 . pak pak2 . pak
void FS_AddGameDirectory (char *dir)
{
	int				i;
	searchpath_t	*search;
	pack_t			*pak;
	char			pakfile[MAX_OSPATH];
	strcpy (fs_gamedir, dir);
	 add the directory to the search path
	search = Z_Malloc (sizeof(searchpath_t));
	strcpy (search->filename, dir);
	search->next = fs_searchpaths;
	fs_searchpaths = search;
	 add any pak files in the format pak0.pak pak1.pak, ...
	for (i=0; i<10; i++)
	{
		Com_sprintf (pakfile, sizeof(pakfile), "%s/pak%i.pak", dir, i);
		pak = FS_LoadPackFile (pakfile);
		if (!pak)
			continue;
		search = Z_Malloc (sizeof(searchpath_t));
		search->pack = pak;
		search->next = fs_searchpaths;
		fs_searchpaths = search;		
	}
}
void FS_AddGameDirectory ( char * dir ) { int i ; searchpath_t * search ; pack_t * pak ; char pakfile [ MAX_OSPATH ] ; strcpy ( fs_gamedir , dir ) ; search = Z_Malloc ( sizeof ( searchpath_t ) ) ; strcpy ( search -> filename , dir ) ; search -> next = fs_searchpaths ; fs_searchpaths = search ; for ( i = 0 ; i < 10 ; i ++ ) { Com_sprintf ( pakfile , sizeof ( pakfile ) , " " , dir , i ) ; pak = FS_LoadPackFile ( pakfile ) ; if ( ! pak ) continue ; search = Z_Malloc ( sizeof ( searchpath_t ) ) ; search -> pack = pak ; search -> next = fs_searchpaths ; fs_searchpaths = search ; } }
FS_AddGameDirectory
Sets fs_gamedir, adds the directory to the head of the path,
then loads and adds pak1.pak pak2.pak ...
FS_AddGameDirectory Sets fs_gamedir adds the directory to the head of the path then loads and adds pak1 . pak pak2 . pak ...
// // add the directory to the search path // // // add any pak files in the format pak0.pak pak1.pak, ... //