mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 12:40:58 +00:00
Convert simple movement to directionchar+analog
Analog + no directionchar is old analog (now known as CS_LMAOGALOG because lmao if you still use it).
This commit is contained in:
parent
e0f35d207f
commit
c3d14064e2
7 changed files with 102 additions and 82 deletions
61
src/g_game.c
61
src/g_game.c
|
@ -1144,7 +1144,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
INT32 *myaiming = (ssplayer == 1 ? &localaiming : &localaiming2);
|
||||
|
||||
angle_t drawangleoffset = (player->powers[pw_carry] == CR_ROLLOUT) ? ANGLE_180 : 0;
|
||||
INT32 chasecam, chasefreelook, alwaysfreelook, usejoystick, analog, invertmouse, mousemove, abilitydirection;
|
||||
INT32 chasecam, chasefreelook, alwaysfreelook, usejoystick, invertmouse, mousemove;
|
||||
controlstyle_e controlstyle = G_ControlStyle(ssplayer);
|
||||
INT32 *mx; INT32 *my; INT32 *mly;
|
||||
|
||||
static INT32 turnheld[2]; // for accelerative turning
|
||||
|
@ -1165,7 +1166,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
chasefreelook = cv_chasefreelook.value;
|
||||
alwaysfreelook = cv_alwaysfreelook.value;
|
||||
usejoystick = cv_usejoystick.value;
|
||||
analog = cv_analog[0].value;
|
||||
invertmouse = cv_invertmouse.value;
|
||||
mousemove = cv_mousemove.value;
|
||||
mx = &mousex;
|
||||
|
@ -1179,7 +1179,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
chasefreelook = cv_chasefreelook2.value;
|
||||
alwaysfreelook = cv_alwaysfreelook2.value;
|
||||
usejoystick = cv_usejoystick2.value;
|
||||
analog = cv_analog[1].value;
|
||||
invertmouse = cv_invertmouse2.value;
|
||||
mousemove = cv_mousemove2.value;
|
||||
mx = &mouse2x;
|
||||
|
@ -1187,9 +1186,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
mly = &mlook2y;
|
||||
G_CopyTiccmd(cmd, I_BaseTiccmd2(), 1); // empty, or external driver
|
||||
}
|
||||
abilitydirection = cv_abilitydirection[player->bot ? 0 : forplayer].value;
|
||||
|
||||
strafeisturn = abilitydirection && ticcmd_centerviewdown[forplayer] &&
|
||||
strafeisturn = controlstyle == CS_SIMPLE && ticcmd_centerviewdown[forplayer] &&
|
||||
((cv_cam_lockedinput[forplayer].value && !ticcmd_ztargetfocus[forplayer]) || (player->pflags & PF_STARTDASH)) &&
|
||||
!player->climbing && player->powers[pw_carry] != CR_MINECART;
|
||||
|
||||
|
@ -1259,7 +1257,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
tspeed = speed;
|
||||
|
||||
// let movement keys cancel each other out
|
||||
if (analog) // Analog
|
||||
if (controlstyle == CS_LMAOGALOG) // Analog
|
||||
{
|
||||
if (turnright)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - angleturn[tspeed]);
|
||||
|
@ -1288,7 +1286,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
side += ((lookjoystickvector.xaxis * sidemove[1]) >> 10);
|
||||
}
|
||||
}
|
||||
else if (analog) // Analog
|
||||
else if (controlstyle == CS_LMAOGALOG) // Analog
|
||||
{
|
||||
if (turnright)
|
||||
cmd->buttons |= BT_CAMRIGHT;
|
||||
|
@ -1399,7 +1397,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
static boolean last_centerviewdown[2], centerviewhold[2]; // detect taps for toggle behavior
|
||||
boolean down = PLAYERINPUTDOWN(ssplayer, gc_centerview);
|
||||
|
||||
if (!(abilitydirection && cv_cam_centertoggle[forplayer].value))
|
||||
if (!(controlstyle == CS_SIMPLE && cv_cam_centertoggle[forplayer].value))
|
||||
centerviewdown = down;
|
||||
else
|
||||
{
|
||||
|
@ -1416,9 +1414,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
if (centerviewdown)
|
||||
{
|
||||
if (abilitydirection && !ticcmd_centerviewdown[forplayer] && !G_RingSlingerGametype())
|
||||
if (controlstyle == CS_SIMPLE && !ticcmd_centerviewdown[forplayer] && !G_RingSlingerGametype())
|
||||
{
|
||||
CV_SetValue((ssplayer == 1 ? &cv_directionchar[0] : &cv_directionchar[1]), 0);
|
||||
CV_SetValue(&cv_directionchar[forplayer], 0); ///@TODO will break things
|
||||
*myangle = player->mo->angle;
|
||||
*myaiming = 0;
|
||||
|
||||
|
@ -1430,10 +1428,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
}
|
||||
else if (ticcmd_centerviewdown[forplayer])
|
||||
{
|
||||
if (abilitydirection)
|
||||
if (controlstyle == CS_SIMPLE)
|
||||
{
|
||||
P_SetTarget(&ticcmd_ztargetfocus[forplayer], NULL);
|
||||
CV_SetValue((ssplayer == 1 ? &cv_directionchar[0] : &cv_directionchar[1]), 1);
|
||||
CV_SetValue(&cv_directionchar[forplayer], 1);
|
||||
}
|
||||
|
||||
ticcmd_centerviewdown[forplayer] = false;
|
||||
|
@ -1562,7 +1560,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
if ((!demoplayback && (player->pflags & PF_SLIDING))) // Analog for mouse
|
||||
side += *mx*2;
|
||||
else if (analog)
|
||||
else if (controlstyle == CS_LMAOGALOG)
|
||||
{
|
||||
if (*mx)
|
||||
{
|
||||
|
@ -1622,7 +1620,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
}
|
||||
}
|
||||
|
||||
if (analog) {
|
||||
if (controlstyle == CS_LMAOGALOG) {
|
||||
if (player->awayviewtics)
|
||||
cmd->angleturn = (INT16)(player->awayviewmobj->angle >> 16);
|
||||
else
|
||||
|
@ -1634,7 +1632,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
cmd->angleturn = (INT16)(*myangle >> 16);
|
||||
|
||||
// Adjust camera angle by player input
|
||||
if (abilitydirection && !forcestrafe && camera.chase && !turnheld[forplayer] && !ticcmd_centerviewdown[forplayer] && !player->climbing && player->powers[pw_carry] != CR_MINECART)
|
||||
if (controlstyle == CS_SIMPLE && !forcestrafe && camera.chase && !turnheld[forplayer] && !ticcmd_centerviewdown[forplayer] && !player->climbing && player->powers[pw_carry] != CR_MINECART)
|
||||
{
|
||||
fixed_t camadjustfactor = cv_cam_turnfacinginput[forplayer].value;
|
||||
|
||||
|
@ -1654,30 +1652,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
cmd->sidemove = 0;
|
||||
}
|
||||
|
||||
if (abilitydirection && camera.chase && !ticcmd_centerviewdown[forplayer] && !player->climbing && !forcestrafe && (player->pflags & PF_DIRECTIONCHAR) && player->powers[pw_carry] != CR_MINECART)
|
||||
{
|
||||
///@TODO This block of code is a hack to get the desired abilitydirection and player angle behaviors while remaining netplay-compatible with EXEs without those features.
|
||||
// This has side effects like making F12 spectate look kind of weird, and making the input viewer inaccurate.
|
||||
// In a perfect world, this will be removed and player behavior would use facing direction in a way that mimics this.
|
||||
// But that's a lot more work and I want to A) have this out quickly B) be netplay-compatible.
|
||||
|
||||
if (cmd->forwardmove || cmd->sidemove)
|
||||
{
|
||||
angle_t controlangle = R_PointToAngle2(0, 0, cmd->forwardmove << FRACBITS, -cmd->sidemove << FRACBITS);
|
||||
cmd->angleturn += (controlangle>>16);
|
||||
|
||||
cmd->forwardmove = R_PointToDist2(0, 0, cmd->forwardmove, cmd->sidemove);
|
||||
if (cmd->forwardmove > MAXPLMOVE)
|
||||
cmd->forwardmove = MAXPLMOVE;
|
||||
cmd->sidemove = 0;
|
||||
}
|
||||
else
|
||||
cmd->angleturn = (player->drawangle+drawangleoffset)>>16;
|
||||
}
|
||||
|
||||
// Adjust camera angle to face player direction, depending on circumstances
|
||||
// Nothing happens if cam left/right are held, so you can hold both to lock the camera in one direction
|
||||
if (abilitydirection && !forcestrafe && camera.chase && !turnheld[forplayer] && !ticcmd_centerviewdown[forplayer] && player->powers[pw_carry] != CR_MINECART)
|
||||
if (controlstyle == CS_SIMPLE && !forcestrafe && camera.chase && !turnheld[forplayer] && !ticcmd_centerviewdown[forplayer] && player->powers[pw_carry] != CR_MINECART)
|
||||
{
|
||||
fixed_t camadjustfactor;
|
||||
boolean alt = false; // Reduce intensity on diagonals and prevent backwards movement from turning the camera
|
||||
|
@ -1703,7 +1680,15 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
if (camadjustfactor)
|
||||
{
|
||||
INT32 anglediff = ((player->pflags & PF_SPINNING) ? player->drawangle + drawangleoffset : (cmd->angleturn<<16)) - *myangle;
|
||||
angle_t controlangle;
|
||||
INT32 anglediff;
|
||||
|
||||
if ((cmd->forwardmove || cmd->sidemove) && !(player->pflags & PF_SPINNING))
|
||||
controlangle = (cmd->angleturn<<16) + R_PointToAngle2(0, 0, cmd->forwardmove << FRACBITS, -cmd->sidemove << FRACBITS);
|
||||
else
|
||||
controlangle = player->drawangle + drawangleoffset;
|
||||
|
||||
anglediff = controlangle - *myangle;
|
||||
|
||||
if (alt)
|
||||
{
|
||||
|
|
11
src/g_game.h
11
src/g_game.h
|
@ -68,8 +68,19 @@ extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime,
|
|||
extern consvar_t cv_crosshair, cv_crosshair2;
|
||||
extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_chasefreelook, cv_mousemove;
|
||||
extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_chasefreelook2, cv_mousemove2;
|
||||
|
||||
extern consvar_t cv_useranalog[2], cv_analog[2];
|
||||
extern consvar_t cv_directionchar[2];
|
||||
|
||||
typedef enum {
|
||||
CS_LEGACY,
|
||||
CS_LMAOGALOG,
|
||||
CS_STANDARD,
|
||||
CS_SIMPLE = CS_LMAOGALOG|CS_STANDARD,
|
||||
} controlstyle_e;
|
||||
#define G_ControlStyle(ssplayer) ((cv_analog[(ssplayer)-1].value ? CS_LMAOGALOG : 0) | (cv_directionchar[(ssplayer)-1].value ? CS_STANDARD : 0))
|
||||
#define P_ControlStyle(player) ((((player)->pflags & PF_ANALOGMODE) ? CS_LMAOGALOG : 0) | (((player)->pflags & PF_DIRECTIONCHAR) ? CS_STANDARD : 0))
|
||||
|
||||
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,cv_deadzone,cv_digitaldeadzone;
|
||||
extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2,cv_deadzone2,cv_digitaldeadzone2;
|
||||
|
|
|
@ -192,11 +192,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
|
|||
boolean P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
|
||||
boolean P_SuperReady(player_t *player);
|
||||
void P_DoJump(player_t *player, boolean soundandstate);
|
||||
#if 0
|
||||
boolean P_AnalogMove(player_t *player);
|
||||
#else
|
||||
#define P_AnalogMove(player) (player->pflags & PF_ANALOGMODE)
|
||||
#endif
|
||||
#define P_AnalogMove(player) (P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
boolean P_TransferToNextMare(player_t *player);
|
||||
UINT8 P_FindLowestMare(void);
|
||||
void P_FindEmerald(void);
|
||||
|
|
|
@ -377,7 +377,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
{
|
||||
object->angle = object->player->drawangle = spring->angle;
|
||||
|
||||
if (!demoplayback || P_AnalogMove(object->player))
|
||||
if (!demoplayback || P_ControlStyle(object->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (object->player == &players[consoleplayer])
|
||||
localangle = spring->angle;
|
||||
|
@ -1322,7 +1322,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
thing->angle = tmthing->angle;
|
||||
|
||||
if (!demoplayback || P_AnalogMove(thing->player))
|
||||
if (!demoplayback || P_ControlStyle(thing->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (thing->player == &players[consoleplayer])
|
||||
localangle = thing->angle;
|
||||
|
@ -3491,7 +3491,7 @@ isblocking:
|
|||
&& canclimb)
|
||||
{
|
||||
slidemo->angle = climbangle;
|
||||
/*if (!demoplayback || P_AnalogMove(slidemo->player))
|
||||
/*if (!demoplayback || P_ControlStyle(slidemo->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (slidemo->player == &players[consoleplayer])
|
||||
localangle = slidemo->angle;
|
||||
|
|
|
@ -4619,7 +4619,7 @@ DoneSection2:
|
|||
|
||||
player->mo->angle = player->drawangle = lineangle;
|
||||
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
|
@ -9176,7 +9176,7 @@ void T_Pusher(pusher_t *p)
|
|||
thing->player->pflags |= PF_SLIDING;
|
||||
thing->angle = R_PointToAngle2 (0, 0, xspeed<<(FRACBITS-PUSH_FACTOR), yspeed<<(FRACBITS-PUSH_FACTOR));
|
||||
|
||||
if (!demoplayback || P_AnalogMove(thing->player))
|
||||
if (!demoplayback || P_ControlStyle(thing->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (thing->player == &players[consoleplayer])
|
||||
{
|
||||
|
|
84
src/p_user.c
84
src/p_user.c
|
@ -3579,7 +3579,7 @@ static void P_DoClimbing(player_t *player)
|
|||
}
|
||||
|
||||
#define CLIMBCONEMAX FixedAngle(90*FRACUNIT)
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
{
|
||||
|
@ -4394,7 +4394,7 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
|
||||
player->drawangle = player->mo->angle = player->mo->angle - ANGLE_180; // Turn around from the wall you were climbing.
|
||||
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle; // Adjust the local control angle.
|
||||
|
@ -4719,7 +4719,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
|
|||
{
|
||||
player->mo->angle = R_PointToAngle2(player->mo->x, player->mo->y, lockon->x, lockon->y);
|
||||
bullet = P_SpawnPointMissile(player->mo, lockon->x, lockon->y, zpos(lockon), player->revitem, player->mo->x, player->mo->y, zpos(player->mo));
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
|
@ -5616,13 +5616,6 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
boolean P_AnalogMove(player_t *player)
|
||||
{
|
||||
return player->pflags & PF_ANALOGMODE;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// P_GetPlayerControlDirection
|
||||
//
|
||||
|
@ -5661,7 +5654,7 @@ INT32 P_GetPlayerControlDirection(player_t *player)
|
|||
origtempangle = tempangle = 0; // relative to the axis rather than the player!
|
||||
controlplayerdirection = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy);
|
||||
}
|
||||
else if (P_AnalogMove(player) && thiscam->chase)
|
||||
else if ((P_ControlStyle(player) & CS_LMAOGALOG) && thiscam->chase)
|
||||
{
|
||||
if (player->awayviewtics)
|
||||
origtempangle = tempangle = player->awayviewmobj->angle;
|
||||
|
@ -5887,7 +5880,7 @@ static void P_3dMovement(player_t *player)
|
|||
INT32 mforward = 0, mbackward = 0;
|
||||
angle_t dangle; // replaces old quadrants bits
|
||||
fixed_t normalspd = FixedMul(player->normalspeed, player->mo->scale);
|
||||
boolean analogmove = false;
|
||||
controlstyle_e controlstyle;
|
||||
boolean spin = ((onground = P_IsObjectOnGround(player->mo)) && (player->pflags & (PF_SPINNING|PF_THOKKED)) == PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH));
|
||||
fixed_t oldMagnitude, newMagnitude;
|
||||
#ifdef ESLOPE
|
||||
|
@ -5900,7 +5893,7 @@ static void P_3dMovement(player_t *player)
|
|||
// Get the old momentum; this will be needed at the end of the function! -SH
|
||||
oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
|
||||
|
||||
analogmove = P_AnalogMove(player);
|
||||
controlstyle = P_ControlStyle(player);
|
||||
|
||||
cmd = &player->cmd;
|
||||
|
||||
|
@ -5927,7 +5920,7 @@ static void P_3dMovement(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
if (analogmove)
|
||||
if (controlstyle & CS_LMAOGALOG)
|
||||
{
|
||||
movepushangle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
}
|
||||
|
@ -6073,7 +6066,7 @@ static void P_3dMovement(player_t *player)
|
|||
P_SetObjectMomZ(player->mo, FixedDiv(cmd->forwardmove*FRACUNIT, 15*FRACUNIT>>1), false);
|
||||
}
|
||||
}
|
||||
else if (!analogmove
|
||||
else if (!(controlstyle == CS_LMAOGALOG)
|
||||
&& cmd->forwardmove != 0 && !(player->pflags & PF_GLIDING || player->exiting
|
||||
|| (P_PlayerInPain(player) && !onground)))
|
||||
{
|
||||
|
@ -6112,7 +6105,7 @@ static void P_3dMovement(player_t *player)
|
|||
P_InstaThrust(player->mo, player->mo->angle-ANGLE_90, FixedDiv(cmd->sidemove*player->mo->scale, 15*FRACUNIT>>1));
|
||||
}
|
||||
// Analog movement control
|
||||
else if (analogmove)
|
||||
else if (controlstyle == CS_LMAOGALOG)
|
||||
{
|
||||
if (!(player->pflags & PF_GLIDING || player->exiting || P_PlayerInPain(player)))
|
||||
{
|
||||
|
@ -8132,8 +8125,33 @@ static void P_MovePlayer(player_t *player)
|
|||
P_2dMovement(player);
|
||||
else
|
||||
{
|
||||
if (!player->climbing && (!P_AnalogMove(player)))
|
||||
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
if (!player->climbing)
|
||||
{
|
||||
switch (P_ControlStyle(player))
|
||||
{
|
||||
case CS_LEGACY:
|
||||
case CS_STANDARD:
|
||||
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
break;
|
||||
|
||||
case CS_LMAOGALOG:
|
||||
break; // handled elsewhere
|
||||
|
||||
case CS_SIMPLE:
|
||||
if (cmd->forwardmove || cmd->sidemove)
|
||||
{
|
||||
angle_t controlangle = R_PointToAngle2(0, 0, cmd->forwardmove << FRACBITS, -cmd->sidemove << FRACBITS);
|
||||
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */) + controlangle;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle_t drawangleoffset = (player->powers[pw_carry] == CR_ROLLOUT) ? ANGLE_180 : 0;
|
||||
player->mo->angle = player->drawangle + drawangleoffset;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ticruned++;
|
||||
if ((cmd->angleturn & TICCMD_RECEIVED) == 0)
|
||||
|
@ -8259,7 +8277,7 @@ static void P_MovePlayer(player_t *player)
|
|||
if (player->pflags & PF_GLIDING)
|
||||
{
|
||||
mobj_t *mo = player->mo; // seriously why isn't this at the top of the function hngngngng
|
||||
fixed_t leeway = !P_AnalogMove(player) ? FixedAngle(cmd->sidemove*(FRACUNIT)) : 0;
|
||||
fixed_t leeway = (P_ControlStyle(player) != CS_LMAOGALOG) ? FixedAngle(cmd->sidemove*(FRACUNIT)) : 0;
|
||||
fixed_t glidespeed = player->actionspd;
|
||||
fixed_t momx = mo->momx - player->cmomx, momy = mo->momy - player->cmomy;
|
||||
angle_t angle, moveangle = R_PointToAngle2(0, 0, momx, momy);
|
||||
|
@ -8531,7 +8549,7 @@ static void P_MovePlayer(player_t *player)
|
|||
//////////////////
|
||||
|
||||
// This really looks like it should be moved to P_3dMovement. -Red
|
||||
if (P_AnalogMove(player)
|
||||
if (P_ControlStyle(player) == CS_LMAOGALOG
|
||||
&& (cmd->forwardmove != 0 || cmd->sidemove != 0) && !player->climbing && !twodlevel && !(player->mo->flags2 & MF2_TWOD))
|
||||
{
|
||||
// If travelling slow enough, face the way the controls
|
||||
|
@ -9376,7 +9394,7 @@ boolean P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target
|
|||
if (source->player)
|
||||
{
|
||||
source->player->drawangle = source->angle;
|
||||
if (!demoplayback || P_AnalogMove(source->player))
|
||||
if (!demoplayback || P_ControlStyle(source->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (source->player == &players[consoleplayer])
|
||||
localangle = source->angle;
|
||||
|
@ -9982,7 +10000,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
camheight = FixedMul(camheight, player->camerascale);
|
||||
|
||||
#ifdef REDSANALOG
|
||||
if (P_AnalogMove(player) && (player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)) {
|
||||
if (P_ControlStyle(player) == CS_LMAOGALOG && (player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)) {
|
||||
camstill = true;
|
||||
|
||||
if (camspeed < 4*FRACUNIT/5)
|
||||
|
@ -10012,7 +10030,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
angle = R_PointToAngle2(mo->x, mo->y, mo->target->x, mo->target->y);
|
||||
}
|
||||
}
|
||||
else if (P_AnalogMove(player) && !sign) // Analog
|
||||
else if (P_ControlStyle(player) == CS_LMAOGALOG && !sign) // Analog
|
||||
angle = R_PointToAngle2(thiscam->x, thiscam->y, mo->x, mo->y);
|
||||
else if (demoplayback)
|
||||
{
|
||||
|
@ -10102,7 +10120,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
camheight = mo->scale << 7;
|
||||
camspeed = FRACUNIT/12;
|
||||
}
|
||||
else if (P_AnalogMove(player)) // x1.2 dist for analog
|
||||
else if (P_ControlStyle(player) == CS_LMAOGALOG) // x1.2 dist for analog
|
||||
{
|
||||
dist = FixedMul(dist, 6*FRACUNIT/5);
|
||||
camheight = FixedMul(camheight, 6*FRACUNIT/5);
|
||||
|
@ -10995,7 +11013,7 @@ static void P_MinecartThink(player_t *player)
|
|||
else if (angdiff > ANGLE_180 && angdiff < InvAngle(MINECARTCONEMAX))
|
||||
player->mo->angle = minecart->angle - MINECARTCONEMAX;
|
||||
|
||||
if (angdiff + minecart->angle != player->mo->angle && (!demoplayback || P_AnalogMove(player)))
|
||||
if (angdiff + minecart->angle != player->mo->angle && (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG))
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
|
@ -11074,7 +11092,7 @@ static void P_MinecartThink(player_t *player)
|
|||
else
|
||||
minecart->angle = targetangle + ANGLE_180;
|
||||
angdiff = (minecart->angle - prevangle);
|
||||
if (angdiff && (!demoplayback || P_AnalogMove(player))) // maintain relative angle on turns
|
||||
if (angdiff && (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)) // maintain relative angle on turns
|
||||
{
|
||||
player->mo->angle += angdiff;
|
||||
if (player == &players[consoleplayer])
|
||||
|
@ -11840,7 +11858,7 @@ void P_PlayerThink(player_t *player)
|
|||
player->mo->reactiontime--;
|
||||
else if (player->powers[pw_carry] == CR_MINECART)
|
||||
{
|
||||
if (!P_AnalogMove(player))
|
||||
if (P_ControlStyle(player) != CS_LMAOGALOG)
|
||||
player->mo->angle = (cmd->angleturn << 16 /* not FRACBITS */);
|
||||
|
||||
ticruned++;
|
||||
|
@ -11853,7 +11871,7 @@ void P_PlayerThink(player_t *player)
|
|||
{
|
||||
if (player->powers[pw_carry] == CR_ROPEHANG)
|
||||
{
|
||||
if (!P_AnalogMove(player))
|
||||
if (P_ControlStyle(player) != CS_LMAOGALOG)
|
||||
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
|
||||
ticruned++;
|
||||
|
@ -11901,7 +11919,7 @@ void P_PlayerThink(player_t *player)
|
|||
;
|
||||
else if (!(player->pflags & PF_DIRECTIONCHAR)
|
||||
|| (player->climbing) // stuff where the direction is forced at all times
|
||||
|| (P_AnalogMove(player) || twodlevel || player->mo->flags2 & MF2_TWOD) // keep things synchronised up there, since the camera IS seperate from player motion when that happens
|
||||
|| (twodlevel || player->mo->flags2 & MF2_TWOD) // keep things synchronised up there, since the camera IS seperate from player motion when that happens
|
||||
|| G_RingSlingerGametype()) // no firing rings in directions your player isn't aiming
|
||||
player->drawangle = player->mo->angle;
|
||||
else if (P_PlayerInPain(player))
|
||||
|
@ -11932,7 +11950,7 @@ void P_PlayerThink(player_t *player)
|
|||
case CR_ROLLOUT:
|
||||
if (cmd->forwardmove || cmd->sidemove) // only when you're pressing movement keys
|
||||
{ // inverse direction!
|
||||
diff = ((player->mo->angle + R_PointToAngle2(0, 0, -cmd->forwardmove<<FRACBITS, cmd->sidemove<<FRACBITS)) - player->drawangle);
|
||||
diff = (((player->cmd.angleturn<<16) + R_PointToAngle2(0, 0, -cmd->forwardmove<<FRACBITS, cmd->sidemove<<FRACBITS)) - player->drawangle);
|
||||
factor = 4;
|
||||
}
|
||||
break;
|
||||
|
@ -11989,7 +12007,7 @@ void P_PlayerThink(player_t *player)
|
|||
}
|
||||
else if (cmd->forwardmove || cmd->sidemove) // only when you're pressing movement keys
|
||||
{
|
||||
diff = ((player->mo->angle + R_PointToAngle2(0, 0, cmd->forwardmove<<FRACBITS, -cmd->sidemove<<FRACBITS)) - player->drawangle);
|
||||
diff = ((player->mo->angle + ((player->pflags & PF_ANALOGMODE) ? 0 : R_PointToAngle2(0, 0, cmd->forwardmove<<FRACBITS, -cmd->sidemove<<FRACBITS))) - player->drawangle);
|
||||
factor = 4;
|
||||
}
|
||||
else if (player->rmomx || player->rmomy)
|
||||
|
@ -12602,7 +12620,7 @@ void P_PlayerAfterThink(player_t *player)
|
|||
{
|
||||
player->mo->angle = tails->angle;
|
||||
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
|
@ -12691,7 +12709,7 @@ void P_PlayerAfterThink(player_t *player)
|
|||
macecenter->angle += cmd->sidemove<<ANGLETOFINESHIFT;
|
||||
player->mo->angle += cmd->sidemove<<ANGLETOFINESHIFT; // 2048 --> ANGLE_MAX
|
||||
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle; // Adjust the local control angle.
|
||||
|
|
|
@ -1157,10 +1157,20 @@ static void ST_drawInput(void)
|
|||
"AUTOBRAKE");
|
||||
y -= 8;
|
||||
}
|
||||
if (stplyr->pflags & PF_ANALOGMODE)
|
||||
switch (P_ControlStyle(stplyr))
|
||||
{
|
||||
case CS_LMAOGALOG:
|
||||
V_DrawThinString(x, y, hudinfo[HUD_LIVES].f, "ANALOG");
|
||||
y -= 8;
|
||||
break;
|
||||
|
||||
case CS_SIMPLE:
|
||||
V_DrawThinString(x, y, hudinfo[HUD_LIVES].f, "SIMPLE");
|
||||
y -= 8;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!demosynced) // should always be last, so it doesn't push anything else around
|
||||
|
|
Loading…
Reference in a new issue