Merge branch 'master' into battle-rethink

This commit is contained in:
Sally Coolatta 2020-10-26 22:22:40 -04:00
commit b83f9afecb
8 changed files with 86 additions and 98 deletions

View file

@ -1702,12 +1702,6 @@ void D_SRB2Main(void)
ultimatemode = true; ultimatemode = true;
}*/ }*/
if (M_CheckParm("-splitscreen"))
{
autostart = true;
splitscreen = true;
}
// rei/miru: bootmap (Idea: starts the game on a predefined map) // rei/miru: bootmap (Idea: starts the game on a predefined map)
if (bootmap && !(M_CheckParm("-warp") && M_IsNextParm())) if (bootmap && !(M_CheckParm("-warp") && M_IsNextParm()))
{ {

View file

@ -2313,7 +2313,7 @@ SINT8 K_GetForwardMove(player_t *player)
return forwardmove; return forwardmove;
} }
fixed_t K_3dKartMovement(player_t *player, boolean onground) fixed_t K_3dKartMovement(player_t *player)
{ {
const fixed_t accelmax = 4000; const fixed_t accelmax = 4000;
const fixed_t p_speed = K_GetKartSpeed(player, true); const fixed_t p_speed = K_GetKartSpeed(player, true);
@ -2323,8 +2323,6 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground)
fixed_t orig = ORIG_FRICTION; fixed_t orig = ORIG_FRICTION;
SINT8 forwardmove = K_GetForwardMove(player); SINT8 forwardmove = K_GetForwardMove(player);
if (!onground) return 0; // If the player isn't on the ground, there is no change in speed
if (K_PlayerUsesBotMovement(player)) if (K_PlayerUsesBotMovement(player))
{ {
orig = K_BotFrictionRubberband(player, ORIG_FRICTION); orig = K_BotFrictionRubberband(player, ORIG_FRICTION);

View file

@ -85,7 +85,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower);
fixed_t K_GetKartAccel(player_t *player); fixed_t K_GetKartAccel(player_t *player);
UINT16 K_GetKartFlashing(player_t *player); UINT16 K_GetKartFlashing(player_t *player);
SINT8 K_GetForwardMove(player_t *player); SINT8 K_GetForwardMove(player_t *player);
fixed_t K_3dKartMovement(player_t *player, boolean onground); fixed_t K_3dKartMovement(player_t *player);
boolean K_PlayerEBrake(player_t *player); boolean K_PlayerEBrake(player_t *player);
void K_AdjustPlayerFriction(player_t *player); void K_AdjustPlayerFriction(player_t *player);
void K_MoveKartPlayer(player_t *player, boolean onground); void K_MoveKartPlayer(player_t *player, boolean onground);

View file

@ -2521,60 +2521,57 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
floatok = true; floatok = true;
thingtop = thing->z + thing->height; if (maxstep > 0)
// Step up
if (thing->z < tmfloorz)
{ {
if (tmfloorz - thing->z <= maxstep) thingtop = thing->z + thing->height;
{
thing->z = thing->floorz = tmfloorz;
thing->floorrover = tmfloorrover;
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
}
else
{
return false; // mobj must raise itself to fit
}
}
else if (tmceilingz < thingtop)
return false; // mobj must lower itself to fit
// Ramp test // Step up
if ((maxstep > 0) && !(P_MobjTouchingSectorSpecial(thing, 1, 14, false))) if (thing->z < tmfloorz)
{
// If the floor difference is MAXSTEPMOVE or less, and the sector isn't Section1:14, ALWAYS
// step down! Formerly required a Section1:13 sector for the full MAXSTEPMOVE, but no more.
if (thingtop == thing->ceilingz && tmceilingz > thingtop && tmceilingz - thingtop <= maxstep)
{ {
if (tmfloorstep <= maxstep)
{
thing->z = thing->floorz = tmfloorz;
thing->floorrover = tmfloorrover;
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
}
else
{
return false; // mobj must raise itself to fit
}
}
else if (tmceilingz < thingtop)
{
if (tmceilingstep <= maxstep)
{
thing->z = ( thing->ceilingz = tmceilingz ) - thing->height;
thing->ceilingrover = tmceilingrover;
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
}
else
{
return false; // mobj must lower itself to fit
}
}
else if (!(P_MobjTouchingSectorSpecial(thing, 1, 14, false))) // Step down
{
// If the floor difference is MAXSTEPMOVE or less, and the sector isn't Section1:14, ALWAYS
// step down! Formerly required a Section1:13 sector for the full MAXSTEPMOVE, but no more.
if (thingtop == thing->ceilingz && tmceilingz > thingtop && thing->ceilingdrop <= maxstep) if (thingtop == thing->ceilingz && tmceilingz > thingtop && thing->ceilingdrop <= maxstep)
{ {
thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height; thing->z = (thing->ceilingz = tmceilingz) - thing->height;
thing->ceilingrover = tmceilingrover; thing->ceilingrover = tmceilingrover;
thing->eflags |= MFE_JUSTSTEPPEDDOWN; thing->eflags |= MFE_JUSTSTEPPEDDOWN;
thing->ceilingdrop = 0; thing->ceilingdrop = 0;
} }
else if (tmceilingz < thingtop && tmceilingstep <= maxstep) else if (thing->z == thing->floorz && tmfloorz < thing->z && thing->floordrop <= maxstep)
{ {
thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height; thing->z = thing->floorz = tmfloorz;
thing->ceilingrover = tmceilingrover; thing->floorrover = tmfloorrover;
thing->eflags |= MFE_JUSTSTEPPEDDOWN; thing->eflags |= MFE_JUSTSTEPPEDDOWN;
thing->floordrop = 0;
} }
} }
else if (thing->z == thing->floorz && tmfloorz < thing->z && thing->floordrop <= maxstep)
{
thing->z = thing->floorz = tmfloorz;
thing->floorrover = tmfloorrover;
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
thing->floordrop = 0;
}
else if (tmfloorz > thing->z && tmfloorstep <= maxstep)
{
thing->z = thing->floorz = tmfloorz;
thing->floorrover = tmfloorrover;
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
}
} }
if (!allowdropoff && !(thing->flags & MF_FLOAT) && thing->type != MT_SKIM && !tmfloorthing) if (!allowdropoff && !(thing->flags & MF_FLOAT) && thing->type != MT_SKIM && !tmfloorthing)

View file

@ -1924,26 +1924,24 @@ static void P_3dMovement(player_t *player)
K_AdjustPlayerFriction(player); K_AdjustPlayerFriction(player);
// Forward movement // Forward movement
if (!P_PlayerInPain(player)) // If the player isn't on the ground, there is no change in speed
// Smiley Face
if (onground)
{ {
if (onground) movepushforward = K_3dKartMovement(player);
if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration...
movepushforward = FixedMul(movepushforward, player->mo->movefactor);
totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward);
totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward);
if (K_PlayerUsesBotMovement(player) == true)
{ {
movepushforward = K_3dKartMovement(player, onground); K_MomentumToFacing(player);
if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration...
movepushforward = FixedMul(movepushforward, player->mo->movefactor);
totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward);
totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward);
} }
} }
if ((!P_PlayerInPain(player) && !onground)
|| (K_PlayerUsesBotMovement(player) == true))
{
K_MomentumToFacing(player);
}
if ((totalthrust.x || totalthrust.y) if ((totalthrust.x || totalthrust.y)
&& player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) > FRACUNIT/2) { && player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) > FRACUNIT/2) {
// Factor thrust to slope, but only for the part pushing up it! // Factor thrust to slope, but only for the part pushing up it!
@ -4411,6 +4409,11 @@ void P_PlayerThink(player_t *player)
// Allows some turning // Allows some turning
P_MovePlayer(player); P_MovePlayer(player);
} }
else if (player->respawn.state == RESPAWNST_MOVE)
{
angle_t angleChange = player->cmd.turning << TICCMD_REDUCE;
P_SetPlayerAngle(player, player->angleturn + angleChange);
}
} }
else if (player->mo->reactiontime) else if (player->mo->reactiontime)
{ {

View file

@ -601,6 +601,12 @@ static inline void R_InitLightTables(void)
//#define WOUGHMP_WOUGHMP // I got a fish-eye lens - I'll make a rap video with a couple of friends //#define WOUGHMP_WOUGHMP // I got a fish-eye lens - I'll make a rap video with a couple of friends
// it's kinda laggy sometimes // it's kinda laggy sometimes
#ifdef WOUGHMP_WOUGHMP
#define AHHHH_IM_SO_MAAAAD { 0U, 0, FRACUNIT, NULL, 0, 0, {0}, {0}, false }
#else
#define AHHHH_IM_SO_MAAAAD { 0U, FRACUNIT, NULL, 0, 0, {0}, {0}, false }
#endif
static struct viewmorph { static struct viewmorph {
angle_t rollangle; // pre-shifted by fineshift angle_t rollangle; // pre-shifted by fineshift
#ifdef WOUGHMP_WOUGHMP #ifdef WOUGHMP_WOUGHMP
@ -615,7 +621,14 @@ static struct viewmorph {
INT16 ceilingclip[MAXVIDWIDTH], floorclip[MAXVIDWIDTH]; INT16 ceilingclip[MAXVIDWIDTH], floorclip[MAXVIDWIDTH];
boolean use; boolean use;
} viewmorph[MAXSPLITSCREENPLAYERS] = {0}; } viewmorph[MAXSPLITSCREENPLAYERS] = {
AHHHH_IM_SO_MAAAAD,
AHHHH_IM_SO_MAAAAD,
AHHHH_IM_SO_MAAAAD,
AHHHH_IM_SO_MAAAAD,
};
#undef AHHHH_IM_SO_MAAAAD
void R_CheckViewMorph(int s) void R_CheckViewMorph(int s)
{ {
@ -643,11 +656,6 @@ void R_CheckViewMorph(int s)
fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value
#endif #endif
if (v->zoomneeded == 0)
{
v->zoomneeded = FRACUNIT;
}
rollangle >>= ANGLETOFINESHIFT; rollangle >>= ANGLETOFINESHIFT;
rollangle = ((rollangle+2) & ~3) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot. rollangle = ((rollangle+2) & ~3) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot.

View file

@ -939,9 +939,9 @@ void S_UpdateSounds(void)
memset(&listener4, 0, sizeof(listener_t)); memset(&listener4, 0, sizeof(listener_t));
// Update sound/music volumes, if changed manually at console // Update sound/music volumes, if changed manually at console
if (actualsfxvolume != cv_soundvolume.value) if (actualsfxvolume != cv_soundvolume.value * USER_VOLUME_SCALE)
S_SetSfxVolume (cv_soundvolume.value); S_SetSfxVolume (cv_soundvolume.value);
if (actualdigmusicvolume != cv_digmusicvolume.value) if (actualdigmusicvolume != cv_digmusicvolume.value * USER_VOLUME_SCALE)
S_SetDigMusicVolume (cv_digmusicvolume.value); S_SetDigMusicVolume (cv_digmusicvolume.value);
// We're done now, if we're not in a level. // We're done now, if we're not in a level.

View file

@ -570,17 +570,13 @@ void I_SetSfxVolume(int volume)
/// Music Utilities /// Music Utilities
/// ------------------------ /// ------------------------
static UINT32 get_real_volume(int volume) static int attenuate(int scale)
{ {
{ // attenuate scale by all volumes as percentages
// convert volume to mixer's 128 scale return scale
// then apply internal_volume as a percentage * musicdef_volume / 100
//return ((UINT32)volume*128/31) * (UINT32)internal_volume / 100; * internal_volume / 100
return MIX_MAX_VOLUME * music_volume / 100;
* musicdef_volume / 100
* internal_volume / 100
* volume / 100;
}
} }
static UINT32 get_adjusted_position(UINT32 position) static UINT32 get_adjusted_position(UINT32 position)
@ -686,7 +682,7 @@ static UINT32 music_fade(UINT32 interval, void *param)
else if ((fading_timer -= 10) <= 0) else if ((fading_timer -= 10) <= 0)
{ {
internal_volume = fading_target; internal_volume = fading_target;
Mix_VolumeMusic(get_real_volume(music_volume)); Mix_VolumeMusic(attenuate(MIX_MAX_VOLUME));
I_StopFadingSong(); I_StopFadingSong();
do_fading_callback(); do_fading_callback();
return 0; return 0;
@ -699,7 +695,7 @@ static UINT32 music_fade(UINT32 interval, void *param)
internal_volume = max(min(internal_volume, fading_source - FixedMul(delta, factor)), fading_target); internal_volume = max(min(internal_volume, fading_source - FixedMul(delta, factor)), fading_target);
else if (fading_target > fading_source) else if (fading_target > fading_source)
internal_volume = min(max(internal_volume, fading_source + FixedMul(delta, factor)), fading_target); internal_volume = min(max(internal_volume, fading_source + FixedMul(delta, factor)), fading_target);
Mix_VolumeMusic(get_real_volume(music_volume)); Mix_VolumeMusic(attenuate(MIX_MAX_VOLUME));
return interval; return interval;
} }
} }
@ -719,13 +715,9 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
// play gme into stream // play gme into stream
gme_play(gme, len/2, (short *)stream); gme_play(gme, len/2, (short *)stream);
// Limiter to prevent music from being disorted with some formats
if (music_volume >= 18)
music_volume = 18;
// apply volume to stream // apply volume to stream
for (i = 0, p = (short *)stream; i < len/2; i++, p++) for (i = 0, p = (short *)stream; i < len/2; i++, p++)
*p = ((INT32)*p) * (music_volume*internal_volume/100)*2 / 40; *p = attenuate(*p);
} }
#endif #endif
@ -743,13 +735,9 @@ static void mix_openmpt(void *udata, Uint8 *stream, int len)
// Play module into stream // Play module into stream
openmpt_module_read_interleaved_stereo(openmpt_mhandle, SAMPLERATE, BUFFERSIZE, (short *)stream); openmpt_module_read_interleaved_stereo(openmpt_mhandle, SAMPLERATE, BUFFERSIZE, (short *)stream);
// Limiter to prevent music from being disorted with some formats
if (music_volume >= 18)
music_volume = 18;
// apply volume to stream // apply volume to stream
for (i = 0, p = (short *)stream; i < len/2; i++, p++) for (i = 0, p = (short *)stream; i < len/2; i++, p++)
*p = ((INT32)*p) * (music_volume*internal_volume/100)*2 / 40; *p = attenuate(*p);
} }
#endif #endif
@ -1398,7 +1386,7 @@ void I_SetMusicVolume(int volume)
music_volume = volume; music_volume = volume;
Mix_VolumeMusic(get_real_volume(music_volume)); Mix_VolumeMusic(attenuate(MIX_MAX_VOLUME));
} }
boolean I_SetSongTrack(int track) boolean I_SetSongTrack(int track)
@ -1460,7 +1448,7 @@ void I_SetInternalMusicVolume(UINT8 volume)
internal_volume = volume; internal_volume = volume;
if (!I_SongPlaying()) if (!I_SongPlaying())
return; return;
Mix_VolumeMusic(get_real_volume(music_volume)); Mix_VolumeMusic(attenuate(MIX_MAX_VOLUME));
} }
void I_StopFadingSong(void) void I_StopFadingSong(void)