6 #include "world_render.h"
10 #include "shaders/model_menu.h"
11 #include "vg_steam_friends.h"
12 #include "submodules/tinydir/tinydir.h"
14 VG_STATIC mdl_context menu_model
;
15 VG_STATIC mdl_array_ptr menu_markers
;
16 VG_STATIC glmesh menu_glmesh
;
17 VG_STATIC m4x3f menu_mdl_mtx
;
18 VG_STATIC
float menu_opacity
= 0.0f
;
19 VG_STATIC
float menu_input_cooldown
= 0.0f
;
20 VG_STATIC
float menu_fov_target
= 97.0f
,
21 menu_smooth_fov
= 97.0f
;
22 VG_STATIC v2f menu_extra_angles
;
23 VG_STATIC v3f menu_camera_pos
;
24 VG_STATIC v2f menu_camera_angles
;
26 VG_STATIC
int cl_menu
= 0,
29 VG_STATIC
int menu_enabled(void){ return cl_menu
; }
31 VG_STATIC
const char *playermodels
[] = { "ch_new", "ch_jordan", "ch_outlaw" };
33 vg_tex2d tex_menu
= { .path
= "textures/menu.qoi",.flags
= VG_TEXTURE_NEAREST
};
35 VG_STATIC
struct input_binding input_menu_h
,
40 input_menu_toggle_kbm
;
42 VG_STATIC
void menu_btn_quit( int event
);
43 VG_STATIC
void menu_btn_skater( int event
);
44 VG_STATIC
void menu_btn_blur( int event
);
45 VG_STATIC
void menu_btn_fuckoff( int event
);
46 VG_STATIC
void menu_btn_reset( int event
);
47 VG_STATIC
void menu_btn_map( int event
);
48 VG_STATIC
void menu_btn_settings( int event
);
49 VG_STATIC
void menu_btn_invert_y( int event
);
51 VG_STATIC mdl_mesh
*menu_mesh_fov_slider
,
52 *menu_mesh_vol_slider
;
77 k_menu_page_main
= 0x1,
78 k_menu_page_skater
= 0x2,
79 k_menu_page_quit
= 0x4,
80 k_menu_page_settings
= 0x8,
81 k_menu_page_map
= 0x10
84 struct menu_btn_userdata
{
89 VG_STATIC
int menu_settings_if( struct menu_btn_userdata ud
)
91 if( game_menu
.page
& k_menu_page_settings
){
92 int *ptr
= ud
.ptr_generic
;
99 VG_STATIC
int menu_vis( struct menu_btn_userdata ud
)
101 if( ud
.i
& game_menu
.page
)
107 VG_STATIC
int menu_controller( struct menu_btn_userdata ud
)
109 if( (game_menu
.page
& (k_menu_page_main
|k_menu_page_settings
))
110 && (ud
.i
== menu_display_controller
) )
115 VG_STATIC
int menu_controller_inf( struct menu_btn_userdata ud
)
117 if( (game_menu
.page
& k_menu_page_settings
)
118 && (ud
.i
== menu_display_controller
) )
127 int (*fn_visibility
)( struct menu_btn_userdata ud
);
128 struct menu_btn_userdata user
;
130 void (*fn_press
)( int event
);
140 VG_STATIC menu_buttons
[] =
143 "text_quit", menu_vis
, {.i
=k_menu_page_main
|k_menu_page_quit
},
144 .fn_press
= menu_btn_quit
,
145 .ld
="text_reset", .lr
="text_settings", /*.ll="text_map"*/
148 "text_quitty", menu_vis
, {.i
=k_menu_page_quit
}
151 "text_yes", menu_vis
, {.i
=k_menu_page_quit
},
152 .fn_press
= menu_btn_fuckoff
155 "text_reset", menu_vis
, {.i
=k_menu_page_main
},
156 .fn_press
= menu_btn_reset
,
157 .lu
="text_quit", .ld
="text_skater", /*.ll="text_map",*/ .lr
="text_settings"
160 "text_skater", menu_vis
, {.i
=k_menu_page_main
|k_menu_page_skater
},
161 .fn_press
= menu_btn_skater
,
162 .lu
="text_reset", /*.ll="text_map",*/ .lr
="text_settings"
166 "text_map", menu_vis, {.i=k_menu_page_main},
167 .fn_press = menu_btn_map,
172 "text_settings", menu_vis
, {.i
=k_menu_page_main
|k_menu_page_settings
},
173 .fn_press
= menu_btn_settings
,
177 "skater_left", menu_vis
, {k_menu_page_skater
}
180 "skater_right", menu_vis
, {k_menu_page_skater
}
184 "fov_slider", menu_vis
, {k_menu_page_settings
},
187 { "fov_info", menu_vis
, {k_menu_page_settings
} },
190 "vol_slider", menu_vis
, {k_menu_page_settings
},
193 { "vol_info", menu_vis
, {k_menu_page_settings
} },
196 "text_invert_y", menu_vis
, {k_menu_page_settings
},
197 .fn_press
= menu_btn_invert_y
,
198 .lu
= "fov_slider", .ld
="text_blur"
201 "text_invert_y_check", menu_settings_if
, {.ptr_generic
=&cl_invert_y
}
204 "text_blur", menu_vis
, {k_menu_page_settings
},
205 .fn_press
= menu_btn_blur
,
206 .lu
="text_invert_y", .ld
="vol_slider"
209 "text_blur_check", menu_settings_if
, {.ptr_generic
=&cl_blur
}
212 { "ctr_xbox", menu_controller_inf
, {k_menu_controller_type_xbox
}},
213 { "ctr_xbox_text", menu_controller_inf
, {k_menu_controller_type_xbox
}},
214 { "ctr_steam", menu_controller_inf
, {k_menu_controller_type_steam
}},
215 { "ctr_steam_text", menu_controller_inf
, {k_menu_controller_type_steam
}},
216 { "ctr_deck", menu_controller_inf
, {k_menu_controller_type_steam_deck
}},
217 { "ctr_deck_text", menu_controller_inf
, {k_menu_controller_type_steam_deck
}},
218 { "ctr_ps", menu_controller_inf
, {k_menu_controller_type_playstation
}},
219 { "ctr_ps_text", menu_controller_inf
, {k_menu_controller_type_playstation
}},
220 { "ctr_kbm", menu_controller_inf
, {k_menu_controller_type_keyboard
}},
221 { "ctr_kbm_text", menu_controller_inf
, {k_menu_controller_type_keyboard
}},
223 "text_paused", menu_vis
, {k_menu_page_main
}
227 VG_STATIC
int menu_get_loc( const char *loc
)
229 for( int i
=0; i
<vg_list_size(menu_buttons
); i
++ )
230 if( !strcmp( menu_buttons
[i
].name
, loc
) )
237 VG_STATIC
int __respawn( int argc
, const char *argv
[] );
238 VG_STATIC
void menu_btn_reset( int event
)
245 VG_STATIC
void menu_btn_fuckoff( int event
)
247 vg
.window_should_close
= 1;
250 VG_STATIC
void menu_btn_quit( int event
)
252 game_menu
.page
= k_menu_page_quit
;
253 game_menu
.loc
= menu_get_loc( "text_yes" );
256 VG_STATIC
void menu_btn_settings( int event
)
258 game_menu
.page
= k_menu_page_settings
;
259 game_menu
.loc
= menu_get_loc( "fov_slider" );
262 VG_STATIC
void menu_btn_skater( int event
)
264 game_menu
.page
= k_menu_page_skater
;
267 VG_STATIC
void menu_btn_blur( int event
)
272 VG_STATIC
void menu_btn_invert_y( int event
)
277 VG_STATIC
void menu_btn_map( int event
)
279 game_menu
.page
= k_menu_page_map
;
280 game_menu
.map_count
= 0;
281 game_menu
.selected_map
= 0;
284 tinydir_open( &dir
, "maps" );
286 while( dir
.has_next
){
288 tinydir_readfile( &dir
, &file
);
291 struct menu_map_file
*mf
= &game_menu
.maps_list
[ game_menu
.map_count
];
293 vg_strncpy( file
.name
, mf
->name
,
294 vg_list_size(game_menu
.maps_list
[0].name
)-1 );
296 game_menu
.map_count
++;
297 if( game_menu
.map_count
== vg_list_size(game_menu
.maps_list
) )
301 tinydir_next( &dir
);
307 VG_STATIC
void menu_crap_ui(void)
309 if( cl_menu
&& (game_menu
.page
== k_menu_page_map
) ){
311 box
[0] = vg
.window_x
/2 - 150;
312 box
[1] = vg
.window_y
/2 - 300;
316 ui_fill_rect( box
, 0xa0000000 );
318 if( game_menu
.map_count
== 0 ){
319 ui_text( (ui_rect
){ vg
.window_x
/2, box
[1]+8, 0,0 }, "No maps found", 1,
320 k_text_align_center
);
323 ui_rect_pad( box
, 4 );
326 for( int i
=0; i
<game_menu
.map_count
; i
++ ){
327 struct menu_map_file
*mf
= &game_menu
.maps_list
[ i
];
329 ui_fill_rect( box
, game_menu
.selected_map
== i
? 0xa0ffffff:
331 ui_text( (ui_rect
){ vg
.window_x
/2, box
[1]+2, 0,0 },
332 mf
->name
, 1, k_text_align_center
);
339 VG_STATIC
void steam_on_game_overlay( CallbackMsg_t
*msg
)
341 GameOverlayActivated_t
*inf
= (GameOverlayActivated_t
*)msg
->m_pubParam
;
342 vg_info( "Steam game overlay activated; pausing\n" );
344 if( inf
->m_bActive
){
346 game_menu
.page
= k_menu_page_main
;
347 game_menu
.loc
= menu_get_loc( "text_skater" );
351 VG_STATIC
void menu_init(void)
353 vg_create_unnamed_input( &input_menu_h
, k_input_type_axis
);
354 vg_create_unnamed_input( &input_menu_v
, k_input_type_axis
);
355 vg_create_unnamed_input( &input_menu_back
, k_input_type_button
);
356 vg_create_unnamed_input( &input_menu_press
, k_input_type_button
);
357 vg_create_unnamed_input( &input_menu_toggle
, k_input_type_button
);
358 vg_create_unnamed_input( &input_menu_toggle_kbm
, k_input_type_button
);
360 vg_apply_bind_str( &input_menu_h
, "", "gp-ls-h" );
361 vg_apply_bind_str( &input_menu_h
, "+", "right" );
362 vg_apply_bind_str( &input_menu_h
, "-", "left" );
363 vg_apply_bind_str( &input_menu_v
, "", "-gp-ls-v" );
364 vg_apply_bind_str( &input_menu_v
, "+", "up" );
365 vg_apply_bind_str( &input_menu_v
, "-", "down" );
366 vg_apply_bind_str( &input_menu_press
, "", "gp-a" );
367 vg_apply_bind_str( &input_menu_press
, "", "\2enter" );
368 vg_apply_bind_str( &input_menu_back
, "", "gp-b" );
369 vg_apply_bind_str( &input_menu_back
, "", "\2escape" );
370 vg_apply_bind_str( &input_menu_toggle_kbm
, "", "\2escape" );
371 vg_apply_bind_str( &input_menu_toggle
, "", "\2gp-menu" );
373 vg_linear_clear( vg_mem
.scratch
);
375 mdl_open( &menu_model
, "models/rs_menu.mdl", vg_mem
.rtmemory
);
376 mdl_load_metadata_block( &menu_model
, vg_mem
.rtmemory
);
377 mdl_load_mesh_block( &menu_model
, vg_mem
.scratch
);
378 mdl_load_array( &menu_model
, &menu_markers
, "ent_marker", vg_mem
.rtmemory
);
379 //mdl_invert_uv_coordinates( &menu_model );
380 mdl_close( &menu_model
);
382 vg_acquire_thread_sync();
384 mdl_unpack_glmesh( &menu_model
, &menu_glmesh
);
385 vg_tex2d_init( (vg_tex2d
*[]){ &tex_menu
}, 1 );
387 vg_release_thread_sync();
389 for( int i
=0; i
<vg_list_size(menu_buttons
); i
++ ){
390 struct menu_button
*btn
= &menu_buttons
[i
];
391 btn
->mesh
= mdl_find_mesh( &menu_model
, btn
->name
);
394 vg_info( "info: %s\n", btn
->name
);
395 vg_fatal_exit_loop( "Menu programming error" );
400 ent_find_marker( &menu_model
, &menu_markers
, "fov_slider_max" );
402 ent_find_marker( &menu_model
, &menu_markers
, "fov_slider_min" );
404 ent_find_marker( &menu_model
, &menu_markers
, "vol_slider_max" );
406 ent_find_marker( &menu_model
, &menu_markers
, "vol_slider_min" );
408 menu_mesh_fov_slider
= mdl_find_mesh( &menu_model
, "fov_slider" );
409 menu_mesh_vol_slider
= mdl_find_mesh( &menu_model
, "vol_slider" );
411 shader_model_menu_register();
414 steam_register_callback( k_iGameOverlayActivated
, steam_on_game_overlay
);
418 VG_STATIC
void menu_run_directional(void)
420 struct menu_button
*btn
= &menu_buttons
[ game_menu
.loc
];
422 if( vg_input_button_down( &input_menu_press
) ){
425 audio_oneshot( &audio_ui
[0], 1.0f
, 0.0f
);
433 if( menu_input_cooldown
<= 0.0f
){
434 v2f dir
= { input_menu_h
.axis
.value
,
435 -input_menu_v
.axis
.value
};
437 if( v2_length2( dir
) > 0.8f
*0.8f
){
438 const char *link
= NULL
;
440 if( fabsf(dir
[0]) > fabsf(dir
[1]) ){
441 if( dir
[0] > 0.0f
) link
= btn
->lr
;
445 if( dir
[1] > 0.0f
) link
= btn
->ld
;
450 game_menu
.loc
= menu_get_loc( link
);
451 menu_input_cooldown
= 0.25f
;
457 VG_STATIC
int menu_page_should_backout(void)
459 return vg_input_button_down( &input_menu_back
);
462 VG_STATIC
void menu_close(void)
466 game_menu
.loc
= menu_get_loc( "text_skater" );
469 VG_STATIC
void menu_page_main(void)
471 if( menu_page_should_backout() )
477 menu_fov_target
= 112.0f
;
478 menu_run_directional();
481 VG_STATIC
void menu_page_map(void)
483 if( menu_page_should_backout() ){
484 game_menu
.page
= k_menu_page_main
;
485 game_menu
.loc
= menu_get_loc( "text_map" );
488 if( game_menu
.map_count
> 0 ){
489 float v
= input_menu_v
.axis
.value
;
490 if( (fabsf(v
) > 0.7f
) && (menu_input_cooldown
<= 0.0f
) ){
492 audio_oneshot( &audio_rewind
[4], 1.0f
, 0.0f
);
496 game_menu
.selected_map
--;
498 if( game_menu
.selected_map
< 0 )
499 game_menu
.selected_map
= game_menu
.map_count
-1;
501 menu_input_cooldown
= 0.25f
;
504 game_menu
.selected_map
++;
506 if( game_menu
.selected_map
>= game_menu
.map_count
)
507 game_menu
.selected_map
= 0;
509 menu_input_cooldown
= 0.25f
;
513 if( vg_input_button_down( &input_menu_press
) ){
517 strcpy( temp
, "maps/" );
518 strcat( temp
, game_menu
.maps_list
[game_menu
.selected_map
].name
);
520 world_change_world( 1, (const char *[]){ temp
} );
526 menu_fov_target
= 80.0f
;
529 VG_STATIC
void menu_page_quit(void)
531 if( menu_page_should_backout() ){
532 game_menu
.page
= k_menu_page_main
;
533 game_menu
.loc
= menu_get_loc( "text_quit" );
536 menu_fov_target
= 90.0f
;
537 menu_run_directional();
540 void temp_update_playermodel(void);
541 VG_STATIC
void menu_page_skater(void)
543 float h
= input_menu_h
.axis
.value
;
544 menu_fov_target
= 97.0f
;
546 if( menu_page_should_backout() ){
547 game_menu
.page
= k_menu_page_main
;
548 game_menu
.loc
= menu_get_loc( "text_skater" );
552 if( (fabsf(h
) > 0.7f
) && (menu_input_cooldown
<= 0.0f
) ){
554 audio_oneshot( &audio_rewind
[4], 1.0f
, 0.0f
);
557 vg_info( "%f\n", h
);
561 if( cl_playermdl_id
< 0 )
564 int li
= menu_get_loc( "skater_left" );
566 menu_buttons
[li
].fsize
= 0.4f
;
567 menu_buttons
[li
].falpha
= 1.0f
;
569 menu_input_cooldown
= 0.25f
;
573 if( cl_playermdl_id
> 2 )
576 int ri
= menu_get_loc( "skater_right" );
578 menu_buttons
[ri
].fsize
= 0.4f
;
579 menu_buttons
[ri
].falpha
= 1.0f
;
581 menu_input_cooldown
= 0.25f
;
584 temp_update_playermodel();
588 VG_STATIC
void menu_slider( float *value
, int set_value
,
589 mdl_mesh
*slider
, v3f co_min
, v3f co_max
)
592 float h
= input_menu_h
.axis
.value
;
593 if( fabsf(h
) > 0.04f
)
594 *value
+= h
* vg
.frame_delta
;
595 *value
= vg_clampf( *value
, 0.0f
, 1.0f
);
598 v3_lerp( co_min
, co_max
, *value
, slider
->transform
.co
);
601 VG_STATIC
void menu_page_settings(void)
603 menu_run_directional();
605 int fov_select
= game_menu
.loc
== menu_get_loc( "fov_slider" );
606 menu_slider( &cl_fov
, fov_select
,
607 menu_mesh_fov_slider
, menu_mark_fov_min
->transform
.co
,
608 menu_mark_fov_max
->transform
.co
);
611 menu_fov_target
= vg_lerpf( 97.0f
, 135.0f
, cl_fov
) * 0.8f
;
613 menu_slider( &vg_audio
.external_global_volume
,
614 (game_menu
.loc
== menu_get_loc( "vol_slider" )),
615 menu_mesh_vol_slider
, menu_mark_vol_min
->transform
.co
,
616 menu_mark_vol_max
->transform
.co
);
618 if( menu_page_should_backout() ){
619 game_menu
.page
= k_menu_page_main
;
620 game_menu
.loc
= menu_get_loc( "text_settings" );
625 player_instance
*tmp_localplayer(void);
627 VG_STATIC
void menu_update(void)
629 vg_input_update( 1, &input_menu_h
);
630 vg_input_update( 1, &input_menu_v
);
631 vg_input_update( 1, &input_menu_back
);
632 vg_input_update( 1, &input_menu_press
);
633 vg_input_update( 1, &input_menu_toggle
);
634 vg_input_update( 1, &input_menu_toggle_kbm
);
636 int toggle_gp
= vg_input_button_down( &input_menu_toggle
),
637 toggle_kb
= vg_input_button_down( &input_menu_toggle_kbm
),
640 if( toggle_gp
|| toggle_kb
){
655 if( !wait_for_a_sec
&& cl_menu
){
656 if( game_menu
.page
== k_menu_page_main
)
658 else if( game_menu
.page
== k_menu_page_skater
)
660 else if( game_menu
.page
== k_menu_page_quit
)
662 else if( game_menu
.page
== k_menu_page_settings
)
663 menu_page_settings();
664 else if( game_menu
.page
== k_menu_page_map
)
668 struct menu_button
*btn
= &menu_buttons
[ game_menu
.loc
];
672 player_instance
*player
= tmp_localplayer();
673 struct player_avatar
*av
= player
->playeravatar
;
676 if( player
->subsystem
== k_player_subsystem_dead
){
677 m4x3_mulv( av
->sk
.final_mtx
[av
->id_hip
], (v3f
){0.0f
,0.9f
,0.0f
},
681 m4x3_mulv( av
->sk
.final_mtx
[av
->id_head
], (v3f
){0.0f
,1.5f
,0.0f
},
687 if( player
->subsystem
== k_player_subsystem_walk
){
688 v3_muls( player
->rb
.to_world
[2], 1.0f
, cam_offset
);
692 v3_muls( player
->rb
.to_world
[0], -1.0f
, cam_offset
);
693 cam_rot
= -VG_PIf
*0.5f
;
698 m3x3_mulv( player
->invbasis
, cam_offset
, lookdir
);
700 v3_normalize( lookdir
);
702 m3x3_mulv( player
->basis
, lookdir
, cam_offset
);
703 v3_muladds( center_rough
, cam_offset
, 2.0f
, menu_camera_pos
);
705 menu_camera_angles
[1] = 0.0f
;
706 menu_camera_angles
[0] = -atan2f( lookdir
[0], lookdir
[2] );
708 /* setup model matrix */
710 q_axis_angle( qmenu_mdl
, (v3f
){0.0f
,1.0f
,0.0f
}, -menu_camera_angles
[0] );
711 q_m3x3( qmenu_mdl
, menu_mdl_mtx
);
712 v3_add( center_rough
, (v3f
){0.0f
,-0.5f
,0.0f
}, menu_mdl_mtx
[3] );
713 m3x3_mul( player
->basis
, menu_mdl_mtx
, menu_mdl_mtx
);
715 menu_smooth_fov
= vg_lerpf( menu_smooth_fov
, menu_fov_target
,
716 vg
.frame_delta
* 8.2f
);
722 v3_sub( btn
->mesh
->transform
.co
, (v3f
){ 0.0f
,1.5f
,-1.5f
}, delta
);
723 v3_normalize( delta
);
725 float y
= atan2f( delta
[0], delta
[2] ),
729 menu_extra_angles
[0] = vg_lerpf( menu_extra_angles
[0], y
, dt
);
730 menu_extra_angles
[1] = vg_lerpf( menu_extra_angles
[1], p
, dt
);
732 v2_muladds( menu_camera_angles
, menu_extra_angles
, 0.8f
,
733 menu_camera_angles
);
734 menu_camera_angles
[0] = fmodf( menu_camera_angles
[0], VG_TAUf
);
737 float dt
= vg
.frame_delta
* 6.0f
;
738 menu_opacity
= vg_lerpf( menu_opacity
, cl_menu
&&!cl_menu_go_away
, dt
);
740 if( menu_opacity
<= 0.01f
){
745 vg
.time_rate
= 1.0-(double)menu_opacity
;
748 menu_input_cooldown
-= vg
.frame_delta
;
752 /* https://iquilezles.org/articles/functions/ */
753 float expSustainedImpulse( float x
, float f
, float k
)
755 float s
= fmaxf(x
-f
,0.0f
);
756 return fminf( x
*x
/(f
*f
), 1.0f
+(2.0f
/f
)*s
*expf(-k
*s
));
759 VG_STATIC
void menu_render_bg(void)
762 glDisable(GL_DEPTH_TEST
);
763 glBlendFunc( GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
);
764 glBlendEquation(GL_FUNC_ADD
);
766 shader_blitcolour_use();
767 shader_blitcolour_uColour( (v4f
){ 0.1f
, 0.1f
, 0.3f
, menu_opacity
*0.5f
} );
771 VG_STATIC
void menu_render_fg( camera
*cam
)
773 glEnable( GL_DEPTH_TEST
);
774 glDisable( GL_BLEND
);
778 shader_model_menu_use();
779 shader_model_menu_uColour( (v4f
){ 1.0f
,1.0f
,1.0f
,1.0f
} );
780 shader_model_menu_uTexMain( 1 );
781 vg_tex2d_bind( &tex_menu
, 1 );
783 shader_model_menu_uPv( cam
->mtx
.pv
);
784 shader_model_menu_uPvmPrev( cam
->mtx_prev
.pv
);
785 mesh_bind( &menu_glmesh
);
787 for( int i
=0; i
<vg_list_size(menu_buttons
); i
++ ){
788 struct menu_button
*btn
= &menu_buttons
[i
];
789 float talpha
= i
==game_menu
.loc
? 1.0f
: 0.0f
,
790 tsize0
= btn
->fn_visibility( btn
->user
)? 1.0f
: 0.0f
,
791 tsize1
= i
==game_menu
.loc
? 0.07f
: 0.0f
,
792 tsize
= tsize0
+tsize1
;
794 btn
->falpha
= vg_lerpf( btn
->falpha
, talpha
, vg
.frame_delta
* 14.0f
);
795 btn
->fsize
= vg_lerpf( btn
->fsize
, tsize
, vg
.frame_delta
* 7.0f
);
798 v4f vselected
= {0.95f
*1.3f
,0.45f
*1.3f
,0.095f
*1.3f
, 1.0f
},
799 vnormal
= {1.0f
,1.0f
,1.0f
, 1.0f
},
802 v4_lerp( vnormal
, vselected
, btn
->falpha
, vcurrent
);
803 shader_model_menu_uColour( vcurrent
);
807 mdl_transform_m4x3( &btn
->mesh
->transform
, mtx
);
808 m4x3_mul( menu_mdl_mtx
, mtx
, mtx
);
809 m4x3_identity( mtx_size
);
810 m4x3_scale( mtx_size
, expSustainedImpulse( btn
->fsize
, 0.5f
, 8.7f
) );
811 m4x3_mul( mtx
, mtx_size
, mtx
);
812 shader_model_menu_uMdl( mtx
);
814 for( int j
=0; j
<btn
->mesh
->submesh_count
; j
++ ){
816 mdl_arritm( &menu_model
.submeshs
, btn
->mesh
->submesh_start
+j
);
817 mdl_draw_submesh( sm
);
822 for( int i=0; i<menu_model->node_count; i++ )
824 mdl_node *pnode = mdl_node_from_id( menu_model, i );
826 for( int j=0; j<pnode->submesh_count; j++ )
829 mdl_submesh_from_id( menu_model, pnode->submesh_start+j );
831 mdl_node_transform( pnode, mtx );
832 m4x3_mul( menu_mdl_mtx, mtx, mtx );
833 shader_menu_uMdl( mtx );
835 mdl_draw_submesh( sm );