commit
[carveJwlIkooP6JGAAIwe30JlM.git] / world_routes.h
index 05ef3c9586a8094634ed20e448ca6236d4b5b72a..91456aa0afdbde6bb4f42937aceaab8399a06a79 100644 (file)
@@ -564,7 +564,8 @@ VG_STATIC void world_bind_light_index( world_instance *world,
                                        GLuint shader, GLuint location, 
                                        int slot );
 
-VG_STATIC void render_world_routes( world_instance *world, camera *cam )
+VG_STATIC void render_world_routes( world_instance *world, camera *cam, 
+                                    int layer_depth )
 {
    m4x3f identity_matrix;
    m4x3_identity( identity_matrix );
@@ -626,8 +627,9 @@ VG_STATIC void render_world_routes( world_instance *world, camera *cam )
 
          shader_model_gate_uColour( colour );
 
-         u32 next = route->checkpoints_start +
-                   (route->active_checkpoint+1) % route->checkpoints_count;
+         u32 next = route->active_checkpoint+1+layer_depth;
+             next = next % route->checkpoints_count;
+             next += route->checkpoints_start;
 
          ent_checkpoint *cp = mdl_arritm( &world->ent_checkpoint, next );
          ent_gate *gate = mdl_arritm( &world->ent_gate, cp->gate_index );