version 1.5 | | version 1.6 |
---|
| | |
* Routines to configure keyboard, joystick, etc.. | | * Routines to configure keyboard, joystick, etc.. |
* | | * |
* $Log$ | | * $Log$ |
| | * Revision 1.6 2000/04/19 21:27:56 sekmu |
| | * movable death-cam from WraithX |
| | * |
* Revision 1.5 1999/11/21 13:00:08 donut | | * Revision 1.5 1999/11/21 13:00:08 donut |
* Changed screen_mode format. Now directly encodes res into a 32bit int, rather than using arbitrary values. | | * Changed screen_mode format. Now directly encodes res into a 32bit int, rather than using arbitrary values. |
* | | * |
| | |
{ 43,158,141,112, 26, 41, 0, 42, 22,TNUM_CRUISE_OFF, BT_KEY, 255 }, | | { 43,158,141,112, 26, 41, 0, 42, 22,TNUM_CRUISE_OFF, BT_KEY, 255 }, |
{ 44,158, 93, 83, 26, 36, 30, 11, 45,TNUM_AUTOMAP, BT_KEY, 255 }, | | { 44,158, 93, 83, 26, 36, 30, 11, 45,TNUM_AUTOMAP, BT_KEY, 255 }, |
{ 45,158, 93,112, 26, 37, 31, 44, 12,TNUM_AUTOMAP, BT_KEY, 255 }, | | { 45,158, 93,112, 26, 37, 31, 44, 12,TNUM_AUTOMAP, BT_KEY, 255 }, |
//added/killed on 2/5/99 by Victor Rachels to move to d1x | | |
//-killed- { 46,158,153, 83, 26, 42, 48, 23, 47,TNUM_PRIMARY_CYCLE, BT_KEY, 255 }, | | |
//-killed- { 47,158,153,112, 26, 43, 49, 46, 48,TNUM_PRIMARY_CYCLE, BT_KEY, 255 }, | | |
//-killed- { 48,158,161, 83, 26, 46, 50, 47, 49,TNUM_SECONDARY_CYCLE, BT_KEY, 255 }, | | |
//-killed- { 49,158,161,112, 26, 47, 51, 48, 50,TNUM_SECONDARY_CYCLE, BT_KEY, 255 }, | | |
//-killed- { 50,158,169, 83, 26, 48, 52, 49, 51,TNUM_CYCLE_P_TOGGLE, BT_KEY, 255 }, | | |
//-killed- { 51,158,169,112, 26, 49, 53, 50, 52,TNUM_CYCLE_P_TOGGLE, BT_KEY, 255 }, | | |
//-killed- { 52,158,177, 83, 26, 50, 25, 51, 53,TNUM_CYCLE_S_TOGGLE, BT_KEY, 255 }, | | |
//-killed- { 53,158,177,112, 26, 51, 0, 52, 0,TNUM_CYCLE_S_TOGGLE, BT_KEY, 255 } | | |
//end this section kill - VR | | |
}; | | }; |
kc_item kc_joystick[NUM_ALL_OTHER_CONTROLS] = { | | kc_item kc_joystick[NUM_ALL_OTHER_CONTROLS] = { |
{ 0, 25, 46, 85, 26, 15, 1, 24, 5,TNUM_FIRE_PRIMARY, BT_JOY_BUTTON, 255 }, | | { 0, 25, 46, 85, 26, 15, 1, 24, 5,TNUM_FIRE_PRIMARY, BT_JOY_BUTTON, 255 }, |
| | |
{ 24,164,174,106, 8, 22, 13, 23, 0,TNUM_THROTTLE, BT_INVERT, 255 }, | | { 24,164,174,106, 8, 22, 13, 23, 0,TNUM_THROTTLE, BT_INVERT, 255 }, |
{ 25, 25,102, 85, 26, 3, 14, 11, 12,TNUM_REAR_VIEW, BT_JOY_BUTTON, 255 }, | | { 25, 25,102, 85, 26, 3, 14, 11, 12,TNUM_REAR_VIEW, BT_JOY_BUTTON, 255 }, |
{ 26, 25, 70, 85, 26, 4, 2, 7, 8,TNUM_DROP_BOMB, BT_JOY_BUTTON, 255 }, | | { 26, 25, 70, 85, 26, 4, 2, 7, 8,TNUM_DROP_BOMB, BT_JOY_BUTTON, 255 }, |
//added/killed on 2/5/99 by Victor Rachels to move to d1x | | |
//-killed- { 27,172,114, 67, 26, 12, 28, 29, 30,TNUM_PRIMARY_CYCLE, BT_JOY_BUTTON, 255 }, | | |
//-killed- { 28,172,122, 67, 26, 27, 18, 30, 13,TNUM_SECONDARY_CYCLE, BT_JOY_BUTTON, 255 }, | | |
//-killed- { 29, 25,114, 85, 26, 25, 30, 12, 27,TNUM_CYCLE_P_TOGGLE, BT_JOY_BUTTON, 255 }, | | |
//-killed- { 30, 25,122, 85, 26, 29, 14, 27, 28,TNUM_CYCLE_S_TOGGLE, BT_JOY_BUTTON, 255 } | | |
//end this section kill - VR | | |
| | |
}; | | }; |
kc_item kc_mouse[NUM_OTHER_CONTROLS] = { | | kc_item kc_mouse[NUM_OTHER_CONTROLS] = { |
{ 0, 25, 46, 85, 26, 12, 1, 24, 5,TNUM_FIRE_PRIMARY, BT_MOUSE_BUTTON, 255 }, | | { 0, 25, 46, 85, 26, 12, 1, 24, 5,TNUM_FIRE_PRIMARY, BT_MOUSE_BUTTON, 255 }, |
| | |
void kconfig_read_fcs( int raw_axis ); | | void kconfig_read_fcs( int raw_axis ); |
void kconfig_set_fcs_button( int btn, int button ); | | void kconfig_set_fcs_button( int btn, int button ); |
| | |
| | //the following methods added by WraithX, 4/17/00 |
| | int isJoyRotationKey(int test_key) |
| | { |
| | if ( test_key == kc_joystick[11].value || |
| | test_key == kc_joystick[12].value) |
| | { |
| | return 1; |
| | }//end if |
| | |
| | //else... |
| | return 0; |
| | }//method isJoyRotationKey |
| | |
| | int isMouseRotationKey(int test_key) |
| | { |
| | if ( test_key == kc_mouse[11].value || |
| | test_key == kc_mouse[12].value) |
| | { |
| | return 1; |
| | }//end if |
| | |
| | //else... |
| | return 0; |
| | }//method isMouseRotationKey |
| | |
| | int isKeyboardRotationKey(int test_key) |
| | { |
| | if ( test_key == kc_keyboard[0].value || |
| | test_key == kc_keyboard[1].value || |
| | test_key == kc_keyboard[2].value || |
| | test_key == kc_keyboard[3].value || |
| | test_key == kc_keyboard[4].value || |
| | test_key == kc_keyboard[5].value || |
| | test_key == kc_keyboard[6].value || |
| | test_key == kc_keyboard[7].value || |
| | test_key == kc_keyboard[20].value || |
| | test_key == kc_keyboard[21].value || |
| | test_key == kc_keyboard[22].value || |
| | test_key == kc_keyboard[23].value) |
| | { |
| | return 1; |
| | }//end if |
| | |
| | //else... |
| | return 0; |
| | }//method isKeyboardRotationKey |
| | //end addition - WraithX |
| | |
int kconfig_is_axes_used(int axis) | | int kconfig_is_axes_used(int axis) |
{ | | { |
int i; | | int i; |
| | |
| | |
//added on 2/4/99 by Victor Rachels for d1x keys | | //added on 2/4/99 by Victor Rachels for d1x keys |
//--------- Read primary weapon select ------------- | | //--------- Read primary weapon select ------------- |
| | //the following "if" added by WraithX to stop deadies from switchin weapons, 4/14/00 |
| | if (!Player_is_dead) |
| | { |
{ | | { |
int d1x_joystick_state[10]; | | int d1x_joystick_state[10]; |
| | |
| | |
//-killed- if ( (use_joystick)&&(kc_joystick[28].value < 255 ) ) Controls.cycle_secondary_state = joy_get_button_state( kc_joystick[28].value ); | | //-killed- if ( (use_joystick)&&(kc_joystick[28].value < 255 ) ) Controls.cycle_secondary_state = joy_get_button_state( kc_joystick[28].value ); |
//end this section addition/kill - VR | | //end this section addition/kill - VR |
//end edit - Victor Rachels | | //end edit - Victor Rachels |
| | }//end "if (!Player_is_dead)" - WraithX |
| | |
//------------- Read slide_on ------------- | | //------------- Read slide_on ------------- |
| | |
| | |
Controls.pitch_time = 0; | | Controls.pitch_time = 0; |
} | | } |
| | |
| | //the following "if" added by WraithX, 4/14/00 |
| | //done so that dead players can't move |
| | if (!Player_is_dead) |
| | { |
//----------- Read vertical_thrust_time ----------------- | | //----------- Read vertical_thrust_time ----------------- |
| | |
if ( slide_on ) { | | if ( slide_on ) { |
| | |
Controls.vertical_thrust_time += mouse_button_down_time(MB_Z_UP)/2; | | Controls.vertical_thrust_time += mouse_button_down_time(MB_Z_UP)/2; |
Controls.vertical_thrust_time -= mouse_button_down_time(MB_Z_DOWN)/2; | | Controls.vertical_thrust_time -= mouse_button_down_time(MB_Z_DOWN)/2; |
} | | } |
| | }//end "if" added by WraithX |
| | |
//---------- Read heading_time ----------- | | //---------- Read heading_time ----------- |
| | |
| | |
Controls.heading_time = 0; | | Controls.heading_time = 0; |
} | | } |
| | |
| | //the following "if" added by WraithX, 4/14/00 |
| | //done so that dead players can't move |
| | if (!Player_is_dead) |
| | { |
//----------- Read sideways_thrust_time ----------------- | | //----------- Read sideways_thrust_time ----------------- |
| | |
if ( slide_on ) { | | if ( slide_on ) { |
| | |
else | | else |
Controls.sideways_thrust_time -= mouse_axis[kc_mouse[17].value]; | | Controls.sideways_thrust_time -= mouse_axis[kc_mouse[17].value]; |
} | | } |
| | }//end "if" added by WraithX |
| | |
//----------- Read bank_time ----------------- | | //----------- Read bank_time ----------------- |
| | |
| | |
Controls.bank_time -= mouse_button_down_time(MB_BANK_RIGHT); | | Controls.bank_time -= mouse_button_down_time(MB_BANK_RIGHT); |
} | | } |
| | |
| | //the following "if" added by WraithX, 4/14/00 |
| | //done so that dead players can't move |
| | if (!Player_is_dead) |
| | { |
//----------- Read forward_thrust_time ------------- | | //----------- Read forward_thrust_time ------------- |
| | |
// From keyboard... | | // From keyboard... |
| | |
if (kc_keyboard[37].value < 255 ) Controls.rear_view_down_state |= keyd_pressed[kc_keyboard[37].value]; | | if (kc_keyboard[37].value < 255 ) Controls.rear_view_down_state |= keyd_pressed[kc_keyboard[37].value]; |
if ((use_joystick)&&(kc_joystick[25].value < 255 )) Controls.rear_view_down_state |= joy_get_button_state(kc_joystick[25].value); | | if ((use_joystick)&&(kc_joystick[25].value < 255 )) Controls.rear_view_down_state |= joy_get_button_state(kc_joystick[25].value); |
if ((use_mouse)&&(kc_mouse[25].value < 255 )) Controls.rear_view_down_state |= mouse_button_state(kc_mouse[25].value); | | if ((use_mouse)&&(kc_mouse[25].value < 255 )) Controls.rear_view_down_state |= mouse_button_state(kc_mouse[25].value); |
| | |
| | }//end "if" added by WraithX |
| | |
//----------- Read automap_down_count | | //----------- Read automap_down_count |
if (kc_keyboard[44].value < 255 ) Controls.automap_down_count += key_down_count(kc_keyboard[44].value); | | if (kc_keyboard[44].value < 255 ) Controls.automap_down_count += key_down_count(kc_keyboard[44].value); |