update overlay to have ps controls too
authorhgn <hgodden00@gmail.com>
Wed, 10 Apr 2024 23:53:16 +0000 (00:53 +0100)
committerhgn <hgodden00@gmail.com>
Wed, 10 Apr 2024 23:53:16 +0000 (00:53 +0100)
control_overlay.c
models_src/rs_overlay.mdl

index f0b7a9aef23f9eecd90885cb68b7ea917d1900b2..a39d77b697c1f15a03211f94005f7d8547ac8a2e 100644 (file)
@@ -276,6 +276,14 @@ void control_overlay_render(void)
            press_dpad_w = 0, press_dpad_e = 0, press_dpad_n = 0, press_dpad_s = 0,
            press_menu = 0, press_back = 0;
 
            press_dpad_w = 0, press_dpad_e = 0, press_dpad_n = 0, press_dpad_s = 0,
            press_menu = 0, press_back = 0;
 
+      bool is_ps = 0;
+      if( (vg_input.display_input_type == SDL_CONTROLLER_TYPE_PS3) ||
+          (vg_input.display_input_type == SDL_CONTROLLER_TYPE_PS4) ||
+          (vg_input.display_input_type == SDL_CONTROLLER_TYPE_PS5) )
+      {
+         is_ps = 1;
+      }
+
       vg_exec_input_program( k_vg_input_type_button_u8, 
             (vg_input_op[]){
                vg_joy_button, SDL_CONTROLLER_BUTTON_A, vg_end }, &press_a );
       vg_exec_input_program( k_vg_input_type_button_u8, 
             (vg_input_op[]){
                vg_joy_button, SDL_CONTROLLER_BUTTON_A, vg_end }, &press_a );
@@ -324,7 +332,9 @@ void control_overlay_render(void)
       {
          colorize( 0, 0 );
       }
       {
          colorize( 0, 0 );
       }
-      render_overlay_mesh( press_b? ov_b_down: ov_b );
+
+      if( is_ps ) render_overlay_mesh( press_b? ov_b_down_ps: ov_b_ps );
+      else        render_overlay_mesh( press_b? ov_b_down: ov_b );
 
       /* Y / SKATE / WALK / GLIDE */
 
 
       /* Y / SKATE / WALK / GLIDE */
 
@@ -355,7 +365,9 @@ void control_overlay_render(void)
       }
       else
          colorize( 0, 0 );
       }
       else
          colorize( 0, 0 );
-      render_overlay_mesh( press_y? ov_y_down: ov_y );
+
+      if( is_ps ) render_overlay_mesh( press_y? ov_y_down_ps: ov_y_ps );
+      else        render_overlay_mesh( press_y? ov_y_down: ov_y );
 
       /* X / TREFLIP */
       if( subsytem == k_player_subsystem_skate )
 
       /* X / TREFLIP */
       if( subsytem == k_player_subsystem_skate )
@@ -365,7 +377,9 @@ void control_overlay_render(void)
       }
       else
          colorize( press_x, 0 );
       }
       else
          colorize( press_x, 0 );
-      render_overlay_mesh( press_x? ov_x_down: ov_x );
+
+      if( is_ps ) render_overlay_mesh( press_x? ov_x_down_ps: ov_x_ps );
+      else        render_overlay_mesh( press_x? ov_x_down: ov_x );
 
       /* A / JUMP / SHUVIT */
       if( subsytem == k_player_subsystem_skate )
 
       /* A / JUMP / SHUVIT */
       if( subsytem == k_player_subsystem_skate )
@@ -381,7 +395,9 @@ void control_overlay_render(void)
          colorize( press_a, !in_air );
          render_overlay_mesh( ov_text_a_jump_mid );
       }
          colorize( press_a, !in_air );
          render_overlay_mesh( ov_text_a_jump_mid );
       }
-      render_overlay_mesh( press_a? ov_a_down: ov_a );
+
+      if( is_ps ) render_overlay_mesh( press_a? ov_a_down_ps: ov_a_ps );
+      else        render_overlay_mesh( press_a? ov_a_down: ov_a );
 
       /* JUMP CHARGE */
       if( subsytem == k_player_subsystem_skate )
 
       /* JUMP CHARGE */
       if( subsytem == k_player_subsystem_skate )
index 7c89d41b080927081823776df0a51cc1958e859a..96c6a96b60d3ec5a7726efe365d5c52dba251c6b 100644 (file)
Binary files a/models_src/rs_overlay.mdl and b/models_src/rs_overlay.mdl differ