aboutsummaryrefslogtreecommitdiff
path: root/src/libparsec/include/gd_heads.h
blob: b958294cd46003d35d570b6c25294c576238194c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * PARSEC HEADER: gd_heads.h
 */

#ifndef _GD_HEADS_H_
#define _GD_HEADS_H_


// ----------------------------------------------------------------------------
// DATA FILE HEADER DEFINITIONS                                               -
// ----------------------------------------------------------------------------


// filepack: structure of file package header ---------------------------------
//
struct packageheader_s {

	char	signature[ 16 ];
	dword	numitems;
	dword	headersize;
	dword	datasize;
	dword	packsize;
};


// filepack: structure of single entry in info list in memory -----------------
//
struct pfileinfo_s {

	char	*file;
	dword	foffset;
	dword	flength;
	FILE	*fp;
	dword	fcurpos;
};


// filepack: structure of single entry in info list on storage device ---------
//
struct pfileinfodisk_s {

	char	file[ 16 ];
	dword	foffset;
	dword	flength;
	dword	fp; // dword instead of FILE* because packed .dat file requires it to be 32 bits
	dword	fcurpos;
};


// parpfg format (parsec font info files) -------------------------------------
//
struct PfgHeader {

	char	signature[7];
	byte	version;
	int 	srcwidth;
	short	width;
	short	height;
};

#define PFG_SIGNATURE			"PARPFG"
#define REQUIRED_PFG_VERSION	0x01


// parfnt format (parsec font files) ------------------------------------------
//
struct FntHeader {

	char	signature[7];
	byte	version;
	int 	width;
	int 	height;
};

#define FNT_SIGNATURE			"PARFNT"
#define REQUIRED_FNT_VERSION	0x01
#define FONT_EXTENSION			"fnt"


// partex format (parsec texture data files) ----------------------------------
//
struct TexHeader {

	char	signature[7];
	byte	version;
	int 	width;
	int 	height;
};

#define TEX_SIGNATURE			"PARTEX"
#define REQUIRED_TEX_VERSION	0x01


// parbdt format (parsec bitmap data files) -----------------------------------
//
struct BdtHeader {

	char	signature[7];
	byte	version;
	int 	width;
	int 	height;
};

#define BDT_SIGNATURE			"PARBDT"
#define REQUIRED_BDT_VERSION	0x01


// pardem format (parsec demo data files) --------------------------------------
//
struct DemHeader {

	char	signature[7];
	byte	version;
	dword	headersize;
};

#define DEM_SIGNATURE			"PARDEM"
#define REQUIRED_DEM_VERSION	0x01

enum {

	DEMO_KEY_TITLE			= 0x01,
	DEMO_KEY_DESCRIPTION	= 0x02,
	DEMO_KEY_AUTHOR			= 0x03,

	NUM_DEMO_KEYS			// must be last in list
};


#endif // _GD_HEADS_H_