Subversion Repositories spk

Rev

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

Rev 126 Rev 127
Line 33... Line 33...
33
#include "x2bc/x2bc_common/bob_dom.h"
33
#include "x2bc/x2bc_common/bob_dom.h"
34
#include "x2bc/x2bc_common/bod_parser.h"
34
#include "x2bc/x2bc_common/bod_parser.h"
35
#include "x2bc/x2bc_common/realfile_stream.h"
35
#include "x2bc/x2bc_common/realfile_stream.h"
36
*/
36
*/
37
#include "../Windows/libx2bc.h"
37
#include "../Windows/libx2bc.h"
-
 
38
 
-
 
39
//////////////////////////////////////////////////////////////////////
-
 
40
// STATIC FUNCTIONS
-
 
41
//////////////////////////////////////////////////////////////////////
-
 
42
 
-
 
43
Utils::String C_File::GetDirectory(FileType eType, const Utils::String &filename, CBaseFile *file)
-
 
44
{
-
 
45
	switch (eType)
-
 
46
	{
-
 
47
	case FILETYPE_SCRIPT:
-
 
48
		return "Scripts";
-
 
49
	case FILETYPE_TEXT:
-
 
50
		return "T";
-
 
51
	case FILETYPE_README:
-
 
52
	{
-
 
53
		if (file)
-
 
54
			return Utils::String("PluginManager/Readme/") + file->GetNameValidFile().ToString();
-
 
55
		return "PluginManager/Readme";
-
 
56
	}
-
 
57
	case FILETYPE_MAP:
-
 
58
		return "Maps";
-
 
59
	case FILETYPE_MOD:
-
 
60
		return "Mods";
-
 
61
	case FILETYPE_UNINSTALL:
-
 
62
		return "PluginManager/Uninstall";
-
 
63
	case FILETYPE_SOUND:
-
 
64
		if (!filename.empty() && !CFileIO(filename).CheckFileExtension("wav"))
-
 
65
			return "Soundtrack";
-
 
66
		return "s";
-
 
67
	case FILETYPE_SOUNDTRACK:
-
 
68
		return "Soundtrack";
-
 
69
	case FILETYPE_EXTRA:
-
 
70
		return "PluginManager/Extras";
-
 
71
	case FILETYPE_SCREEN:
-
 
72
		return "loadscr";
-
 
73
	case FILETYPE_ADVERT:
-
 
74
		return "PluginManager/Graphics";
-
 
75
	case FILETYPE_MISSION:
-
 
76
		return "Director";
-
 
77
	}
-
 
78
	return Utils::String::Null();
-
 
79
}
-
 
80
 
-
 
81
bool C_File::DoesTypeHaveExtraDir(int i)
-
 
82
{
-
 
83
	switch (i)
-
 
84
	{
-
 
85
	case FILETYPE_EXTRA:
-
 
86
	case FILETYPE_SHIPSCENE:
-
 
87
	case FILETYPE_COCKPITSCENE:
-
 
88
	case FILETYPE_SHIPMODEL:
-
 
89
	case FILETYPE_SHIPOTHER:
-
 
90
		return true;
-
 
91
	}
-
 
92
	return false;
-
 
93
}
38
 
94
 
39
//////////////////////////////////////////////////////////////////////
95
//////////////////////////////////////////////////////////////////////
40
// Construction/Destruction
96
// Construction/Destruction
41
//////////////////////////////////////////////////////////////////////
97
//////////////////////////////////////////////////////////////////////
42
 
98
 
43
void CProgressInfoDone::DoingFile ( C_File *file )
99
void CProgressInfoDone::DoingFile ( C_File *file )
44
{
100
{
45
	m_iDone = 0;
101
	m_iDone = 0;
46
 
102
 
47
	if ( !m_bDontDoMax )
103
	if ( !m_bDontDoMax )
48
	{
104
	{
49
		if ( file->GetData() && file->GetDataSize() )
105
		if ( file->GetData() && file->GetDataSize() )
50
			m_lMaxSize = file->GetDataSize();
106
			m_lMaxSize = file->GetDataSize();
51
		else
107
		else
52
			m_lMaxSize = file->GetSize();
108
			m_lMaxSize = file->GetSize();
53
	}
109
	}
54
 
110
 
55
	m_pOnFile = file;
111
	m_pOnFile = file;
56
}
112
}
57
 
113
 
58
void CProgressInfoDone::DoingPackage ( SMultiSpkFile *file )
114
void CProgressInfoDone::DoingPackage ( SMultiSpkFile *file )
59
{
115
{
60
	m_iDone = 0;
116
	m_iDone = 0;
61
 
117
 
62
	if ( !m_bDontDoMax )
118
	if ( !m_bDontDoMax )
63
		m_lMaxSize = file->lSize;
119
		m_lMaxSize = file->lSize;
64
 
120
 
65
	m_pOnPackage = file;
121
	m_pOnPackage = file;
66
}
122
}
67
 
123
 
68
int C_File::m_iTempNum = 0;
124
int C_File::m_iTempNum = 0;
69
 
125
 
70
C_File::C_File()
126
C_File::C_File()
71
{
127
{
72
	m_bDontDeleteData = false;
128
	m_bDontDeleteData = false;
73
	m_bUsedMalloc = false;
129
	m_bUsedMalloc = false;
74
	m_sData = NULL;
130
	m_sData = NULL;
75
	Reset();
131
	Reset();
76
}
-
 
77
 
-
 
78
C_File::C_File ( CyString filename )
-
 
79
{
-
 
80
	m_bDontDeleteData = false;
-
 
81
	m_bUsedMalloc = false;
-
 
82
	m_sData = NULL;
-
 
83
	Reset ();
-
 
84
	SetFilename ( filename );
-
 
85
}
132
}
86
 
133
 
87
C_File::C_File ( const char *filename )
134
C_File::C_File(const Utils::String &filename)
88
{
135
{
89
	m_bDontDeleteData = false;
136
	m_bDontDeleteData = false;
90
	m_bUsedMalloc = false;
137
	m_bUsedMalloc = false;
91
	m_sData = NULL;
138
	m_sData = NULL;
92
	Reset ();
139
	Reset ();
93
	SetFilename ( CyString(filename) );
140
	SetFilename(filename);
94
}
141
}
95
 
142
 
96
C_File::~C_File()
143
C_File::~C_File()
97
{
144
{
98
	DeleteData ();
145
	DeleteData ();
Line 119... Line 166...
119
		CyString dir = m_sDir.FindReplace ( "\\", "/" );
166
		CyString dir = m_sDir.FindReplace ( "\\", "/" );
120
		if ( file )
167
		if ( file )
121
		{
168
		{
122
			dir = dir.FindReplace ( "$scriptname", file->GetNameValidFile() );
169
			dir = dir.FindReplace ( "$scriptname", file->GetNameValidFile() );
123
			dir = dir.FindReplace ( "$scriptauthor", CyString(file->author()) );
170
			dir = dir.FindReplace ( "$scriptauthor", CyString(file->author()) );
124
		}
171
		}
125
		return dir;
172
		return dir;
126
	}
173
	}
127
 
174
 
128
	switch ( m_iFileType )
175
	switch ( m_iFileType )
129
	{
176
	{
130
		case FILETYPE_SCRIPT:
177
		case FILETYPE_SCRIPT:
131
			return "Scripts";
178
			return "Scripts";
132
		case FILETYPE_TEXT:
179
		case FILETYPE_TEXT:
Line 179... Line 226...
179
			dir = dir.findReplace("$scriptname", file->GetNameValidFile().ToString());
226
			dir = dir.findReplace("$scriptname", file->GetNameValidFile().ToString());
180
			dir = dir.findReplace("$scriptauthor", file->author());
227
			dir = dir.findReplace("$scriptauthor", file->author());
181
		}
228
		}
182
		return dir;
229
		return dir;
183
	}
230
	}
184
 
231
 
185
	switch (m_iFileType)
-
 
186
	{
-
 
187
	case FILETYPE_SCRIPT:
-
 
188
		return "Scripts";
-
 
189
	case FILETYPE_TEXT:
-
 
190
		return "T";
-
 
191
	case FILETYPE_README:
-
 
192
	{
-
 
193
		if (file)
-
 
194
			return Utils::String("PluginManager/Readme/") + file->GetNameValidFile().ToString();
-
 
195
		return "PluginManager/Readme";
-
 
196
	}
-
 
197
	case FILETYPE_MAP:
-
 
198
		return "Maps";
-
 
199
	case FILETYPE_MOD:
-
 
200
		//			if ( (file) && (file->IsPatch()) )
-
 
201
		//				return "Mods/Patch";
-
 
202
		return "Mods";
-
 
203
	case FILETYPE_UNINSTALL:
-
 
204
		return "PluginManager/Uninstall";
-
 
205
	case FILETYPE_SOUND:
-
 
206
		if (CFileIO(m_sName).CheckFileExtension("wav"))
-
 
207
			return "s";
-
 
208
		return "Soundtrack";
-
 
209
	case FILETYPE_EXTRA:
-
 
210
		return "PluginManager/Extras";
-
 
211
	case FILETYPE_SCREEN:
-
 
212
		return "loadscr";
-
 
213
	case FILETYPE_ADVERT:
-
 
214
		return "PluginManager/Graphics";
-
 
215
	case FILETYPE_MISSION:
-
 
216
		return "Director";
-
 
217
	}
-
 
218
	return Utils::String::Null();
232
	return GetDirectory(m_iFileType, m_sName.ToString(), file);
219
}
233
}
220
 
-
 
221
 
234
 
222
CyString C_File::GetNameDirectory ( CBaseFile *file )
235
CyString C_File::GetNameDirectory ( CBaseFile *file )
223
{
236
{
224
	CyString dir = GetDirectory( file );
237
	CyString dir = GetDirectory( file );
225
	if ( !dir.Empty() )
238
	if ( !dir.Empty() )
Line 234... Line 247...
234
*/
247
*/
235
void C_File::Reset ()
248
void C_File::Reset ()
236
{
249
{
237
	m_iLastError = SPKERR_NONE;
250
	m_iLastError = SPKERR_NONE;
238
	m_bLoaded = false;
251
	m_bLoaded = false;
239
	m_iFileType = -1;
252
	m_iFileType = FILETYPE_UNKNOWN;
240
	m_lSize = 0;
253
	m_lSize = 0;
241
	m_iVersion = 0;
254
	m_iVersion = 0;
242
	m_bSigned = false;
255
	m_bSigned = false;
243
	m_iUsed = 0;
256
	m_iUsed = 0;
244
	m_tTime = 0;
257
	m_tTime = 0;
Line 249... Line 262...
249
	m_bShared = false;
262
	m_bShared = false;
250
	m_bCompressedToFile = false;
263
	m_bCompressedToFile = false;
251
	m_bDisabled = false;
264
	m_bDisabled = false;
252
	m_bUpdatedSignature = false;
265
	m_bUpdatedSignature = false;
253
	m_iPos = -1;
266
	m_iPos = -1;
254
	m_iGame = 0;
267
	_iGame = 0;
255
}
268
}
256
 
269
 
257
bool C_File::UpdateSigned()
270
bool C_File::UpdateSigned()
258
{
271
{
259
	switch ( m_iFileType )
272
	switch ( m_iFileType )
Line 267... Line 280...
267
		case FILETYPE_BACKUP:
280
		case FILETYPE_BACKUP:
268
			m_bSigned = true;
281
			m_bSigned = true;
269
			break;
282
			break;
270
 
283
 
271
		// mods, maps are always not signed
284
		// mods, maps are always not signed
272
		case FILETYPE_MOD:
285
		case FILETYPE_MOD:
273
		case FILETYPE_MAP:
286
		case FILETYPE_MAP:
274
		case FILETYPE_SHIPOTHER:
287
		case FILETYPE_SHIPOTHER:
275
		case FILETYPE_SHIPMODEL:
288
		case FILETYPE_SHIPMODEL:
276
		case FILETYPE_SHIPSCENE:
289
		case FILETYPE_SHIPSCENE:
277
		case FILETYPE_COCKPITSCENE:
290
		case FILETYPE_COCKPITSCENE:
278
			m_bSigned = false;
291
			m_bSigned = false;
Line 346... Line 359...
346
 
359
 
347
	if ( textid <= 3 )
360
	if ( textid <= 3 )
348
		return true;
361
		return true;
349
 
362
 
350
	// check for original name
363
	// check for original name
351
	if ( !m_sOriginalName.Empty() )
364
	if ( !_sOriginalName.empty() )
352
	{
365
	{
353
		textid = GetTextFileID(m_sOriginalName);
366
		textid = GetTextFileID(_sOriginalName);
354
		if ( textid >= 0 && textid <= 3 )
367
		if ( textid >= 0 && textid <= 3 )
355
			return true;
368
			return true;
356
	}
369
	}
357
 
370
 
358
	return false;
371
	return false;
Line 532... Line 545...
532
	if ( !m_sName.Empty() )
545
	if ( !m_sName.Empty() )
533
		fullfile += m_sName.ToString();
546
		fullfile += m_sName.ToString();
534
 
547
 
535
	return fullfile;
548
	return fullfile;
536
}
549
}
-
 
550
 
-
 
551
bool C_File::isExternalFile() const
-
 
552
{
-
 
553
	if (!m_sData && !m_lDataSize)
-
 
554
	{
-
 
555
		Utils::String file = this->filePointer();
-
 
556
		if (!file.empty() && CFileIO::Exists(file))
-
 
557
			return true;
-
 
558
	}
-
 
559
	return false;
-
 
560
}
-
 
561
 
537
/*
562
/*
538
	Func:	GetFilePointer
563
	Func:	GetFilePointer
539
	Desc:	Returns the file pointer name
564
	Desc:	Returns the file pointer name
540
			Joins dir and name together
565
			Joins dir and name together
541
			Works for relative paths as well
566
			Works for relative paths as well
Line 554... Line 579...
554
	if ( !m_sData )
579
	if ( !m_sData )
555
	{
580
	{
556
		if ( !ReadFromFile() )
581
		if ( !ReadFromFile() )
557
			return;
582
			return;
558
		deleteData = true;
583
		deleteData = true;
559
	}
584
	}
560
 
585
 
561
	if ( CheckPCK() )
586
	if ( CheckPCK() )
562
		UnPCKFile();
587
		UnPCKFile();
563
 
588
 
564
	m_bUpdatedSignature = true;
589
	m_bUpdatedSignature = true;
565
 
590
 
Line 601... Line 626...
601
	if ( File.exists() ) m_lSize = File.fileSize();
626
	if ( File.exists() ) m_lSize = File.fileSize();
602
 
627
 
603
	m_lUncomprDataSize = m_lSize;
628
	m_lUncomprDataSize = m_lSize;
604
 
629
 
605
	return m_lSize;
630
	return m_lSize;
606
}
631
}
607
 
632
 
608
/*
633
/*
609
	Func:	ReadLastModifed()
634
	Func:	ReadLastModifed()
610
	Desc:	Reads the last modified time of the file and returns
635
	Desc:	Reads the last modified time of the file and returns
611
			Uses seperate rountines for Windows and Linux
636
			Uses seperate rountines for Windows and Linux
Line 671... Line 696...
671
			}
696
			}
672
		}
697
		}
673
	}
698
	}
674
 
699
 
675
	return false;
700
	return false;
676
}
701
}
677
 
702
 
678
int C_File::ReadScriptVersion ()
703
int C_File::ReadScriptVersion ()
679
{
704
{
680
	if ( (m_iFileType != FILETYPE_SCRIPT) && (m_iFileType != FILETYPE_UNINSTALL) ) return 0;
705
	if ( (m_iFileType != FILETYPE_SCRIPT) && (m_iFileType != FILETYPE_UNINSTALL) ) return 0;
681
 
706
 
Line 711... Line 736...
711
		{
736
		{
712
			Utils::String baseName = CFileIO(file->GetName()).dir() + "/" + CFileIO(file->GetName()).baseName();
737
			Utils::String baseName = CFileIO(file->GetName()).dir() + "/" + CFileIO(file->GetName()).baseName();
713
			Utils::String compareBaseName = CFileIO(m_sName).dir() + "/" + CFileIO(m_sName).baseName();
738
			Utils::String compareBaseName = CFileIO(m_sName).dir() + "/" + CFileIO(m_sName).baseName();
714
			if (baseName.Compare(compareBaseName))
739
			if (baseName.Compare(compareBaseName))
715
				return true;
740
				return true;
716
		}
741
		}
717
		return false;
742
		return false;
718
	}
743
	}
719
 
744
 
720
	return true;
745
	return true;
721
}
746
}
722
 
747
 
723
/*
748
/*
724
########################################################################################################################
749
########################################################################################################################
725
####################################              Compression Functions             ####################################
750
####################################              Compression Functions             ####################################
726
########################################################################################################################
751
########################################################################################################################
727
*/
752
*/
Line 1160... Line 1185...
1160
		filen = filen.findReplace ( "\\\\", "\\" );
1185
		filen = filen.findReplace ( "\\\\", "\\" );
1161
 
1186
 
1162
		if ( len && data ) {
1187
		if ( len && data ) {
1163
			CFileIO File(filen);
1188
			CFileIO File(filen);
1164
			if ( File.startWrite() ) ret = File.write(data, len);
1189
			if ( File.startWrite() ) ret = File.write(data, len);
1165
		}
1190
		}
1166
	}
1191
	}
1167
 
1192
 
1168
	return ret;
1193
	return ret;
1169
}
1194
}
1170
 
1195
 
1171
CyString C_File::GetFullFileToDir ( CyString dir, bool includedir, CBaseFile *file )
1196
CyString C_File::GetFullFileToDir ( CyString dir, bool includedir, CBaseFile *file )
1172
{
1197
{
1173
	CyString fullfile = dir;
1198
	CyString fullfile = dir;
1174
	if ( includedir )
1199
	if ( includedir )
1175
	{
1200
	{
Line 1302... Line 1327...
1302
	}
1327
	}
1303
 
1328
 
1304
	return Utils::String::Null();
1329
	return Utils::String::Null();
1305
}
1330
}
1306
 
1331
 
1307
int GetFileTypeFromString ( CyString type )
1332
FileType GetFileTypeFromString ( CyString type )
1308
{
1333
{
1309
	CyString ltype = type.ToLower();
1334
	CyString ltype = type.ToLower();
1310
	if ( ltype == "script" )
1335
	if ( ltype == "script" )
1311
		return FILETYPE_SCRIPT;
1336
		return FILETYPE_SCRIPT;
1312
	else if ( ltype == "text" )
1337
	else if ( ltype == "text" )
Line 1338... Line 1363...
1338
	else if ( ltype == "shipscene" )
1363
	else if ( ltype == "shipscene" )
1339
		return FILETYPE_SHIPSCENE;
1364
		return FILETYPE_SHIPSCENE;
1340
	else if ( ltype == "cockpitscene" )
1365
	else if ( ltype == "cockpitscene" )
1341
		return FILETYPE_COCKPITSCENE;
1366
		return FILETYPE_COCKPITSCENE;
1342
 
1367
 
1343
	return -1;
1368
	return FILETYPE_UNKNOWN;
1344
}
1369
}
1345
 
1370
 
1346
 
1371
 
1347
CyString FormatErrorString(int error, CyString rest)
1372
CyString FormatErrorString(int error, CyString rest)
1348
{
1373
{
Line 1609... Line 1634...
1609
 
1634
 
1610
	// create data buffer
1635
	// create data buffer
1611
	size_t *uncomprLenSize = (size_t*)(newData + (datasize - 4));
1636
	size_t *uncomprLenSize = (size_t*)(newData + (datasize - 4));
1612
	unsigned long uncomprLen = (unsigned long)*uncomprLenSize;
1637
	unsigned long uncomprLen = (unsigned long)*uncomprLenSize;
1613
	if ( uncomprLen > (datasize * 100) )
1638
	if ( uncomprLen > (datasize * 100) )
1614
	{
1639
	{
1615
		if ( tempData ) delete []tempData;
1640
		if ( tempData ) delete []tempData;
1616
		*len = 0;
1641
		*len = 0;
1617
		return NULL;
1642
		return NULL;
1618
	}
1643
	}
1619
	unsigned char *uncompr = new unsigned char[uncomprLen + 1];
1644
	unsigned char *uncompr = new unsigned char[uncomprLen + 1];
1620
	if ( !uncompr ) {
1645
	if ( !uncompr ) {
1621
		if ( tempData ) delete []tempData;
1646
		if ( tempData ) delete []tempData;
1622
		return NULL;
1647
		return NULL;
1623
	}
1648
	}
Line 1669... Line 1694...
1669
{
1694
{
1670
	if ( size >=3 )
1695
	if ( size >=3 )
1671
	{
1696
	{
1672
		unsigned char magic=data[0] ^ 0xC8;
1697
		unsigned char magic=data[0] ^ 0xC8;
1673
		return ((data[1] ^ magic)==0x1F && (data[2] ^ magic)==0x8B);
1698
		return ((data[1] ^ magic)==0x1F && (data[2] ^ magic)==0x8B);
1674
	}
1699
	}
1675
	else
1700
	else
1676
		return false;
1701
		return false;
1677
 
1702
 
1678
}
1703
}
1679
 
1704
 
Line 1780... Line 1805...
1780
 
1805
 
1781
	// remove file extension
1806
	// remove file extension
1782
	file = file.GetToken ( ".", 1, file.NumToken ( '.' ) - 1 );
1807
	file = file.GetToken ( ".", 1, file.NumToken ( '.' ) - 1 );
1783
 
1808
 
1784
	return file;
1809
	return file;
1785
}
1810
}
1786
 
1811
 
1787
void C_File::CopyData(C_File *oldFile, bool includeData)
1812
void C_File::CopyData(C_File *oldFile, bool includeData)
1788
{
1813
{
1789
	SetFilename(oldFile->GetFullFilename());
1814
	SetFilename(oldFile->GetFullFilename());
1790
	m_sDir = oldFile->GetDir();
1815
	m_sDir = oldFile->GetDir();
1791
	m_tTime = oldFile->GetCreationTime();
1816
	m_tTime = oldFile->GetCreationTime();
1792
	m_bShared = oldFile->IsShared();
1817
	m_bShared = oldFile->IsShared();
1793
	m_bSigned = oldFile->IsSigned();
1818
	m_bSigned = oldFile->IsSigned();
1794
	m_iFileType = oldFile->GetFileType();
1819
	m_iFileType = oldFile->fileType();
1795
	m_lSize = oldFile->GetSize();
1820
	m_lSize = oldFile->GetSize();
1796
	if ( includeData )
1821
	if ( includeData )
1797
	{
1822
	{
1798
		m_lDataSize = oldFile->GetDataSize();
1823
		m_lDataSize = oldFile->GetDataSize();
1799
		if ( m_sData )
1824
		if ( m_sData )
Line 1810... Line 1835...
1810
	m_iDataCompression = oldFile->GetCompressionType();
1835
	m_iDataCompression = oldFile->GetCompressionType();
1811
}
1836
}
1812
 
1837
 
1813
float GetLibraryVersion() { return (float)LIBRARYVERSION; }
1838
float GetLibraryVersion() { return (float)LIBRARYVERSION; }
1814
float GetFileFormatVersion() { return (float)FILEVERSION; }
1839
float GetFileFormatVersion() { return (float)FILEVERSION; }
1815
 
1840
 
1816
CyString C_File::ChangeFileExt(CyString ext)
1841
CyString C_File::ChangeFileExt(CyString ext)
1817
{
1842
{
1818
	m_sName = CFileIO(m_sName).ChangeFileExtension(ext);
1843
	m_sName = CFileIO(m_sName).ChangeFileExtension(ext);
1819
	return m_sName;
1844
	return m_sName;
1820
}
1845
}
1821
 
1846
 
1822
bool C_File::CheckPackedExtension()
1847
bool C_File::CheckPackedExtension()
1823
{
1848
{
1824
	CyString ext = this->GetFileExt();
1849
	CyString ext = this->GetFileExt();
1825
	if ( ext == "pck" )
1850
	if ( ext == "pck" )
1826
		return true;
1851
		return true;
1827
	else if ( ext == "pbb" )
1852
	else if ( ext == "pbb" )
1828
		return true;
1853
		return true;
1829
	else if ( ext == "pbd" )
1854
	else if ( ext == "pbd" )
1830
		return true;
1855
		return true;
1831
 
1856
 
1832
	return false;
1857
	return false;
1833
}
1858
}
1834
 
1859
 
1835
bool C_File::shouldCheckBaseName() const
1860
bool C_File::shouldCheckBaseName() const
1836
{
1861
{
1837
	Utils::String ext = CFileIO(m_sName).extension();
1862
	Utils::String ext = CFileIO(m_sName).extension();
1838
	if (ext == "xml" || ext == "txt" || ext == "pck")
1863
	if (ext == "xml" || ext == "txt" || ext == "pck")
1839
		return true;
1864
		return true;
1840
	if (ext == "bod" || ext == "bob" || ext == "pbb" || ext == "pbd")
1865
	if (ext == "bod" || ext == "bob" || ext == "pbb" || ext == "pbd")
1841
		return true;
1866
		return true;
1842
	return false;
1867
	return false;
-
 
1868
}
-
 
1869
 
-
 
1870
unsigned int C_File::game() const 
-
 
1871
{ 
-
 
1872
	return _iGame; 
-
 
1873
}
-
 
1874
 
-
 
1875
void C_File::setGame(unsigned int i) 
-
 
1876
{ 
-
 
1877
	if (i == 0 || i == 1 << 31)
-
 
1878
		_iGame = 0;
-
 
1879
	else
-
 
1880
		_iGame = i; 
1843
}
1881
}
1844
 
1882
 
1845
 
1883
 
1846
unsigned char *C_File::BobDecompile(size_t *size)
1884
unsigned char *C_File::BobDecompile(size_t *size)
1847
{
1885
{