X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_in.h;h=b56e9f4640f1c7f54dc73ddc15275f1a7ed528ce;hb=c060c91a1c7e418122606fdc5cd7c9ce5a55495d;hp=36cc96bfe4e9672c3118e3e9466f6bb5eebaf1cf;hpb=eeed3f1dd956a367532007219c336ea22e68ffcd;p=16.git diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 36cc96bf..b56e9f46 100755 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -29,20 +29,19 @@ #include #include "src/lib/16_head.h" -#include "src/lib/timer.h" -#include "src/lib/bitmap.h" -#include "src/lib/planar.h" - -#ifdef __DEBUG__ -//#define __DEBUG_InputMgr__ -#endif - -#ifdef __DEBUG_InputMgr__ -//#define TESTKEYIN -//#define TESTCONTROLNOISY +#include "src/lib/16_timer.h" +#ifdef __WATCOMC__ //borland C BCEXMM.EXE +#include "src/lib/16_dbg.h" +#include "src/lib/16_spri.h" +#include "src/lib/16_enti.h" +//#include "src/lib/bitmap.h" //old format #endif -static word testkeyin=0,testcontrolnoisy=0; +//if else for gfxtesting and direction +//player[pn].d == 2 || +//player[pn].d != 2 || +#define DIRECTIONIFELSE (player[pn].info.dir == 2) +//#define NDIRECTIONIFELSE (player[pn].info.dir != 2) #define KeyInt 9 // The keyboard ISR number @@ -51,13 +50,13 @@ static word testkeyin=0,testcontrolnoisy=0; #define JoyScaleShift 8 #define MaxJoyValue 5000 -#define MaxPlayers 4 +#define MaxPlayers 2//futre plans for multiple playable charaters and being able to alternate #define MaxKbds 2 #define MaxJoys 2 #define MaxPads 2 #define NumCodes 128 -typedef byte ScanCode; +//typedef byte ScanCode; #define sc_None 0 #define sc_Bad 0xff #define sc_Return 0x1c @@ -156,15 +155,14 @@ typedef enum { demo_Off,demo_Record,demo_Playback,demo_PlayDone } Demo; #endif -typedef enum { +//moved to 16_tdef.h +/*typedef enum { //ctrl_None, // MDM (GAMERS EDGE) - added ctrl_Keyboard, ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2, ctrl_Joystick, ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2, ctrl_Mouse, - ctrl_Joypad, - ctrl_Joypad1 = ctrl_Joypad,ctrl_Joypad2 } ControlType; typedef enum { motion_Left = -1,motion_Up = -1, @@ -205,10 +203,6 @@ typedef struct { joyMultXL,joyMultYL, joyMultXH,joyMultYH; } JoystickDef; -typedef struct -{ - boolean w; -} JoypadDef; typedef struct { @@ -220,18 +214,25 @@ typedef struct 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 - byte d; //direction!! wwww - byte q; //loop variable + byte d; //direction to render sprite!! wwww + byte q; //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www + byte near pdir; //previous direction~ word speed; //player speed! -//0000 planar_buf_t huge *data; //supposively the sprite sheet data -// planar_buf_t data; //supposively the sprite sheet data -////0000---- - bitmap_t huge *data; //supposively the sprite sheet data + word spt; //speed per tile +#ifdef __WATCOMC__ + struct sprite *spri; //supposively the sprite sheet data + memptr gr; + entity_t *ent; +#endif + bitmap_t *data; //supposively the sprite sheet data//old format + bitmap_t bmp; sword hp; //hitpoints of the player - int persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */ + int persist_aniframe; // gonna be increased to 1 before being used, so 0 is ok for default CursorInfo info; ControlType Controls; -} player_t; +//newer vars + int dx, dy, delta; //TODO: what is this? ^^ +} player_t;*/ /* ============================================================================= @@ -244,7 +245,6 @@ typedef struct { boolean MousePresent; boolean JoysPresent[MaxJoys]; - boolean JoyPadPresent[MaxPads]; boolean Keyboard[NumCodes]; boolean Paused; char LastASCII; @@ -252,7 +252,6 @@ typedef struct KeyboardDef KbdDefs[MaxKbds]; JoystickDef JoyDefs[MaxJoys]; - JoypadDef JoypadDefs[MaxPads]; } inpu;*/ #ifdef DEMO0 @@ -285,8 +284,8 @@ 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 near IN_ReadControl(int playnum,player_t *player); -extern void IN_SetControlType(word playnum,player_t *player,ControlType type); +extern void near IN_ReadControl(word pn, player_t *player); +extern void IN_SetControlType(word pn,player_t *player,ControlType type); #if DEMO0 extern boolean IN_StartDemoRecord(word bufsize); extern void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize); @@ -303,5 +302,7 @@ 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); +extern ScanCode IN_GetLastScan(); +extern ScanCode IN_GetCurCode(); #endif