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

#include "chunk.hpp"
#include "chnktype.hpp"
#include "obchunk.hpp"

struct WaypointLink
{
	int index;
	int flags;
};

struct ModuleLink
{
	~ModuleLink();

	char*  module_name;
	int flags;
};

#define WaypointFlag_CentreDefinedByUser 0x80000000
#define WaypointFlag_FirstGroundWaypoint 0x40000000 
struct ChunkWaypoint
{
	ChunkWaypoint();
	~ChunkWaypoint();
	
	int index;
	ChunkVectorInt min,max; //relative to centre
	ChunkVectorInt centre; //relative to world

	int NumWPLinks;
	WaypointLink* WayLinks;

	int NumModLinks;
	ModuleLink* ModLinks;

	int flags,spare2;

};

class Module_Waypoint_Chunk : public Chunk
{
	public :
	Module_Waypoint_Chunk(Chunk_With_Children*,const char *,size_t);
	Module_Waypoint_Chunk(Chunk_With_Children*);
	~Module_Waypoint_Chunk();

	virtual size_t size_chunk();
	virtual void fill_data_block(char* data_start);
	
	//Copies waypoint data and deletes the old waypoint_chunk
	void TransferWaypointData(Module_Waypoint_Chunk*);

	int NumWaypoints;
	ChunkWaypoint* Waypoints;

	ChunkWaypoint* AlienWaypoints;
	ChunkWaypoint* GroundWaypoints;
	
	short NumAlienWaypoints;
	short NumGroundWaypoints;

	int spare1;
	int spare2;
};

class AI_Module_Master_Chunk : public Chunk
{
	public :
	AI_Module_Master_Chunk(Chunk_With_Children*,const char*,size_t);
	AI_Module_Master_Chunk(Object_Module_Data_Chunk*);

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

	void AddModule(Object_Chunk*);
	Object_Chunk* get_my_object_chunk();

	List<Object_Chunk*> ModuleList;
};

class AI_Module_Slave_Chunk : public Chunk
{
	public :
	AI_Module_Slave_Chunk(Chunk_With_Children*,const char*,size_t);
	AI_Module_Slave_Chunk(Object_Module_Data_Chunk*,Object_Chunk*);
	~AI_Module_Slave_Chunk();

	virtual size_t size_chunk();
	virtual void fill_data_block(char* data_start);
	virtual void post_input_processing();

	Object_Chunk* get_my_object_chunk();

	Object_Chunk* MasterModule;
	int MasterModuleIndex;
};


#endif