Subversion Repositories spk

Rev

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

Rev 212 Rev 213
Line 400... Line 400...
400
		else if ( first.Compare("ScreenShot") )
400
		else if ( first.Compare("ScreenShot") )
401
		{
401
		{
402
			int size = rest.token(" ", 1);
402
			int size = rest.token(" ", 1);
403
			Utils::String ext = rest.token(" ", 2);
403
			Utils::String ext = rest.token(" ", 2);
404
 
404
 
405
			C_File *newFile = this->addFile(m_sID + "_" + (long)(this->countFiles(FILETYPE_SCREEN) + 1) + "." + ext, "", FILETYPE_SCREEN);
405
			C_File *newFile = this->addFile(m_sID + "_" + (long)(this->countFiles(FILETYPE_SCREEN) + 1) + "." + ext, L"", FILETYPE_SCREEN);
406
			newFile->ReadFromData((char *)(compr + pos), size); 
406
			newFile->ReadFromData((char *)(compr + pos), size); 
407
 
407
 
408
			start += (size + 1);
408
			start += (size + 1);
409
		}
409
		}
410
		else if ( first.Compare("SceneFile") )
410
		else if ( first.Compare("SceneFile") )
Line 463... Line 463...
463
			newFile->ReadFromData((char *)(compr + pos), rest.token(" ", 2));
463
			newFile->ReadFromData((char *)(compr + pos), rest.token(" ", 2));
464
			start += (newFile->GetDataSize() + 1);
464
			start += (newFile->GetDataSize() + 1);
465
 
465
 
466
			if ( special )
466
			if ( special )
467
			{
467
			{
468
				if (newFile->checkFileExt("pck"))
468
				if (newFile->checkFileExt(L"pck"))
469
					newFile->UnPCKFile();
469
					newFile->UnPCKFile();
470
 
470
 
471
				// read data into lines
471
				// read data into lines
472
				Utils::String data((const char *)newFile->GetData());
472
				Utils::String data((const char *)newFile->GetData());
473
				data.removeChar('\r');
473
				data.removeChar('\r');
Line 849... Line 849...
849
		list->pushBack(L"# Missile Masks, the missiles for each game: <GAME> <MASK>");
849
		list->pushBack(L"# Missile Masks, the missiles for each game: <GAME> <MASK>");
850
		for(CListNode<SWeaponMask> *node = m_lMissileMasks.Front(); node; node = node->next()) {
850
		for(CListNode<SWeaponMask> *node = m_lMissileMasks.Front(); node; node = node->next()) {
851
			list->pushBack(Utils::WString(L"WeaponMask: ") + (long)node->Data()->iGame + L" " + (long)node->Data()->iMask);
851
			list->pushBack(Utils::WString(L"WeaponMask: ") + (long)node->Data()->iGame + L" " + (long)node->Data()->iMask);
852
		}
852
		}
853
 
853
 
854
		list->pushBack("");
854
		list->pushBack(L"");
855
	}
855
	}
856
 
856
 
857
	if ( this->m_lComponent.size() ) {
857
	if ( this->m_lComponent.size() ) {
858
		list->pushBack(L"# Ship Components, each component used in the ships scene: <SECTION> <MODELENTRY> <VALUES>");
858
		list->pushBack(L"# Ship Components, each component used in the ships scene: <SECTION> <MODELENTRY> <VALUES>");
859
		for(CListNode<SComponent> *node = m_lComponent.Front(); node; node = node->next()) {
859
		for(CListNode<SComponent> *node = m_lComponent.Front(); node; node = node->next()) {
Line 1466... Line 1466...
1466
		}
1466
		}
1467
		else
1467
		else
1468
		{
1468
		{
1469
			// remove comments, endspaces and last ;
1469
			// remove comments, endspaces and last ;
1470
			Utils::WString sStriped = line;
1470
			Utils::WString sStriped = line;
1471
			if (sStriped.isin("//"))
1471
			if (sStriped.contains(L"//"))
1472
			{
1472
			{
1473
				if (entries <= newEntries)
1473
				if (entries <= newEntries)
1474
					lastComment = L"//" + sStriped.tokens(L"//", 2);
1474
					lastComment = L"//" + sStriped.tokens(L"//", 2);
1475
				sStriped = sStriped.token(L"//", 1);
1475
				sStriped = sStriped.token(L"//", 1);
1476
			}
1476
			}
Line 2134... Line 2134...
2134
							Utils::String type = strs[i].token(";", 1);
2134
							Utils::String type = strs[i].token(";", 1);
2135
							Utils::String valtype = strs[i].token(";", 2);			
2135
							Utils::String valtype = strs[i].token(";", 2);			
2136
							if ( valtype.Compare("SPTYPE_STRING") ) {
2136
							if ( valtype.Compare("SPTYPE_STRING") ) {
2137
								Utils::String file = strs[i].token(";", 3);
2137
								Utils::String file = strs[i].token(";", 3);
2138
								if(!list.contains(file))
2138
								if(!list.contains(file))
2139
									list.pushBack(file, "");
2139
									list.pushBack(file, L"");
2140
							}
2140
							}
2141
						}
2141
						}
2142
					}
2142
					}
2143
 
2143
 
2144
					CLEANSPLIT(strs, max)
2144
					CLEANSPLIT(strs, max)
Line 2206... Line 2206...
2206
				if ( !f->ReadFromFile() )
2206
				if ( !f->ReadFromFile() )
2207
					continue;
2207
					continue;
2208
			}
2208
			}
2209
 
2209
 
2210
 
2210
 
2211
			if ( f->checkFileExt("pbb") || f->checkFileExt("pbd") )
2211
			if ( f->checkFileExt(L"pbb") || f->checkFileExt(L"pbd") )
2212
				data = f->UnPCKFile(&size);
2212
				data = f->UnPCKFile(&size);
2213
			else
2213
			else
2214
			{
2214
			{
2215
				data = f->GetData();
2215
				data = f->GetData();
2216
				size = f->GetDataSize();
2216
				size = f->GetDataSize();
Line 2571... Line 2571...
2571
void CXspFile::ExtractTexts(CCatFile *catFile, CCatFile *secondCatFile, int textId)
2571
void CXspFile::ExtractTexts(CCatFile *catFile, CCatFile *secondCatFile, int textId)
2572
{
2572
{
2573
	for (auto itr = catFile->GetFiles()->begin(); itr != catFile->GetFiles()->end(); itr++ )
2573
	for (auto itr = catFile->GetFiles()->begin(); itr != catFile->GetFiles()->end(); itr++ )
2574
	{
2574
	{
2575
		SInCatFile *f = *itr;
2575
		SInCatFile *f = *itr;
2576
		if ( !f->sFile.left(2).Compare("t\\") && !f->sFile.left(2).Compare("t/") )
2576
		if ( !f->sFile.left(2).Compare(L"t\\") && !f->sFile.left(2).Compare(L"t/") )
2577
			continue;
2577
			continue;
2578
 
2578
 
2579
		// extract the text file and read in the data
2579
		// extract the text file and read in the data
2580
		bool extracted = catFile->extractFile(f->sFile, CPackages::tempDirectory() + "/tmp.dat");
2580
		bool extracted = catFile->extractFile(f->sFile, CPackages::tempDirectory() + L"/tmp.dat");
2581
		if ( !extracted && secondCatFile ) extracted = secondCatFile->extractFile(f->sFile, CPackages::tempDirectory() + "/tmp.dat");
2581
		if ( !extracted && secondCatFile ) extracted = secondCatFile->extractFile(f->sFile, CPackages::tempDirectory() + L"/tmp.dat");
2582
		if ( extracted ) {
2582
		if ( extracted ) {
2583
			this->addTextFromFile(CPackages::tempDirectory() + L"/tmp.dat", textId);
2583
			this->addTextFromFile(CPackages::tempDirectory() + L"/tmp.dat", textId);
2584
			CFileIO::Remove(CPackages::tempDirectory() + L"/tmp.dat");
2584
			CFileIO::Remove(CPackages::tempDirectory() + L"/tmp.dat");
2585
		}
2585
		}
2586
	}
2586
	}
Line 2695... Line 2695...
2695
			{
2695
			{
2696
				if ( f->PCKFile() )
2696
				if ( f->PCKFile() )
2697
					f->ChangeFileExt("pbd");
2697
					f->ChangeFileExt("pbd");
2698
			}	
2698
			}	
2699
 
2699
 
2700
			else */if ( f->checkFileExt("bob") )
2700
			else */if ( f->checkFileExt(L"bob") )
2701
			{
2701
			{
2702
				if ( f->PCKFile() )
2702
				if ( f->PCKFile() )
2703
					f->changeFileExt("pbb");
2703
					f->changeFileExt(L"pbb");
2704
			}
2704
			}
2705
		}
2705
		}
2706
	}
2706
	}
2707
}
2707
}
2708
 
2708