6 #include "world_render.h"
10 #include "shaders/model_menu.h"
11 #include "vg_steam_friends.h"
13 VG_STATIC mdl_context menu_model
;
14 VG_STATIC mdl_array_ptr menu_markers
;
15 VG_STATIC glmesh menu_glmesh
;
16 VG_STATIC m4x3f menu_mdl_mtx
;
17 VG_STATIC
float menu_opacity
= 0.0f
;
18 VG_STATIC
float menu_input_cooldown
= 0.0f
;
19 VG_STATIC
float menu_fov_target
= 97.0f
,
20 menu_smooth_fov
= 97.0f
;
21 VG_STATIC v2f menu_extra_angles
;
22 VG_STATIC v3f menu_camera_pos
;
23 VG_STATIC v2f menu_camera_angles
;
25 VG_STATIC
int cl_menu
= 0,
28 VG_STATIC
int menu_enabled(void){ return cl_menu
; }
30 VG_STATIC
const char *playermodels
[] = { "ch_new", "ch_jordan", "ch_outlaw" };
35 VG_STATIC
struct input_binding input_menu_h
,
40 input_menu_toggle_kbm
;
43 VG_STATIC
void menu_btn_quit( int event
);
44 VG_STATIC
void menu_btn_skater( int event
);
45 VG_STATIC
void menu_btn_blur( int event
);
46 VG_STATIC
void menu_btn_fuckoff( int event
);
47 VG_STATIC
void menu_btn_reset( int event
);
48 VG_STATIC
void menu_btn_map( int event
);
49 VG_STATIC
void menu_btn_settings( int event
);
50 VG_STATIC
void menu_btn_invert_y( int event
);
52 VG_STATIC mdl_mesh
*menu_mesh_fov_slider
,
53 *menu_mesh_vol_slider
,
54 *menu_mesh_res_slider
;
81 k_menu_page_main
= 0x1,
82 k_menu_page_skater
= 0x2,
83 k_menu_page_quit
= 0x4,
84 k_menu_page_settings
= 0x8,
85 k_menu_page_map
= 0x10
88 struct menu_btn_userdata
{
93 VG_STATIC
int menu_settings_if( struct menu_btn_userdata ud
)
95 if( game_menu
.page
& k_menu_page_settings
){
96 int *ptr
= ud
.ptr_generic
;
103 VG_STATIC
int menu_vis( struct menu_btn_userdata ud
)
105 if( ud
.i
& game_menu
.page
)
112 VG_STATIC
int menu_controller( struct menu_btn_userdata ud
)
114 if( (game_menu
.page
& (k_menu_page_main
|k_menu_page_settings
))
115 && (ud
.i
== steam_display_controller
) )
120 VG_STATIC
int menu_controller_inf( struct menu_btn_userdata ud
)
122 if( (game_menu
.page
& k_menu_page_settings
)
123 && (ud
.i
== steam_display_controller
) )
133 int (*fn_visibility
)( struct menu_btn_userdata ud
);
134 struct menu_btn_userdata user
;
136 void (*fn_press
)( int event
);
146 VG_STATIC menu_buttons
[] =
149 "text_quit", menu_vis
, {.i
=k_menu_page_main
|k_menu_page_quit
},
150 .fn_press
= menu_btn_quit
,
151 .ld
="text_reset", .lr
="text_settings", /*.ll="text_map"*/
154 "text_quitty", menu_vis
, {.i
=k_menu_page_quit
}
157 "text_yes", menu_vis
, {.i
=k_menu_page_quit
},
158 .fn_press
= menu_btn_fuckoff
161 "text_reset", menu_vis
, {.i
=k_menu_page_main
},
162 .fn_press
= menu_btn_reset
,
163 .lu
="text_quit", .ld
="text_skater", /*.ll="text_map",*/ .lr
="text_settings"
166 "text_skater", menu_vis
, {.i
=k_menu_page_main
|k_menu_page_skater
},
167 .fn_press
= menu_btn_skater
,
168 .lu
="text_reset", /*.ll="text_map",*/ .lr
="text_settings"
172 "text_map", menu_vis, {.i=k_menu_page_main},
173 .fn_press = menu_btn_map,
178 "text_settings", menu_vis
, {.i
=k_menu_page_main
|k_menu_page_settings
},
179 .fn_press
= menu_btn_settings
,
183 "skater_left", menu_vis
, {k_menu_page_skater
}
186 "skater_right", menu_vis
, {k_menu_page_skater
}
190 "fov_slider", menu_vis
, {k_menu_page_settings
},
193 { "fov_info", menu_vis
, {k_menu_page_settings
} },
196 "vol_slider", menu_vis
, {k_menu_page_settings
},
199 { "vol_info", menu_vis
, {k_menu_page_settings
} },
202 "text_invert_y", menu_vis
, {k_menu_page_settings
},
203 .fn_press
= menu_btn_invert_y
,
204 .lu
= "fov_slider", .ld
="text_blur"
207 "text_invert_y_check", menu_settings_if
, {.ptr_generic
=&cl_invert_y
}
210 "text_blur", menu_vis
, {k_menu_page_settings
},
211 .fn_press
= menu_btn_blur
,
212 .lu
="text_invert_y", .ld
="res_slider"
215 "text_blur_check", menu_settings_if
, {.ptr_generic
=&cl_blur
}
218 "res_slider", menu_vis
, {k_menu_page_settings
},
219 .ld
= "vol_slider", .lu
= "text_blur"
222 "res_info", menu_vis
, {k_menu_page_settings
},
225 { "ctr_xbox", menu_controller_inf
, {k_steam_controller_type_xbox
}},
226 { "ctr_xbox_text", menu_controller_inf
, {k_steam_controller_type_xbox
}},
227 { "ctr_steam", menu_controller_inf
, {k_steam_controller_type_steam
}},
228 { "ctr_steam_text", menu_controller_inf
, {k_steam_controller_type_steam
}},
229 { "ctr_deck", menu_controller_inf
, {k_steam_controller_type_steam_deck
}},
230 { "ctr_deck_text", menu_controller_inf
, {k_steam_controller_type_steam_deck
}},
231 { "ctr_ps", menu_controller_inf
, {k_steam_controller_type_playstation
}},
232 { "ctr_ps_text", menu_controller_inf
, {k_steam_controller_type_playstation
}},
233 { "ctr_kbm", menu_controller_inf
, {k_steam_controller_type_keyboard
}},
234 { "ctr_kbm_text", menu_controller_inf
, {k_steam_controller_type_keyboard
}},
237 "text_paused", menu_vis
, {k_menu_page_main
}
241 VG_STATIC
int menu_get_loc( const char *loc
)
243 for( int i
=0; i
<vg_list_size(menu_buttons
); i
++ )
244 if( !strcmp( menu_buttons
[i
].name
, loc
) )
251 VG_STATIC
void menu_btn_reset( int event
)
253 localplayer_cmd_respawn( 0, NULL
);
258 VG_STATIC
void menu_btn_fuckoff( int event
)
260 vg
.window_should_close
= 1;
263 VG_STATIC
void menu_btn_quit( int event
)
265 game_menu
.page
= k_menu_page_quit
;
266 game_menu
.loc
= menu_get_loc( "text_yes" );
269 VG_STATIC
void menu_btn_settings( int event
)
271 game_menu
.page
= k_menu_page_settings
;
272 game_menu
.loc
= menu_get_loc( "fov_slider" );
275 VG_STATIC
void menu_btn_skater( int event
)
277 game_menu
.page
= k_menu_page_skater
;
280 VG_STATIC
void menu_btn_blur( int event
)
285 VG_STATIC
void menu_btn_invert_y( int event
)
290 VG_STATIC
void menu_btn_map( int event
)
292 game_menu
.page
= k_menu_page_map
;
293 game_menu
.map_count
= 0;
294 game_menu
.selected_map
= 0;
297 tinydir_open( &dir
, "maps" );
299 while( dir
.has_next
){
301 tinydir_readfile( &dir
, &file
);
304 struct menu_map_file
*mf
= &game_menu
.maps_list
[ game_menu
.map_count
];
306 vg_strncpy( file
.name
, mf
->name
,
307 vg_list_size(game_menu
.maps_list
[0].name
),
308 k_strncpy_always_add_null
);
310 game_menu
.map_count
++;
311 if( game_menu
.map_count
== vg_list_size(game_menu
.maps_list
) )
315 tinydir_next( &dir
);
321 VG_STATIC
void menu_crap_ui(void)
324 if( cl_menu
&& (game_menu
.page
== k_menu_page_map
) ){
326 box
[0] = vg
.window_x
/2 - 150;
327 box
[1] = vg
.window_y
/2 - 300;
331 ui_fill_rect( box
, 0xa0000000 );
333 if( game_menu
.map_count
== 0 ){
334 ui_text( (ui_rect
){ vg
.window_x
/2, box
[1]+8, 0,0 }, "No maps found", 1,
335 k_text_align_center
);
338 ui_rect_pad( box
, 4 );
341 for( int i
=0; i
<game_menu
.map_count
; i
++ ){
342 struct menu_map_file
*mf
= &game_menu
.maps_list
[ i
];
344 ui_fill_rect( box
, game_menu
.selected_map
== i
? 0xa0ffffff:
346 ui_text( (ui_rect
){ vg
.window_x
/2, box
[1]+2, 0,0 },
347 mf
->name
, 1, k_text_align_center
);
355 VG_STATIC
void steam_on_game_overlay( CallbackMsg_t
*msg
)
357 GameOverlayActivated_t
*inf
= (GameOverlayActivated_t
*)msg
->m_pubParam
;
358 vg_info( "Steam game overlay activated; pausing\n" );
360 if( inf
->m_bActive
){
362 game_menu
.page
= k_menu_page_main
;
363 game_menu
.loc
= menu_get_loc( "text_skater" );
367 VG_STATIC
void menu_init(void)
370 vg_apply_bind_str( &input_menu_h
, "", "gp-ls-h" );
371 vg_apply_bind_str( &input_menu_h
, "+", "right" );
372 vg_apply_bind_str( &input_menu_h
, "-", "left" );
373 vg_apply_bind_str( &input_menu_v
, "", "-gp-ls-v" );
374 vg_apply_bind_str( &input_menu_v
, "+", "up" );
375 vg_apply_bind_str( &input_menu_v
, "-", "down" );
376 vg_apply_bind_str( &input_menu_press
, "", "gp-a" );
377 vg_apply_bind_str( &input_menu_press
, "", "\2enter" );
378 vg_apply_bind_str( &input_menu_back
, "", "gp-b" );
379 vg_apply_bind_str( &input_menu_back
, "", "\2escape" );
380 vg_apply_bind_str( &input_menu_toggle_kbm
, "", "\2escape" );
381 vg_apply_bind_str( &input_menu_toggle
, "", "\2gp-menu" );
384 vg_linear_clear( vg_mem
.scratch
);
386 mdl_open( &menu_model
, "models/rs_menu.mdl", vg_mem
.rtmemory
);
387 mdl_load_metadata_block( &menu_model
, vg_mem
.rtmemory
);
388 mdl_load_array( &menu_model
, &menu_markers
, "ent_marker", vg_mem
.rtmemory
);
389 //mdl_invert_uv_coordinates( &menu_model );
390 mdl_async_load_glmesh( &menu_model
, &menu_glmesh
);
391 mdl_close( &menu_model
);
393 vg_tex2d_load_qoi_async_file( "textures/menu.qoi",
394 VG_TEX2D_CLAMP
|VG_TEX2D_NEAREST
,
398 for( int i
=0; i
<vg_list_size(menu_buttons
); i
++ ){
399 struct menu_button
*btn
= &menu_buttons
[i
];
400 btn
->mesh
= mdl_find_mesh( &menu_model
, btn
->name
);
403 vg_info( "info: %s\n", btn
->name
);
404 vg_fatal_error( "Menu programming error" );
409 ent_find_marker( &menu_model
, &menu_markers
, "fov_slider_max" );
411 ent_find_marker( &menu_model
, &menu_markers
, "fov_slider_min" );
413 ent_find_marker( &menu_model
, &menu_markers
, "vol_slider_max" );
415 ent_find_marker( &menu_model
, &menu_markers
, "vol_slider_min" );
417 ent_find_marker( &menu_model
, &menu_markers
, "res_slider_max" );
419 ent_find_marker( &menu_model
, &menu_markers
, "res_slider_min" );
421 menu_mesh_fov_slider
= mdl_find_mesh( &menu_model
, "fov_slider" );
422 menu_mesh_vol_slider
= mdl_find_mesh( &menu_model
, "vol_slider" );
423 menu_mesh_res_slider
= mdl_find_mesh( &menu_model
, "res_slider" );
425 shader_model_menu_register();
428 steam_register_callback( k_iGameOverlayActivated
, steam_on_game_overlay
);
432 VG_STATIC
void menu_run_directional(void)
435 struct menu_button
*btn
= &menu_buttons
[ game_menu
.loc
];
437 if( vg_input_button_down( &input_menu_press
) ){
440 audio_oneshot( &audio_ui
[0], 1.0f
, 0.0f
);
448 if( menu_input_cooldown
<= 0.0f
){
449 v2f dir
= { input_menu_h
.axis
.value
,
450 -input_menu_v
.axis
.value
};
452 if( v2_length2( dir
) > 0.8f
*0.8f
){
453 const char *link
= NULL
;
455 if( fabsf(dir
[0]) > fabsf(dir
[1]) ){
456 if( dir
[0] > 0.0f
) link
= btn
->lr
;
460 if( dir
[1] > 0.0f
) link
= btn
->ld
;
465 game_menu
.loc
= menu_get_loc( link
);
466 menu_input_cooldown
= 0.25f
;
473 VG_STATIC
int menu_page_should_backout(void)
477 return vg_input_button_down( &input_menu_back
);
481 VG_STATIC
void menu_close(void)
485 game_menu
.loc
= menu_get_loc( "text_skater" );
488 VG_STATIC
void menu_page_main(void)
490 if( menu_page_should_backout() )
496 menu_fov_target
= 112.0f
;
497 menu_run_directional();
500 VG_STATIC
void menu_page_map(void)
502 if( menu_page_should_backout() ){
503 game_menu
.page
= k_menu_page_main
;
504 game_menu
.loc
= menu_get_loc( "text_map" );
507 if( game_menu
.map_count
> 0 ){
509 float v
= input_menu_v
.axis
.value
;
510 if( (fabsf(v
) > 0.7f
) && (menu_input_cooldown
<= 0.0f
) ){
512 audio_oneshot( &audio_rewind
[4], 1.0f
, 0.0f
);
516 game_menu
.selected_map
--;
518 if( game_menu
.selected_map
< 0 )
519 game_menu
.selected_map
= game_menu
.map_count
-1;
521 menu_input_cooldown
= 0.25f
;
524 game_menu
.selected_map
++;
526 if( game_menu
.selected_map
>= game_menu
.map_count
)
527 game_menu
.selected_map
= 0;
529 menu_input_cooldown
= 0.25f
;
533 if( vg_input_button_down( &input_menu_press
) ){
537 strcpy( temp
, "maps/" );
538 strcat( temp
, game_menu
.maps_list
[game_menu
.selected_map
].name
);
540 world_change_world( 1, (const char *[]){ temp
} );
547 menu_fov_target
= 80.0f
;
550 VG_STATIC
void menu_page_quit(void)
552 if( menu_page_should_backout() ){
553 game_menu
.page
= k_menu_page_main
;
554 game_menu
.loc
= menu_get_loc( "text_quit" );
557 menu_fov_target
= 90.0f
;
558 menu_run_directional();
561 void temp_update_playermodel(void);
562 VG_STATIC
void menu_page_skater(void)
565 float h
= input_menu_h
.axis
.value
;
566 menu_fov_target
= 97.0f
;
568 if( menu_page_should_backout() ){
569 game_menu
.page
= k_menu_page_main
;
570 game_menu
.loc
= menu_get_loc( "text_skater" );
574 if( (fabsf(h
) > 0.7f
) && (menu_input_cooldown
<= 0.0f
) ){
576 audio_oneshot( &audio_rewind
[4], 1.0f
, 0.0f
);
579 vg_info( "%f\n", h
);
583 if( cl_playermdl_id
< 0 )
586 int li
= menu_get_loc( "skater_left" );
588 menu_buttons
[li
].fsize
= 0.4f
;
589 menu_buttons
[li
].falpha
= 1.0f
;
591 menu_input_cooldown
= 0.25f
;
595 if( cl_playermdl_id
> 2 )
598 int ri
= menu_get_loc( "skater_right" );
600 menu_buttons
[ri
].fsize
= 0.4f
;
601 menu_buttons
[ri
].falpha
= 1.0f
;
603 menu_input_cooldown
= 0.25f
;
606 temp_update_playermodel();
611 VG_STATIC
void menu_slider( float *value
, int set_value
,
612 mdl_mesh
*slider
, v3f co_min
, v3f co_max
)
616 float h
= input_menu_h
.axis
.value
;
617 if( fabsf(h
) > 0.04f
)
618 *value
+= h
* vg
.time_frame_delta
;
619 *value
= vg_clampf( *value
, 0.0f
, 1.0f
);
622 v3_lerp( co_min
, co_max
, *value
, slider
->transform
.co
);
626 VG_STATIC
void menu_page_settings(void)
628 menu_run_directional();
630 int fov_select
= game_menu
.loc
== menu_get_loc( "fov_slider" );
631 menu_slider( &cl_fov
, fov_select
,
632 menu_mesh_fov_slider
, menu_mark_fov_min
->transform
.co
,
633 menu_mark_fov_max
->transform
.co
);
636 menu_fov_target
= vg_lerpf( 97.0f
, 135.0f
, cl_fov
) * 0.8f
;
638 menu_slider( &vg_audio
.external_global_volume
,
639 (game_menu
.loc
== menu_get_loc( "vol_slider" )),
640 menu_mesh_vol_slider
, menu_mark_vol_min
->transform
.co
,
641 menu_mark_vol_max
->transform
.co
);
643 menu_slider( &gpipeline
.view_render_scale
,
644 (game_menu
.loc
== menu_get_loc( "res_slider" )),
645 menu_mesh_res_slider
, menu_mark_res_min
->transform
.co
,
646 menu_mark_res_max
->transform
.co
);
648 if( menu_page_should_backout() ){
649 game_menu
.page
= k_menu_page_main
;
650 game_menu
.loc
= menu_get_loc( "text_settings" );
655 VG_STATIC
void menu_update(void)
658 vg_input_update( 1, &input_menu_h
);
659 vg_input_update( 1, &input_menu_v
);
660 vg_input_update( 1, &input_menu_back
);
661 vg_input_update( 1, &input_menu_press
);
662 vg_input_update( 1, &input_menu_toggle
);
663 vg_input_update( 1, &input_menu_toggle_kbm
);
669 int toggle_gp
= vg_input_button_down( &input_menu_toggle
),
670 toggle_kb
= vg_input_button_down( &input_menu_toggle_kbm
),
673 if( toggle_gp
|| toggle_kb
){
688 if( !wait_for_a_sec
&& cl_menu
){
689 if( game_menu
.page
== k_menu_page_main
)
691 else if( game_menu
.page
== k_menu_page_skater
)
693 else if( game_menu
.page
== k_menu_page_quit
)
695 else if( game_menu
.page
== k_menu_page_settings
)
696 menu_page_settings();
697 else if( game_menu
.page
== k_menu_page_map
)
701 struct menu_button
*btn
= &menu_buttons
[ game_menu
.loc
];
705 player_instance
*player
= &localplayer
;
706 struct player_avatar
*av
= player
->playeravatar
;
709 if( player
->subsystem
== k_player_subsystem_dead
){
710 m4x3_mulv( av
->sk
.final_mtx
[av
->id_hip
], (v3f
){0.0f
,0.9f
,0.0f
},
714 m4x3_mulv( av
->sk
.final_mtx
[av
->id_head
], (v3f
){0.0f
,1.5f
,0.0f
},
720 if( player
->subsystem
== k_player_subsystem_walk
){
721 v3_muls( player
->rb
.to_world
[2], 1.0f
, cam_offset
);
725 v3_muls( player
->rb
.to_world
[0], -1.0f
, cam_offset
);
726 cam_rot
= -VG_PIf
*0.5f
;
731 m3x3_mulv( player
->invbasis
, cam_offset
, lookdir
);
733 v3_normalize( lookdir
);
735 m3x3_mulv( player
->basis
, lookdir
, cam_offset
);
736 v3_muladds( center_rough
, cam_offset
, 2.0f
, menu_camera_pos
);
738 menu_camera_angles
[1] = 0.0f
;
739 menu_camera_angles
[0] = -atan2f( lookdir
[0], lookdir
[2] );
741 /* setup model matrix */
743 q_axis_angle( qmenu_mdl
, (v3f
){0.0f
,1.0f
,0.0f
}, -menu_camera_angles
[0] );
744 q_m3x3( qmenu_mdl
, menu_mdl_mtx
);
745 v3_add( center_rough
, (v3f
){0.0f
,-0.5f
,0.0f
}, menu_mdl_mtx
[3] );
746 m3x3_mul( player
->basis
, menu_mdl_mtx
, menu_mdl_mtx
);
748 menu_smooth_fov
= vg_lerpf( menu_smooth_fov
, menu_fov_target
,
749 vg
.time_frame_delta
* 8.2f
);
755 v3_sub( btn
->mesh
->transform
.co
, (v3f
){ 0.0f
,1.5f
,-1.5f
}, delta
);
756 v3_normalize( delta
);
758 float y
= atan2f( delta
[0], delta
[2] ),
760 dt
= vg
.time_frame_delta
;
762 menu_extra_angles
[0] = vg_lerpf( menu_extra_angles
[0], y
, dt
);
763 menu_extra_angles
[1] = vg_lerpf( menu_extra_angles
[1], p
, dt
);
765 v2_muladds( menu_camera_angles
, menu_extra_angles
, 0.8f
,
766 menu_camera_angles
);
767 menu_camera_angles
[0] = fmodf( menu_camera_angles
[0], VG_TAUf
);
770 float dt
= vg
.time_frame_delta
* 6.0f
;
771 menu_opacity
= vg_lerpf( menu_opacity
, cl_menu
&&!cl_menu_go_away
, dt
);
773 if( menu_opacity
<= 0.01f
){
778 vg
.time_rate
= 1.0-(double)menu_opacity
;
781 menu_input_cooldown
-= vg
.time_frame_delta
;
786 /* https://iquilezles.org/articles/functions/ */
787 float expSustainedImpulse( float x
, float f
, float k
)
789 float s
= fmaxf(x
-f
,0.0f
);
790 return fminf( x
*x
/(f
*f
), 1.0f
+(2.0f
/f
)*s
*expf(-k
*s
));
793 VG_STATIC
void menu_render_bg(void)
796 glDisable(GL_DEPTH_TEST
);
797 glBlendFunc( GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
);
798 glBlendEquation(GL_FUNC_ADD
);
800 shader_blitcolour_use();
801 shader_blitcolour_uColour( (v4f
){ 0.1f
, 0.1f
, 0.3f
, menu_opacity
*0.5f
} );
805 VG_STATIC
void menu_render_fg( camera
*cam
)
807 glEnable( GL_DEPTH_TEST
);
808 glDisable( GL_BLEND
);
812 shader_model_menu_use();
813 shader_model_menu_uColour( (v4f
){ 1.0f
,1.0f
,1.0f
,1.0f
} );
814 shader_model_menu_uTexMain( 1 );
816 glActiveTexture( GL_TEXTURE1
);
817 glBindTexture( GL_TEXTURE_2D
, tex_menu
);
819 shader_model_menu_uPv( cam
->mtx
.pv
);
820 shader_model_menu_uPvmPrev( cam
->mtx_prev
.pv
);
821 mesh_bind( &menu_glmesh
);
823 for( int i
=0; i
<vg_list_size(menu_buttons
); i
++ ){
824 struct menu_button
*btn
= &menu_buttons
[i
];
825 float talpha
= i
==game_menu
.loc
? 1.0f
: 0.0f
,
826 tsize0
= btn
->fn_visibility( btn
->user
)? 1.0f
: 0.0f
,
827 tsize1
= i
==game_menu
.loc
? 0.07f
: 0.0f
,
828 tsize
= tsize0
+tsize1
;
830 btn
->falpha
= vg_lerpf( btn
->falpha
, talpha
, vg
.time_frame_delta
* 14.0f
);
831 btn
->fsize
= vg_lerpf( btn
->fsize
, tsize
, vg
.time_frame_delta
* 7.0f
);
834 v4f vselected
= {0.95f
*1.3f
,0.45f
*1.3f
,0.095f
*1.3f
, 1.0f
},
835 vnormal
= {1.0f
,1.0f
,1.0f
, 1.0f
},
838 v4_lerp( vnormal
, vselected
, btn
->falpha
, vcurrent
);
839 shader_model_menu_uColour( vcurrent
);
843 mdl_transform_m4x3( &btn
->mesh
->transform
, mtx
);
844 m4x3_mul( menu_mdl_mtx
, mtx
, mtx
);
845 m4x3_identity( mtx_size
);
846 m3x3_scalef( mtx_size
, expSustainedImpulse( btn
->fsize
, 0.5f
, 8.7f
) );
847 m4x3_mul( mtx
, mtx_size
, mtx
);
848 shader_model_menu_uMdl( mtx
);
850 for( int j
=0; j
<btn
->mesh
->submesh_count
; j
++ ){
852 mdl_arritm( &menu_model
.submeshs
, btn
->mesh
->submesh_start
+j
);
853 mdl_draw_submesh( sm
);
858 for( int i=0; i<menu_model->node_count; i++ )
860 mdl_node *pnode = mdl_node_from_id( menu_model, i );
862 for( int j=0; j<pnode->submesh_count; j++ )
865 mdl_submesh_from_id( menu_model, pnode->submesh_start+j );
867 mdl_node_transform( pnode, mtx );
868 m4x3_mul( menu_mdl_mtx, mtx, mtx );
869 shader_menu_uMdl( mtx );
871 mdl_draw_submesh( sm );