X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_in.h;h=9e4bfc2e88ae047cf49024a4e5919e5818cc117a;hb=8e974b9ed72a1521714ea3cf96a9b87c68db8025;hp=68f2d7211155d281985c47a99ea2d1e1247cb27c;hpb=4d65c704b6a652a66cbff653c192fcc8aca6ef30;p=16.git diff --git a/src/lib/16_in.h b/src/lib/16_in.h old mode 100644 new mode 100755 index 68f2d721..9e4bfc2e --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -29,15 +29,19 @@ #include #include "src/lib/16_head.h" - -#ifdef __DEBUG__ -//#define __DEBUG_InputMgr__ +#include "src/lib/16_timer.h" +#ifdef __WATCOMC__ //borland C BCEXMM.EXE +#include "src/lib/16_dbg.h" +#include "src/lib/16_sprit.h" +#include "src/lib/16_enti.h" +//#include "src/lib/bitmap.h" //old format #endif -#ifdef __DEBUG_InputMgr__ -#define TESTKEYIN -#define TESTCONTROLNOISY -#endif +//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 @@ -46,7 +50,7 @@ #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 @@ -158,8 +162,6 @@ typedef enum { 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, @@ -174,14 +176,14 @@ typedef enum { dir_South,//dir_Soutinest, } Direction; typedef struct { - boolean button0,button1,button2,button3; - int x,y; - Motion xaxis,yaxis; - Direction dir; + boolean near button0,button1,button2,button3; + int near x,y; + Motion near xaxis,yaxis; + Direction near dir; } CursorInfo; typedef struct { - ScanCode button0,button1, + ScanCode near button0,button1, //upleft, up, down, @@ -193,17 +195,13 @@ typedef struct { ; } KeyboardDef; typedef struct { - word joyMinX,joyMinY, + word near joyMinX,joyMinY, threshMinX,threshMinY, threshMaxX,threshMaxY, joyMaxX,joyMaxY, joyMultXL,joyMultYL, joyMultXH,joyMultYH; } JoystickDef; -typedef struct -{ - boolean w; -} JoypadDef; typedef struct { @@ -213,14 +211,28 @@ typedef struct 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 - word q; //loop variable -// word d; //direction - //bitmap_t data; //supposively the sprite sheet data - int hp; //hitpoints of the player + 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 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~ + //byte near kd[2]; //array of arrow key pressed + word speed; //player speed! + word spt; //speed per tile +//0000 planar_buf_t huge *data; //supposively the sprite sheet data +// planar_buf_t data; //supposively the sprite sheet data +////0000---- +#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 + 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; + int dx, dy, delta; //TODO: what is this? ^^ } player_t; /* @@ -234,7 +246,6 @@ typedef struct { boolean MousePresent; boolean JoysPresent[MaxJoys]; - boolean JoyPadPresent[MaxPads]; boolean Keyboard[NumCodes]; boolean Paused; char LastASCII; @@ -242,7 +253,6 @@ typedef struct KeyboardDef KbdDefs[MaxKbds]; JoystickDef JoyDefs[MaxJoys]; - JoypadDef JoypadDefs[MaxPads]; } inpu;*/ #ifdef DEMO0 @@ -251,8 +261,6 @@ typedef struct static word DemoOffset,DemoSize; #endif -extern dword far* clockdw; - // Internal routines extern void interrupt INL_KeyService(); extern void Mouse(int x); @@ -277,8 +285,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 IN_ReadControl(int playnum,player_t *player); -extern void IN_SetControlType(word playnum,player_t *player,ControlType type); +extern void near IN_ReadControl(int 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); @@ -295,5 +303,6 @@ 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); +void IN_initplayer(player_t *player, word pn); #endif