Make sure strncpy always keeps one byte untouched for NUL
[neverball] / ball / game_common.h
index 57fb7d9..ac502a2 100644 (file)
 
 /*---------------------------------------------------------------------------*/
 
-#define GAME_NONE 0
-#define GAME_TIME 1
-#define GAME_GOAL 2
-#define GAME_FALL 3
+enum
+{
+    GAME_NONE = 0,
+
+    GAME_TIME,
+    GAME_GOAL,
+    GAME_FALL,
+
+    GAME_MAX
+};
 
 const char *status_to_str(int);
 
 /*---------------------------------------------------------------------------*/
 
-void game_comp_grav(float h[3], const float g[3],
-                    float view_a,
-                    float game_rx,
-                    float game_rz);
+enum
+{
+    VIEW_NONE = -1,
+
+    VIEW_CHASE,
+    VIEW_LAZY,
+    VIEW_MANUAL,
+    VIEW_TOPDOWN,
+
+    VIEW_MAX
+};
+
+const char *view_to_str(int);
+
+/*---------------------------------------------------------------------------*/
+
+struct game_tilt
+{
+    float x[3], rx;
+    float z[3], rz;
+};
+
+void game_tilt_init(struct game_tilt *);
+void game_tilt_axes(struct game_tilt *, float view_e[3][3]);
+void game_tilt_grav(float h[3], const float g[3], const struct game_tilt *);
 
 /*---------------------------------------------------------------------------*/