From 8b53295a744cf72b8b13148593e9a5e2f98a24ec Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 9 Sep 2017 19:02:11 -0400 Subject: [PATCH 01/17] Remove instances of player state changes being done every tic Makes it easier to change player state with Lua. Wasn't sure how to tackle changing this for S_PLAY_CLIMB or S_PLAY_CLING, so I left them; it's a minor ability-specific case anyway --- src/p_user.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 09cafa0b3..b3cb15c9a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4049,14 +4049,14 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) if (onground && player->pflags & PF_STARTDASH) { - if (player->mo->state-states != S_PLAY_SPINDASH) - P_SetPlayerMobjState(player->mo, S_PLAY_SPINDASH); + //if (player->mo->state-states != S_PLAY_SPINDASH) + //P_SetPlayerMobjState(player->mo, S_PLAY_SPINDASH); // Spawn spin dash dust if (!(player->charflags & SF_NOSPINDASHDUST) && !(player->mo->eflags & MFE_GOOWATER)) P_DoSpinDashDust(player); } - else if (onground && player->pflags & PF_SPINNING && !(player->panim == PA_ROLL)) - P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); + //else if (onground && player->pflags & PF_SPINNING && !(player->panim == PA_ROLL)) + //P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); } // @@ -4115,6 +4115,8 @@ void P_DoBubbleBounce(player_t *player) P_DoJump(player, false); if (player->charflags & SF_NOJUMPSPIN) P_SetPlayerMobjState(player->mo, S_PLAY_FALL); + else + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); player->pflags |= PF_THOKKED; player->pflags &= ~PF_STARTJUMP; player->secondjump = UINT8_MAX; @@ -9333,20 +9335,20 @@ void P_PlayerThink(player_t *player) #endif if (!player->mo->health) ; - else if (player->pflags & PF_GLIDING) + /*else if (player->pflags & PF_GLIDING) { if (player->panim != PA_ABILITY) P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE); - } + }*/ else if ((player->pflags & PF_JUMPED && !(player->pflags & PF_NOJUMPDAMAGE) && (player->mo->state-states != S_PLAY_FLOAT && player->mo->state-states != S_PLAY_FLOAT_RUN)) && ((((player->charflags & (SF_NOJUMPSPIN|SF_NOJUMPDAMAGE)) == (SF_NOJUMPSPIN|SF_NOJUMPDAMAGE)) && player->panim != PA_ROLL) || (!(player->charflags & SF_NOJUMPSPIN) && player->panim != PA_JUMP))) { - if (!(player->charflags & SF_NOJUMPSPIN)) + /*if (!(player->charflags & SF_NOJUMPSPIN)) P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); else if (!(player->pflags & PF_NOJUMPDAMAGE)) - P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL);*/ } if (player->flashcount) @@ -10011,12 +10013,13 @@ void P_PlayerAfterThink(player_t *player) if (P_IsLocalPlayer(player) && (player->pflags & PF_WPNDOWN) && player->currentweapon != oldweapon) S_StartSound(NULL, sfx_wepchg); - if (player->pflags & PF_GLIDING) + /*if (player->pflags & PF_GLIDING) { if (player->panim != PA_ABILITY) P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE); } - else if (player->pflags & PF_SLIDING) + else if (player->pflags & PF_SLIDING)*/ + if (player->pflags & PF_SLIDING) P_SetPlayerMobjState(player->mo, player->mo->info->painstate); /* if (player->powers[pw_carry] == CR_NONE && player->mo->tracer && !player->homing) From 5cc8734da7466492ffd609934ce963145f362e75 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 17 Sep 2017 21:37:36 -0400 Subject: [PATCH 02/17] Prevent bots from killing bubbles Self-explanatory. They can still breathe them in, they just no longer get popped --- src/p_inter.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index d2101ca57..316d2f43a 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1593,7 +1593,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; // Only go in the mouth // Eaten by player! - if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) + if ((!player->bot) && (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1)) P_RestoreMusic(player); if (player->powers[pw_underwater] < underwatertics + 1) @@ -1606,7 +1606,11 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } toucher->momx = toucher->momy = toucher->momz = 0; - break; + + if (player->bot) + return; + else + break; case MT_WATERDROP: if (special->state == &states[special->info->spawnstate]) From ce0a49ede5f3bfb8e54262b3431bdd80b2f8796e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 17 Sep 2017 22:30:48 -0400 Subject: [PATCH 03/17] Add jump & spin joystick axis Lets you set jump/spin to Xbox controller triggers, like you can with fire/nfire --- src/d_netcmd.c | 4 ++++ src/g_game.c | 33 +++++++++++++++++++++++++++++---- src/g_game.h | 4 ++-- src/m_menu.c | 14 +++++++++----- 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 7f408a2b5..c37d7be2b 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -724,6 +724,10 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_moveaxis2); CV_RegisterVar(&cv_lookaxis); CV_RegisterVar(&cv_lookaxis2); + CV_RegisterVar(&cv_jumpaxis); + CV_RegisterVar(&cv_jumpaxis2); + CV_RegisterVar(&cv_spinaxis); + CV_RegisterVar(&cv_spinaxis2); CV_RegisterVar(&cv_fireaxis); CV_RegisterVar(&cv_fireaxis2); CV_RegisterVar(&cv_firenaxis); diff --git a/src/g_game.c b/src/g_game.c index e996938ab..63055a8c4 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -376,6 +376,8 @@ typedef enum AXISLOOK, AXISSTRAFE, AXISDEAD, //Axises that don't want deadzones + AXISJUMP, + AXISSPIN, AXISFIRE, AXISFIRENORMAL, } axis_input_e; @@ -415,6 +417,10 @@ consvar_t cv_fireaxis = {"joyaxis_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, consvar_t cv_firenaxis = {"joyaxis_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif +// Yeeeah I don't think I'm gonna sort out this giant if else end chain to add defaults to these :V +consvar_t cv_jumpaxis = {"joyaxis_jump", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_spinaxis = {"joyaxis_spin", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + #if defined (_WII) || defined (WMINPUT) consvar_t cv_turnaxis2 = {"joyaxis2_turn", "LStick.X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_moveaxis2 = {"joyaxis2_move", "LStick.Y", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -442,6 +448,9 @@ consvar_t cv_fireaxis2 = {"joyaxis2_fire", "None", CV_SAVE, joyaxis_cons_t, NULL consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif +// :rolling_eyes: +consvar_t cv_jumpaxis2 = {"joyaxis2_jump", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_spinaxis2 = {"joyaxis2_spin", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #if MAXPLAYERS > 32 #error "please update player_name table using the new value for MAXPLAYERS" @@ -804,6 +813,12 @@ static INT32 JoyAxis(axis_input_e axissel) case AXISSTRAFE: axisval = cv_sideaxis.value; break; + case AXISJUMP: + axisval = cv_jumpaxis.value; + break; + case AXISSPIN: + axisval = cv_spinaxis.value; + break; case AXISFIRE: axisval = cv_fireaxis.value; break; @@ -881,6 +896,12 @@ static INT32 Joy2Axis(axis_input_e axissel) case AXISSTRAFE: axisval = cv_sideaxis2.value; break; + case AXISJUMP: + axisval = cv_jumpaxis2.value; + break; + case AXISSPIN: + axisval = cv_spinaxis2.value; + break; case AXISFIRE: axisval = cv_fireaxis2.value; break; @@ -1123,7 +1144,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) cmd->buttons |= BT_CUSTOM3; // use with any button/key - if (PLAYER1INPUTDOWN(gc_use)) + axis = JoyAxis(AXISSPIN); + if (PLAYER1INPUTDOWN(gc_use) || (cv_usejoystick.value && axis > 0)) cmd->buttons |= BT_USE; if (PLAYER1INPUTDOWN(gc_camreset)) @@ -1136,7 +1158,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) resetdown = false; // jump button - if (PLAYER1INPUTDOWN(gc_jump)) + axis = JoyAxis(AXISJUMP); + if (PLAYER1INPUTDOWN(gc_jump) || (cv_usejoystick.value && axis > 0)) cmd->buttons |= BT_JUMP; // player aiming shit, ahhhh... @@ -1418,7 +1441,8 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) cmd->buttons |= BT_CUSTOM3; // use with any button/key - if (PLAYER2INPUTDOWN(gc_use)) + axis = Joy2Axis(AXISSPIN); + if (PLAYER2INPUTDOWN(gc_use) || (cv_usejoystick2.value && axis > 0)) cmd->buttons |= BT_USE; if (PLAYER2INPUTDOWN(gc_camreset)) @@ -1431,7 +1455,8 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) resetdown = false; // jump button - if (PLAYER2INPUTDOWN(gc_jump)) + axis = Joy2Axis(AXISJUMP); + if (PLAYER2INPUTDOWN(gc_jump) || (cv_usejoystick2.value && axis > 0)) cmd->buttons |= BT_JUMP; // player aiming shit, ahhhh... diff --git a/src/g_game.h b/src/g_game.h index 72a6f3d6e..577ea0c7d 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -59,8 +59,8 @@ extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove; extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_mousemove2; extern consvar_t cv_useranalog, cv_useranalog2; extern consvar_t cv_analog, cv_analog2; -extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_fireaxis,cv_firenaxis; -extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_fireaxis2,cv_firenaxis2; +extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis; +extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2; extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest; // mouseaiming (looking up/down with the mouse or keyboard) diff --git a/src/m_menu.c b/src/m_menu.c index 64255e71a..eca88ae42 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1130,13 +1130,15 @@ static menuitem_t OP_ChangeControlsMenu[] = static menuitem_t OP_Joystick1Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup1PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup1PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Move \x17 Axis" , &cv_moveaxis , 30}, {IT_STRING | IT_CVAR, NULL, "Move \x18 Axis" , &cv_sideaxis , 40}, {IT_STRING | IT_CVAR, NULL, "Camera \x17 Axis" , &cv_lookaxis , 50}, {IT_STRING | IT_CVAR, NULL, "Camera \x18 Axis" , &cv_turnaxis , 60}, - {IT_STRING | IT_CVAR, NULL, "Fire Axis" , &cv_fireaxis , 70}, - {IT_STRING | IT_CVAR, NULL, "Fire Normal Axis" , &cv_firenaxis , 80}, + {IT_STRING | IT_CVAR, NULL, "Jump Axis" , &cv_jumpaxis , 70}, + {IT_STRING | IT_CVAR, NULL, "Spin Axis" , &cv_spinaxis , 80}, + {IT_STRING | IT_CVAR, NULL, "Fire Axis" , &cv_fireaxis , 90}, + {IT_STRING | IT_CVAR, NULL, "Fire Normal Axis" , &cv_firenaxis ,100}, }; static menuitem_t OP_Joystick2Menu[] = @@ -1146,8 +1148,10 @@ static menuitem_t OP_Joystick2Menu[] = {IT_STRING | IT_CVAR, NULL, "Move \x18 Axis" , &cv_sideaxis2 , 40}, {IT_STRING | IT_CVAR, NULL, "Camera \x17 Axis" , &cv_lookaxis2 , 50}, {IT_STRING | IT_CVAR, NULL, "Camera \x18 Axis" , &cv_turnaxis2 , 60}, - {IT_STRING | IT_CVAR, NULL, "Fire Axis" , &cv_fireaxis2 , 70}, - {IT_STRING | IT_CVAR, NULL, "Fire Normal Axis" , &cv_firenaxis2 , 80}, + {IT_STRING | IT_CVAR, NULL, "Jump Axis" , &cv_jumpaxis2 , 70}, + {IT_STRING | IT_CVAR, NULL, "Spin Axis" , &cv_spinaxis2 , 80}, + {IT_STRING | IT_CVAR, NULL, "Fire Axis" , &cv_fireaxis2 , 90}, + {IT_STRING | IT_CVAR, NULL, "Fire Normal Axis" , &cv_firenaxis2 ,100}, }; static menuitem_t OP_JoystickSetMenu[] = From e020352c0cad3e8c39ad747b7d2a34ad10e259c0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 19 Sep 2017 00:26:05 -0400 Subject: [PATCH 04/17] Fixed diagonal analog input being weakened Using a keyboard and an analog stick should now give you similar acceleration in all directions. --- src/g_game.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 63055a8c4..a087a0ad6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -981,7 +981,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) INT32 tspeed, forward, side, axis, i; const INT32 speed = 1; // these ones used for multiple conditions - boolean turnleft, turnright, mouseaiming, analogjoystickmove, gamepadjoystickmove; + boolean turnleft, turnright, strafelkey, straferkey, movefkey, movebkey, mouseaiming, analogjoystickmove, gamepadjoystickmove; player_t *player = &players[consoleplayer]; camera_t *thiscam = &camera; @@ -1002,6 +1002,12 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) turnright = PLAYER1INPUTDOWN(gc_turnright); turnleft = PLAYER1INPUTDOWN(gc_turnleft); + + straferkey = PLAYER1INPUTDOWN(gc_straferight); + strafelkey = PLAYER1INPUTDOWN(gc_strafeleft); + movefkey = PLAYER1INPUTDOWN(gc_forward); + movebkey = PLAYER1INPUTDOWN(gc_backward); + mouseaiming = (PLAYER1INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook.value; analogjoystickmove = cv_usejoystick.value && !Joystick.bGamepadStyle; gamepadjoystickmove = cv_usejoystick.value && Joystick.bGamepadStyle; @@ -1090,9 +1096,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) // forward with key or button axis = JoyAxis(AXISMOVE); - if (PLAYER1INPUTDOWN(gc_forward) || (gamepadjoystickmove && axis < 0)) + if (movefkey || (gamepadjoystickmove && axis < 0)) forward = forwardmove[speed]; - if (PLAYER1INPUTDOWN(gc_backward) || (gamepadjoystickmove && axis > 0)) + if (movebkey || (gamepadjoystickmove && axis > 0)) forward -= forwardmove[speed]; if (analogjoystickmove && axis != 0) @@ -1100,9 +1106,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) // some people strafe left & right with mouse buttons // those people are weird - if (PLAYER1INPUTDOWN(gc_straferight)) + if (straferkey) side += sidemove[speed]; - if (PLAYER1INPUTDOWN(gc_strafeleft)) + if (strafelkey) side -= sidemove[speed]; if (PLAYER1INPUTDOWN(gc_weaponnext)) @@ -1239,7 +1245,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) // No additional acceleration when moving forward/backward and strafing simultaneously. // do this AFTER we cap to MAXPLMOVE so people can't find ways to cheese around this. - if (!forcestrafe && forward && side) + // 9-18-2017: ALSO, only do this when using keys to move. Gamepad analog sticks get severely gimped by this + if (!forcestrafe && (((movefkey || movebkey) && side) || ((strafelkey || straferkey) && forward))) { forward = FixedMul(forward, 3*FRACUNIT/4); side = FixedMul(side, 3*FRACUNIT/4); From d1e379f4f9c2369e262dd5863752fdcdda838287 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 19 Sep 2017 00:30:08 -0400 Subject: [PATCH 05/17] Whoops, forgot P2 --- src/g_game.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index a087a0ad6..95b7b8890 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1288,7 +1288,7 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) INT32 tspeed, forward, side, axis, i; const INT32 speed = 1; // these ones used for multiple conditions - boolean turnleft, turnright, mouseaiming, analogjoystickmove, gamepadjoystickmove; + boolean turnleft, turnright, strafelkey, straferkey, movefkey, movebkey, mouseaiming, analogjoystickmove, gamepadjoystickmove; player_t *player = &players[secondarydisplayplayer]; camera_t *thiscam = (player->bot == 2 ? &camera : &camera2); @@ -1309,6 +1309,12 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) turnright = PLAYER2INPUTDOWN(gc_turnright); turnleft = PLAYER2INPUTDOWN(gc_turnleft); + + straferkey = PLAYER2INPUTDOWN(gc_straferight); + strafelkey = PLAYER2INPUTDOWN(gc_strafeleft); + movefkey = PLAYER2INPUTDOWN(gc_forward); + movebkey = PLAYER2INPUTDOWN(gc_backward); + mouseaiming = (PLAYER2INPUTDOWN(gc_mouseaiming)) ^ cv_alwaysfreelook2.value; analogjoystickmove = cv_usejoystick2.value && !Joystick2.bGamepadStyle; gamepadjoystickmove = cv_usejoystick2.value && Joystick2.bGamepadStyle; @@ -1397,9 +1403,9 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) // forward with key or button axis = Joy2Axis(AXISMOVE); - if (PLAYER2INPUTDOWN(gc_forward) || (gamepadjoystickmove && axis < 0)) + if (movefkey || (gamepadjoystickmove && axis < 0)) forward = forwardmove[speed]; - if (PLAYER2INPUTDOWN(gc_backward) || (gamepadjoystickmove && axis > 0)) + if (movebkey || (gamepadjoystickmove && axis > 0)) forward -= forwardmove[speed]; if (analogjoystickmove && axis != 0) @@ -1407,9 +1413,9 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) // some people strafe left & right with mouse buttons // those people are (still) weird - if (PLAYER2INPUTDOWN(gc_straferight)) + if (straferkey) side += sidemove[speed]; - if (PLAYER2INPUTDOWN(gc_strafeleft)) + if (strafelkey) side -= sidemove[speed]; if (PLAYER2INPUTDOWN(gc_weaponnext)) @@ -1543,7 +1549,8 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) // No additional acceleration when moving forward/backward and strafing simultaneously. // do this AFTER we cap to MAXPLMOVE so people can't find ways to cheese around this. - if (!forcestrafe && forward && side) + // 9-18-2017: ALSO, only do this when using keys to move. Gamepad analog sticks get severely gimped by this + if (!forcestrafe && (((movefkey || movebkey) && side) || ((strafelkey || straferkey) && forward))) { forward = FixedMul(forward, 3*FRACUNIT/4); side = FixedMul(side, 3*FRACUNIT/4); From da82a6bb56971bd9af20de953dc7a4375eff6546 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 19 Sep 2017 00:33:53 -0400 Subject: [PATCH 06/17] Replaced instances of "joystick" with "gamepad" in menus --- src/m_menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index eca88ae42..74f457f08 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1055,7 +1055,7 @@ static menuitem_t OP_P1ControlsMenu[] = { {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup1PControlsMenu, 10}, {IT_SUBMENU | IT_STRING, NULL, "Mouse Options...", &OP_MouseOptionsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Joystick Options...", &OP_Joystick1Def , 30}, + {IT_SUBMENU | IT_STRING, NULL, "Gamepad Options...", &OP_Joystick1Def , 30}, {IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam , 50}, {IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam , 60}, @@ -1068,7 +1068,7 @@ static menuitem_t OP_P2ControlsMenu[] = { {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup2PControlsMenu, 10}, {IT_SUBMENU | IT_STRING, NULL, "Second Mouse Options...", &OP_Mouse2OptionsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Second Joystick Options...", &OP_Joystick2Def , 30}, + {IT_SUBMENU | IT_STRING, NULL, "Second Gamepad Options...", &OP_Joystick2Def , 30}, {IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam2 , 50}, {IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam2 , 60}, @@ -1130,7 +1130,7 @@ static menuitem_t OP_ChangeControlsMenu[] = static menuitem_t OP_Joystick1Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup1PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad...", M_Setup1PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Move \x17 Axis" , &cv_moveaxis , 30}, {IT_STRING | IT_CVAR, NULL, "Move \x18 Axis" , &cv_sideaxis , 40}, {IT_STRING | IT_CVAR, NULL, "Camera \x17 Axis" , &cv_lookaxis , 50}, @@ -1143,7 +1143,7 @@ static menuitem_t OP_Joystick1Menu[] = static menuitem_t OP_Joystick2Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick...", M_Setup2PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad...", M_Setup2PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Move \x17 Axis" , &cv_moveaxis2 , 30}, {IT_STRING | IT_CVAR, NULL, "Move \x18 Axis" , &cv_sideaxis2 , 40}, {IT_STRING | IT_CVAR, NULL, "Camera \x17 Axis" , &cv_lookaxis2 , 50}, From 6a0f50cdf5a3e81269d51e400f65c60403f95260 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 19 Sep 2017 17:27:13 -0400 Subject: [PATCH 07/17] Resolve conflicts --- src/g_game.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/g_game.h b/src/g_game.h index aa567b1d1..7b7f04b6a 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -59,15 +59,10 @@ extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove; extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_mousemove2; extern consvar_t cv_useranalog, cv_useranalog2; extern consvar_t cv_analog, cv_analog2; -<<<<<<< HEAD -extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis; -extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2; -======= extern consvar_t cv_directionchar, cv_directionchar2; extern consvar_t cv_autobrake, cv_autobrake2; -extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_fireaxis,cv_firenaxis; -extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_fireaxis2,cv_firenaxis2; ->>>>>>> refs/remotes/origin/master +extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis; +extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2; extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest; // mouseaiming (looking up/down with the mouse or keyboard) From 4e7b8179459fa199ca9b5e9a3056755fa6ee90b4 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 20 Sep 2017 16:14:00 -0400 Subject: [PATCH 08/17] Does THIS fix the conflicts?? --- src/g_game.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.h b/src/g_game.h index 7b7f04b6a..ff86beb7f 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -61,8 +61,8 @@ extern consvar_t cv_useranalog, cv_useranalog2; extern consvar_t cv_analog, cv_analog2; extern consvar_t cv_directionchar, cv_directionchar2; extern consvar_t cv_autobrake, cv_autobrake2; -extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis; -extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2; +extern consvar_t cv_sideaxis, cv_turnaxis, cv_moveaxis, cv_lookaxis, cv_jumpaxis, cv_spinaxis, cv_fireaxis, cv_firenaxis; +extern consvar_t cv_sideaxis2, cv_turnaxis2, cv_moveaxis2, cv_lookaxis2, cv_jumpaxis2, cv_spinaxis2, cv_fireaxis2, cv_firenaxis2; extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest; // mouseaiming (looking up/down with the mouse or keyboard) From 7c7bf243a2c74ee47896d0e644910237e7a826da Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 20 Sep 2017 16:20:30 -0400 Subject: [PATCH 09/17] Okay, nope, still nothing; reverting --- src/g_game.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.h b/src/g_game.h index ff86beb7f..7b7f04b6a 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -61,8 +61,8 @@ extern consvar_t cv_useranalog, cv_useranalog2; extern consvar_t cv_analog, cv_analog2; extern consvar_t cv_directionchar, cv_directionchar2; extern consvar_t cv_autobrake, cv_autobrake2; -extern consvar_t cv_sideaxis, cv_turnaxis, cv_moveaxis, cv_lookaxis, cv_jumpaxis, cv_spinaxis, cv_fireaxis, cv_firenaxis; -extern consvar_t cv_sideaxis2, cv_turnaxis2, cv_moveaxis2, cv_lookaxis2, cv_jumpaxis2, cv_spinaxis2, cv_fireaxis2, cv_firenaxis2; +extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis; +extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2; extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest; // mouseaiming (looking up/down with the mouse or keyboard) From cfce6650cabb7e613a8161cb67c6ba0f0b0738f6 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 20 Sep 2017 16:53:05 -0400 Subject: [PATCH 10/17] Fix holding spin while landing putting you in your walking state, remove commented out stuff --- src/p_user.c | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index c1215088f..fc94c55a7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1815,8 +1815,8 @@ boolean P_PlayerHitFloor(player_t *player) S_StartSound(player->mo, sfx_s3k8b); player->pflags |= PF_FULLSTASIS; } - else if (player->pflags & PF_JUMPED || !(player->pflags & PF_SPINNING) - || player->powers[pw_tailsfly] || player->mo->state-states == S_PLAY_FLY_TIRED) + else if ((player->pflags & PF_JUMPED || player->powers[pw_tailsfly] + || player->mo->state-states == S_PLAY_FLY_TIRED) && !(player->pflags & PF_SPINNING)) { if (player->cmomx || player->cmomy) { @@ -4179,14 +4179,10 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) if (onground && player->pflags & PF_STARTDASH) { - //if (player->mo->state-states != S_PLAY_SPINDASH) - //P_SetPlayerMobjState(player->mo, S_PLAY_SPINDASH); // Spawn spin dash dust if (!(player->charflags & SF_NOSPINDASHDUST) && !(player->mo->eflags & MFE_GOOWATER)) P_DoSpinDashDust(player); } - //else if (onground && player->pflags & PF_SPINNING && !(player->panim == PA_ROLL)) - //P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); } // @@ -9473,23 +9469,6 @@ void P_PlayerThink(player_t *player) } } #endif - if (!player->mo->health) - ; - /*else if (player->pflags & PF_GLIDING) - { - if (player->panim != PA_ABILITY) - P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE); - }*/ - else if ((player->pflags & PF_JUMPED && !(player->pflags & PF_NOJUMPDAMAGE) - && (player->mo->state-states != S_PLAY_FLOAT && player->mo->state-states != S_PLAY_FLOAT_RUN)) - && ((((player->charflags & (SF_NOJUMPSPIN|SF_NOJUMPDAMAGE)) == (SF_NOJUMPSPIN|SF_NOJUMPDAMAGE)) && player->panim != PA_ROLL) - || (!(player->charflags & SF_NOJUMPSPIN) && player->panim != PA_JUMP))) - { - /*if (!(player->charflags & SF_NOJUMPSPIN)) - P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); - else if (!(player->pflags & PF_NOJUMPDAMAGE)) - P_SetPlayerMobjState(player->mo, S_PLAY_ROLL);*/ - } if (player->flashcount) player->flashcount--; @@ -10282,12 +10261,6 @@ void P_PlayerAfterThink(player_t *player) if (P_IsLocalPlayer(player) && (player->pflags & PF_WPNDOWN) && player->currentweapon != oldweapon) S_StartSound(NULL, sfx_wepchg); - /*if (player->pflags & PF_GLIDING) - { - if (player->panim != PA_ABILITY) - P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE); - } - else if (player->pflags & PF_SLIDING)*/ if (player->pflags & PF_SLIDING) P_SetPlayerMobjState(player->mo, player->mo->info->painstate); From d55f84bec0b958ad961ca36392dc6bf6a6e40e71 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 21 Sep 2017 16:43:55 -0400 Subject: [PATCH 11/17] Camera scaling to splitscreen mode Stacks with analog's camera buff. The camera height of both are also now proportional with their dist --- src/p_user.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index fc94c55a7..9e109c029 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8632,7 +8632,7 @@ void P_ResetCamera(player_t *player, camera_t *thiscam) boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled) { angle_t angle = 0, focusangle = 0, focusaiming = 0; - fixed_t x, y, z, dist, checkdist, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight; + fixed_t x, y, z, dist, height, checkdist, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight; INT32 camrotate; boolean camstill, cameranoclip; mobj_t *mo; @@ -8805,6 +8805,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } } + height = camheight; + // sets ideal cam pos if (twodlevel || (mo->flags2 & MF2_TWOD)) dist = 480<climbing || player->exiting || player->playerstate == PST_DEAD || (player->powers[pw_carry] == CR_ROPEHANG || player->powers[pw_carry] == CR_GENERIC || player->powers[pw_carry] == CR_MACESPIN)) dist <<= 1; } @@ -8865,9 +8877,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall pviewheight = FixedMul(cv_viewheight.value<scale); if (mo->eflags & MFE_VERTICALFLIP) - z = mo->z + mo->height - pviewheight - camheight; + z = mo->z + mo->height - pviewheight - height; else - z = mo->z + pviewheight + camheight; + z = mo->z + pviewheight + height; // move camera down to move under lower ceilings newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1)); @@ -9065,7 +9077,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } if (mo->type == MT_EGGTRAP) - z = mo->z + 128*FRACUNIT + pviewheight + camheight; + z = mo->z + 128*FRACUNIT + pviewheight + height; if (thiscam->z < thiscam->floorz && !cameranoclip) thiscam->z = thiscam->floorz; From 6b448f72eeaefebf8204a6315cc4612431a4b0e0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 21 Sep 2017 17:34:53 -0400 Subject: [PATCH 12/17] A_GhostMe lets you change fuse with var1, fixed the walking-spin frames bug For Real This Time --- src/p_enemy.c | 8 ++++-- src/p_user.c | 76 ++++++++++++++++++++++++++------------------------- 2 files changed, 45 insertions(+), 39 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 1f5b902d4..a63edd7d5 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -7957,16 +7957,20 @@ void A_OrbitNights(mobj_t* actor) // // Description: Spawns a "ghost" mobj of this actor, ala spindash trails and the minus's digging "trails" // -// var1 = unused +// var1 = duration in tics // var2 = unused // void A_GhostMe(mobj_t *actor) { + INT32 locvar1 = var1; + mobj_t *ghost; #ifdef HAVE_BLUA if (LUA_CallAction("A_GhostMe", actor)) return; #endif - P_SpawnGhostMobj(actor); + ghost = P_SpawnGhostMobj(actor); + if (ghost && locvar1 > 1) + ghost->fuse = locvar1; } // Function: A_SetObjectState diff --git a/src/p_user.c b/src/p_user.c index 9e109c029..831b877ad 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1801,48 +1801,50 @@ boolean P_PlayerHitFloor(player_t *player) S_StartSound(player->mo, sfx_spin); } else + { player->pflags &= ~PF_SPINNING; - if (player->pflags & PF_GLIDING) // ground gliding - { - player->skidtime = TICRATE; - player->mo->tics = -1; - } - else if (player->charability2 == CA2_MELEE && (player->panim == PA_ABILITY2 && player->mo->state-states != S_PLAY_MELEE_LANDING)) - { - P_SetPlayerMobjState(player->mo, S_PLAY_MELEE_LANDING); - player->mo->tics = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS; - S_StartSound(player->mo, sfx_s3k8b); - player->pflags |= PF_FULLSTASIS; - } - else if ((player->pflags & PF_JUMPED || player->powers[pw_tailsfly] - || player->mo->state-states == S_PLAY_FLY_TIRED) && !(player->pflags & PF_SPINNING)) - { - if (player->cmomx || player->cmomy) + if (player->pflags & PF_GLIDING) // ground gliding { - if (player->charflags & SF_DASHMODE && player->dashmode >= 3*TICRATE && player->panim != PA_DASH) - P_SetPlayerMobjState(player->mo, S_PLAY_DASH); - else if (player->speed >= FixedMul(player->runspeed, player->mo->scale) - && (player->panim != PA_RUN || player->mo->state-states == S_PLAY_FLOAT_RUN)) - P_SetPlayerMobjState(player->mo, S_PLAY_RUN); - else if ((player->rmomx || player->rmomy) - && (player->panim != PA_WALK || player->mo->state-states == S_PLAY_FLOAT)) - P_SetPlayerMobjState(player->mo, S_PLAY_WALK); - else if (!player->rmomx && !player->rmomy && player->panim != PA_IDLE) - P_SetPlayerMobjState(player->mo, S_PLAY_STND); + player->skidtime = TICRATE; + player->mo->tics = -1; } - else + else if (player->charability2 == CA2_MELEE && (player->panim == PA_ABILITY2 && player->mo->state-states != S_PLAY_MELEE_LANDING)) { - if (player->charflags & SF_DASHMODE && player->dashmode >= 3*TICRATE && player->panim != PA_DASH) - P_SetPlayerMobjState(player->mo, S_PLAY_DASH); - else if (player->speed >= FixedMul(player->runspeed, player->mo->scale) - && (player->panim != PA_RUN || player->mo->state-states == S_PLAY_FLOAT_RUN)) - P_SetPlayerMobjState(player->mo, S_PLAY_RUN); - else if ((player->mo->momx || player->mo->momy) - && (player->panim != PA_WALK || player->mo->state-states == S_PLAY_FLOAT)) - P_SetPlayerMobjState(player->mo, S_PLAY_WALK); - else if (!player->mo->momx && !player->mo->momy && player->panim != PA_IDLE) - P_SetPlayerMobjState(player->mo, S_PLAY_STND); + P_SetPlayerMobjState(player->mo, S_PLAY_MELEE_LANDING); + player->mo->tics = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS; + S_StartSound(player->mo, sfx_s3k8b); + player->pflags |= PF_FULLSTASIS; + } + else if (player->pflags & PF_JUMPED || !(player->pflags & PF_SPINNING) + || player->powers[pw_tailsfly] || player->mo->state-states == S_PLAY_FLY_TIRED) + { + if (player->cmomx || player->cmomy) + { + if (player->charflags & SF_DASHMODE && player->dashmode >= 3*TICRATE && player->panim != PA_DASH) + P_SetPlayerMobjState(player->mo, S_PLAY_DASH); + else if (player->speed >= FixedMul(player->runspeed, player->mo->scale) + && (player->panim != PA_RUN || player->mo->state-states == S_PLAY_FLOAT_RUN)) + P_SetPlayerMobjState(player->mo, S_PLAY_RUN); + else if ((player->rmomx || player->rmomy) + && (player->panim != PA_WALK || player->mo->state-states == S_PLAY_FLOAT)) + P_SetPlayerMobjState(player->mo, S_PLAY_WALK); + else if (!player->rmomx && !player->rmomy && player->panim != PA_IDLE) + P_SetPlayerMobjState(player->mo, S_PLAY_STND); + } + else + { + if (player->charflags & SF_DASHMODE && player->dashmode >= 3*TICRATE && player->panim != PA_DASH) + P_SetPlayerMobjState(player->mo, S_PLAY_DASH); + else if (player->speed >= FixedMul(player->runspeed, player->mo->scale) + && (player->panim != PA_RUN || player->mo->state-states == S_PLAY_FLOAT_RUN)) + P_SetPlayerMobjState(player->mo, S_PLAY_RUN); + else if ((player->mo->momx || player->mo->momy) + && (player->panim != PA_WALK || player->mo->state-states == S_PLAY_FLOAT)) + P_SetPlayerMobjState(player->mo, S_PLAY_WALK); + else if (!player->mo->momx && !player->mo->momy && player->panim != PA_IDLE) + P_SetPlayerMobjState(player->mo, S_PLAY_STND); + } } } From 09c3c5857591169290007dcc5d500e09df235517 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 21 Sep 2017 17:38:42 -0400 Subject: [PATCH 13/17] Obligatory "fixing a very tiny and very stupid mistake" commit :p --- src/p_enemy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index a63edd7d5..797586b49 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -7969,7 +7969,7 @@ void A_GhostMe(mobj_t *actor) return; #endif ghost = P_SpawnGhostMobj(actor); - if (ghost && locvar1 > 1) + if (ghost && locvar1 > 0) ghost->fuse = locvar1; } From fcc155446721dc0b9fc01d9a104ba83c88d68db5 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 24 Sep 2017 13:43:36 -0400 Subject: [PATCH 14/17] Play bubble breathe sound for bots --- src/p_inter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_inter.c b/src/p_inter.c index bc5a31881..6dae204ed 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1581,6 +1581,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (!player->climbing) { + if (player->bot && toucher->state-states != S_PLAY_GASP) + S_StartSound(toucher, special->info->deathsound); // Force it to play a sound for bots P_SetPlayerMobjState(toucher, S_PLAY_GASP); P_ResetPlayer(player); } From 8a676d8aa4623db2086b372dc13cbdf494816e7e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 14 Oct 2017 16:11:08 -0400 Subject: [PATCH 15/17] Added movebob removed viewheight "movebob" lets you determine the strength of movement bobbing (does not affect landing delta, that's technically not movement bobbing :p), values range from 0.0 to 4.0. viewheight is now relative to player->height. --- src/m_cheat.c | 2 +- src/p_local.h | 4 +--- src/p_mobj.c | 10 +++++----- src/p_saveg.c | 2 +- src/p_user.c | 19 ++++++++++--------- src/r_main.c | 6 ++---- 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 3308f721c..5f45790a1 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1129,7 +1129,7 @@ void OP_ObjectplaceMovement(player_t *player) // make sure viewz follows player if in 1st person mode player->deltaviewheight = 0; - player->viewheight = FixedMul(cv_viewheight.value << FRACBITS, player->mo->scale); + player->viewheight = FixedMul(41*player->height/48, player->mo->scale); if (player->mo->eflags & MFE_VERTICALFLIP) player->viewz = player->mo->z + player->mo->height - player->viewheight; else diff --git a/src/p_local.h b/src/p_local.h index 91ee0c496..59f9bee0a 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -25,8 +25,6 @@ #define FLOATSPEED (FRACUNIT*4) -#define VIEWHEIGHTS "41" - // Maximum player score. #define MAXSCORE 999999990 @@ -217,7 +215,7 @@ void P_RestoreMultiMusic(player_t *player); extern mapthing_t *itemrespawnque[ITEMQUESIZE]; extern tic_t itemrespawntime[ITEMQUESIZE]; extern size_t iquehead, iquetail; -extern consvar_t cv_gravity, cv_viewheight; +extern consvar_t cv_gravity, cv_movebob; void P_RespawnSpecials(void); diff --git a/src/p_mobj.c b/src/p_mobj.c index 10bdee2bc..4fe5be9c4 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -36,9 +36,9 @@ #endif #include "f_finale.h" -// protos. -static CV_PossibleValue_t viewheight_cons_t[] = {{16, "MIN"}, {56, "MAX"}, {0, NULL}}; -consvar_t cv_viewheight = {"viewheight", VIEWHEIGHTS, 0, viewheight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t CV_BobSpeed[] = {{0, "MIN"}, {4*FRACUNIT, "MAX"}, {0, NULL}}; +consvar_t cv_movebob = {"movebob", "1.0", CV_FLOAT|CV_SAVE, CV_BobSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; + #ifdef WALLSPLATS consvar_t cv_splats = {"splats", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif @@ -2896,7 +2896,7 @@ static void P_PlayerZMovement(mobj_t *mo) mo->player->viewheight -= mo->floorz - mo->z; mo->player->deltaviewheight = - (FixedMul(cv_viewheight.value<scale) - mo->player->viewheight)>>3; + (FixedMul(41*mo->player->height/48, mo->scale) - mo->player->viewheight)>>3; } // adjust height @@ -9088,7 +9088,7 @@ void P_AfterPlayerSpawn(INT32 playernum) else if (playernum == secondarydisplayplayer) localangle2 = mobj->angle; - p->viewheight = cv_viewheight.value<viewheight = 41*p->height/48; if (p->mo->eflags & MFE_VERTICALFLIP) p->viewz = p->mo->z + p->mo->height - p->viewheight; diff --git a/src/p_saveg.c b/src/p_saveg.c index 8efe7027b..71bc93971 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -413,7 +413,7 @@ static void P_NetUnArchivePlayers(void) if (flags & AWAYVIEW) players[i].awayviewmobj = (mobj_t *)(size_t)READUINT32(save_p); - players[i].viewheight = cv_viewheight.value<bob = (FixedMul(player->rmomx,player->rmomx) - + FixedMul(player->rmomy,player->rmomy))>>2; + player->bob = FixedMul(cv_movebob.value, + (FixedMul(player->rmomx,player->rmomx) + + FixedMul(player->rmomy,player->rmomy))>>2); - if (player->bob > FixedMul(MAXBOB, mo->scale)) - player->bob = FixedMul(MAXBOB, mo->scale); + if (player->bob > FixedMul(cv_movebob.value, FixedMul(MAXBOB, mo->scale))) + player->bob = FixedMul(cv_movebob.value, FixedMul(MAXBOB, mo->scale)); if (!P_IsObjectOnGround(mo)) { @@ -215,7 +216,7 @@ void P_CalcHeight(player_t *player) bob = FixedMul(player->bob/2, FINESINE(angle)); // move viewheight - pviewheight = FixedMul(cv_viewheight.value << FRACBITS, mo->scale); // default eye view height + pviewheight = FixedMul(41*player->height/48, mo->scale); // default eye view height if (player->playerstate == PST_LIVE) { @@ -8606,9 +8607,9 @@ void P_ResetCamera(player_t *player, camera_t *thiscam) x = player->mo->x - P_ReturnThrustX(player->mo, thiscam->angle, player->mo->radius); y = player->mo->y - P_ReturnThrustY(player->mo, thiscam->angle, player->mo->radius); if (player->mo->eflags & MFE_VERTICALFLIP) - z = player->mo->z + player->mo->height - (cv_viewheight.value<mo->z + player->mo->height - (41*player->height/48) - 16*FRACUNIT; else - z = player->mo->z + (cv_viewheight.value<mo->z + (41*player->height/48); // set bits for the camera thiscam->x = x; @@ -8876,7 +8877,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } #endif // bad 2D camera code - pviewheight = FixedMul(cv_viewheight.value<scale); + pviewheight = FixedMul(41*player->height/48, mo->scale); if (mo->eflags & MFE_VERTICALFLIP) z = mo->z + mo->height - pviewheight - height; @@ -10427,7 +10428,7 @@ void P_PlayerAfterThink(player_t *player) { // defaults to make sure 1st person cam doesn't do anything weird on startup player->deltaviewheight = 0; - player->viewheight = FixedMul(cv_viewheight.value << FRACBITS, player->mo->scale); + player->viewheight = FixedMul(41*player->height/48, player->mo->scale); if (player->mo->eflags & MFE_VERTICALFLIP) player->viewz = player->mo->z + player->mo->height - player->viewheight; else diff --git a/src/r_main.c b/src/r_main.c index cabefed14..c5f64c1e9 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1311,10 +1311,8 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_translucenthud); CV_RegisterVar(&cv_maxportals); - - // Default viewheight is changeable, - // initialized to standard viewheight - CV_RegisterVar(&cv_viewheight); + + CV_RegisterVar(&cv_movebob); #ifdef HWRENDER // GL-specific Commands From ead8fd6bf724887f190e4f75f47e0fea56333af4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 30 Oct 2017 23:23:52 +0000 Subject: [PATCH 16/17] Update some strings that say "joystick". --- src/sdl/i_system.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 3e46a9b6a..7b9dcfe8d 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -1026,7 +1026,7 @@ static int joy_open(const char *fname) { if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) { - CONS_Printf(M_GetText("Couldn't initialize joystick: %s\n"), SDL_GetError()); + CONS_Printf(M_GetText("Couldn't initialize gamepad: %s\n"), SDL_GetError()); return -1; } else @@ -1036,7 +1036,7 @@ static int joy_open(const char *fname) if (num_joy < joyindex) { - CONS_Printf(M_GetText("Cannot use joystick #%d/(%s), it doesn't exist\n"),joyindex,fname); + CONS_Printf("Cannot use gamepad #%d/(%s), it doesn't exist\n",joyindex,fname); for (i = 0; i < num_joy; i++) CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); I_ShutdownJoystick(); @@ -1310,7 +1310,7 @@ static int joy_open2(const char *fname) { if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) { - CONS_Printf(M_GetText("Couldn't initialize joystick: %s\n"), SDL_GetError()); + CONS_Printf(M_GetText("Couldn't initialize gamepad: %s\n"), SDL_GetError()); return -1; } else @@ -1318,7 +1318,7 @@ static int joy_open2(const char *fname) if (num_joy < joyindex) { - CONS_Printf(M_GetText("Cannot use joystick #%d/(%s), it doesn't exist\n"),joyindex,fname); + CONS_Printf("Cannot use gamepad #%d/(%s), it doesn't exist\n",joyindex,fname); for (i = 0; i < num_joy; i++) CONS_Printf("#%d/(%s)\n", i+1, SDL_JoystickNameForIndex(i)); I_ShutdownJoystick2(); From 05832e66a33e07d174cc1afdcd338a4149ac5076 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 2 Nov 2017 19:38:21 +0000 Subject: [PATCH 17/17] Fix unmatched readfixed (by replacing). --- src/p_saveg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 2e8615c17..d53869d2e 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -424,8 +424,6 @@ static void P_NetUnArchivePlayers(void) if (flags & FOLLOW) players[i].followmobj = (mobj_t *)(size_t)READUINT32(save_p); - players[i].viewheight = READFIXED(save_p); - players[i].camerascale = READFIXED(save_p); players[i].shieldscale = READFIXED(save_p); @@ -448,6 +446,8 @@ static void P_NetUnArchivePlayers(void) players[i].jumpfactor = READFIXED(save_p); players[i].height = READFIXED(save_p); players[i].spinheight = READFIXED(save_p); + + players[i].viewheight = 41*players[i].height/48; // scale cannot be factored in at this point } }