Subversion Repositories spk

Rev

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

Rev 58 Rev 88
Line 11... Line 11...
11
 
11
 
12
#include "lists.h"
12
#include "lists.h"
13
#include "StringList.h"
13
#include "StringList.h"
14
#include "File.h"
14
#include "File.h"
15
#include "Utils/String.h"
15
#include "Utils/String.h"
-
 
16
#include "Utils/StringList.h"
16
 
17
 
17
#include "Package/CorePackage.h"
18
#include "Package/CorePackage.h"
18
 
19
 
19
#define GAME_ALL			0
20
#define GAME_ALL			0
20
#define GAME_X2				1
21
#define GAME_X2				1
Line 28... Line 29...
28
 
29
 
29
#define WRITECHUNK		50000
30
#define WRITECHUNK		50000
30
 
31
 
31
class CPackages;
32
class CPackages;
32
 
33
 
-
 
34
namespace SPK {
-
 
35
	class CTextDB;
-
 
36
}
-
 
37
 
-
 
38
using namespace SPK;
-
 
39
 
33
enum {
40
enum {
34
	READFLAG_NONE = 0,
41
	READFLAG_NONE = 0,
35
	READFLAG_NOUNCOMPRESS = 1
42
	READFLAG_NOUNCOMPRESS = 1
36
};
43
};
37
 
44
 
Line 54... Line 61...
54
#define TEXTPAGE_OBJECTS	17
61
#define TEXTPAGE_OBJECTS	17
55
#define TEXTPAGE_CLASS		2006
62
#define TEXTPAGE_CLASS		2006
56
#define TEXTPAGE_CARGOCLASS	1999
63
#define TEXTPAGE_CARGOCLASS	1999
57
 
64
 
58
 
65
 
-
 
66
enum WareTypes {
-
 
67
	Ware_BuiltIn,
-
 
68
	Ware_EMP,
-
 
69
	Ware_Custom
-
 
70
};
-
 
71
 
-
 
72
tstruct SWareEntry {
-
 
73
	Utils::String name;
-
 
74
	Utils::String description;
-
 
75
	enum WareTypes type;
-
 
76
	Utils::String id;
-
 
77
	int			  relval;
-
 
78
	int			  notority;
-
 
79
	int			  position;
-
 
80
} SWareEntry;
-
 
81
 
-
 
82
 
59
// spk header struct
83
// spk header struct
60
tstruct SSPKHeader {
84
tstruct SSPKHeader {
61
	SSPKHeader () { fVersion = 0; iValueCompression = lValueCompressSize = 0; }
85
	SSPKHeader () { fVersion = 0; iValueCompression = lValueCompressSize = 0; }
62
	float fVersion;
86
	float fVersion;
63
	int iValueCompression;
87
	int iValueCompression;
Line 268... Line 292...
268
	void RemoveFakePatchOrder(CyString scriptName, CyString author);
292
	void RemoveFakePatchOrder(CyString scriptName, CyString author);
269
	void AddFakePatchOrder(bool after, CyString scriptName, CyString author);
293
	void AddFakePatchOrder(bool after, CyString scriptName, CyString author);
270
	bool AnyFakePatchOrder() { if ( !m_lFakePatchBefore.Empty() || !m_lFakePatchAfter.Empty() ) return true; return false; }
294
	bool AnyFakePatchOrder() { if ( !m_lFakePatchBefore.Empty() || !m_lFakePatchAfter.Empty() ) return true; return false; }
271
	CyStringList &GetFakePatchBeforeOrder() { return m_lFakePatchBefore; }
295
	CyStringList &GetFakePatchBeforeOrder() { return m_lFakePatchBefore; }
272
	CyStringList &GetFakePatchAfterOrder() { return m_lFakePatchAfter; }
296
	CyStringList &GetFakePatchAfterOrder() { return m_lFakePatchAfter; }
-
 
297
	void updateTextDB() { this->_resetTextDB(); }
-
 
298
 
-
 
299
	virtual bool readWares(int iLang, CLinkList<SWareEntry> &list, const Utils::String &empWares);
273
 
300
 
274
//	bool IsChanged() { return m_bChanged; }
301
//	bool IsChanged() { return m_bChanged; }
275
//	void SetChanged(bool b) { m_bChanged = b; }
302
//	void SetChanged(bool b) { m_bChanged = b; }
276
 
303
 
277
	int  FindFirstGameInPackage();
304
	int  FindFirstGameInPackage();
Line 322... Line 349...
322
 
349
 
323
	int _read_FileHeader(std::fstream &stream, int iReadType, int iMaxProgress, int iDoneLen, CProgressInfo *pProgress);
350
	int _read_FileHeader(std::fstream &stream, int iReadType, int iMaxProgress, int iDoneLen, CProgressInfo *pProgress);
324
	int _read_Header(std::fstream &stream, int iReadType, int iMaxProgress, CProgressInfo *pProgress);
351
	int _read_Header(std::fstream &stream, int iReadType, int iMaxProgress, CProgressInfo *pProgress);
325
	CFileIO *_startRead();
352
	CFileIO *_startRead();
326
 
353
 
-
 
354
	void _addFile(C_File *file, bool dontChange = false);
-
 
355
	void _updateTextDB(C_File *file);
-
 
356
	void _resetTextDB();
-
 
357
	void _addWaresToList(int iLang, CLinkList<SWareEntry> &list, const Utils::String &wares, enum WareTypes eType);
-
 
358
 
-
 
359
protected:
327
	SSPKHeader m_SHeader;
360
	SSPKHeader m_SHeader;
328
	SSPKHeader2 m_SHeader2;
361
	SSPKHeader2 m_SHeader2;
329
 
362
 
330
	C_File *m_pIconFile;
363
	C_File *m_pIconFile;
331
	CyString m_sIconExt;
364
	CyString m_sIconExt;
Line 336... Line 369...
336
	CLinkList<SNames> m_lNames;			//TODO: move to CorePackage
369
	CLinkList<SNames> m_lNames;			//TODO: move to CorePackage
337
	CyStringList m_lMirrors;			//TODO: move to CorePackage
370
	CyStringList m_lMirrors;			//TODO: move to CorePackage
338
	CyStringList m_lFakePatchBefore;
371
	CyStringList m_lFakePatchBefore;
339
	CyStringList m_lFakePatchAfter;
372
	CyStringList m_lFakePatchAfter;
340
 
373
 
-
 
374
	CTextDB	*_pTextDB;
-
 
375
 
341
	CLinkList<SGameCompat> m_lGames;
376
	CLinkList<SGameCompat> m_lGames;
342
 
377
 
343
	bool m_bSigned;
378
	bool m_bSigned;
344
	bool m_bFullyLoaded;
379
	bool m_bFullyLoaded;
345
 
380