fix long standing grind bug
[carveJwlIkooP6JGAAIwe30JlM.git] / player_render.c
index 8f2521538ca9719b7c83b93dccf3a27553f49e0c..011d0415edacf62857cb81e9b83a767005c951d5 100644 (file)
@@ -6,6 +6,7 @@
 #include "camera.h"
 #include "player_model.h"
 #include "ent_skateshop.h"
+#include "audio.h"
 
 #include "shaders/model_character_view.h"
 #include "shaders/model_board_view.h"
@@ -174,7 +175,7 @@ VG_STATIC void player__pre_render( player_instance *player )
       v3_zero( vp1 );
    }
 
-   struct ub_world_lighting *ubo = &get_active_world()->ub_lighting;
+   struct ub_world_lighting *ubo = &world_current_instance()->ub_lighting;
    m4x3_mulv( av->sk.final_mtx[ av->id_board ], vp0, ubo->g_board_0 );
    m4x3_mulv( av->sk.final_mtx[ av->id_board ], vp1, ubo->g_board_1 );
 
@@ -194,11 +195,11 @@ VG_STATIC void player__pre_render( player_instance *player )
          player->rewind_length = 1;
          player->rewind_total_length = 0.0f;
          player->rewind_accum = 0.0f;
-         world_global.sky_target_rate = 1.0;
-         world_global.time = world_global.last_use;
+         world_render.sky_target_rate = 1.0;
+         world_static.time = world_static.last_use;
       }
       else{
-         world_global.sky_target_rate = -100.0;
+         world_render.sky_target_rate = -100.0;
 
          float budget         = vg.time_delta,
                overall_length = player->rewind_length;
@@ -282,11 +283,6 @@ VG_STATIC void player__pre_render( player_instance *player )
    player__cam_iterate( player );
 }
 
-enum board_shader{
-   k_board_shader_player,
-   k_board_shader_entity
-};
-
 VG_STATIC void render_board( camera *cam, world_instance *world,
                              struct player_board *board, m4x3f root,
                              enum board_shader shader )
@@ -423,7 +419,7 @@ PLAYER_API void player__render( camera *cam, player_instance *player )
    inverse[2] = cam->farz-cam->nearz;
    shader_model_character_view_uInverseRatioMain( inverse );
 
-   world_instance *world = get_active_world();
+   world_instance *world = world_current_instance();
    world_link_lighting_ub( world, _shader_model_character_view.id );
    world_bind_position_texture( world, _shader_model_character_view.id,
                               _uniform_model_character_view_g_world_depth, 2 );