X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_in.c;h=bb11c095eab2567a2fede1ef4a4a112445d24dcb;hb=1cc75f46d15728fed75f53a2243c9ad4c8234511;hp=f07a694f4ea7bd03f85923ed492731913c46a59f;hpb=3dc6dfae836293380daf9e7dbd7c04d211a2cb16;p=16.git diff --git a/src/lib/16_in.c b/src/lib/16_in.c old mode 100644 new mode 100755 index f07a694f..bb11c095 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -149,12 +149,12 @@ static byte far ASCIINames[] = // Unshifted ASCII for scan codes static Direction DirTable[] = // Quick lookup for total direction { - //dir_Nortinest, - dir_North, + //dir_Nortinest, + dir_North, dir_West, - dir_None, - dir_East, - dir_South + dir_None, + dir_East, + dir_South //dir_NorthEast, //dir_Soutinest, //,dir_SouthEast @@ -234,9 +234,9 @@ static boolean special; if (INL_KeyHook && !special) INL_KeyHook(); - #ifdef TESTKEYIN - printf("%c %x %u\n", c, k, inpu.Keyboard[k]); - #endif +//#ifdef TESTKEYIN + if(testkeyin > 0) printf("%c %x %u\n", c, k, inpu.Keyboard[k]); +//endif outp(0x20,0x20); } @@ -370,10 +370,10 @@ static void INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive) { word x,y; - dword time; - dword TimeCount = *clockdw; + word time; + word TimeCount = *clockw; JoystickDef *def; -static dword lasttime; +static word lasttime; IN_GetJoyAbs(joy,&x,&y); def = inpu.JoyDefs + joy; @@ -465,8 +465,8 @@ register word result; word IN_GetJoyButtonsDB(word joy) { - dword TimeCount = *clockdw; - dword lasttime; + word TimeCount = *clockw; + word lasttime; word result1,result2; do @@ -797,21 +797,21 @@ IN_ReadCursor(CursorInfo *info) // player and fills in the control info struct // /////////////////////////////////////////////////////////////////////////// -void +void near IN_ReadControl(int playnum,player_t *player) -{ +{ boolean realdelta; byte dbyte; word buttons; int dx,dy; Motion mx,my; - ControlType type; + ControlType type; sword conpee; register KeyboardDef *def; dx = dy = 0; mx = my = motion_None; - buttons = 0; + buttons = 0; #if DEMO0 if (DemoMode == demo_Playback) @@ -849,17 +849,17 @@ register KeyboardDef *def; mx = motion_Left,my = motion_Down; else if (Keyboard[def->downright]) mx = motion_Right,my = motion_Down;*/ - if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){ + //if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){ if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].d == 2))// || player[playnum].info.dir == 0) - my = motion_Up; + my = motion_Up; if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].d == 2))// || player[playnum].info.dir == 4) - my = motion_Down; - }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ + my = motion_Down; + //}else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].d == 2))// || player[playnum].info.dir == 1) - mx = motion_Left; + mx = motion_Left; if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].d == 2))// || player[playnum].info.dir == 3) - mx = motion_Right; - } + mx = motion_Right; + //} if (inpu.Keyboard[def->button0]) buttons += 1 << 0; if (inpu.Keyboard[def->button1]) @@ -896,7 +896,7 @@ register KeyboardDef *def; dx = mx;// * 127; dy = my;// * 127; } - + player[playnum].info.x = dx; player[playnum].info.xaxis = mx; player[playnum].info.y = dy; @@ -905,14 +905,14 @@ register KeyboardDef *def; player[playnum].info.button1 = buttons & (1 << 1); player[playnum].info.button2 = buttons & (1 << 2); player[playnum].info.button3 = buttons & (1 << 3); -// player[playnum].info.dir = DirTable[((my + 1) * 3) + (mx + 1)]; - conpee=(((my + 1) * 2) + (mx + 1)); - if(conpee) conpee--; - player[playnum].info.dir = DirTable[conpee]; - if(player[playnum].q==1 && (mx!=motion_None || my!=motion_None)) - { - player[playnum].d = player[playnum].info.dir; - } +// player[playnum].info.dir = DirTable[((my + 1) * 3) + (mx + 1)]; + conpee=(((my + 1) * 2) + (mx + 1)); + if(conpee) conpee--; + player[playnum].info.dir = DirTable[conpee]; + if(player[playnum].q==1 && (mx!=motion_None || my!=motion_None)) + { + player[playnum].d = player[playnum].info.dir; + } #if DEMO0 if (DemoMode == demo_Record) @@ -939,14 +939,15 @@ register KeyboardDef *def; } } #endif -#ifdef TESTCONTROLNOISY -if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])&& player[playnum].info.dir!=2) -{ - printf("(mx)=%d ", mx); - printf("(my)=%d ", my); - printf("dir=%d\n", player[playnum].info.dir); +//#ifdef TESTCONTROLNOISY +if(testcontrolnoisy > 0) +if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])&& player[playnum].info.dir!=2) +{ + printf("(mx)=%d ", mx); + printf("(my)=%d ", my); + printf("dir=%d\n", player[playnum].info.dir); } -#endif +//#endif } /////////////////////////////////////////////////////////////////////////// @@ -1180,8 +1181,8 @@ IN_IsUserInput() boolean IN_UserInput(dword delay,boolean clear) { - dword TimeCount = *clockdw; - dword lasttime; + word TimeCount = *clockw; + word lasttime; lasttime = TimeCount; do @@ -1209,10 +1210,10 @@ void IN_ClearKey(byte code) } boolean IN_qb(byte kee) -{ - #ifdef TESTKEYIN - printf("%u\n", inpu.Keyboard[kee]); - #endif +{ +//#ifdef TESTKEYIN + if(testkeyin > 0) printf("%u\n", inpu.Keyboard[kee]); +//#endif if(inpu.Keyboard[kee]==true) return 1; else return 0; }