{\r
boolean MousePresent;\r
boolean JoysPresent[MaxJoys];\r
-// boolean JoyPadPresent[MaxPads];\r
boolean Keyboard[NumCodes];\r
boolean Paused;\r
char LastASCII;\r
\r
KeyboardDef KbdDefs[MaxKbds];\r
JoystickDef JoyDefs[MaxJoys];\r
-// JoypadDef JoypadDefs[MaxPads];\r
} inpu;\r
\r
//extern inconfig inpu;\r
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
|| ((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
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
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
joyMultXL,joyMultYL,\r
joyMultXH,joyMultYH;\r
} JoystickDef;\r
-// typedef struct\r
-// {\r
-// boolean w;\r
-// } JoypadDef;\r
\r
typedef struct\r
{\r
{\r
boolean MousePresent;\r
boolean JoysPresent[MaxJoys];\r
- boolean JoyPadPresent[MaxPads];\r
boolean Keyboard[NumCodes];\r
boolean Paused;\r
char LastASCII;\r
\r
KeyboardDef KbdDefs[MaxKbds];\r
JoystickDef JoyDefs[MaxJoys];\r
- JoypadDef JoypadDefs[MaxPads];\r
} inpu;*/\r
\r
#ifdef DEMO0\r