aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/space.h
diff options
context:
space:
mode:
authorMatthew Stewart2018-07-17 22:49:10 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commita024a3fd4501a0ab41ffdd62f65914f2307bdf22 (patch)
treed8dd2ddcfc0b1d8a9d9f63bc8a161f7068690202 /engines/startrek/space.h
parent639c02b76f591fe17ee78b6a72da46c4782fd4d5 (diff)
downloadscummvm-rg350-a024a3fd4501a0ab41ffdd62f65914f2307bdf22.tar.gz
scummvm-rg350-a024a3fd4501a0ab41ffdd62f65914f2307bdf22.tar.bz2
scummvm-rg350-a024a3fd4501a0ab41ffdd62f65914f2307bdf22.zip
STARTREK: Move space functions into separate file
Diffstat (limited to 'engines/startrek/space.h')
-rw-r--r--engines/startrek/space.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/engines/startrek/space.h b/engines/startrek/space.h
new file mode 100644
index 0000000000..f5d08e5d1e
--- /dev/null
+++ b/engines/startrek/space.h
@@ -0,0 +1,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