]> 4ch.mooo.com Git - 16.git/commitdiff
testing input oops ^^; i mean this output ok so i am abojut to ineject it soon
authorsparky4 <sparky4@cock.li>
Wed, 10 Aug 2016 16:32:27 +0000 (11:32 -0500)
committersparky4 <sparky4@cock.li>
Wed, 10 Aug 2016 16:32:27 +0000 (11:32 -0500)
src/lib/16_in.c

index 47fbe3cdc6e8a9cdd84df1f4dc1008d0ea06da98..8b07fb54b9ae0468a06f365ecc0a90f4a649e722 100755 (executable)
@@ -378,10 +378,6 @@ 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
-       //into joystick code!\r
-       //look at IN_ReadControl\r
        if (x < def->threshMinX)\r
        {\r
                if (x < def->joyMinX)\r
@@ -869,26 +865,24 @@ register  KeyboardDef     *def;
                                        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
+                       }else{  //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
+                                                       if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right])){ dir = DirTable[1]; mx = motion_Left; }\r
+                                                       else if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left])){ dir = DirTable[3]; mx = motion_Right; }\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
+                                                       if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down])){ dir = DirTable[0]; my = motion_Up; }\r
+                                                       else if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up])){ dir = DirTable[4]; my = motion_Down; }\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
                        }\r
                        //input from player\r
                        if (inpu.Keyboard[def->button0])\r
@@ -971,11 +965,11 @@ register  KeyboardDef     *def;
 if(testcontrolnoisy > 0)\r
 if(player[pn].d /*(inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])*/ || player[pn].q>1)\r
 {\r
-       printf("b1=%u b2=%u b3=%u b4=%u ", player[pn].info.button0, player[pn].info.button1, player[pn].info.button2, player[pn].info.button3);\r
-       printf("q=%d ", player[pn].q);\r
-       printf("cpee=%c ", dirchar(conpee));\r
+       //printf("b1=%u b2=%u b3=%u b4=%u       ", player[pn].info.button0, player[pn].info.button1, player[pn].info.button2, player[pn].info.button3);\r
+       //printf("q=%d ", player[pn].q);\r
+       //printf("cpee=%c ", dirchar(conpee));\r
        printf("pdir=%c d=%c dir=%c ", dirchar(player[pn].pdir), dirchar(player[pn].d), dirchar(player[pn].info.dir));\r
-       /*if(realdelta) */printf("dx=%d dy=%d   mx=%d my=%d", player[pn].info.x, player[pn].info.y, player[pn].info.xaxis, player[pn].info.yaxis);\r
+       /*if(realdelta) */printf("dx=%d dy=%d   mx=%d   my=%d", player[pn].info.x, player[pn].info.y, player[pn].info.xaxis, player[pn].info.yaxis);\r
        ///*else if(!realdelta) */printf("%c%d %c%d %c%d %c%d", dirchar(0), inpu.Keyboard[def->up], dirchar(4), inpu.Keyboard[def->down], dirchar(1), inpu.Keyboard[def->left], dirchar(3), inpu.Keyboard[def->right]);\r
        printf("\n");\r
 }\r