Exemplo n.º 1
0
int QERApp_EClassScanDir( const char *path, void* hPlug ){
	char temp[NAME_MAX];
	char filebase[NAME_MAX];
	char filename[NAME_MAX];
	char          *s;
	eclass_t      *e;
	DIR           *dir;
	struct dirent *dirlist;

	QE_ConvertDOSToUnixName( temp, path );
	strcpy( filebase, path );
	s = filebase + strlen( filebase ) - 1;
	while ( *s != '\\' && *s != '/' && s != filebase )
		s--;
	*s = 0;

	dir = opendir( path );
	if ( dir != NULL ) {
		while ( ( dirlist = readdir( dir ) ) != NULL )
		{
			sprintf( filename, "%s/%s", filebase, dirlist->d_name );
			Eclass_ScanFile( filename );

			if ( eclass_found ) {
				e = eclass_e;
				e->modelpath = strdup( dirlist->d_name );
				e->nShowFlags |= ECLASS_PLUGINENTITY;
				e->hPlug = hPlug;
			}
		}
		closedir( dir );
	}
	return 0;
}
Exemplo n.º 2
0
void Eclass_InitForSourceDirectory (char *path)
{
	struct _finddata_t fileinfo;
	int		handle;
	char	filename[1024];
	char	filebase[1024];
	char    temp[1024];
	char	*s;

	QE_ConvertDOSToUnixName( temp, path );

	Sys_Printf ("Eclass_InitForSourceDirectory: %s\n", temp );

	strcpy (filebase, path);
	s = filebase + strlen(filebase)-1;
	while (*s != '\\' && *s != '/' && s!=filebase)
		s--;
	*s = 0;

	eclass = NULL;

	handle = _findfirst (path, &fileinfo);
	if (handle != -1)
	{
		do
		{
			sprintf (filename, "%s\\%s", filebase, fileinfo.name);
			Eclass_ScanFile (filename);
		} while (_findnext( handle, &fileinfo ) != -1);

		_findclose (handle);
	}

	eclass_bad = Eclass_InitFromText ("/*QUAKED UNKNOWN_CLASS (0 0.5 0) ?");
}
Exemplo n.º 3
0
int WINAPI QERApp_ScanFileForEClass(char *filename )
{
	// set single class parsing
	parsing_single = true;
	Eclass_ScanFile(filename);
	if (eclass_found)
	{
		eclass_e->nShowFlags |= ECLASS_PLUGINENTITY;
		return 1;
	}
	return 0;
}
Exemplo n.º 4
0
void Eclass_InitForSourceDirectory (char *path)
{
	struct _finddata_t fileinfo;
	int		handle;
	char	filename[1024];
	char	filebase[1024];
	char    temp[1024];
	char	*s;

	QE_ConvertDOSToUnixName( temp, path );

	Sys_Printf ("Eclass_InitForSourceDirectory: %s\n", temp );

	strcpy (filebase, path);
	s = filebase + strlen(filebase)-1;
	while (*s != '\\' && *s != '/' && s!=filebase)
		s--;
	*s = 0;

	CleanUpEntities();
	eclass = NULL;
	//#ifdef BUILD_LIST
	if (g_bBuildList)
		strDefFile = "";
	//#endif
	handle = _findfirst (path, &fileinfo);
	if (handle != -1)
	{
		do
		{
			sprintf (filename, "%s\\%s", filebase, fileinfo.name);
			Eclass_ScanFile (filename);
		} while (_findnext( handle, &fileinfo ) != -1);

		_findclose (handle);
	}

	//#ifdef BUILD_LIST
	if (g_bBuildList)
	{
		CFile file;
		if (file.Open("c:\\entities.def", CFile::modeCreate | CFile::modeWrite)) 
		{
			file.Write(strDefFile.GetBuffer(0), strDefFile.GetLength());
			file.Close();
		}
	}
	//#endif

	eclass_bad = Eclass_InitFromText ("/*QUAKED UNKNOWN_CLASS (0 0.5 0) ?");
}
Exemplo n.º 5
0
// is Eclass_InitForModelDirectory
int WINAPI QERApp_EClassScanDir( char *path, HMODULE hPlug )
{
	struct _finddata_t	fileinfo;
	int					handle;
	char				temp[ _MAX_PATH ];
	char				filebase[ _MAX_PATH ];
	char				filename[ _MAX_PATH ];
	char				*s;
	eclass_t			*e;
	QE_ConvertDOSToUnixName( temp, path );
	strcpy (filebase, path);
	s = filebase + strlen(filebase)-1;
	while (*s != '\\' && *s != '/' && s!=filebase)
		s--;
	*s = 0;
	handle = _findfirst (path, &fileinfo);
	if (handle != -1)
	   {
		do
		{			
			sprintf (filename, "%s\\%s", filebase, fileinfo.name);
			Eclass_ScanFile (filename);
			
			if (eclass_found)
            {
				e = eclass_e;
				e->modelpath = strdup( fileinfo.name );
				e->nShowFlags |= ECLASS_PLUGINENTITY;
				e->hPlug = hPlug;
            }
		} while (_findnext( handle, &fileinfo ) != -1);
		
		_findclose (handle);
	   }
	return 0;
}