diff --git a/polymer/eduke32/build/src/rawinput.c b/polymer/eduke32/build/src/rawinput.c index 55dcb5daf..3e312ed7a 100644 --- a/polymer/eduke32/build/src/rawinput.c +++ b/polymer/eduke32/build/src/rawinput.c @@ -25,7 +25,7 @@ static inline void RI_ProcessMouse(const RAWMOUSE* rmouse) { int32_t i, mask; - if (!mousegrab) + if (!mousegrab || !appactive) return; mousex += rmouse->lLastX; @@ -211,7 +211,7 @@ void RI_PollDevices() DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam); } - if (mousegrab) + if (mousegrab && appactive) { // center the cursor in the window POINT pt = { xdim>>1, ydim>>1 }; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 78309088c..708864884 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -11817,15 +11817,16 @@ MAIN_LOOP_RESTART: quitevent = 0; } + sampletimer(); + // only allow binds to function if the player is actually in a game (not in a menu, typing, et cetera) or demo bindsenabled = g_player[myconnectindex].ps->gm & (MODE_GAME|MODE_DEMO); - CONTROL_ProcessBinds(); OSD_DispatchQueued(); if (!(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO)) && totalclock >= ototalclock+TICSPERFRAME) { - faketimerhandler(); + CONTROL_ProcessBinds(); getinput(myconnectindex); G_HandleLocalKeys(); @@ -11839,13 +11840,20 @@ MAIN_LOOP_RESTART: Bmemcpy(&inputfifo[0][myconnectindex], &avg, sizeof(input_t)); Bmemset(&avg, 0, sizeof(input_t)); - if ((g_netServer || ud.multimode > 1) && ud.playerai) +/* + if (ud.playerai && (g_netServer || ud.multimode > 1)) + { TRAVERSE_CONNECT(i) - if (i != myconnectindex) - { - //clearbufbyte(&inputfifo[g_player[i].movefifoend&(MOVEFIFOSIZ-1)][i],sizeof(input_t),0L); - computergetinput(i,&inputfifo[0][i]); - } + if (i != myconnectindex) + { + //clearbufbyte(&inputfifo[g_player[i].movefifoend&(MOVEFIFOSIZ-1)][i],sizeof(input_t),0L); + computergetinput(i,&inputfifo[0][i]); + } + } +*/ + + do faketimerhandler(); + while (!(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO)) && totalclock >= ototalclock+TICSPERFRAME); } if (((ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) && diff --git a/polymer/eduke32/source/jmact/control.c b/polymer/eduke32/source/jmact/control.c index 7dffdb4fc..e7c2e9317 100644 --- a/polymer/eduke32/source/jmact/control.c +++ b/polymer/eduke32/source/jmact/control.c @@ -800,7 +800,7 @@ void CONTROL_GetInput(ControlInfo *info) do { - CONTROL_SetFlag(i, CONTROL_KeyboardFunctionPressed(i) | periphs[i] | extinput[i]); + CONTROL_SetFlag(i, /*CONTROL_KeyboardFunctionPressed(i) | */periphs[i] | extinput[i]); if (CONTROL_Flags[i].cleared == FALSE) BUTTONSET(i, CONTROL_Flags[i].active); else if (CONTROL_Flags[i].active == FALSE) CONTROL_Flags[i].cleared = 0; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 5c99f0d59..5712be873 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2952,7 +2952,7 @@ void P_DisplayWeapon(int32_t snum) int32_t g_myAimMode = 0, g_myAimStat = 0, g_oldAimStat = 0; int32_t mouseyaxismode = -1; -int32_t jump_input = 0; +int32_t jump_timer = 0; void getinput(int32_t snum) { @@ -2969,14 +2969,13 @@ void getinput(int32_t snum) { if (!(p->gm&MODE_MENU)) CONTROL_GetInput(&info[0]); - memset(&info[1], 0, sizeof(info[1])); - loc.fvel = vel = 0; - loc.svel = svel = 0; - loc.avel = angvel = 0; - loc.horz = horiz = 0; + + Bmemset(&info[1], 0, sizeof(input_t)); + Bmemset(&loc, 0, sizeof(input_t)); loc.bits = (((int32_t)g_gameQuit)<team)<<6; loc.extbits |= (1<<7); + return; } @@ -2993,16 +2992,13 @@ void getinput(int32_t snum) } } - { - int32_t i; - if (g_myAimMode) i = analog_lookingupanddown; - else i = ud.config.MouseAnalogueAxes[1]; + if (g_myAimMode) j = analog_lookingupanddown; + else j = ud.config.MouseAnalogueAxes[1]; - if (i != mouseyaxismode) - { - CONTROL_MapAnalogAxis(1, i, controldevice_mouse); - mouseyaxismode = i; - } + if (j != mouseyaxismode) + { + CONTROL_MapAnalogAxis(1, j, controldevice_mouse); + mouseyaxismode = j; } CONTROL_GetInput(&info[0]); @@ -3055,9 +3051,9 @@ void getinput(int32_t snum) } if (BUTTON(gamefunc_Jump) && p->on_ground) - jump_input = 4; + jump_timer = 4; - loc.bits = (jump_input > 0 || BUTTON(gamefunc_Jump))< 0 || BUTTON(gamefunc_Jump))<curr_weapon][snum] & WEAPON_SEMIAUTO && BUTTON(gamefunc_Fire)) CONTROL_ClearButton(gamefunc_Fire); - if (jump_input > 0) - jump_input--; + if (jump_timer > 0) + jump_timer--; j=0; @@ -3236,10 +3232,6 @@ void getinput(int32_t snum) return; } - /* - if (numplayers > 1) - daang = myang; - else*/ daang = p->ang; momx = mulscale9(vel,sintable[(daang+2560)&2047]); diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index ea819b110..a3b3ecf20 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1588,18 +1588,17 @@ void Net_WaitForServer(void) } } -extern int32_t jump_input; - void clearfifo(void) { int32_t i = 0; + extern int32_t jump_timer; syncvaltail = 0L; syncvaltottail = 0L; memset(&syncstat, 0, sizeof(syncstat)); bufferjitter = 1; mymaxlag = otherminlag = 0; - jump_input = 0; + jump_timer = 0; movefifoplc = movefifosendplc = predictfifoplc = 0; avg.fvel = avg.svel = avg.avel = avg.horz = avg.bits = avg.extbits = 0;