removed bsp test
[dosrtxon] / src / parts / rtxonoff.c
index 4c5f35e..14edf1c 100644 (file)
@@ -14,17 +14,19 @@ static int init(void);
 static void destroy(void);
 static void start(long trans_time);
 static void draw(void);
+static void keypress(int key);
 
 static struct screen scr = {
        "rtxonoff",
        init,
        destroy,
        start, 0,
-       draw
+       draw,
+       keypress
 };
 
 static float cam_theta = -29, cam_phi = 35;
-static float cam_dist = 6;
+static float cam_dist = 10;
 
 static const char *car_fname[2] = {"data/ldiablo.obj", 0};
 static const char *cartex_fname[2] = {"data/ldiablo.png", 0};
@@ -45,6 +47,7 @@ static int init(void)
                        if(!(tex_car[i].pixels = img_load_pixels(cartex_fname[i],
                                                        &tex_car[i].width, &tex_car[i].height, IMG_FMT_RGB24))) {
                                fprintf(stderr, "failed to load car texture: %s\n", cartex_fname[i]);
+                               return -1;
                        }
                        convimg_rgb24_rgb16(tex_car[i].pixels, (unsigned char*)tex_car[i].pixels,
                                        tex_car[i].width, tex_car[i].height);
@@ -60,6 +63,12 @@ static int init(void)
 
 static void destroy(void)
 {
+       int i;
+
+       for(i=0; i<2; i++) {
+               free(mesh_car[i].varr);
+               free(mesh_car[i].iarr);
+       }
 }
 
 static void start(long trans_time)
@@ -81,6 +90,7 @@ static void update(void)
 static void draw(void)
 {
        int i;
+       static float vdir[3];
        float t = (float)time_msec / 16.0f;
 
        update();
@@ -106,3 +116,7 @@ static void draw(void)
 
        swap_buffers(fb_pixels);
 }
+
+static void keypress(int key)
+{
+}