]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_in.h
__seguse.txt added to show _seg usage also OpenVGMFile needs to be ported to 16_snd...
[16.git] / src / lib / 16_in.h
old mode 100644 (file)
new mode 100755 (executable)
index be4d81e..39519c2
 #define        __16_IN__\r
 \r
 #include <string.h>\r
-#include "src/lib/16_head.h"
-#include "src/lib/bitmap.h"\r
-\r
-#ifdef __DEBUG__\r
-//#define      __DEBUG_InputMgr__\r
+#include "src/lib/16_head.h"\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_spri.h"\r
+#include "src/lib/16_enti.h"\r
+//#include "src/lib/bitmap.h"  //old format\r
 #endif\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
 #define        JoyScaleShift   8\r
 #define        MaxJoyValue             5000\r
 \r
-#define        MaxPlayers      4\r
+//#define      MaxPlayers              2//future plans for multiple playable charaters and being able to alternate\r
 #define        MaxKbds         2\r
 #define        MaxJoys         2\r
 #define        MaxPads         2\r
 #define        NumCodes        128\r
 \r
-typedef        byte            ScanCode;\r
+//typedef      byte            ScanCode;\r
 #define        sc_None                 0\r
 #define        sc_Bad                  0xff\r
 #define        sc_Return               0x1c\r
@@ -152,15 +155,14 @@ typedef   enum            {
                                                demo_Off,demo_Record,demo_Playback,demo_PlayDone\r
                                        } Demo;\r
 #endif\r
-typedef        enum            {\r
+//moved to 16_tdef.h\r
+/*typedef      enum            {\r
                                                //ctrl_None,                            // MDM (GAMERS EDGE) - added\r
                                                ctrl_Keyboard,\r
                                                        ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,\r
                                                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
@@ -175,14 +177,14 @@ typedef   enum            {
                                                dir_South,//dir_Soutinest,\r
                                        } Direction;\r
 typedef        struct          {\r
-                                               boolean         button0,button1,button2,button3;\r
-                                               int                     x,y;\r
-                                               Motion          xaxis,yaxis;\r
-                                               Direction       dir;\r
+                                               boolean near    button0,button1,button2,button3;\r
+                                               int     near            x,y;\r
+                                               Motion  near    xaxis,yaxis;\r
+                                               Direction near  dir;\r
                                        } CursorInfo;\r
 \r
 typedef        struct          {\r
-                                               ScanCode        button0,button1,\r
+                                               ScanCode near   button0,button1,\r
                                                                        //upleft,\r
                                                                        up,\r
                                                                        down,\r
@@ -194,17 +196,13 @@ typedef   struct          {
                                                                        ;\r
                                        } KeyboardDef;\r
 typedef        struct          {\r
-                                               word            joyMinX,joyMinY,\r
+                                               word    near    joyMinX,joyMinY,\r
                                                                        threshMinX,threshMinY,\r
                                                                        threshMaxX,threshMaxY,\r
                                                                        joyMaxX,joyMaxY,\r
                                                                        joyMultXL,joyMultYL,\r
                                                                        joyMultXH,joyMultYH;\r
                                        } JoystickDef;\r
-typedef        struct\r
-{\r
-       boolean w;\r
-} JoypadDef;\r
 \r
 typedef        struct\r
 {\r
@@ -214,17 +212,27 @@ typedef   struct
        int ty; //player tile position on the viewable map\r
        int triggerx; //player's trigger box tile position on the viewable map\r
        int triggery; //player's trigger box tile position on the viewable map\r
-       int setx; //NOT USED YET! player sprite sheet set on the image x\r
-       int sety; //NOT USED YET! player sprite sheet set on the image y
-       word d; //direction!! wwww\r
-       word q; //loop variable
+       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
+       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
        word speed;             //player speed!\r
-       bitmap_t data; //supposively the sprite sheet data\r
-       sword hp; //hitpoints of the player
-       int persist_aniframe;    /* gonna be increased to 1 before being used, so 0 is ok for default */\r
+       word spt;               //speed per tile\r
+#ifdef __WATCOMC__\r
+       struct sprite   *spri;  //supposively the sprite sheet data\r
+       memptr          gr;\r
+       entity_t                *ent;\r
+#endif\r
+       bitmap_t        *data;          //supposively the sprite sheet data//old format\r
+       bitmap_t        bmp;\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;
-} player_t;\r
+       ControlType     Controls;\r
+//newer vars\r
+       int dx, dy, delta;      //TODO: what is this? ^^\r
+} player_t;*/\r
 \r
 /*\r
 =============================================================================\r
@@ -237,7 +245,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
@@ -245,7 +252,6 @@ typedef     struct
 \r
        KeyboardDef     KbdDefs[MaxKbds];\r
        JoystickDef     JoyDefs[MaxJoys];\r
-       JoypadDef       JoypadDefs[MaxPads];\r
 } inpu;*/\r
 \r
 #ifdef DEMO0\r
@@ -254,8 +260,6 @@ typedef     struct
                static word             DemoOffset,DemoSize;\r
 #endif\r
 \r
-extern dword far* clockdw;\r
-\r
 //     Internal routines\r
 extern void interrupt INL_KeyService();\r
 extern void Mouse(int x);\r
@@ -280,8 +284,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 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(word 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
@@ -298,5 +302,7 @@ 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
+extern ScanCode IN_GetLastScan();\r
+extern ScanCode IN_GetCurCode();\r
 \r
 #endif\r