to the workers of the world
[carveJwlIkooP6JGAAIwe30JlM.git] / world_routes.h
index 2454a593c0574aae14c79ffdd68489182a23a5a8..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 );
@@ -611,6 +612,8 @@ VG_STATIC void render_world_routes( world_instance *world, camera *cam )
    mesh_bind( &world_global.mesh_gate );
 
    /* skip writing into the motion vectors for this */
+   /* TODO: draw future gate if the one we're looking through is to be passed,
+    *       instead of current gate */
    glDrawBuffers( 1, (GLenum[]){ GL_COLOR_ATTACHMENT0 } );
 
    for( u32 i=0; i<mdl_arrcount(&world->ent_route); i++ ){
@@ -624,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 );