Subversion Repositories spk

Rev

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

Rev 114 Rev 115
Line 2011... Line 2011...
2011
	{
2011
	{
2012
		C_File *f = node->Data();
2012
		C_File *f = node->Data();
2013
		if ( f->GetFileType() != FILETYPE_SHIPMODEL )
2013
		if ( f->GetFileType() != FILETYPE_SHIPMODEL )
2014
			continue;
2014
			continue;
2015
 
2015
 
-
 
2016
		bool deleteData = false;
2016
		unsigned char *data = NULL;
2017
		unsigned char *data = NULL;
2017
		size_t size;
2018
		size_t size;
2018
 
2019
 
2019
		// cant do these yet
2020
		// cant do these yet
2020
		if ( f->CheckFileExt("pbb") || f->CheckFileExt("bob") )
2021
		if ( f->CheckFileExt("pbb") || f->CheckFileExt("bob") )
2021
		{
2022
		{
2022
			if ( !f->BobDecompile() ) {
2023
			data = f->BobDecompile(&size);
-
 
2024
			if ( !data || !size ) {
2023
				// search for the pbd or bod files that match and use them instead
2025
				// search for the pbd or bod files that match and use them instead
2024
				Utils::String file;
2026
				Utils::String file;
2025
 
2027
 
2026
				file = CFileIO(f->GetNameDirectory(NULL)).ChangeFileExtension("pbd").ToString();
2028
				file = CFileIO(f->GetNameDirectory(NULL)).ChangeFileExtension("pbd").ToString();
2027
				file = pVfs->ExtractGameFile(file, CPackages::tempDirectory() + "tmp.tmp");
2029
				file = pVfs->ExtractGameFile(file, CPackages::tempDirectory() + "tmp.tmp");
Line 2041... Line 2043...
2041
 
2043
 
2042
				if ( data && size ) 
2044
				if ( data && size ) 
2043
					this->GetTextureList(&lTextures, data, size);
2045
					this->GetTextureList(&lTextures, data, size);
2044
				continue;
2046
				continue;
2045
			}
2047
			}
2046
		}
-
 
2047
 
-
 
2048
		if ( !f->GetData() )
-
 
2049
		{
-
 
2050
			if ( !f->ReadFromFile() )
-
 
2051
				continue;
-
 
2052
		}
-
 
2053
 
-
 
2054
 
2048
 
-
 
2049
			deleteData = true;
-
 
2050
		}
-
 
2051
 
-
 
2052
		if ( !data || !size ) {
-
 
2053
			if ( !f->GetData() )
-
 
2054
			{
-
 
2055
				if ( !f->ReadFromFile() )
-
 
2056
					continue;
-
 
2057
			}
-
 
2058
 
-
 
2059
 
2055
		if ( f->CheckFileExt("pbb") || f->CheckFileExt("pbd") )
2060
			if ( f->CheckFileExt("pbb") || f->CheckFileExt("pbd") )
2056
			data = f->UnPCKFile(&size);
2061
				data = f->UnPCKFile(&size);
2057
		else
2062
			else
2058
		{
2063
			{
2059
			data = f->GetData();
2064
				data = f->GetData();
2060
			size = f->GetDataSize();
2065
				size = f->GetDataSize();
-
 
2066
			}
2061
		}
2067
		}
-
 
2068
		this->GetTextureList(&lTextures, data, size);
2062
 
2069
 
2063
		this->GetTextureList(&lTextures, data, size);
2070
		if ( deleteData ) delete data;
2064
	}
2071
	}
2065
 
2072
 
2066
	for ( SStringList *node = lTextures.Head(); node; node = node->next )
2073
	for ( SStringList *node = lTextures.Head(); node; node = node->next )
2067
	{
2074
	{
2068
		CFileIO F(node->str);
2075
		CFileIO F(node->str);