Merge branch 'public_next' into master

This commit is contained in:
Alam Ed Arias 2016-05-07 11:35:05 -04:00
commit 398dbed4ed
5 changed files with 86 additions and 57 deletions

View File

@ -1009,10 +1009,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
} }
if (cv_analog.value || twodlevel if (cv_analog.value || twodlevel
|| (player->mo && (player->mo->flags2 & MF2_TWOD)) || (player->mo && (player->mo->flags2 & MF2_TWOD))
|| player->climbing || (!demoplayback && (player->climbing
|| (player->pflags & PF_NIGHTSMODE) || (player->pflags & PF_NIGHTSMODE)
|| (player->pflags & PF_SLIDING) || (player->pflags & PF_SLIDING)
|| (player->pflags & PF_FORCESTRAFE)) // Analog || (player->pflags & PF_FORCESTRAFE)))) // Analog
forcestrafe = true; forcestrafe = true;
if (forcestrafe) // Analog if (forcestrafe) // Analog
{ {
@ -1184,8 +1184,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
if (!mouseaiming && cv_mousemove.value) if (!mouseaiming && cv_mousemove.value)
forward += mousey; forward += mousey;
if (cv_analog.value || player->climbing if (cv_analog.value ||
|| (player->pflags & PF_SLIDING)) // Analog for mouse (!demoplayback && (player->climbing
|| (player->pflags & PF_SLIDING)))) // Analog for mouse
side += mousex*2; side += mousex*2;
else else
cmd->angleturn = (INT16)(cmd->angleturn - (mousex*8)); cmd->angleturn = (INT16)(cmd->angleturn - (mousex*8));

View File

@ -169,6 +169,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
boolean P_SuperReady(player_t *player); boolean P_SuperReady(player_t *player);
void P_DoJump(player_t *player, boolean soundandstate); void P_DoJump(player_t *player, boolean soundandstate);
boolean P_AnalogMove(player_t *player);
boolean P_TransferToNextMare(player_t *player); boolean P_TransferToNextMare(player_t *player);
UINT8 P_FindLowestMare(void); UINT8 P_FindLowestMare(void);
void P_FindEmerald(void); void P_FindEmerald(void);

View File

@ -189,10 +189,13 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
{ {
object->angle = spring->angle; object->angle = spring->angle;
if (object->player == &players[consoleplayer]) if (!demoplayback || P_AnalogMove(object->player))
localangle = spring->angle; {
else if (object->player == &players[secondarydisplayplayer]) if (object->player == &players[consoleplayer])
localangle2 = spring->angle; localangle = spring->angle;
else if (object->player == &players[secondarydisplayplayer])
localangle2 = spring->angle;
}
} }
pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these. pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these.
@ -672,10 +675,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
thing->angle = tmthing->angle; thing->angle = tmthing->angle;
if (thing->player == &players[consoleplayer]) if (!demoplayback || P_AnalogMove(thing->player))
localangle = thing->angle; {
else if (thing->player == &players[secondarydisplayplayer]) if (thing->player == &players[consoleplayer])
localangle2 = thing->angle; localangle = thing->angle;
else if (thing->player == &players[secondarydisplayplayer])
localangle2 = thing->angle;
}
return true; return true;
} }
@ -2666,10 +2672,13 @@ isblocking:
&& P_IsClimbingValid(slidemo->player, climbangle)) && P_IsClimbingValid(slidemo->player, climbangle))
{ {
slidemo->angle = climbangle; slidemo->angle = climbangle;
if (slidemo->player == &players[consoleplayer]) if (!demoplayback || P_AnalogMove(slidemo->player))
localangle = slidemo->angle; {
else if (slidemo->player == &players[secondarydisplayplayer]) if (slidemo->player == &players[consoleplayer])
localangle2 = slidemo->angle; localangle = slidemo->angle;
else if (slidemo->player == &players[secondarydisplayplayer])
localangle2 = slidemo->angle;
}
if (!slidemo->player->climbing) if (!slidemo->player->climbing)
{ {

View File

@ -3670,10 +3670,13 @@ DoneSection2:
player->mo->angle = lineangle; player->mo->angle = lineangle;
if (player == &players[consoleplayer]) if (!demoplayback || P_AnalogMove(player))
localangle = player->mo->angle; {
else if (player == &players[secondarydisplayplayer]) if (player == &players[consoleplayer])
localangle2 = player->mo->angle; localangle = player->mo->angle;
else if (player == &players[secondarydisplayplayer])
localangle2 = player->mo->angle;
}
if (!(lines[i].flags & ML_EFFECT4)) if (!(lines[i].flags & ML_EFFECT4))
{ {
@ -7500,24 +7503,27 @@ void T_Pusher(pusher_t *p)
P_SetPlayerMobjState (thing, thing->info->painstate); // Whee! P_SetPlayerMobjState (thing, thing->info->painstate); // Whee!
thing->angle = R_PointToAngle2 (0, 0, xspeed<<(FRACBITS-PUSH_FACTOR), yspeed<<(FRACBITS-PUSH_FACTOR)); thing->angle = R_PointToAngle2 (0, 0, xspeed<<(FRACBITS-PUSH_FACTOR), yspeed<<(FRACBITS-PUSH_FACTOR));
if (thing->player == &players[consoleplayer]) if (!demoplayback || P_AnalogMove(thing->player))
{ {
if (thing->angle - localangle > ANGLE_180) if (thing->player == &players[consoleplayer])
localangle -= (localangle - thing->angle) / 8; {
else if (thing->angle - localangle > ANGLE_180)
localangle += (thing->angle - localangle) / 8; localangle -= (localangle - thing->angle) / 8;
else
localangle += (thing->angle - localangle) / 8;
}
else if (thing->player == &players[secondarydisplayplayer])
{
if (thing->angle - localangle2 > ANGLE_180)
localangle2 -= (localangle2 - thing->angle) / 8;
else
localangle2 += (thing->angle - localangle2) / 8;
}
/*if (thing->player == &players[consoleplayer])
localangle = thing->angle;
else if (thing->player == &players[secondarydisplayplayer])
localangle2 = thing->angle;*/
} }
else if (thing->player == &players[secondarydisplayplayer])
{
if (thing->angle - localangle2 > ANGLE_180)
localangle2 -= (localangle2 - thing->angle) / 8;
else
localangle2 += (thing->angle - localangle2) / 8;
}
/*if (thing->player == &players[consoleplayer])
localangle = thing->angle;
else if (thing->player == &players[secondarydisplayplayer])
localangle2 = thing->angle;*/
} }
if (p->exclusive) if (p->exclusive)

View File

@ -2700,10 +2700,13 @@ static void P_DoClimbing(player_t *player)
P_InstaThrust(player->mo, player->mo->angle, FixedMul(-4*FRACUNIT, player->mo->scale)); P_InstaThrust(player->mo, player->mo->angle, FixedMul(-4*FRACUNIT, player->mo->scale));
} }
if (player == &players[consoleplayer]) if (!demoplayback || P_AnalogMove(player))
localangle = player->mo->angle; {
else if (player == &players[secondarydisplayplayer]) if (player == &players[consoleplayer])
localangle2 = player->mo->angle; localangle = player->mo->angle;
else if (player == &players[secondarydisplayplayer])
localangle2 = player->mo->angle;
}
if (player->climbing == 0) if (player->climbing == 0)
P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); P_SetPlayerMobjState(player->mo, S_PLAY_JUMP);
@ -3583,10 +3586,13 @@ void P_DoJump(player_t *player, boolean soundandstate)
player->mo->angle = player->mo->angle - ANGLE_180; // Turn around from the wall you were climbing. player->mo->angle = player->mo->angle - ANGLE_180; // Turn around from the wall you were climbing.
if (player == &players[consoleplayer]) if (!demoplayback || P_AnalogMove(player))
localangle = player->mo->angle; // Adjust the local control angle. {
else if (player == &players[secondarydisplayplayer]) if (player == &players[consoleplayer])
localangle2 = player->mo->angle; localangle = player->mo->angle; // Adjust the local control angle.
else if (player == &players[secondarydisplayplayer])
localangle2 = player->mo->angle;
}
player->climbing = 0; // Stop climbing, duh! player->climbing = 0; // Stop climbing, duh!
P_InstaThrust(player->mo, player->mo->angle, FixedMul(6*FRACUNIT, player->mo->scale)); // Jump off the wall. P_InstaThrust(player->mo, player->mo->angle, FixedMul(6*FRACUNIT, player->mo->scale)); // Jump off the wall.
@ -4242,7 +4248,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
} }
} }
static boolean P_AnalogMove(player_t *player) boolean P_AnalogMove(player_t *player)
{ {
return player->pflags & PF_ANALOGMODE; return player->pflags & PF_ANALOGMODE;
} }
@ -7577,7 +7583,7 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target
// change angle // change angle
source->angle = R_PointToAngle2(source->x, source->y, enemy->x, enemy->y); source->angle = R_PointToAngle2(source->x, source->y, enemy->x, enemy->y);
if (source->player) if (source->player && (!demoplayback || P_AnalogMove(source->player)))
{ {
if (source->player == &players[consoleplayer]) if (source->player == &players[consoleplayer])
localangle = source->angle; localangle = source->angle;
@ -7996,6 +8002,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
angle = R_PointToAngle2(player->mo->x, player->mo->y, player->mo->target->x, player->mo->target->y); angle = R_PointToAngle2(player->mo->x, player->mo->y, player->mo->target->x, player->mo->target->y);
} }
} }
else if (P_AnalogMove(player)) // Analog
angle = R_PointToAngle2(thiscam->x, thiscam->y, mo->x, mo->y);
else if (demoplayback) else if (demoplayback)
{ {
angle = focusangle; angle = focusangle;
@ -8008,8 +8016,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
localangle -= abs((signed)(focusangle - localangle))>>5; localangle -= abs((signed)(focusangle - localangle))>>5;
} }
} }
else if (P_AnalogMove(player)) // Analog
angle = R_PointToAngle2(thiscam->x, thiscam->y, mo->x, mo->y);
else else
angle = focusangle + FixedAngle(camrotate*FRACUNIT); angle = focusangle + FixedAngle(camrotate*FRACUNIT);
@ -8020,7 +8026,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
thiscam->angle = angle; thiscam->angle = angle;
} }
if (!objectplacing && !(twodlevel || (mo->flags2 & MF2_TWOD)) && !(player->pflags & PF_NIGHTSMODE)) if (!objectplacing && !(twodlevel || (mo->flags2 & MF2_TWOD)) && !(player->pflags & PF_NIGHTSMODE) && displayplayer == consoleplayer)
{ {
#ifdef REDSANALOG #ifdef REDSANALOG
if ((player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)); else if ((player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)); else
@ -9379,10 +9385,13 @@ void P_PlayerAfterThink(player_t *player)
{ {
player->mo->angle = player->mo->tracer->angle; player->mo->angle = player->mo->tracer->angle;
if (player == &players[consoleplayer]) if (!demoplayback || P_AnalogMove(player))
localangle = player->mo->angle; {
else if (player == &players[secondarydisplayplayer]) if (player == &players[consoleplayer])
localangle2 = player->mo->angle; localangle = player->mo->angle;
else if (player == &players[secondarydisplayplayer])
localangle2 = player->mo->angle;
}
} }
if (P_AproxDistance(player->mo->x - player->mo->tracer->x, player->mo->y - player->mo->tracer->y) > player->mo->radius) if (P_AproxDistance(player->mo->x - player->mo->tracer->x, player->mo->y - player->mo->tracer->y) > player->mo->radius)
@ -9449,10 +9458,13 @@ void P_PlayerAfterThink(player_t *player)
player->mo->tracer->target->health += cmd->sidemove; player->mo->tracer->target->health += cmd->sidemove;
player->mo->angle += cmd->sidemove<<ANGLETOFINESHIFT; // 2048 --> ANGLE_MAX player->mo->angle += cmd->sidemove<<ANGLETOFINESHIFT; // 2048 --> ANGLE_MAX
if (player == &players[consoleplayer]) if (!demoplayback || P_AnalogMove(player))
localangle = player->mo->angle; // Adjust the local control angle. {
else if (player == &players[secondarydisplayplayer]) if (player == &players[consoleplayer])
localangle2 = player->mo->angle; localangle = player->mo->angle; // Adjust the local control angle.
else if (player == &players[secondarydisplayplayer])
localangle2 = player->mo->angle;
}
} }
} }