Subversion Repositories spk

Rev

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

Rev 125 Rev 127
Line 193... Line 193...
193
 
193
 
194
void COriginalFiles::parse(const Utils::String &data)
194
void COriginalFiles::parse(const Utils::String &data)
195
{
195
{
196
	C_File *uf = new C_File();
196
	C_File *uf = new C_File();
197
 
197
 
198
	uf->SetFileType(data.token(" ", 1).toLong());
198
	uf->setFileType((FileType)data.token(" ", 1).toLong());
199
 
199
 
200
	// Extra files also contain a directory, so make sure we split that up
200
	// Extra files also contain a directory, so make sure we split that up
201
	if ( uf->GetFileType() == FILETYPE_EXTRA )
201
	if (uf->fileType() == FILETYPE_EXTRA )
202
	{
202
	{
203
		uf->SetDir(data.tokens(" ", 2).tokens(":", 2));
203
		uf->SetDir(data.tokens(" ", 2).tokens(":", 2));
204
		uf->SetFilename(data.tokens(" ", 2).token(":", 1));
204
		uf->SetFilename(data.tokens(" ", 2).token(":", 1));
205
	}
205
	}
206
	else
206
	else
Line 265... Line 265...
265
 * Original files should be all the scripts/sounds, etc that are in an unmodified game directory
265
 * Original files should be all the scripts/sounds, etc that are in an unmodified game directory
266
 *
266
 *
267
 * Save list of files and check if any packages overright these files
267
 * Save list of files and check if any packages overright these files
268
 * Any file that gets overrighten from this list will automatically be backed up, and restored once the packages are removed
268
 * Any file that gets overrighten from this list will automatically be backed up, and restored once the packages are removed
269
 */
269
 */
270
void COriginalFiles::_storeFiles(int filetype, const Utils::String &searchPath, const CLinkList<C_File> *pFiles)
270
void COriginalFiles::_storeFiles(FileType filetype, const Utils::String &searchPath, const CLinkList<C_File> *pFiles)
271
{
271
{
272
	Utils::String ext = "pck";
272
	Utils::String ext = "pck";
273
	switch ( filetype )
273
	switch ( filetype )
274
	{
274
	{
275
		case FILETYPE_SOUND:
275
		case FILETYPE_SOUND:
Line 324... Line 324...
324
/**
324
/**
325
 * Adds a file onto the original files list
325
 * Adds a file onto the original files list
326
 *
326
 *
327
 * Checks if it already exists so we dont create multiples
327
 * Checks if it already exists so we dont create multiples
328
 */
328
 */
329
void COriginalFiles::_add(int filetype, const Utils::String &filename, const Utils::String &searchPath, const CLinkList<C_File> *pFiles)
329
void COriginalFiles::_add(FileType filetype, const Utils::String &filename, const Utils::String &searchPath, const CLinkList<C_File> *pFiles)
330
{
330
{
331
	// dont add plugin manager as original files
331
	// dont add plugin manager as original files
332
	if ( filetype == FILETYPE_SCRIPT && filename.isin("!init.pmanager") )
332
	if ( filetype == FILETYPE_SCRIPT && filename.isin("!init.pmanager") )
333
		return;
333
		return;
334
 
334
 
Line 353... Line 353...
353
		if ( file->GetFilename().Compare(CyString(filename)) )
353
		if ( file->GetFilename().Compare(CyString(filename)) )
354
			return;
354
			return;
355
	}
355
	}
356
 
356
 
357
	// add the file entry to the list
357
	// add the file entry to the list
358
	C_File *of = new C_File(CyString(filename));
358
	C_File *of = new C_File(filename);
359
	of->SetFileType(filetype);
359
	of->setFileType(filetype);
360
	if ( filetype == FILETYPE_EXTRA )
360
	if (filetype == FILETYPE_EXTRA)
361
		of->SetDir(searchPath);
361
		of->SetDir(searchPath);
362
	of->SetFilename(_sDir + "/" + of->GetNameDirectory(NULL).ToString());
362
	of->SetFilename(_sDir + "/" + of->GetNameDirectory(NULL).ToString());
363
 
363
 
364
	_lFiles.push_back(of);
364
	_lFiles.push_back(of);
365
}
365
}