parser sortof-works
[antikythera] / src / main.cc
index 772b63c..2aec0a0 100644 (file)
@@ -13,6 +13,7 @@
 #include "texture.h"
 #include "machine.h"
 #include "meshgen.h"
+#include "mparser.h"
 
 static bool init();
 static void cleanup();
@@ -88,7 +89,12 @@ static bool init()
        Mesh::use_custom_sdr_attr = false;
 
        machine = new Machine;
+       if(!parse_machine(machine, "data/test.machine")) {
+               fprintf(stderr, "failed to parse machine\n");
+               return false;
+       }
 
+       /*
        const float pitch = 10.0f;
 
        Gear *gear1 = new Gear;
@@ -119,6 +125,7 @@ static bool init()
        gear2->attach(subgear);
        machine->add_gear(subgear);
        subgear->color = Vec3(0.8, 0.7, 0.5);
+       */
 
        machine->add_motor(0, 1.0);