Commit bcd61803 authored by Steven Fuller's avatar Steven Fuller

Some cleanups on id_in

parent 2bb2fbd9
...@@ -22,3 +22,4 @@ ...@@ -22,3 +22,4 @@
* Have some sort of way of playing both digital and adlib sounds on all * Have some sort of way of playing both digital and adlib sounds on all
platforms... platforms...
* Test with other (compatible) available mods * Test with other (compatible) available mods
* Unified input handling
...@@ -15,21 +15,19 @@ ...@@ -15,21 +15,19 @@
// //
boolean MousePresent; boolean MousePresent;
boolean JoysPresent[MaxJoys]; boolean JoysPresent[MaxJoys];
boolean JoyPadPresent;
// Global variables // Global variables
boolean Keyboard[NumCodes]; boolean Keyboard[NumCodes];
boolean Paused; boolean Paused;
char LastASCII; char LastASCII;
ScanCode LastScan; ScanCode LastScan;
/*
KeyboardDef KbdDefs = {0x1d,0x38,0x47,0x48,0x49,0x4b,0x4d,0x4f,0x50,0x51};
*/
KeyboardDef KbdDefs = {sc_Control, sc_Alt, sc_Home, sc_UpArrow, sc_PgUp, sc_LeftArrow, sc_RightArrow, sc_End, sc_DownArrow, sc_PgDn};
KeyboardDef KbdDefs = {0x1d,0x38,0x47,0x48,0x49,0x4b,0x4d,0x4f,0x50,0x51};
JoystickDef JoyDefs[MaxJoys];
ControlType Controls[MaxPlayers]; ControlType Controls[MaxPlayers];
longword MouseDownCount;
/* /*
============================================================================= =============================================================================
...@@ -434,34 +432,6 @@ void IN_ReadControl(int player,ControlInfo *info) ...@@ -434,34 +432,6 @@ void IN_ReadControl(int player,ControlInfo *info)
} }
///////////////////////////////////////////////////////////////////////////
//
// IN_SetControlType() - Sets the control type to be used by the specified
// player
//
///////////////////////////////////////////////////////////////////////////
void IN_SetControlType(int player, ControlType type)
{
// DEBUG - check that requested type is present?
Controls[player] = type;
}
///////////////////////////////////////////////////////////////////////////
//
// IN_WaitForASCII() - Waits for an ASCII char, then clears LastASCII and
// returns the ASCII value
//
///////////////////////////////////////////////////////////////////////////
char IN_WaitForASCII(void)
{
char result;
while (!(result = LastASCII))
;
LastASCII = '\0';
return(result);
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// //
// IN_Ack() - waits for a button or key press. If a button is down, upon // IN_Ack() - waits for a button or key press. If a button is down, upon
......
...@@ -19,10 +19,19 @@ typedef byte ScanCode; ...@@ -19,10 +19,19 @@ typedef byte ScanCode;
#define sc_CapsLock 0x3a #define sc_CapsLock 0x3a
#define sc_LShift 0x2a #define sc_LShift 0x2a
#define sc_RShift 0x36 #define sc_RShift 0x36
#define sc_UpArrow 0x48
/* TODO: have all these defines map into system specific values */
/*
#define sc_UpArrow 0x48
#define sc_DownArrow 0x50 #define sc_DownArrow 0x50
#define sc_LeftArrow 0x4b #define sc_LeftArrow 0x4b
#define sc_RightArrow 0x4d #define sc_RightArrow 0x4d
*/
#define sc_UpArrow 103
#define sc_DownArrow 108
#define sc_LeftArrow 105
#define sc_RightArrow 106
#define sc_Insert 0x52 #define sc_Insert 0x52
#define sc_Delete 0x53 #define sc_Delete 0x53
#define sc_Home 0x47 #define sc_Home 0x47
...@@ -81,13 +90,6 @@ typedef byte ScanCode; ...@@ -81,13 +90,6 @@ typedef byte ScanCode;
#define sc_Z 0x2c #define sc_Z 0x2c
#define key_None 0 #define key_None 0
#define key_Return 0x0d
#define key_Enter key_Return
#define key_Escape 0x1b
#define key_Space 0x20
#define key_BackSpace 0x08
#define key_Tab 0x09
#define key_Delete 0x7f
typedef enum { typedef enum {
ctrl_Keyboard, ctrl_Keyboard,
...@@ -120,14 +122,6 @@ typedef struct { ...@@ -120,14 +122,6 @@ typedef struct {
left, right, left, right,
downleft, down, downright; downleft, down, downright;
} KeyboardDef; } KeyboardDef;
typedef struct {
word joyMinX,joyMinY,
threshMinX,threshMinY,
threshMaxX,threshMaxY,
joyMaxX,joyMaxY,
joyMultXL,joyMultYL,
joyMultXH,joyMultYH;
} JoystickDef;
// Global variables // Global variables
extern boolean Keyboard[], extern boolean Keyboard[],
MousePresent, MousePresent,
...@@ -136,7 +130,6 @@ extern boolean Paused; ...@@ -136,7 +130,6 @@ extern boolean Paused;
extern char LastASCII; extern char LastASCII;
extern ScanCode LastScan; extern ScanCode LastScan;
extern KeyboardDef KbdDefs; extern KeyboardDef KbdDefs;
extern JoystickDef JoyDefs[];
extern ControlType Controls[MaxPlayers]; extern ControlType Controls[MaxPlayers];
// Function prototypes // Function prototypes
...@@ -144,19 +137,14 @@ extern ControlType Controls[MaxPlayers]; ...@@ -144,19 +137,14 @@ extern ControlType Controls[MaxPlayers];
#define IN_ClearKey(code) {Keyboard[code] = false; \ #define IN_ClearKey(code) {Keyboard[code] = false; \
if (code == LastScan) LastScan = sc_None;} if (code == LastScan) LastScan = sc_None;}
// DEBUG - put names in prototypes
extern void IN_Startup(void),IN_Shutdown(void), extern void IN_Startup(void),IN_Shutdown(void),
IN_Default(boolean gotit,ControlType in),
IN_SetKeyHook(void (*)()),
IN_ClearKeysDown(void), IN_ClearKeysDown(void),
IN_ReadControl(int,ControlInfo *), IN_ReadControl(int,ControlInfo *),
IN_SetControlType(int,ControlType),
IN_GetJoyAbs(word joy,word *xp,word *yp), IN_GetJoyAbs(word joy,word *xp,word *yp),
IN_SetupJoy(word joy,word minx,word maxx, IN_SetupJoy(word joy,word minx,word maxx,
word miny,word maxy), word miny,word maxy),
IN_Ack(void); IN_Ack(void);
extern boolean IN_UserInput(longword delay); extern boolean IN_UserInput(longword delay);
extern char IN_WaitForASCII(void);
extern byte *IN_GetScanName(ScanCode); extern byte *IN_GetScanName(ScanCode);
......
...@@ -54,7 +54,7 @@ unsigned leftmargin[TEXTROWS],rightmargin[TEXTROWS]; ...@@ -54,7 +54,7 @@ unsigned leftmargin[TEXTROWS],rightmargin[TEXTROWS];
char *text; char *text;
unsigned rowon; unsigned rowon;
int picx,picy,picnum,picdelay; int picx,picy,picnum,picdelay;
boolean layoutdone; boolean layoutdone;
//=========================================================================== //===========================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment