2006-03-20 17:12:09 +00:00
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ( " PARALLAX " ) . PARALLAX , IN DISTRIBUTING THE CODE TO
END - USERS , AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN , GRANTS A
ROYALTY - FREE , PERPETUAL LICENSE TO SUCH END - USERS FOR USE BY SUCH END - USERS
IN USING , DISPLAYING , AND CREATING DERIVATIVE WORKS THEREOF , SO LONG AS
SUCH USE , DISPLAY OR CREATION IS FOR NON - COMMERCIAL , ROYALTY OR REVENUE
FREE PURPOSES . IN NO EVENT SHALL THE END - USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE - BEARING PURPOSES . THE END - USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE .
COPYRIGHT 1993 - 1999 PARALLAX SOFTWARE CORPORATION . ALL RIGHTS RESERVED .
*/
/*
*
* Prototypes for reading controls
*
*/
# ifndef _KCONFIG_H
# define _KCONFIG_H
# include "config.h"
2011-02-02 00:36:49 +00:00
# include "event.h"
2011-01-04 10:43:37 +00:00
# include "key.h"
# include "joy.h"
# include "mouse.h"
2006-03-20 17:12:09 +00:00
2012-11-11 22:12:51 +00:00
# ifdef __cplusplus
extern " C " {
# endif
2006-03-20 17:12:09 +00:00
typedef struct _control_info {
2012-06-01 09:53:59 +00:00
float key_pitch_forward_down_time , key_pitch_backward_down_time , key_heading_left_down_time , key_heading_right_down_time , key_slide_left_down_time , key_slide_right_down_time , key_slide_up_down_time , key_slide_down_down_time , key_bank_left_down_time , key_bank_right_down_time ; // to scale movement depending on how long the key is pressed
fix pitch_time , vertical_thrust_time , heading_time , sideways_thrust_time , bank_time , forward_thrust_time ;
ubyte key_pitch_forward_state , key_pitch_backward_state , key_heading_left_state , key_heading_right_state , key_slide_left_state , key_slide_right_state , key_slide_up_state , key_slide_down_state , key_bank_left_state , key_bank_right_state ; // to scale movement for keys only we need them to be seperate from joystick/mouse buttons
ubyte btn_slide_left_state , btn_slide_right_state , btn_slide_up_state , btn_slide_down_state , btn_bank_left_state , btn_bank_right_state ;
ubyte slide_on_state , bank_on_state ;
ubyte accelerate_state , reverse_state , cruise_plus_state , cruise_minus_state , cruise_off_count ;
2013-11-02 02:35:38 +00:00
ubyte rear_view_state ;
2013-11-02 02:33:10 +00:00
ubyte fire_primary_state , fire_secondary_state , fire_flare_count , drop_bomb_count ;
2013-11-02 02:37:43 +00:00
ubyte automap_state ;
2012-06-01 09:53:59 +00:00
ubyte cycle_primary_count , cycle_secondary_count , select_weapon_count ;
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_II)
ubyte toggle_bomb_count ;
2012-06-01 09:53:59 +00:00
ubyte afterburner_state , headlight_count , energy_to_shield_state ;
2013-03-03 01:03:33 +00:00
# endif
2013-01-03 15:57:24 +00:00
fix joy_axis [ JOY_MAX_AXES ] , raw_joy_axis [ JOY_MAX_AXES ] , mouse_axis [ 3 ] , raw_mouse_axis [ 3 ] ;
2011-01-04 10:43:37 +00:00
} control_info ;
2006-03-20 17:12:09 +00:00
2010-02-21 01:25:27 +00:00
# define CONTROL_USING_JOYSTICK 1
# define CONTROL_USING_MOUSE 2
2011-01-04 10:43:37 +00:00
# define MOUSEFS_DELTA_RANGE 512
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_I)
2013-08-16 21:47:00 +00:00
# define NUM_DXX_REBIRTH_CONTROLS 30
# define MAX_DXX_REBIRTH_CONTROLS 30
2013-03-03 01:03:33 +00:00
# define NUM_KEY_CONTROLS 50
# define NUM_JOYSTICK_CONTROLS 48
# define NUM_MOUSE_CONTROLS 29
# define MAX_CONTROLS 50
# elif defined(DXX_BUILD_DESCENT_II)
2013-08-16 21:47:00 +00:00
# define NUM_DXX_REBIRTH_CONTROLS 30
# define MAX_DXX_REBIRTH_CONTROLS 30
2006-03-20 17:12:09 +00:00
# define NUM_KEY_CONTROLS 57
2007-03-06 10:36:37 +00:00
# define NUM_JOYSTICK_CONTROLS 56
2007-05-14 13:38:44 +00:00
# define NUM_MOUSE_CONTROLS 30
2006-03-20 17:12:09 +00:00
# define MAX_CONTROLS 60 // there are actually 48, so this leaves room for more
2013-03-03 01:03:33 +00:00
# endif
2006-03-20 17:12:09 +00:00
2009-12-02 13:49:54 +00:00
extern control_info Controls ;
2011-02-02 00:36:49 +00:00
extern void kconfig_read_controls ( d_event * event , int automap_flag ) ;
2013-06-08 22:24:17 +00:00
extern void kconfig ( int n , const char * title ) ;
2009-12-02 13:49:54 +00:00
2013-07-21 00:03:08 +00:00
# if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
2013-08-16 21:47:00 +00:00
extern const ubyte DefaultKeySettingsRebirth [ MAX_DXX_REBIRTH_CONTROLS ] ;
2012-07-22 23:17:54 +00:00
extern const ubyte DefaultKeySettings [ 3 ] [ MAX_CONTROLS ] ;
2013-07-21 00:03:08 +00:00
# endif
2006-03-20 17:12:09 +00:00
extern void kc_set_controls ( ) ;
//set the cruise speed to zero
extern void reset_cruise ( void ) ;
2012-11-11 00:12:17 +00:00
extern char * joybutton_text [ JOY_MAX_BUTTONS ] ;
extern char * joyaxis_text [ JOY_MAX_AXES ] ;
2012-11-11 00:14:30 +00:00
extern fix Cruise_speed ;
2012-11-11 00:12:17 +00:00
2012-11-11 22:12:51 +00:00
# ifdef __cplusplus
}
# endif
2006-03-20 17:12:09 +00:00
# endif /* _KCONFIG_H */