Subversion Repositories spk

Rev

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

Rev 248 Rev 264
Line 1822... Line 1822...
1822
		}
1822
		}
1823
	}
1823
	}
1824
 
1824
 
1825
	if ( cuts.empty() ) return;
1825
	if ( cuts.empty() ) return;
1826
 
1826
 
1827
	if ( pVfs->extractGameFile(L"types/CutData.pck", CPackages::tempDirectory() + L"tmp.dat").empty()) return;
1827
	if ( pVfs->extractGameFile(L"types/CutData.pck", CPackages::tempDirectory() + L"/tmp.dat").empty()) return;
1828
	
1828
	
1829
	CFileIO File(CPackages::tempDirectory() + L"tmp.dat");
1829
	CFileIO File(CPackages::tempDirectory() + L"/tmp.dat");
1830
	if ( !File.exists() ) return;
1830
	if ( !File.exists() ) return;
1831
	
1831
	
1832
	std::vector<Utils::WString> lines;
1832
	std::vector<Utils::WString> lines;
1833
	File.readLines(lines);
1833
	File.readLines(lines);
1834
	int count = -1;
1834
	int count = -1;
Line 1867... Line 1867...
1867
void CXspFile::extractDummies(CVirtualFileSystem *pVfs, Utils::WStringList& sceneModels, bool add)
1867
void CXspFile::extractDummies(CVirtualFileSystem *pVfs, Utils::WStringList& sceneModels, bool add)
1868
{
1868
{
1869
	if (sceneModels.empty()) return;
1869
	if (sceneModels.empty()) return;
1870
 
1870
 
1871
	bool extracted = false;
1871
	bool extracted = false;
1872
	if ( !pVfs->extractGameFile(L"types/dummies.pck", CPackages::tempDirectory() + L"tmp.dat").empty()) 
1872
	if ( !pVfs->extractGameFile(L"types/dummies.pck", CPackages::tempDirectory() + L"/tmp.dat").empty()) 
1873
	{
1873
	{
1874
		CFileIO File(CPackages::tempDirectory() + L"tmp.dat");
1874
		CFileIO File(CPackages::tempDirectory() + L"/tmp.dat");
1875
		if ( File.exists() )
1875
		if ( File.exists() )
1876
		{
1876
		{
1877
			Utils::WString section;
1877
			Utils::WString section;
1878
			int secCount = 0;
1878
			int secCount = 0;
1879
			std::vector<Utils::WString> lines;
1879
			std::vector<Utils::WString> lines;
Line 1928... Line 1928...
1928
}
1928
}
1929
 
1929
 
1930
void CXspFile::extractComponants(CVirtualFileSystem *pVfs, const Utils::WStringList& sceneModels)
1930
void CXspFile::extractComponants(CVirtualFileSystem *pVfs, const Utils::WStringList& sceneModels)
1931
{
1931
{
1932
	if (sceneModels.empty()) return;
1932
	if (sceneModels.empty()) return;
1933
	if ( !pVfs->extractGameFile(L"types/components.pck", CPackages::tempDirectory() + L"tmp.dat").empty())
1933
	if ( !pVfs->extractGameFile(L"types/components.pck", CPackages::tempDirectory() + L"/tmp.dat").empty())
1934
	{
1934
	{
1935
		CFileIO File(CPackages::tempDirectory() + L"tmp.dat");
1935
		CFileIO File(CPackages::tempDirectory() + L"/tmp.dat");
1936
		if ( File.exists() )
1936
		if ( File.exists() )
1937
		{
1937
		{
1938
			Utils::WString file;
1938
			Utils::WString file;
1939
			Utils::WString section;
1939
			Utils::WString section;
1940
			int secCount = 0;
1940
			int secCount = 0;
Line 2153... Line 2153...
2153
	if ( CFileIO(file).isFileExtension(L"pck") )
2153
	if ( CFileIO(file).isFileExtension(L"pck") )
2154
	{
2154
	{
2155
		C_File F;
2155
		C_File F;
2156
		F.setFilename(file);
2156
		F.setFilename(file);
2157
		F.UnPCKFile();
2157
		F.UnPCKFile();
2158
		if (F.writeToFile(CPackages::tempDirectory() + L"tmp.dat"))
2158
		if (F.writeToFile(CPackages::tempDirectory() + L"/tmp.dat"))
2159
		{
2159
		{
2160
			remove = true;
2160
			remove = true;
2161
			file = CPackages::tempDirectory() + L"tmp.dat";
2161
			file = CPackages::tempDirectory() + L"/tmp.dat";
2162
		}
2162
		}
2163
	}
2163
	}
2164
 
2164
 
2165
	/*
2165
	/*
2166
	std::wfstream fileStream(file.c_str());
2166
	std::wfstream fileStream(file.c_str());
Line 2287... Line 2287...
2287
	return false;
2287
	return false;
2288
}
2288
}
2289
 
2289
 
2290
bool CXspFile::extractCockpits(CVirtualFileSystem *pVfs)
2290
bool CXspFile::extractCockpits(CVirtualFileSystem *pVfs)
2291
{
2291
{
2292
	if ( !pVfs->extractGameFile(L"types/TCockpits.pck", CPackages::tempDirectory() + L"tmp.dat").empty() ) {
2292
	if ( !pVfs->extractGameFile(L"types/TCockpits.pck", CPackages::tempDirectory() + L"/tmp.dat").empty() ) {
2293
		bool ret = this->ImportCockpits((CPackages::tempDirectory() + L"tmp.dat"));
2293
		bool ret = this->ImportCockpits((CPackages::tempDirectory() + L"/tmp.dat"));
2294
		CFileIO::Remove(CPackages::tempDirectory() + L"tmp.dat");
2294
		CFileIO::Remove(CPackages::tempDirectory() + L"/tmp.dat");
2295
 
2295
 
2296
		return ret;
2296
		return ret;
2297
	}
2297
	}
2298
 
2298
 
2299
	return false;
2299
	return false;
Line 2301... Line 2301...
2301
 
2301
 
2302
bool CXspFile::extractBodies(CVirtualFileSystem *pVfs, const Utils::WStringList &sceneModels)
2302
bool CXspFile::extractBodies(CVirtualFileSystem *pVfs, const Utils::WStringList &sceneModels)
2303
{
2303
{
2304
	if (sceneModels.empty()) return false;
2304
	if (sceneModels.empty()) return false;
2305
 
2305
 
2306
	if ( !pVfs->extractGameFile(L"types/Bodies.pck", CPackages::tempDirectory() + L"tmp.dat").empty() ) {
2306
	if ( !pVfs->extractGameFile(L"types/Bodies.pck", CPackages::tempDirectory() + L"/tmp.dat").empty() ) {
2307
		bool ret = this->importBodies(sceneModels, (CPackages::tempDirectory() + L"tmp.dat"));
2307
		bool ret = this->importBodies(sceneModels, (CPackages::tempDirectory() + L"/tmp.dat"));
2308
		CFileIO::Remove(CPackages::tempDirectory() + L"tmp.dat");
2308
		CFileIO::Remove(CPackages::tempDirectory() + L"/tmp.dat");
2309
 
2309
 
2310
		return ret;
2310
		return ret;
2311
	}
2311
	}
2312
 
2312
 
2313
	return false;
2313
	return false;