From 6becfdaccabbcc35c4b87f13a43e364908e53656 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 2 Nov 2013 18:16:00 +0000 Subject: [PATCH] Remove NUM_DXX_REBIRTH_CONTROLS --- common/main/kconfig.h | 2 -- similar/main/kconfig.cpp | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/common/main/kconfig.h b/common/main/kconfig.h index 4548bbd92..0b9f7d924 100644 --- a/common/main/kconfig.h +++ b/common/main/kconfig.h @@ -53,11 +53,9 @@ typedef struct _control_info { #define CONTROL_USING_MOUSE 2 #define MOUSEFS_DELTA_RANGE 512 #if defined(DXX_BUILD_DESCENT_I) -#define NUM_DXX_REBIRTH_CONTROLS 30 #define MAX_DXX_REBIRTH_CONTROLS 30 #define MAX_CONTROLS 50 #elif defined(DXX_BUILD_DESCENT_II) -#define NUM_DXX_REBIRTH_CONTROLS 30 #define MAX_DXX_REBIRTH_CONTROLS 30 #define MAX_CONTROLS 60 // there are actually 48, so this leaves room for more #endif diff --git a/similar/main/kconfig.cpp b/similar/main/kconfig.cpp index 10a706239..03239db42 100644 --- a/similar/main/kconfig.cpp +++ b/similar/main/kconfig.cpp @@ -400,7 +400,7 @@ kc_item kc_mouse[] = { #define WEAPON_STRING_SMART "SMART" D2X_EXTENDED_WEAPON_STRING("/MERCURY") " MISSILE" #define WEAPON_STRING_MEGA "MEGA" D2X_EXTENDED_WEAPON_STRING("/EARTHSHAKER") " MISSILE" -kc_item kc_rebirth[NUM_DXX_REBIRTH_CONTROLS] = { +kc_item kc_rebirth[] = { { 15, 69,157, 26, 29, 3, 29, 1,WEAPON_STRING_LASER, BT_KEY, 255, NULL, 0, &Controls.select_weapon_count }, { 15, 69,215, 26, 27, 4, 0, 2,WEAPON_STRING_LASER, BT_JOY_BUTTON, 255, NULL, 0, &Controls.select_weapon_count }, { 15, 69,273, 26, 28, 5, 1, 3,WEAPON_STRING_LASER, BT_MOUSE_BUTTON, 255, NULL, 0, &Controls.select_weapon_count }, @@ -833,7 +833,7 @@ static int kconfig_key_command(window *wind, d_event *event, kc_menu *menu) for (unsigned i=0; i<(sizeof(kc_mouse) / sizeof(kc_mouse[0])); i++ ) menu->items[i].value = DefaultKeySettings[2][i]; if ( menu->items==kc_rebirth ) - for(unsigned i=0;iitems) / sizeof(menu->items[0]);i++) + for(unsigned i=0;iitems[i].value=DefaultKeySettingsRebirth[i]; return 1; case KEY_DELETE: @@ -889,10 +889,10 @@ static int kconfig_key_command(window *wind, d_event *event, kc_menu *menu) kc_mouse[i].r = find_next_item_right( kc_mouse, i); } for (unsigned i=0; i