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
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
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