]> 4ch.mooo.com Git - 16.git/commitdiff
wwww
authorsparky4 <sparky4@cock.li>
Sun, 3 Apr 2016 17:57:47 +0000 (12:57 -0500)
committersparky4 <sparky4@cock.li>
Sun, 3 Apr 2016 17:57:47 +0000 (12:57 -0500)
src/lib/16_in.c
src/lib/16_in.h

index 61d6e689995e8b7fbf984ad8ecea8637500fb3e4..1863e2ad2c98636f5a59957933637aeb529fe4b8 100755 (executable)
@@ -51,7 +51,6 @@ struct inconfig
 {\r
        boolean                 MousePresent;\r
        boolean                 JoysPresent[MaxJoys];\r
-//     boolean                 JoyPadPresent[MaxPads];\r
        boolean         Keyboard[NumCodes];\r
        boolean         Paused;\r
        char            LastASCII;\r
@@ -59,7 +58,6 @@ struct inconfig
 \r
        KeyboardDef     KbdDefs[MaxKbds];\r
        JoystickDef     JoyDefs[MaxJoys];\r
-//     JoypadDef       JoypadDefs[MaxPads];\r
 } inpu;\r
 \r
 //extern inconfig inpu;\r
@@ -380,6 +378,41 @@ static     word    lasttime;
        IN_GetJoyAbs(joy,&x,&y);\r
        def = inpu.JoyDefs + joy;\r
 \r
+       //TODO: inject p16 input controls!\r
+       //which is this\r
+       /*                      if(DIRECTIONIFELSE)\r
+                       {\r
+                       if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){\r
+                               if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]))\r
+                                       my = motion_Up;\r
+                               if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up]))\r
+                                       my = motion_Down;\r
+                       }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
+                               if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]))\r
+                                       mx = motion_Left;\r
+                               if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left]))// || player[pn].pdir != 1)\r
+                                       mx = motion_Right;\r
+                       }else\r
+                               //if(mx+my!=1 && mx+my!=-1 && mx!=my!=0)\r
+                               {       //2 keys pressed\r
+                                       switch (player[pn].pdir)\r
+                                       {\r
+                                               case 0:\r
+                                               case 4:\r
+                                                       if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right])) dir = DirTable[1];\r
+                                                       else if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left])) dir = DirTable[3];\r
+                                               break;\r
+                                               case 1:\r
+                                               case 3:\r
+                                                       if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down])) dir = DirTable[0];\r
+                                                       else if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up])) dir = DirTable[4];\r
+                                               break;\r
+                                               default:\r
+                                               break;\r
+                                       }\r
+                                       if(testcontrolnoisy > 0){ printf("dir=%c ", dirchar(dir)); printf("pdir=%c      ", dirchar(player[pn].pdir)); }\r
+                               }//else printf("                                ");\r
+                       }*/\r
        if (x < def->threshMinX)\r
        {\r
                if (x < def->joyMinX)\r
@@ -678,8 +711,6 @@ IN_Default(boolean gotit,player_t *player,ControlType nt)
        ||      ((nt == ctrl_Joystick1) && !inpu.JoysPresent[0])\r
        ||      ((nt == ctrl_Joystick2) && !inpu.JoysPresent[1])\r
        ||      ((nt == ctrl_Mouse) && !inpu.MousePresent)\r
-//     ||      ((nt == ctrl_Joypad1) && !inpu.JoyPadPresent[0])\r
-//     ||      ((nt == ctrl_Joypad2) && !inpu.JoyPadPresent[1])\r
        )\r
                nt = ctrl_Keyboard1;\r
        inpu.KbdDefs[0].button0 = 0x1c;\r
@@ -898,8 +929,6 @@ register    KeyboardDef     *def;
                                buttons += 1 << 1;\r
                        realdelta = false;\r
                        break;\r
-//             case ctrl_Joypad1:\r
-//             case ctrl_Joypad2:\r
                case ctrl_Joystick1:\r
                case ctrl_Joystick2:\r
                        INL_GetJoyDelta(type - ctrl_Joystick,&dx,&dy,false);\r
index 9b2705859385605f403125987974f19bf8c860ae..ec9b56a2f424b25454f12fed1e8c3e5f77720d25 100755 (executable)
@@ -169,8 +169,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
@@ -211,10 +209,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
@@ -252,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
@@ -260,7 +253,6 @@ typedef     struct
 \r
        KeyboardDef     KbdDefs[MaxKbds];\r
        JoystickDef     JoyDefs[MaxJoys];\r
-       JoypadDef       JoypadDefs[MaxPads];\r
 } inpu;*/\r
 \r
 #ifdef DEMO0\r