aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/space.h
blob: f5d08e5d1ee4884462bbc660731a32ed31a4f8a3 (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
// Pseudo-3D structs

struct Point3 {
	int32 x;
	int32 y;
	int32 z;

	Point3 operator+(const Point3 &p) const {
		Point3 p2;
		p2.x = x + p.x;
		p2.y = y + p.y;
		p2.z = z + p.z;
		return p2;
	}
	Point3 operator-(const Point3 &p) const {
		Point3 p2;
		p2.x = x - p.x;
		p2.y = y - p.y;
		p2.z = z - p.z;
		return p2;
	}
};

struct Point3W {
	int16 x;
	int16 y;
	int16 z;
};

struct Star {
	bool active;
	Point3 pos;
};

// Struct for objects in space.
// TODO: what does this stand for? Maybe rename it.
struct R3 {
	Point3 pos; // 0x0
	int16 field1e; // 0x1e
};

// Maximum number of stars visible at once in the starfields
#define NUM_STARS 16

// Maximum number of R3 objects in space at once
#define NUM_SPACE_OBJECTS 0x30