Subversion Repositories spk

Rev

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

Rev 78 Rev 79
Line 1505... Line 1505...
1505
		}
1505
		}
1506
	}
1506
	}
1507
 
1507
 
1508
	if ( cuts.empty() ) return;
1508
	if ( cuts.empty() ) return;
1509
 
1509
 
1510
	if ( pVfs->ExtractGameFile("types/CutData.pck", "tmp").empty() ) return;
1510
	if ( pVfs->ExtractGameFile("types/CutData.pck", CPackages::tempDirectory() + "tmp.dat").empty() ) return;
1511
	
1511
	
1512
	CFileIO File("tmp");
1512
	CFileIO File(CPackages::tempDirectory() + "tmp.dat");
1513
	if ( !File.exists() ) return;
1513
	if ( !File.exists() ) return;
1514
	
1514
	
1515
	CyStringList *lines = File.ReadLinesStr();
1515
	CyStringList *lines = File.ReadLinesStr();
1516
	int count = -1;
1516
	int count = -1;
1517
	for ( SStringList *node = lines->Head(); node; node = node->next ) {
1517
	for ( SStringList *node = lines->Head(); node; node = node->next ) {
Line 1547... Line 1547...
1547
void CXspFile::extractDummies(CVirtualFileSystem *pVfs, CyStringList *sceneModels, bool add)
1547
void CXspFile::extractDummies(CVirtualFileSystem *pVfs, CyStringList *sceneModels, bool add)
1548
{
1548
{
1549
	if ( !sceneModels ) return;
1549
	if ( !sceneModels ) return;
1550
 
1550
 
1551
	bool extracted = false;
1551
	bool extracted = false;
1552
	if ( !pVfs->ExtractGameFile("types/dummies.pck", "tmp").empty() ) {
1552
	if ( !pVfs->ExtractGameFile("types/dummies.pck", CPackages::tempDirectory() + "tmp.dat").empty() ) {
1553
		CFileIO File("tmp");
1553
		CFileIO File(CPackages::tempDirectory() + "tmp.dat");
1554
		if ( File.exists() )
1554
		if ( File.exists() )
1555
		{
1555
		{
1556
			Utils::String section;
1556
			Utils::String section;
1557
			int secCount = 0;
1557
			int secCount = 0;
1558
			CyStringList *lines = File.ReadLinesStr();
1558
			CyStringList *lines = File.ReadLinesStr();
Line 1606... Line 1606...
1606
}
1606
}
1607
 
1607
 
1608
void CXspFile::extractComponants(CVirtualFileSystem *pVfs, CyStringList *sceneModels)
1608
void CXspFile::extractComponants(CVirtualFileSystem *pVfs, CyStringList *sceneModels)
1609
{
1609
{
1610
	if ( !sceneModels ) return;
1610
	if ( !sceneModels ) return;
1611
	if ( !pVfs->ExtractGameFile("types/components.pck", "tmp").empty() )
1611
	if ( !pVfs->ExtractGameFile("types/components.pck", CPackages::tempDirectory() + "tmp.dat").empty() )
1612
	{
1612
	{
1613
		CFileIO File("tmp");
1613
		CFileIO File(CPackages::tempDirectory() + "tmp.dat");
1614
		if ( File.exists() )
1614
		if ( File.exists() )
1615
		{
1615
		{
1616
			Utils::String file;
1616
			Utils::String file;
1617
			Utils::String section;
1617
			Utils::String section;
1618
			int secCount = 0;
1618
			int secCount = 0;
Line 1763... Line 1763...
1763
	if ( CFileIO(file).CheckFileExtension("pck") )
1763
	if ( CFileIO(file).CheckFileExtension("pck") )
1764
	{
1764
	{
1765
		C_File F;
1765
		C_File F;
1766
		F.SetFilename(CyString(file));
1766
		F.SetFilename(CyString(file));
1767
		F.UnPCKFile();
1767
		F.UnPCKFile();
1768
		if ( F.WriteToFile("tmp") )
1768
		if ( F.WriteToFile(CPackages::tempDirectory() + "tmp.dat") )
1769
		{
1769
		{
1770
			remove = true;
1770
			remove = true;
1771
			file = "tmp";
1771
			file = CPackages::tempDirectory() + "tmp.dat";
1772
		}
1772
		}
1773
	}
1773
	}
1774
 
1774
 
1775
	/*
1775
	/*
1776
	std::wfstream fileStream(file.c_str());
1776
	std::wfstream fileStream(file.c_str());
Line 1894... Line 1894...
1894
	return false;
1894
	return false;
1895
}
1895
}
1896
 
1896
 
1897
bool CXspFile::extractCockpits(CVirtualFileSystem *pVfs)
1897
bool CXspFile::extractCockpits(CVirtualFileSystem *pVfs)
1898
{
1898
{
1899
	if ( !pVfs->ExtractGameFile("types/TCockpits.pck", "tmp").empty() ) {
1899
	if ( !pVfs->ExtractGameFile("types/TCockpits.pck", CPackages::tempDirectory() + "tmp.dat").empty() ) {
1900
		bool ret = this->ImportCockpits("tmp");
1900
		bool ret = this->ImportCockpits(CPackages::tempDirectory() + "tmp.dat");
1901
		CFileIO::Remove("tmp");
1901
		CFileIO::Remove(CPackages::tempDirectory() + "tmp.dat");
1902
 
1902
 
1903
		return ret;
1903
		return ret;
1904
	}
1904
	}
1905
 
1905
 
1906
	return false;
1906
	return false;
Line 1908... Line 1908...
1908
 
1908
 
1909
bool CXspFile::extractBodies(CVirtualFileSystem *pVfs, CyStringList *sceneModels)
1909
bool CXspFile::extractBodies(CVirtualFileSystem *pVfs, CyStringList *sceneModels)
1910
{
1910
{
1911
	if ( !sceneModels ) return false;
1911
	if ( !sceneModels ) return false;
1912
 
1912
 
1913
	if ( !pVfs->ExtractGameFile("types/Bodies.pck", "tmp").empty() ) {
1913
	if ( !pVfs->ExtractGameFile("types/Bodies.pck", CPackages::tempDirectory() + "tmp.dat").empty() ) {
1914
		bool ret = this->ImportBodies(sceneModels, "tmp");
1914
		bool ret = this->ImportBodies(sceneModels, CPackages::tempDirectory() + "tmp.dat");
1915
		CFileIO::Remove("tmp");
1915
		CFileIO::Remove(CPackages::tempDirectory() + "tmp.dat");
1916
 
1916
 
1917
		return ret;
1917
		return ret;
1918
	}
1918
	}
1919
 
1919
 
1920
	return false;
1920
	return false;
Line 2058... Line 2058...
2058
		SInCatFile *f = node->Data();
2058
		SInCatFile *f = node->Data();
2059
		if ( !f->sFile.Left(2).Compare("t\\") && !f->sFile.Left(2).Compare("t/") )
2059
		if ( !f->sFile.Left(2).Compare("t\\") && !f->sFile.Left(2).Compare("t/") )
2060
			continue;
2060
			continue;
2061
 
2061
 
2062
		// extract the text file and read in the data
2062
		// extract the text file and read in the data
2063
		bool extracted = catFile->ExtractFile(f->sFile, "tmp");
2063
		bool extracted = catFile->ExtractFile(f->sFile, CPackages::GetTempDirectory() + "tmp.dat");
2064
		if ( !extracted && secondCatFile ) extracted = secondCatFile->ExtractFile(f->sFile, "tmp");
2064
		if ( !extracted && secondCatFile ) extracted = secondCatFile->ExtractFile(f->sFile, CPackages::GetTempDirectory() + "tmp.dat");
2065
		if ( extracted ) {
2065
		if ( extracted ) {
2066
			this->AddTextFromFile("tmp", textId);
2066
			this->AddTextFromFile(CPackages::tempDirectory() + "tmp.dat", textId);
2067
			CFileIO::Remove("tmp");
2067
			CFileIO::Remove(CPackages::tempDirectory() + "tmp.dat");
2068
		}
2068
		}
2069
	}
2069
	}
2070
}
2070
}
2071
 
2071
 
2072
bool CXspFile::processSceneFileSection(int section, CVirtualFileSystem *pVfs, CyStringList *lModels, CProgressInfo *progress)
2072
bool CXspFile::processSceneFileSection(int section, CVirtualFileSystem *pVfs, CyStringList *lModels, CProgressInfo *progress)