summaryrefslogtreecommitdiff
path: root/src/win95/zsp.hpp
blob: 8f008b5fcf45cc37d242969458c2c5f093e23bb0 (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
#ifndef _zsp_hpp
#define _zsp_hpp 1

#include "shpchunk.hpp"


#define rsp_oc_x0 0x00000001
#define rsp_oc_x1 0x00000002
#define rsp_oc_y0 0x00000004
#define rsp_oc_y1 0x00000008
#define rsp_oc_z0 0x00000010
#define rsp_oc_z1 0x00000020


// this file should be included from chunk.hpp


struct ChunkShape;

struct ZSP_zone
{
#if (cencon || shpedit)
	ZSP_zone (const ChunkShape &, double, double, double, double);
#endif

	ZSP_zone ();
	~ZSP_zone();
	
	ZSP_zone (const ZSP_zone &);
	ZSP_zone & operator=(const ZSP_zone &);
	
	int num_z_polys;
	int * z_poly_list;
	int num_z_verts;
	int * z_vert_list;
	
	friend unsigned char operator==(const ZSP_zone &, const ZSP_zone &);
	friend unsigned char operator!=(const ZSP_zone &, const ZSP_zone &);
};


class ZSP_Data
{

public:

#if (cencon || shpedit)
	ZSP_Data (const ChunkShape &, int);
#endif

	ZSP_Data (const char * zdata, size_t zsize);

	~ZSP_Data ();

	double cube_size;
	double cube_radius;
	
	int num_x_cubes, num_y_cubes, num_z_cubes;

	List<ZSP_zone> zone_array;
	
	
};


/////////////////////////////////////////

class Shape_ZSP_Data_Chunk : public Chunk
{
public:

#if cencon || shpedit
	Shape_ZSP_Data_Chunk (Shape_Sub_Shape_Chunk * parent, ZSP_Data zspin)
	: Chunk(parent, "SHPZSPDT"), zspdata (zspin)
	{}

	Shape_ZSP_Data_Chunk (Shape_Chunk * parent, ZSP_Data zspin)
	: Chunk(parent, "SHPZSPDT"), zspdata (zspin)
	{}
#endif

	const ZSP_Data zspdata;

	size_t size_chunk ();
	void fill_data_block (char *);

	Shape_ZSP_Data_Chunk (Shape_Sub_Shape_Chunk * parent, const char * zdata, size_t zsize)
	: Chunk (parent, "SHPZSPDT"), zspdata	(zdata, zsize)
	{}

	Shape_ZSP_Data_Chunk (Shape_Chunk * parent, const char * zdata, size_t zsize)
	: Chunk (parent, "SHPZSPDT"), zspdata	(zdata, zsize)
	{}
	
};











#endif