vg_fatal_error( "Unknown store (%u)\n", shop->type );
}
+static void skateshop_render_nonfocused( world_instance *world, camera *cam ){
+ for( u32 j=0; j<mdl_arrcount( &world->ent_skateshop ); j ++ ){
+ ent_skateshop *shop = mdl_arritm(&world->ent_skateshop, j );
+
+ if( shop->type != k_skateshop_type_boardshop ) continue;
+
+ f32 dist2 = v3_dist2( cam->pos, shop->transform.co ),
+ maxdist = 50.0f;
+
+ if( dist2 > maxdist*maxdist ) continue;
+ ent_marker *mark_rack = mdl_arritm( &world->ent_marker,
+ mdl_entity_id_id(shop->boards.id_rack));
+
+ u32 slot_count = vg_list_size(global_skateshop.shop_view_slots);
+ for( u32 i=0; i<slot_count; i++ ){
+ struct player_board *board = &localplayer.fallback_board;
+
+ mdl_transform xform;
+ transform_identity( &xform );
+
+ xform.co[0] = -((float)i - ((float)slot_count)*0.5f)*0.45f;
+ mdl_transform_mul( &mark_rack->transform, &xform, &xform );
+
+ struct player_board_pose pose = {0};
+ m4x3f mmdl;
+ mdl_transform_m4x3( &xform, mmdl );
+ render_board( cam, world, board, mmdl, &pose, k_board_shader_entity );
+ }
+ }
+}
+
static void ent_skateshop_helpers_pickable( const char *acceptance ){
vg_str text;
static void ent_skateshop_preupdate( ent_skateshop *shop, int active );
static void skateshop_render( ent_skateshop *shop );
+static void skateshop_render_nonfocused( world_instance *world, camera *cam );
#endif /* ENT_SKATESHOP_H */
/* additional renderings like text etc.. */
static void world_entity_focus_render(void){
- if( skaterift.activity != k_skaterift_ent_focus )
+ world_instance *world = world_current_instance();
+ if( skaterift.activity != k_skaterift_ent_focus ){
+ skateshop_render_nonfocused( world, &skaterift.cam );
return;
+ }
u32 type = mdl_entity_id_type( world_static.focused_entity ),
index = mdl_entity_id_id( world_static.focused_entity );
- world_instance *world = world_current_instance();
if( type == k_ent_skateshop ){
ent_skateshop *skateshop = mdl_arritm( &world->ent_skateshop, index );