OSDN Git Service

trying to figure out the issue with player sprite with pcx
[proj16/16.git] / src / lib / 16_in.h
index ad6d073..e0efe8c 100755 (executable)
 \r
 #include <string.h>\r
 #include "src/lib/16_head.h"\r
-#include "src/lib/timer.h"\r
-#include "src/lib/bitmap.h"\r
-\r
-#ifdef __DEBUG__\r
-//#define      __DEBUG_InputMgr__\r
+#include "src/lib/16_timer.h"\r
+#ifdef __WATCOMC__     //borland C BCEXMM.EXE\r
+#include "src/lib/16_dbg.h"\r
+#include "src/lib/16_sprit.h"\r
+#include "src/lib/16_enti.h"\r
+//#include "src/lib/bitmap.h"  //old format\r
 #endif\r
 \r
-extern boolean testkeyin,testcontrolnoisy;\r
-\r
-#ifdef __DEBUG_InputMgr__\r
-//#define TESTKEYIN\r
-//#define TESTCONTROLNOISY\r
-#endif\r
+//if else for gfxtesting and direction\r
+//player[pn].d == 2 ||\r
+//player[pn].d != 2 ||\r
+#define DIRECTIONIFELSE        (player[pn].info.dir == 2)\r
+//#define NDIRECTIONIFELSE     (player[pn].info.dir != 2)\r
 \r
 #define        KeyInt  9       // The keyboard ISR number\r
 \r
@@ -50,7 +50,7 @@ extern boolean testkeyin,testcontrolnoisy;
 #define        JoyScaleShift   8\r
 #define        MaxJoyValue             5000\r
 \r
-#define        MaxPlayers      4\r
+#define        MaxPlayers              2//futre plans for multiple playable charaters and being able to alternate\r
 #define        MaxKbds         2\r
 #define        MaxJoys         2\r
 #define        MaxPads         2\r
@@ -162,8 +162,6 @@ typedef     enum            {
                                                ctrl_Joystick,\r
                                                        ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,\r
                                                ctrl_Mouse,\r
-                                               ctrl_Joypad,\r
-                                                       ctrl_Joypad1 = ctrl_Joypad,ctrl_Joypad2\r
                                        } ControlType;\r
 typedef        enum            {\r
                                                motion_Left = -1,motion_Up = -1,\r
@@ -204,10 +202,6 @@ typedef    struct          {
                                                                        joyMultXL,joyMultYL,\r
                                                                        joyMultXH,joyMultYH;\r
                                        } JoystickDef;\r
-typedef        struct\r
-{\r
-       boolean w;\r
-} JoypadDef;\r
 \r
 typedef        struct\r
 {\r
@@ -219,14 +213,26 @@ typedef   struct
        int triggery; //player's trigger box tile position on the viewable map\r
        int sheetsetx; //NOT USED YET! player sprite sheet set on the image x\r
        int sheetsety; //NOT USED YET! player sprite sheet set on the image y\r
-       word d; //direction!! wwww\r
-       word q; //loop variable\r
+       byte d;         //direction to render sprite!! wwww\r
+       byte q;         //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www\r
+       byte near pdir; //previous direction~\r
+       //byte near kd[2];      //array of arrow key pressed\r
        word speed;             //player speed!\r
-       bitmap_t data; //supposively the sprite sheet data\r
+       word spt;               //speed per tile\r
+//0000 planar_buf_t huge *data; //supposively the sprite sheet data\r
+//     planar_buf_t data; //supposively the sprite sheet data\r
+////0000----\r
+#ifdef __WATCOMC__\r
+       struct sprite   *spri;  //supposively the sprite sheet data\r
+       memptr          gr;\r
+       entity_t                *ent;\r
+#endif\r
+       bitmap_t __far *data;           //supposively the sprite sheet data//old format\r
        sword hp; //hitpoints of the player\r
        int persist_aniframe;    /* gonna be increased to 1 before being used, so 0 is ok for default */\r
        CursorInfo      info;\r
        ControlType     Controls;\r
+       int dx, dy, delta;      //TODO: what is this? ^^\r
 } player_t;\r
 \r
 /*\r
@@ -240,7 +246,6 @@ typedef     struct
 {\r
        boolean                 MousePresent;\r
        boolean                 JoysPresent[MaxJoys];\r
-       boolean                 JoyPadPresent[MaxPads];\r
        boolean         Keyboard[NumCodes];\r
        boolean         Paused;\r
        char            LastASCII;\r
@@ -248,7 +253,6 @@ typedef     struct
 \r
        KeyboardDef     KbdDefs[MaxKbds];\r
        JoystickDef     JoyDefs[MaxJoys];\r
-       JoypadDef       JoypadDefs[MaxPads];\r
 } inpu;*/\r
 \r
 #ifdef DEMO0\r
@@ -281,8 +285,8 @@ extern void IN_SetKeyHook(void (*hook)());
 extern void IN_ClearKeysDown();\r
 //static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy);\r
 extern void IN_ReadCursor(CursorInfo *info);\r
-extern void near IN_ReadControl(int playnum,player_t *player);\r
-extern void IN_SetControlType(word playnum,player_t *player,ControlType type);\r
+extern void near IN_ReadControl(int pn,player_t *player);\r
+extern void IN_SetControlType(word pn,player_t *player,ControlType type);\r
 #if DEMO0\r
 extern boolean IN_StartDemoRecord(word bufsize);\r
 extern void IN_StartDemoPlayback(byte /*__segment*/ *buffer,word bufsize);\r
@@ -299,5 +303,6 @@ extern boolean IN_UserInput(dword delay,boolean clear);
 extern boolean IN_KeyDown(byte code);\r
 extern void IN_ClearKey(byte code);\r
 extern boolean IN_qb(byte kee);\r
+void IN_initplayer(player_t *player, word pn);\r
 \r
 #endif\r