diff --git a/common/main/kconfig.h b/common/main/kconfig.h index 350254bd4..c84db0137 100644 --- a/common/main/kconfig.h +++ b/common/main/kconfig.h @@ -39,7 +39,7 @@ typedef struct _control_info { ubyte slide_on_state, bank_on_state; ubyte accelerate_state, reverse_state, cruise_plus_state, cruise_minus_state, cruise_off_count; ubyte rear_view_state, rear_view_count; - ubyte fire_primary_state, fire_primary_count, fire_secondary_state, fire_secondary_count, fire_flare_count, drop_bomb_count; + ubyte fire_primary_state, fire_secondary_state, fire_secondary_count, fire_flare_count, drop_bomb_count; ubyte automap_state, automap_count; ubyte cycle_primary_count, cycle_secondary_count, select_weapon_count; #if defined(DXX_BUILD_DESCENT_II) diff --git a/similar/main/automap.cpp b/similar/main/automap.cpp index 6b06a3ba2..c6d3b3f0b 100644 --- a/similar/main/automap.cpp +++ b/similar/main/automap.cpp @@ -743,12 +743,12 @@ static int automap_process_input(window *wind, d_event *event, automap *am) if (PlayerCfg.AutomapFreeFlight) { - if ( am->controls.fire_primary_count > 0) + if ( am->controls.fire_primary_state) { // Reset orientation am->viewMatrix = Objects[Players[Player_num].objnum].orient; vm_vec_scale_add(&am->view_position, &Objects[Players[Player_num].objnum].pos, &am->viewMatrix.fvec, -ZOOM_DEFAULT ); - am->controls.fire_primary_count = 0; + am->controls.fire_primary_state = 0; } if (am->controls.pitch_time || am->controls.heading_time || am->controls.bank_time) @@ -780,7 +780,7 @@ static int automap_process_input(window *wind, d_event *event, automap *am) } else { - if ( am->controls.fire_primary_count > 0) + if ( am->controls.fire_primary_state) { // Reset orientation am->viewDist = ZOOM_DEFAULT; @@ -788,7 +788,7 @@ static int automap_process_input(window *wind, d_event *event, automap *am) am->tangles.h = 0; am->tangles.b = 0; am->view_target = Objects[Players[Player_num].objnum].pos; - am->controls.fire_primary_count = 0; + am->controls.fire_primary_state = 0; } am->viewDist -= am->controls.forward_thrust_time*ZOOM_SPEED_FACTOR; diff --git a/similar/main/kconfig.cpp b/similar/main/kconfig.cpp index 92d56f8b2..ba64d825c 100644 --- a/similar/main/kconfig.cpp +++ b/similar/main/kconfig.cpp @@ -164,8 +164,8 @@ kc_item kc_keyboard[NUM_KEY_CONTROLS] = { { 15,137,100, 26, 19, 23, 20, 42,"Bank left", BT_KEY, 255, &Controls.key_bank_left_state, STATE_BIT2, NULL }, { 15,145, 71, 26, 20, 46, 43, 23,"Bank right", BT_KEY, 255, &Controls.key_bank_right_state, STATE_BIT1, NULL }, { 15,145,100, 26, 21, 47, 22, 46,"Bank right", BT_KEY, 255, &Controls.key_bank_right_state, STATE_BIT2, NULL }, - {158, 49, 83, 26, 49, 26, 1, 25,"Fire primary", BT_KEY, 255, &Controls.fire_primary_state, STATE_BIT1, &Controls.fire_primary_count }, - {158, 49,112, 26, 42, 27, 24, 2,"Fire primary", BT_KEY, 255, &Controls.fire_primary_state, STATE_BIT2, &Controls.fire_primary_count }, + {158, 49, 83, 26, 49, 26, 1, 25,"Fire primary", BT_KEY, 255, &Controls.fire_primary_state, STATE_BIT1, NULL }, + {158, 49,112, 26, 42, 27, 24, 2,"Fire primary", BT_KEY, 255, &Controls.fire_primary_state, STATE_BIT2, NULL }, #elif defined(DXX_BUILD_DESCENT_II) { 15,117,100, 26, 15, 19, 16, 46,"Slide down", BT_KEY, 255, &Controls.key_slide_down_state, STATE_BIT2, NULL }, { 15,129, 71, 26, 16, 20, 47, 19,"Bank on", BT_KEY, 255, &Controls.bank_on_state, STATE_BIT1, NULL }, @@ -174,8 +174,8 @@ kc_item kc_keyboard[NUM_KEY_CONTROLS] = { { 15,137,100, 26, 19, 23, 20, 40,"Bank left", BT_KEY, 255, &Controls.key_bank_left_state, STATE_BIT2, NULL }, { 15,145, 71, 26, 20, 48, 41, 23,"Bank right", BT_KEY, 255, &Controls.key_bank_right_state, STATE_BIT1, NULL }, { 15,145,100, 26, 21, 49, 22, 42,"Bank right", BT_KEY, 255, &Controls.key_bank_right_state, STATE_BIT2, NULL }, - {158, 49, 83, 26, 51, 26, 1, 25,"Fire primary", BT_KEY, 255, &Controls.fire_primary_state, STATE_BIT1, &Controls.fire_primary_count }, - {158, 49,112, 26, 56, 27, 24, 2,"Fire primary", BT_KEY, 255, &Controls.fire_primary_state, STATE_BIT2, &Controls.fire_primary_count }, + {158, 49, 83, 26, 51, 26, 1, 25,"Fire primary", BT_KEY, 255, &Controls.fire_primary_state, STATE_BIT1, NULL }, + {158, 49,112, 26, 56, 27, 24, 2,"Fire primary", BT_KEY, 255, &Controls.fire_primary_state, STATE_BIT2, NULL }, #endif {158, 57, 83, 26, 24, 28, 3, 27,"Fire secondary", BT_KEY, 255, &Controls.fire_secondary_state, STATE_BIT1, &Controls.fire_secondary_count }, {158, 57,112, 26, 25, 29, 26, 4,"Fire secondary", BT_KEY, 255, &Controls.fire_secondary_state, STATE_BIT2, &Controls.fire_secondary_count }, @@ -232,7 +232,7 @@ kc_item kc_keyboard[NUM_KEY_CONTROLS] = { }; kc_item kc_joystick[NUM_JOYSTICK_CONTROLS] = { #if defined(DXX_BUILD_DESCENT_I) - { 22, 46, 82, 26, 15, 1, 24, 29,"Fire primary", BT_JOY_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT3, &Controls.fire_primary_count }, + { 22, 46, 82, 26, 15, 1, 24, 29,"Fire primary", BT_JOY_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT3, NULL }, { 22, 54, 82, 26, 0, 4, 34, 30,"Fire secondary", BT_JOY_BUTTON, 255, &Controls.fire_secondary_state, STATE_BIT3, &Controls.fire_secondary_count }, { 22, 78, 82, 26, 26, 3, 37, 31,"Accelerate", BT_JOY_BUTTON, 255, &Controls.accelerate_state, STATE_BIT3, NULL }, { 22, 86, 82, 26, 2, 25, 38, 32,"Reverse", BT_JOY_BUTTON, 255, &Controls.reverse_state, STATE_BIT3, NULL }, @@ -248,7 +248,7 @@ kc_item kc_joystick[NUM_JOYSTICK_CONTROLS] = { { 22,154, 51, 26, 47, 15, 47, 14,"Pitch U/D", BT_JOY_AXIS, 255, NULL, 0, NULL }, { 22,154, 99, 8, 27, 16, 13, 17,"Pitch U/D", BT_INVERT, 255, NULL, 0, NULL }, #elif defined(DXX_BUILD_DESCENT_II) - { 22, 46, 80, 26, 15, 1, 24, 31,"Fire primary", BT_JOY_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT3, &Controls.fire_primary_count }, + { 22, 46, 80, 26, 15, 1, 24, 31,"Fire primary", BT_JOY_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT3, NULL }, { 22, 54, 80, 26, 0, 4, 36, 32,"Fire secondary", BT_JOY_BUTTON, 255, &Controls.fire_secondary_state, STATE_BIT3, &Controls.fire_secondary_count }, { 22, 78, 80, 26, 26, 3, 39, 33,"Accelerate", BT_JOY_BUTTON, 255, &Controls.accelerate_state, STATE_BIT3, NULL }, { 22, 86, 80, 26, 2, 25, 40, 34,"reverse", BT_JOY_BUTTON, 255, &Controls.reverse_state, STATE_BIT3, NULL }, @@ -285,7 +285,7 @@ kc_item kc_joystick[NUM_JOYSTICK_CONTROLS] = { { 22, 70, 82, 26, 4, 2, 36, 43,"Drop bomb", BT_JOY_BUTTON, 255, NULL, 0, &Controls.drop_bomb_count }, { 22,102, 82, 26, 25, 14, 40, 28,"Automap", BT_JOY_BUTTON, 255, &Controls.automap_state, STATE_BIT3, &Controls.automap_count }, { 22,102,111, 26, 42, 17, 27, 12,"Automap", BT_JOY_BUTTON, 255, &Controls.automap_state, STATE_BIT4, &Controls.automap_count }, - { 22, 46,111, 26, 16, 30, 0, 5,"Fire primary", BT_JOY_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT4, &Controls.fire_primary_count }, + { 22, 46,111, 26, 16, 30, 0, 5,"Fire primary", BT_JOY_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT4, NULL }, { 22, 54,111, 26, 29, 33, 1, 6,"Fire secondary", BT_JOY_BUTTON, 255, &Controls.fire_secondary_state, STATE_BIT4, &Controls.fire_secondary_count }, { 22, 78,111, 26, 43, 32, 2, 9,"Accelerate", BT_JOY_BUTTON, 255, &Controls.accelerate_state, STATE_BIT4, NULL }, { 22, 86,111, 26, 31, 42, 3, 10,"Reverse", BT_JOY_BUTTON, 255, &Controls.reverse_state, STATE_BIT4, NULL }, @@ -312,7 +312,7 @@ kc_item kc_joystick[NUM_JOYSTICK_CONTROLS] = { {174,110, 74, 26, 12, 29, 49, 47,"Cycle Primary", BT_JOY_BUTTON, 255, NULL, 0, &Controls.cycle_primary_count }, {174,118, 74, 26, 28, 54, 53, 48,"Cycle Secondary", BT_JOY_BUTTON, 255, NULL, 0, &Controls.cycle_secondary_count }, { 22,110, 80, 26, 27, 52, 43, 49,"Headlight", BT_JOY_BUTTON, 255, NULL, 0, &Controls.headlight_count }, - { 22, 46,110, 26, 16, 32, 0, 5,"Fire primary", BT_JOY_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT4, &Controls.fire_primary_count }, + { 22, 46,110, 26, 16, 32, 0, 5,"Fire primary", BT_JOY_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT4, NULL }, { 22, 54,110, 26, 31, 35, 1, 6,"Fire secondary", BT_JOY_BUTTON, 255, &Controls.fire_secondary_state, STATE_BIT4, &Controls.fire_secondary_count }, { 22, 78,110, 26, 45, 34, 2, 9,"Accelerate", BT_JOY_BUTTON, 255, &Controls.accelerate_state, STATE_BIT4, NULL }, { 22, 86,110, 26, 33, 44, 3, 10,"reverse", BT_JOY_BUTTON, 255, &Controls.reverse_state, STATE_BIT4, NULL }, @@ -340,7 +340,7 @@ kc_item kc_joystick[NUM_JOYSTICK_CONTROLS] = { #endif }; kc_item kc_mouse[NUM_MOUSE_CONTROLS] = { - { 25, 46, 85, 26, 19, 1, 20, 5,"Fire primary", BT_MOUSE_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT5, &Controls.fire_primary_count }, + { 25, 46, 85, 26, 19, 1, 20, 5,"Fire primary", BT_MOUSE_BUTTON, 255, &Controls.fire_primary_state, STATE_BIT5, NULL }, { 25, 54, 85, 26, 0, 4, 5, 6,"Fire secondary", BT_MOUSE_BUTTON, 255, &Controls.fire_secondary_state, STATE_BIT5, &Controls.fire_secondary_count }, { 25, 78, 85, 26, 26, 3, 8, 9,"Accelerate", BT_MOUSE_BUTTON, 255, &Controls.accelerate_state, STATE_BIT5, NULL }, { 25, 86, 85, 26, 2, 25, 9, 10,"reverse", BT_MOUSE_BUTTON, 255, &Controls.reverse_state, STATE_BIT5, NULL },