X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_in.h;h=eecfae5905bd772859827f1c8385ad0d2779825c;hb=ffd855e814f3aa4f300915ffca12be6f5763e608;hp=1036b6ec8eeaaa7e9294e8fbaa3ee21823a2c50d;hpb=a423e762973f70f457b66845696d58aa597291ed;p=16.git diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 1036b6ec..eecfae59 100644 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -20,23 +20,24 @@ // ID Engine // ID_IN.h - Header file for Input Manager // v1.0d1w -// By Jason Blochowiak +// By Jason Blochowiak // Open Watcom port by sparky4 // #ifndef __16_IN__ #define __16_IN__ - + #include -#include "src/lib/lib_head.h" +#include "src/lib/16_head.h" +#include "src/lib/bitmap.h" #ifdef __DEBUG__ -#define __DEBUG_InputMgr__ -#endif +//#define __DEBUG_InputMgr__ +#endif #ifdef __DEBUG_InputMgr__ -#define TESTKEYIN -#define TESTCONTROLNOISY +#define TESTKEYIN +//#define TESTCONTROLNOISY #endif #define KeyInt 9 // The keyboard ISR number @@ -48,7 +49,7 @@ #define MaxPlayers 4 #define MaxKbds 2 -#define MaxJoys 2 +#define MaxJoys 2 #define MaxPads 2 #define NumCodes 128 @@ -135,10 +136,10 @@ typedef byte ScanCode; #define key_BackSpace 0x08 #define key_Tab 0x09 #define key_Delete 0x7f - -#define key_LSuper 0x5b -#define key_RSuper 0x5c -#define key_Menu 0x5d + +#define key_LSuper 0x5b +#define key_RSuper 0x5c +#define key_Menu 0x5d // Stuff for the mouse #define MReset 0 @@ -157,8 +158,8 @@ typedef enum { ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2, ctrl_Joystick, ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2, - ctrl_Mouse, - ctrl_Joypad, + ctrl_Mouse, + ctrl_Joypad, ctrl_Joypad1 = ctrl_Joypad,ctrl_Joypad2 } ControlType; typedef enum { @@ -166,12 +167,12 @@ typedef enum { motion_None = 0, motion_Right = 1,motion_Down = 1 } Motion; -typedef enum { - dir_North,//dir_NorthEast, - dir_West,//dir_Nortinest, +typedef enum { + dir_North,//dir_NorthEast, + dir_West,//dir_Nortinest, dir_None, - dir_East,//,dir_SouthEast, - dir_South,//dir_Soutinest, + dir_East,//,dir_SouthEast, + dir_South,//dir_Soutinest, } Direction; typedef struct { boolean button0,button1,button2,button3; @@ -183,9 +184,9 @@ typedef struct { typedef struct { ScanCode button0,button1, //upleft, - up, - down, - left, + up, + down, + left, right //upright, //downleft, @@ -199,101 +200,103 @@ typedef struct { joyMaxX,joyMaxY, joyMultXL,joyMultYL, joyMultXH,joyMultYH; - } JoystickDef; -typedef struct -{ + } JoystickDef; +typedef struct +{ boolean w; -} JoypadDef; - -typedef struct -{ - int x; //player exact position on the viewable map - int y; //player exact position on the viewable map - int tx; //player tile position on the viewable map - int ty; //player tile position on the viewable map - int triggerx; //player's trigger box tile position on the viewable map - int triggery; //player's trigger box tile position on the viewable map - int setx; //NOT USED YET! player sprite sheet set on the image x - int sety; //NOT USED YET! player sprite sheet set on the image y +} JoypadDef; + +typedef struct +{ + int x; //player exact position on the viewable map + int y; //player exact position on the viewable map + int tx; //player tile position on the viewable map + int ty; //player tile position on the viewable map + int triggerx; //player's trigger box tile position on the viewable map + int triggery; //player's trigger box tile position on the viewable map + int sheetsetx; //NOT USED YET! player sprite sheet set on the image x + int sheetsety; //NOT USED YET! player sprite sheet set on the image y + word d; //direction!! wwww word q; //loop variable -// word d; //direction - //bitmap_t data; //supposively the sprite sheet data - int hp; //hitpoints of the player - CursorInfo info; + word speed; //player speed! + bitmap_t data; //supposively the sprite sheet data + sword hp; //hitpoints of the player + int persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */ + CursorInfo info; ControlType Controls; -} player_t; - +} player_t; + /* ============================================================================= GLOBAL VARIABLES ============================================================================= -*/ -/*extern struct inconfig -{ +*/ +/*extern struct inconfig +{ boolean MousePresent; boolean JoysPresent[MaxJoys]; - boolean JoyPadPresent[MaxPads]; + boolean JoyPadPresent[MaxPads]; boolean Keyboard[NumCodes]; boolean Paused; char LastASCII; - ScanCode LastScan; - - KeyboardDef KbdDefs[MaxKbds]; - JoystickDef JoyDefs[MaxJoys]; - JoypadDef JoypadDefs[MaxPads]; -} inpu;*/ - + ScanCode LastScan; + + KeyboardDef KbdDefs[MaxKbds]; + JoystickDef JoyDefs[MaxJoys]; + JoypadDef JoypadDefs[MaxPads]; +} inpu;*/ + #ifdef DEMO0 static Demo DemoMode = demo_Off; static byte /*_seg*/ *DemoBuffer; static word DemoOffset,DemoSize; #endif - + extern dword far* clockdw; -// Internal routines -extern void interrupt INL_KeyService(); -extern void Mouse(int x); -//static void INL_GetMouseDelta(int *x,int *y); -//static word INL_GetMouseButtons(void); -extern void IN_GetJoyAbs(word joy,word *xp,word *yp); -//static void INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive); -//static word INL_GetJoyButtons(word joy); -extern word IN_GetJoyButtonsDB(word joy); -//static void INL_StartKbd(void); -//static void INL_ShutKbd(void); -//static boolean INL_StartMouse(void); -//static void INL_ShutMouse(void); -//static void INL_SetJoyScale(word joy); -extern void IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy); -//static boolean INL_StartJoy(word joy); -//static void INL_ShutJoy(word joy); -extern void IN_Startup(); -extern void IN_Default(boolean gotit,player_t *player,ControlType nt); -extern void IN_Shutdown(); -extern void IN_SetKeyHook(void (*hook)()); -extern void IN_ClearKeysDown(); -//static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy); -extern void IN_ReadCursor(CursorInfo *info); -extern void IN_ReadControl(int playnum,player_t *player); -extern void IN_SetControlType(word playnum,player_t *player,ControlType type); -#if DEMO0 -extern boolean IN_StartDemoRecord(word bufsize); -extern void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize); -extern void IN_StopDemo(void); -extern void IN_FreeDemoBuffer(void); -#endif -extern byte *IN_GetScanName(ScanCode scan); -extern ScanCode IN_WaitForKey(); -extern char IN_WaitForASCII(); -extern void IN_AckBack(); -extern void IN_Ack(); -extern boolean IN_IsUserInput(); -extern boolean IN_UserInput(dword delay,boolean clear); -extern boolean IN_KeyDown(byte code); -extern void IN_ClearKey(byte code); -extern boolean IN_qb(byte kee); +// Internal routines +extern void interrupt INL_KeyService(); +extern void Mouse(int x); +//static void INL_GetMouseDelta(int *x,int *y); +//static word INL_GetMouseButtons(void); +extern void IN_GetJoyAbs(word joy,word *xp,word *yp); +//static void INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive); +//static word INL_GetJoyButtons(word joy); +extern word IN_GetJoyButtonsDB(word joy); +//static void INL_StartKbd(void); +//static void INL_ShutKbd(void); +//static boolean INL_StartMouse(void); +//static void INL_ShutMouse(void); +//static void INL_SetJoyScale(word joy); +extern void IN_SetupJoy(word joy,word minx,word maxx,word miny,word maxy); +//static boolean INL_StartJoy(word joy); +//static void INL_ShutJoy(word joy); +extern void IN_Startup(); +extern void IN_Default(boolean gotit,player_t *player,ControlType nt); +extern void IN_Shutdown(); +extern void IN_SetKeyHook(void (*hook)()); +extern void IN_ClearKeysDown(); +//static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy); +extern void IN_ReadCursor(CursorInfo *info); +extern void IN_ReadControl(int playnum,player_t *player); +extern void IN_SetControlType(word playnum,player_t *player,ControlType type); +#if DEMO0 +extern boolean IN_StartDemoRecord(word bufsize); +extern void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize); +extern void IN_StopDemo(void); +extern void IN_FreeDemoBuffer(void); +#endif +extern byte *IN_GetScanName(ScanCode scan); +extern ScanCode IN_WaitForKey(); +extern char IN_WaitForASCII(); +extern void IN_AckBack(); +extern void IN_Ack(); +extern boolean IN_IsUserInput(); +extern boolean IN_UserInput(dword delay,boolean clear); +extern boolean IN_KeyDown(byte code); +extern void IN_ClearKey(byte code); +extern boolean IN_qb(byte kee); #endif