1 #include "control_overlay.h"
5 #include "player_skate.h"
6 #include "player_walk.h"
7 #include "shaders/model_menu.h"
8 #include "vg/vg_engine.h"
12 struct control_overlay control_overlay
= { .enabled
= 1 };
14 static void render_overlay_mesh( enum control_overlay_mesh index
)
16 mdl_draw_submesh( mdl_arritm( &control_overlay
.mdl
.submeshs
, index
) );
19 void control_overlay_init(void)
21 void *alloc
= vg_mem
.rtmemory
;
22 mdl_context
*mdl
= &control_overlay
.mdl
;
24 mdl_open( mdl
, "models/rs_overlay.mdl", alloc
);
25 mdl_load_metadata_block( mdl
, alloc
);
26 mdl_async_full_load_std( mdl
);
31 if( mdl_arrcount( &mdl
->textures
) )
33 mdl_texture
*tex
= mdl_arritm( &mdl
->textures
, 0 );
34 control_overlay
.tex
= tex
->glname
;
38 control_overlay
.tex
= vg
.tex_missing
;
39 vg_error( "No texture in control overlay\n" );
42 vg_console_reg_var( "control_overlay", &control_overlay
.enabled
,
43 k_var_dtype_i32
, VG_VAR_PERSISTENT
);
46 static void draw_key( bool press
, bool wide
)
48 if( wide
) render_overlay_mesh( press
? ov_shift_down
: ov_shift
);
49 else render_overlay_mesh( press
? ov_key_down
: ov_key
);
52 static void colorize( bool press
, bool condition
)
54 v4f cnorm
= { 1,1,1,0.76f
},
55 cdis
= { 1,1,1,0.35f
},
56 chit
= { 1,0.5f
,0.2f
,0.8f
};
60 shader_model_menu_uColour( chit
);
62 shader_model_menu_uColour( cnorm
);
64 shader_model_menu_uColour( cdis
);
67 void control_overlay_render(void)
69 if( !control_overlay
.enabled
) return;
70 if( skaterift
.activity
!= k_skaterift_default
) return;
73 glDisable(GL_DEPTH_TEST
);
74 glBlendFunc( GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
);
75 glBlendEquation(GL_FUNC_ADD
);
78 f32 r
= (f32
)vg
.window_x
/ (f32
)vg
.window_y
,
87 ortho
[0][0] = 2.0f
* rl
;
88 ortho
[2][1] = 2.0f
* tb
;
89 ortho
[3][0] = (fr
+ fl
) * -rl
;
90 ortho
[3][1] = (ft
+ fb
) * -tb
;
93 v4f cnorm
= { 1,1,1,0.76f
},
94 cdis
= { 1,1,1,0.35f
},
95 chit
= { 1,0.5f
,0.2f
,0.8f
};
97 shader_model_menu_use();
98 shader_model_menu_uTexMain( 1 );
99 shader_model_menu_uPv( ortho
);
100 shader_model_menu_uColour( cnorm
);
102 mdl_context
*mdl
= &control_overlay
.mdl
;
103 mesh_bind( &mdl
->mesh
);
104 glActiveTexture( GL_TEXTURE1
);
105 glBindTexture( GL_TEXTURE_2D
, control_overlay
.tex
);
107 enum player_subsystem subsytem
= localplayer
.subsystem
;
110 m4x3_identity( mmdl
);
112 bool in_air
= 0, grinding
= 0;
114 if( subsytem
== k_player_subsystem_walk
)
115 in_air
= player_walk
.state
.activity
== k_walk_activity_air
;
116 else if( subsytem
== k_player_subsystem_skate
)
117 in_air
= player_skate
.state
.activity
< k_skate_activity_ground
;
119 grinding
= (subsytem
== k_player_subsystem_skate
) &&
120 (player_skate
.state
.activity
>= k_skate_activity_grind_any
);
122 if( vg_input
.display_input_method
== k_input_method_controller
)
124 bool press_jump
= player_skate
.state
.jump_charge
> 0.2f
;
125 u8 lb_down
= 0, rb_down
= 0;
126 vg_exec_input_program( k_vg_input_type_button_u8
,
128 vg_joy_button
, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
, vg_end
130 vg_exec_input_program( k_vg_input_type_button_u8
,
132 vg_joy_button
, SDL_CONTROLLER_BUTTON_LEFTSHOULDER
, vg_end
134 f32 lt_amt
= 0.0f
, rt_amt
= 0.0f
;
135 vg_exec_input_program( k_vg_input_type_axis_f32
,
136 (vg_input_op
[]){ vg_joy_axis
, SDL_CONTROLLER_AXIS_TRIGGERLEFT
, vg_end
},
138 vg_exec_input_program( k_vg_input_type_axis_f32
,
139 (vg_input_op
[]){ vg_joy_axis
, SDL_CONTROLLER_AXIS_TRIGGERRIGHT
, vg_end
},
144 joystick_state( k_srjoystick_steer
, steer
);
146 mmdl
[3][0] = -r
+ 0.375f
;
147 mmdl
[3][2] = 1.0f
- 0.375f
;
148 shader_model_menu_uMdl( mmdl
);
150 if( subsytem
== k_player_subsystem_skate
)
153 render_overlay_mesh( ov_ls_circ_skate
);
155 colorize( steer
[1]>=0.5f
, press_jump
);
156 render_overlay_mesh( ov_ls_circ_backflip
);
157 colorize( steer
[1]<=-0.5f
, press_jump
);
158 render_overlay_mesh( ov_ls_circ_frontflip
);
160 colorize( steer
[1] > 0.7f
, !press_jump
&& !in_air
);
161 render_overlay_mesh( ov_ls_circ_manual
);
163 else if( subsytem
== k_player_subsystem_walk
)
166 render_overlay_mesh( ov_ls_circ_walk
);
169 mmdl
[3][0] += steer
[0]*0.125f
*0.75f
;
170 mmdl
[3][2] += steer
[1]*0.125f
*0.75f
;
173 shader_model_menu_uMdl( mmdl
);
174 render_overlay_mesh( ov_ls
);
177 mmdl
[3][0] = r
- 0.375f
;
178 mmdl
[3][2] = 1.0f
- 0.375f
;
179 shader_model_menu_uMdl( mmdl
);
181 if( subsytem
== k_player_subsystem_skate
)
183 colorize( rt_amt
> 0.5f
, in_air
);
184 render_overlay_mesh( ov_rs_circ_grab
);
185 colorize( 0, in_air
);
187 else if( subsytem
== k_player_subsystem_walk
)
190 render_overlay_mesh( ov_rs_circ_look
);
194 joystick_state( k_srjoystick_look
, jlook
);
196 mmdl
[3][0] += jlook
[0]*0.125f
*0.75f
;
197 mmdl
[3][2] += jlook
[1]*0.125f
*0.75f
;
198 shader_model_menu_uMdl( mmdl
);
199 render_overlay_mesh( ov_rs
);
206 shader_model_menu_uMdl( mmdl
);
208 /* LB -------------------------------------------------------------- */
210 if( subsytem
== k_player_subsystem_skate
)
212 colorize( lb_down
, !in_air
);
213 render_overlay_mesh( ov_carve_l
);
218 render_overlay_mesh( lb_down
? ov_lb_down
: ov_lb
);
220 /* LT ---------------------------------------------------------------- */
222 if( subsytem
== k_player_subsystem_skate
)
226 else if( subsytem
== k_player_subsystem_walk
)
228 colorize( lt_amt
>0.2f
, 1 );
229 render_overlay_mesh( ov_lt_run
);
232 render_overlay_mesh( ov_lt
);
234 mmdl
[3][2] += lt_amt
*0.125f
*0.5f
;
235 shader_model_menu_uMdl( mmdl
);
236 render_overlay_mesh( ov_lt_act
);
241 shader_model_menu_uMdl( mmdl
);
243 if( subsytem
== k_player_subsystem_skate
)
245 colorize( rb_down
, !in_air
);
246 render_overlay_mesh( ov_carve_r
);
251 render_overlay_mesh( rb_down
? ov_rb_down
: ov_rb
);
253 /* RT ---------------------------------------------------------------- */
255 if( subsytem
== k_player_subsystem_skate
)
257 colorize( rt_amt
>0.2f
, in_air
);
258 render_overlay_mesh( ov_rt_grab
);
259 colorize( rt_amt
>0.2f
, !in_air
);
260 render_overlay_mesh( ov_rt_crouch
);
261 colorize( rt_amt
>0.2f
, 1 );
263 else if( subsytem
== k_player_subsystem_walk
)
268 render_overlay_mesh( ov_rt
);
270 mmdl
[3][2] += rt_amt
*0.125f
*0.5f
;
271 shader_model_menu_uMdl( mmdl
);
272 render_overlay_mesh( ov_rt_act
);
274 /* RIGHT SIDE BUTTONS */
275 bool press_a
= 0, press_b
= 0, press_x
= 0, press_y
= 0,
276 press_dpad_w
= 0, press_dpad_e
= 0, press_dpad_n
= 0, press_dpad_s
= 0,
277 press_menu
= 0, press_back
= 0;
279 vg_exec_input_program( k_vg_input_type_button_u8
,
281 vg_joy_button
, SDL_CONTROLLER_BUTTON_A
, vg_end
}, &press_a
);
282 vg_exec_input_program( k_vg_input_type_button_u8
,
284 vg_joy_button
, SDL_CONTROLLER_BUTTON_B
, vg_end
}, &press_b
);
285 vg_exec_input_program( k_vg_input_type_button_u8
,
287 vg_joy_button
, SDL_CONTROLLER_BUTTON_X
, vg_end
}, &press_x
);
288 vg_exec_input_program( k_vg_input_type_button_u8
,
290 vg_joy_button
, SDL_CONTROLLER_BUTTON_Y
, vg_end
}, &press_y
);
291 vg_exec_input_program( k_vg_input_type_button_u8
,
293 vg_joy_button
, SDL_CONTROLLER_BUTTON_DPAD_LEFT
, vg_end
}, &press_dpad_w
);
294 vg_exec_input_program( k_vg_input_type_button_u8
,
296 vg_joy_button
, SDL_CONTROLLER_BUTTON_DPAD_RIGHT
, vg_end
}, &press_dpad_e
);
297 vg_exec_input_program( k_vg_input_type_button_u8
,
299 vg_joy_button
, SDL_CONTROLLER_BUTTON_DPAD_UP
, vg_end
}, &press_dpad_n
);
300 vg_exec_input_program( k_vg_input_type_button_u8
,
302 vg_joy_button
, SDL_CONTROLLER_BUTTON_DPAD_DOWN
, vg_end
}, &press_dpad_s
);
303 vg_exec_input_program( k_vg_input_type_button_u8
,
305 vg_joy_button
, SDL_CONTROLLER_BUTTON_BACK
, vg_end
}, &press_back
);
306 vg_exec_input_program( k_vg_input_type_button_u8
,
308 vg_joy_button
, SDL_CONTROLLER_BUTTON_START
, vg_end
}, &press_menu
);
312 shader_model_menu_uMdl( mmdl
);
314 /* B / KICKFLIP / PUSH */
315 if( subsytem
== k_player_subsystem_skate
)
317 colorize( press_b
, !in_air
);
318 render_overlay_mesh( ov_text_b_push
);
319 colorize( press_b
, in_air
);
320 render_overlay_mesh( ov_text_b_kickflip
);
321 colorize( press_b
, 1 );
327 render_overlay_mesh( press_b
? ov_b_down
: ov_b
);
329 /* Y / SKATE / WALK / GLIDE */
331 if( subsytem
== k_player_subsystem_skate
)
333 if( localplayer
.have_glider
)
335 colorize( press_y
, !in_air
);
336 render_overlay_mesh( ov_text_y_walk_lwr
);
337 colorize( press_y
, in_air
);
338 render_overlay_mesh( ov_text_y_glide
);
342 colorize( press_y
, 1 );
343 render_overlay_mesh( ov_text_y_walk
);
346 else if( subsytem
== k_player_subsystem_walk
)
348 colorize( press_y
, player_walk
.state
.activity
< k_walk_activity_inone
);
349 render_overlay_mesh( ov_text_y_skate
);
351 else if( subsytem
== k_player_subsystem_glide
)
353 colorize( press_y
, 1 );
354 render_overlay_mesh( ov_text_y_skate
);
358 render_overlay_mesh( press_y
? ov_y_down
: ov_y
);
361 if( subsytem
== k_player_subsystem_skate
)
363 colorize( press_x
, in_air
);
364 render_overlay_mesh( ov_text_x_treflip
);
367 colorize( press_x
, 0 );
368 render_overlay_mesh( press_x
? ov_x_down
: ov_x
);
370 /* A / JUMP / SHUVIT */
371 if( subsytem
== k_player_subsystem_skate
)
373 colorize( press_a
, !in_air
);
374 render_overlay_mesh( ov_text_a_jump
);
375 colorize( press_a
, in_air
);
376 render_overlay_mesh( ov_text_a_shuvit
);
377 colorize( press_a
, 1 );
379 else if( subsytem
== k_player_subsystem_walk
)
381 colorize( press_a
, !in_air
);
382 render_overlay_mesh( ov_text_a_jump_mid
);
384 render_overlay_mesh( press_a
? ov_a_down
: ov_a
);
387 if( subsytem
== k_player_subsystem_skate
)
389 if( player_skate
.state
.jump_charge
> 0.01f
)
391 mmdl
[0][0] = player_skate
.state
.jump_charge
* 0.465193f
;
392 mmdl
[3][0] += -0.4375f
;
393 mmdl
[3][2] += 0.09375f
;
394 shader_model_menu_uMdl( mmdl
);
395 render_overlay_mesh( ov_jump_ind
);
401 /* DPAD --------------------------------------------------- */
405 shader_model_menu_uMdl( mmdl
);
407 render_overlay_mesh( ov_dpad
);
409 colorize( press_dpad_e
, 1 );
410 render_overlay_mesh( ov_text_de_camera
);
412 render_overlay_mesh( ov_dpad_e
);
414 colorize( press_dpad_w
, 1 );
415 render_overlay_mesh( ov_text_dw_rewind
);
417 render_overlay_mesh( ov_dpad_w
);
419 if( subsytem
== k_player_subsystem_dead
)
421 colorize( press_dpad_n
, 1 );
422 render_overlay_mesh( ov_text_dn_respawn
);
424 else colorize( press_dpad_n
, 0 );
426 render_overlay_mesh( ov_dpad_n
);
428 colorize( press_dpad_s
, 0 );
430 render_overlay_mesh( ov_dpad_s
);
434 if( subsytem
== k_player_subsystem_skate
)
436 /* stored indicator text */
437 mmdl
[3][0] = r
-0.842671f
;
438 mmdl
[3][2] = -1.0f
+ 0.435484f
;
439 colorize( 0, !in_air
);
440 shader_model_menu_uMdl( mmdl
);
441 render_overlay_mesh( ov_text_stored
);
443 mmdl
[0][0] = v3_length( player_skate
.state
.throw_v
) / k_mmthrow_scale
;
444 shader_model_menu_uMdl( mmdl
);
445 colorize( 0, !in_air
);
446 render_overlay_mesh( ov_stored_ind
);
448 static f32 collect
= 0.0f
;
449 collect
= vg_lerpf( collect
, player_skate
.collect_feedback
,
450 vg
.time_frame_delta
* 15.0f
);
451 collect
= vg_clampf( collect
, 0.0f
, 1.0f
);
453 mmdl
[0][0] = collect
;
454 mmdl
[3][2] += 0.015625f
;
455 shader_model_menu_uMdl( mmdl
);
456 render_overlay_mesh( ov_stored_ind
);
462 shader_model_menu_uMdl( mmdl
);
463 colorize( press_menu
, 1 );
464 render_overlay_mesh( press_menu
? ov_met_r_down
: ov_met_r
);
465 render_overlay_mesh( ov_text_met_menu
);
467 colorize( press_back
, 0 );
468 render_overlay_mesh( press_back
? ov_met_l_down
: ov_met_l
);
471 render_overlay_mesh( ov_met
);
476 v2_lerp( gd
, player_skate
.state
.grab_mouse_delta
, vg
.time_frame_delta
*20.0f
, gd
);
479 if( subsytem
== k_player_subsystem_skate
)
481 bool press_ctrl
= vg_getkey(SDLK_LCTRL
);
482 mmdl
[3][0] = -r
+ 0.25f
;
483 mmdl
[3][2] = 1.0f
- 0.125f
;
484 shader_model_menu_uMdl( mmdl
);
485 colorize( press_ctrl
, !in_air
&& !grinding
);
486 draw_key( press_ctrl
, 1 );
487 render_overlay_mesh( ov_text_carve
);
490 /* SHIFT || CROUCH / GRAB / RUN */
491 bool press_shift
= vg_getkey( SDLK_LSHIFT
);
492 if( subsytem
== k_player_subsystem_skate
||
493 subsytem
== k_player_subsystem_walk
)
495 mmdl
[3][0] = -r
+ 0.25f
;
496 mmdl
[3][2] = 1.0f
- 0.125f
- 0.25f
;
497 shader_model_menu_uMdl( mmdl
);
498 colorize( press_shift
, !grinding
);
499 draw_key( press_shift
, 1 );
500 render_overlay_mesh( ov_text_shift
);
502 if( subsytem
== k_player_subsystem_skate
)
504 colorize( press_shift
, !in_air
&& !grinding
);
505 render_overlay_mesh( ov_text_crouch
);
506 colorize( press_shift
, in_air
&& !grinding
);
507 render_overlay_mesh( ov_text_grab
);
509 else if( subsytem
== k_player_subsystem_walk
)
511 render_overlay_mesh( ov_text_run
);
515 if( subsytem
== k_player_subsystem_skate
)
517 /* stored indicator text */
518 mmdl
[3][0] = -r
+ 0.25f
+ 0.203125f
+ 0.007812f
;
519 colorize( 0, !in_air
);
520 shader_model_menu_uMdl( mmdl
);
521 render_overlay_mesh( ov_text_stored
);
523 mmdl
[0][0] = v3_length( player_skate
.state
.throw_v
) / k_mmthrow_scale
;
524 shader_model_menu_uMdl( mmdl
);
525 colorize( 0, !in_air
);
526 render_overlay_mesh( ov_stored_ind
);
528 static f32 collect
= 0.0f
;
529 collect
= vg_lerpf( collect
, player_skate
.collect_feedback
,
530 vg
.time_frame_delta
* 15.0f
);
531 collect
= vg_clampf( collect
, 0.0f
, 1.0f
);
533 mmdl
[0][0] = collect
;
534 mmdl
[3][2] += 0.015625f
;
535 shader_model_menu_uMdl( mmdl
);
536 render_overlay_mesh( ov_stored_ind
);
540 if( subsytem
!= k_player_subsystem_dead
)
542 bool press_c
= vg_getkey(SDLK_c
);
544 mmdl
[3][0] = -r
+ 0.125f
+ 1.0f
;
545 mmdl
[3][2] = 1.0f
- 0.125f
- 0.25f
;
546 shader_model_menu_uMdl( mmdl
);
547 colorize( press_c
, 1 );
548 draw_key( press_c
, 0 );
549 render_overlay_mesh( ov_text_camera
);
554 mmdl
[3][2] = 1.0f
- 0.125f
- 0.25f
- 0.25f
;
557 if( subsytem
!= k_player_subsystem_dead
)
559 bool press_a
= vg_getkey(SDLK_a
);
560 mmdl
[3][0] = -r
+ 0.125f
;
561 shader_model_menu_uMdl( mmdl
);
562 colorize( press_a
, 1 );
563 draw_key( press_a
, 0 );
564 render_overlay_mesh( ov_text_left
);
567 bool press_jump
= player_skate
.state
.jump_charge
< 0.2f
;
569 /* S || MANUAL / BACKFLIP */
570 bool press_s
= vg_getkey(SDLK_s
);
571 mmdl
[3][0] = -r
+ 0.125f
+ 0.25f
;
572 shader_model_menu_uMdl( mmdl
);
574 if( subsytem
== k_player_subsystem_skate
)
576 colorize( press_s
, !in_air
);
577 draw_key( press_s
, 0 );
578 render_overlay_mesh( ov_text_s
);
579 /* backflip/manual */
580 colorize( press_s
, !in_air
&& !press_jump
);
581 render_overlay_mesh( ov_text_back_flip
);
582 colorize( press_s
, !in_air
&& press_jump
);
583 render_overlay_mesh( ov_text_manual
);
585 else if( subsytem
!= k_player_subsystem_dead
)
587 colorize( press_s
, 1 );
588 draw_key( press_s
, 0 );
589 render_overlay_mesh( ov_text_s
);
590 render_overlay_mesh( ov_text_back
);
594 if( subsytem
!= k_player_subsystem_dead
)
596 bool press_d
= vg_getkey(SDLK_d
);
597 mmdl
[3][0] = -r
+ 0.125f
+ 0.25f
+ 0.25f
;
598 shader_model_menu_uMdl( mmdl
);
599 colorize( press_d
, 1 );
600 draw_key( press_d
, 0 );
601 render_overlay_mesh( ov_text_right
);
605 mmdl
[3][2] = 1.0f
- 0.125f
- 0.25f
- 0.25f
- 0.25f
;
608 if( subsytem
== k_player_subsystem_dead
)
610 bool press_q
= vg_getkey(SDLK_q
);
611 mmdl
[3][0] = -r
+ 0.125f
;
612 shader_model_menu_uMdl( mmdl
);
613 colorize( press_q
, 1 );
614 draw_key( press_q
, 0 );
615 render_overlay_mesh( ov_text_respawn
);
618 /* W || PUSH / FRONTFLIP */
619 bool press_w
= vg_getkey(SDLK_w
);
620 mmdl
[3][0] = -r
+ 0.125f
+ 0.25f
;
621 shader_model_menu_uMdl( mmdl
);
623 if( subsytem
== k_player_subsystem_skate
)
625 colorize( press_w
, !in_air
);
626 draw_key( press_w
, 0 );
627 render_overlay_mesh( ov_text_w
);
629 colorize( press_w
, !in_air
&& !press_jump
);
630 render_overlay_mesh( ov_text_front_flip
);
631 colorize( press_w
, !in_air
&& press_jump
);
632 render_overlay_mesh( ov_text_push
);
634 else if( subsytem
!= k_player_subsystem_dead
)
636 colorize( press_w
, 1 );
637 draw_key( press_w
, 0 );
638 render_overlay_mesh( ov_text_w
);
639 render_overlay_mesh( ov_text_forward
);
643 bool press_e
= vg_getkey(SDLK_e
);
644 mmdl
[3][0] = -r
+ 0.125f
+ 0.25f
+ 0.25f
;
646 shader_model_menu_uMdl( mmdl
);
648 if( subsytem
== k_player_subsystem_skate
)
650 if( localplayer
.have_glider
)
652 colorize( press_e
, !in_air
);
653 render_overlay_mesh( ov_text_walk_lwr
);
654 colorize( press_e
, in_air
);
655 render_overlay_mesh( ov_text_glide
);
659 colorize( press_e
, 1 );
660 render_overlay_mesh( ov_text_walk
);
663 else if( subsytem
== k_player_subsystem_glide
)
665 colorize( press_e
, 1 );
666 render_overlay_mesh( ov_text_skate
);
668 else if( subsytem
== k_player_subsystem_walk
)
670 colorize( press_e
, player_walk
.state
.activity
< k_walk_activity_inone
);
671 render_overlay_mesh( ov_text_skate
);
674 if( subsytem
!= k_player_subsystem_dead
)
676 draw_key( press_e
, 0 );
677 render_overlay_mesh( ov_text_e
);
681 bool press_r
= vg_getkey(SDLK_r
);
682 mmdl
[3][0] = -r
+ 0.125f
+ 0.25f
+ 0.25f
+ 0.25f
;
683 shader_model_menu_uColour( cnorm
);
684 shader_model_menu_uMdl( mmdl
);
686 colorize( press_r
, 1 );
687 draw_key( press_r
, 0 );
688 render_overlay_mesh( ov_text_rewind
);
691 bool press_space
= vg_getkey(SDLK_SPACE
);
693 mmdl
[3][2] = 1.0f
- 0.125f
;
696 if( subsytem
== k_player_subsystem_skate
||
697 subsytem
== k_player_subsystem_walk
)
699 shader_model_menu_uMdl( mmdl
);
700 colorize( press_space
, !in_air
);
702 render_overlay_mesh( press_space
?
703 ov_space_down
: ov_space
);
704 render_overlay_mesh( ov_text_jump
);
707 if( subsytem
== k_player_subsystem_skate
)
709 if( player_skate
.state
.jump_charge
> 0.01f
)
711 mmdl
[0][0] = player_skate
.state
.jump_charge
;
712 mmdl
[3][0] = -0.4375f
;
713 shader_model_menu_uMdl( mmdl
);
714 render_overlay_mesh( ov_jump_ind
);
718 bool press_esc
= vg_getkey(SDLK_ESCAPE
);
720 mmdl
[3][0] = -r
+ 0.125f
;;
721 mmdl
[3][2] = -1.0f
+ 0.125f
;
722 shader_model_menu_uMdl( mmdl
);
723 colorize( press_esc
, 1 );
724 render_overlay_mesh( ov_text_menu
);
725 render_overlay_mesh( press_esc
? ov_key_menu_down
: ov_key_menu
);
726 mmdl
[3][0] = r
- 0.38f
;
728 shader_model_menu_uMdl( mmdl
);
729 colorize( press_shift
, in_air
);
731 if( subsytem
== k_player_subsystem_skate
)
733 render_overlay_mesh( ov_mouse_grabs
);
735 if( in_air
&& press_shift
)
737 mmdl
[3][0] += gd
[0]*0.125f
;
738 mmdl
[3][2] += gd
[1]*0.125f
;
742 shader_model_menu_uMdl( mmdl
);
744 bool lmb
= button_press( k_srbind_trick0
),
745 rmb
= button_press( k_srbind_trick1
);
747 if( subsytem
== k_player_subsystem_skate
)
749 colorize( 0, press_space
|| in_air
);
750 render_overlay_mesh( ov_mouse
);
752 colorize( lmb
&&!rmb
, press_space
|| in_air
);
753 render_overlay_mesh( ov_text_shuvit
);
755 colorize( lmb
, press_space
|| in_air
);
756 render_overlay_mesh( lmb
? ov_lmb_down
: ov_lmb
);
758 colorize( rmb
&&!lmb
, press_space
|| in_air
);
759 render_overlay_mesh( ov_text_kickflip
);
761 colorize( rmb
, press_space
|| in_air
);
762 render_overlay_mesh( rmb
? ov_rmb_down
: ov_rmb
);
764 colorize( rmb
&&lmb
, press_space
|| in_air
);
765 render_overlay_mesh( ov_text_treflip
);
767 else if( subsytem
== k_player_subsystem_walk
)
770 render_overlay_mesh( ov_mouse
);
771 render_overlay_mesh( ov_text_look
);
773 render_overlay_mesh( lmb
? ov_lmb_down
: ov_lmb
);
774 render_overlay_mesh( rmb
? ov_rmb_down
: ov_rmb
);