Subversion Repositories spk

Rev

Rev 152 | Rev 158 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 152 Rev 155
Line 8938... Line 8938...
8938
	CyString *str = data.SplitToken("\n", &max);
8938
	CyString *str = data.SplitToken("\n", &max);
8939
	if ( str && max )
8939
	if ( str && max )
8940
	{
8940
	{
8941
		for ( int i = 0; i < max; i++ )
8941
		for ( int i = 0; i < max; i++ )
8942
		{
8942
		{
8943
			CyString line = str[i];
8943
			Utils::String line = str[i].ToString();
8944
			if ( line.Empty() )
8944
			if ( line.empty() )
8945
				continue;
8945
				continue;
8946
 
8946
 
8947
			// filter out any spaces, tabs in front
8947
			// filter out any spaces, tabs in front
8948
			line.RemoveChar('\t');
8948
			line.removeChar('\t');
8949
			line.RemoveChar('\r');
8949
			line.removeChar('\r');
8950
			CyString linenospace = line;
8950
			Utils::String linenospace = line;
8951
			linenospace.RemoveFirstSpace();
8951
			linenospace.removeFirstSpace();
8952
			if ( linenospace.Empty() )
8952
			if ( linenospace.empty() )
8953
				continue;
8953
				continue;
8954
 
8954
 
8955
			// check for any comments
8955
			// check for any comments
8956
			if ( linenospace.Left(2) == "//" )
8956
			if ( linenospace.left(2) == "//" )
8957
				continue;
8957
				continue;
8958
			if ( linenospace[0] == '#' )
8958
			if ( linenospace[0] == '#' )
8959
				continue;
8959
				continue;
8960
 
8960
 
8961
			// all commands start with a keyword followed by a colon, if one doesn't exist, it cant be a valid line
8961
			// all commands start with a keyword followed by a colon, if one doesn't exist, it cant be a valid line
8962
			if ( !line.IsIn(':') )
8962
			if ( !line.contains(':'))
8963
				continue;
8963
				continue;
8964
 
8964
 
8965
			CyString first = line.GetToken(":", 1, 1);
8965
			Utils::String first = line.token(":", 1);
8966
			CyString rest = line.GetToken(":", 2).RemoveFirstSpace();
8966
			Utils::String rest = line.tokens(":", 2).removeFirstSpace();
8967
 
8967
 
8968
			CyString checkType = first;
8968
			Utils::String checkType = first;
8969
			bool shared = false;
8969
			bool shared = false;
8970
			if ( checkType.Left(6).Compare("Shared") )
8970
			if ( checkType.left(6).Compare("Shared") )
8971
			{
8971
			{
8972
				checkType = first.Right(-6);
8972
				checkType = first.right(-6);
8973
				shared = true;
8973
				shared = true;
-
 
8974
			}
-
 
8975
			bool packed = false;
-
 
8976
			if (checkType.right(3).compare("PCK"))
-
 
8977
			{
-
 
8978
				checkType = checkType.left(-3);
-
 
8979
				packed = true;
8974
			}
8980
			}
8975
 
8981
 
8976
			// now check type name
8982
			// now check type name
8977
			int filetype = GetFileTypeFromString(checkType);
8983
			int filetype = GetFileTypeFromString(checkType);
8978
			if ( filetype == -1 )
8984
			if (filetype == -1)
-
 
8985
			{
8979
				archive->LoadPackageData(first.ToString(), rest.ToString(), Utils::String::Null(), otherGames, gameAddons, NULL);
8986
				archive->LoadPackageData(first, rest, Utils::String::Null(), otherGames, gameAddons, NULL);
-
 
8987
			}
8980
		}
8988
		}
8981
	}
8989
	}
8982
 
8990
 
8983
	CLEANSPLIT(str, max)
8991
	CLEANSPLIT(str, max)
8984
}
8992
}