updated URL of forum and table in readme file
[neverball] / share / solid.h
index b298a42..b15b437 100644 (file)
@@ -1,4 +1,4 @@
-/*   
+/*
  * Copyright (C) 2003 Robert Kooima
  *
  * NEVERBALL is  free software; you can redistribute  it and/or modify
@@ -31,7 +31,7 @@
  * the variable.
  *
  * The Xs are as documented by struct s_file:
- * 
+ *
  *     f  File          (struct s_file)
  *     m  Material      (struct s_mtrl)
  *     v  Vertex        (struct s_vert)
@@ -43,7 +43,7 @@
  *     n  Node          (struct s_node)
  *     p  Path          (struct s_path)
  *     b  Body          (struct s_body)
- *     c  Coin          (struct s_coin)
+ *     h  Item          (struct s_item)
  *     z  Goal          (struct s_goal)
  *     j  Jump          (struct s_jump)
  *     x  Switch        (struct s_swch)
  * lumps.  "ei" and "ej" are  edge indices into some "ev" edge vector.
  * An edge is  defined by two vertices, so  an edge structure consists
  * of "vi" and "vj".  And so on.
- * 
+ *
  * Those members that do not conform to this convention are explicitly
  * documented with a comment.
  *
- * These prefixes are still available: h k o q y.
+ * These prefixes are still available: c k o q y.
  */
 
 /*---------------------------------------------------------------------------*/
 
 #define L_DETAIL   1
 
+/* Item types. */
+
+#define ITEM_NONE       0
+#define ITEM_COIN       1
+#define ITEM_GROW       2
+#define ITEM_SHRINK     3
+
 /*---------------------------------------------------------------------------*/
 
 struct s_mtrl
@@ -187,9 +194,10 @@ struct s_body
     int gc;
 };
 
-struct s_coin
+struct s_item
 {
     float p[3];                                /* position                   */
+    int   t;                                   /* type                       */
     int   n;                                   /* value                      */
 };
 
@@ -270,7 +278,7 @@ struct s_file
     int nc;
     int pc;
     int bc;
-    int cc;
+    int hc;
     int zc;
     int jc;
     int xc;
@@ -291,7 +299,7 @@ struct s_file
     struct s_node *nv;
     struct s_path *pv;
     struct s_body *bv;
-    struct s_coin *cv;
+    struct s_item *hv;
     struct s_goal *zv;
     struct s_jump *jv;
     struct s_swch *xv;
@@ -304,23 +312,23 @@ struct s_file
 
 /*---------------------------------------------------------------------------*/
 
+void sol_body_p(float p[3], const struct s_file *, const struct s_body *);
+
+/*---------------------------------------------------------------------------*/
+
 int   sol_load_only_file(struct s_file *, const char *);
-int   sol_load(struct s_file *, const char *, int, int);
+int   sol_load_only_head(struct s_file *, const char *);
 int   sol_stor(struct s_file *, const char *);
 void  sol_free(struct s_file *);
 
-void  sol_back(const struct s_file *, float, float, float);
-void  sol_refl(const struct s_file *);
-void  sol_draw(const struct s_file *);
-void  sol_shad(const struct s_file *);
-
 float sol_step(struct s_file *, const float *, float, int, int *);
 
-int   sol_coin_test(struct s_file *, float *, float);
-int   sol_goal_test(struct s_file *, float *, int);
 int   sol_jump_test(struct s_file *, float *, int);
 int   sol_swch_test(struct s_file *, int);
 
+struct s_goal *sol_goal_test(struct s_file *, float *, int);
+struct s_item *sol_item_test(struct s_file *, float *, float);
+
 /*---------------------------------------------------------------------------*/
 
 void put_file_state(FILE *, struct s_file *);