X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_in.c;h=f07a694f4ea7bd03f85923ed492731913c46a59f;hb=54e82e70b7b402a7aa8e08cf99844c10bc9e89c3;hp=4dd9aa0cc3feb7b7230c851a94c79de07eaf85d9;hpb=634cab2f93fbfecbfd035e1aadd6b396c5ad73a6;p=16.git diff --git a/src/lib/16_in.c b/src/lib/16_in.c index 4dd9aa0c..f07a694f 100644 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -371,7 +371,7 @@ INL_GetJoyDelta(word joy,int *dx,int *dy,boolean adaptive) { word x,y; dword time; - dword TimeCount = /***/clockdw; + dword TimeCount = *clockdw; JoystickDef *def; static dword lasttime; @@ -465,7 +465,7 @@ register word result; word IN_GetJoyButtonsDB(word joy) { - dword TimeCount = /***/clockdw; + dword TimeCount = *clockdw; dword lasttime; word result1,result2; @@ -799,18 +799,19 @@ IN_ReadCursor(CursorInfo *info) /////////////////////////////////////////////////////////////////////////// void 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) @@ -848,20 +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->up] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 0) - my = motion_Up; - else if((inpu.Keyboard[def->down] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 4) - my = motion_Down; - - //}else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ - if((inpu.Keyboard[def->left] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 1) - mx = motion_Left; - else if((inpu.Keyboard[def->right] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 3) - mx = motion_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; + 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]){ + if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].d == 2))// || player[playnum].info.dir == 1) + mx = motion_Left; + if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].d == 2))// || player[playnum].info.dir == 3) + mx = motion_Right; + } if (inpu.Keyboard[def->button0]) buttons += 1 << 0; if (inpu.Keyboard[def->button1]) @@ -895,10 +893,10 @@ register KeyboardDef *def; } else { - dx = mx * 127; - dy = my * 127; + dx = mx;// * 127; + dy = my;// * 127; } - + player[playnum].info.x = dx; player[playnum].info.xaxis = mx; player[playnum].info.y = dy; @@ -908,7 +906,13 @@ register KeyboardDef *def; player[playnum].info.button2 = buttons & (1 << 2); player[playnum].info.button3 = buttons & (1 << 3); // player[playnum].info.dir = DirTable[((my + 1) * 3) + (mx + 1)]; - player[playnum].info.dir = DirTable[(((my + 1) * 2) + (mx + 1))-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) @@ -936,7 +940,7 @@ register KeyboardDef *def; } #endif #ifdef TESTCONTROLNOISY -if(inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right]) +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); @@ -1176,7 +1180,7 @@ IN_IsUserInput() boolean IN_UserInput(dword delay,boolean clear) { - dword TimeCount = /***/clockdw; + dword TimeCount = *clockdw; dword lasttime; lasttime = TimeCount; @@ -1205,8 +1209,10 @@ void IN_ClearKey(byte code) } boolean IN_qb(byte kee) -{ - printf("%u\n", inpu.Keyboard[kee]); +{ + #ifdef TESTKEYIN + printf("%u\n", inpu.Keyboard[kee]); + #endif if(inpu.Keyboard[kee]==true) return 1; else return 0; }