bonus ball for bonus levels. Fix #56
[neverball] / share / mapc.c
index 4283932..154df92 100644 (file)
@@ -33,7 +33,6 @@
 #include <math.h>
 
 #include "vec3.h"
-#include "glext.h"
 #include "solid.h"
 #include "base_config.h"
 
@@ -928,11 +927,17 @@ static void make_goal(struct s_file *fp,
     zp->p[1] = 0.f;
     zp->p[2] = 0.f;
     zp->r    = 0.75;
+    zp->s    = 0;
+    zp->c    = 0;
 
     for (i = 0; i < c; i++)
     {
         if (strcmp(k[i], "radius") == 0)
             sscanf(v[i], "%f", &zp->r);
+        if (strcmp(k[i], "skip") == 0)
+            sscanf(v[i], "%d", &zp->s);
+        if (strcmp(k[i], "special") == 0)
+            sscanf(v[i], "%d", &zp->c);
 
         if (strcmp(k[i], "origin") == 0)
         {
@@ -1034,6 +1039,7 @@ static void make_swch(struct s_file *fp,
     xp->t    = 0;
     xp->f0   = 0;
     xp->f    = 0;
+    xp->i    = 0;
 
     for (i = 0; i < c; i++)
     {
@@ -1048,6 +1054,9 @@ static void make_swch(struct s_file *fp,
 
         if (strcmp(k[i], "state") == 0)
             xp->f = atoi(v[i]);
+       
+        if (strcmp(k[i], "invisible") == 0)
+            xp->i = atoi(v[i]);
 
         if (strcmp(k[i], "origin") == 0)
         {
@@ -2039,6 +2048,12 @@ static void dump_file(struct s_file *p, const char *name)
            p->rc, p->uc, p->ac, p->ic);
 }
 
+/* Skip the ugly SDL main substitution */
+/* Since we only need sdl_image */
+#ifdef main
+#    undef main
+#endif
+
 int main(int argc, char *argv[])
 {
     char src[MAXSTR];