diff --git a/src/d_main.c b/src/d_main.c index cedf3a368..e85d2dc57 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1702,12 +1702,6 @@ void D_SRB2Main(void) ultimatemode = true; }*/ - if (M_CheckParm("-splitscreen")) - { - autostart = true; - splitscreen = true; - } - // rei/miru: bootmap (Idea: starts the game on a predefined map) if (bootmap && !(M_CheckParm("-warp") && M_IsNextParm())) { diff --git a/src/k_kart.c b/src/k_kart.c index 273903ff0..bbdc62e82 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2313,7 +2313,7 @@ SINT8 K_GetForwardMove(player_t *player) 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 p_speed = K_GetKartSpeed(player, true); @@ -2323,8 +2323,6 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground) fixed_t orig = ORIG_FRICTION; 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)) { orig = K_BotFrictionRubberband(player, ORIG_FRICTION); diff --git a/src/k_kart.h b/src/k_kart.h index 115b7f47c..034b13e58 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -85,7 +85,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower); fixed_t K_GetKartAccel(player_t *player); UINT16 K_GetKartFlashing(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); void K_AdjustPlayerFriction(player_t *player); void K_MoveKartPlayer(player_t *player, boolean onground); diff --git a/src/p_map.c b/src/p_map.c index 9b879002a..0bda497ee 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2521,60 +2521,57 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) floatok = true; - thingtop = thing->z + thing->height; - - // Step up - if (thing->z < tmfloorz) + if (maxstep > 0) { - if (tmfloorz - thing->z <= 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) - return false; // mobj must lower itself to fit + thingtop = thing->z + thing->height; - // Ramp test - if ((maxstep > 0) && !(P_MobjTouchingSectorSpecial(thing, 1, 14, false))) - { - // 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) + // Step up + if (thing->z < tmfloorz) { + 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) { - thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height; + thing->z = (thing->ceilingz = tmceilingz) - thing->height; thing->ceilingrover = tmceilingrover; thing->eflags |= MFE_JUSTSTEPPEDDOWN; 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->ceilingrover = tmceilingrover; + thing->z = thing->floorz = tmfloorz; + thing->floorrover = tmfloorrover; 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) diff --git a/src/p_user.c b/src/p_user.c index 0edb0b52f..9e4a16c04 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1924,26 +1924,24 @@ static void P_3dMovement(player_t *player) K_AdjustPlayerFriction(player); // 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); - - 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); + K_MomentumToFacing(player); } } - if ((!P_PlayerInPain(player) && !onground) - || (K_PlayerUsesBotMovement(player) == true)) - { - K_MomentumToFacing(player); - } - if ((totalthrust.x || totalthrust.y) && 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! @@ -4411,6 +4409,11 @@ void P_PlayerThink(player_t *player) // Allows some turning 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) { diff --git a/src/r_main.c b/src/r_main.c index c64907450..8e05b8d27 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -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 // 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 { angle_t rollangle; // pre-shifted by fineshift #ifdef WOUGHMP_WOUGHMP @@ -615,7 +621,14 @@ static struct viewmorph { INT16 ceilingclip[MAXVIDWIDTH], floorclip[MAXVIDWIDTH]; 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) { @@ -643,11 +656,6 @@ void R_CheckViewMorph(int s) fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value #endif - if (v->zoomneeded == 0) - { - v->zoomneeded = FRACUNIT; - } - rollangle >>= ANGLETOFINESHIFT; rollangle = ((rollangle+2) & ~3) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot. diff --git a/src/s_sound.c b/src/s_sound.c index 197e65e57..ce62cb3e2 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -939,9 +939,9 @@ void S_UpdateSounds(void) memset(&listener4, 0, sizeof(listener_t)); // 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); - if (actualdigmusicvolume != cv_digmusicvolume.value) + if (actualdigmusicvolume != cv_digmusicvolume.value * USER_VOLUME_SCALE) S_SetDigMusicVolume (cv_digmusicvolume.value); // We're done now, if we're not in a level. diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 3d2b32737..6c669f415 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -570,17 +570,13 @@ void I_SetSfxVolume(int volume) /// Music Utilities /// ------------------------ -static UINT32 get_real_volume(int volume) +static int attenuate(int scale) { - { - // convert volume to mixer's 128 scale - // then apply internal_volume as a percentage - //return ((UINT32)volume*128/31) * (UINT32)internal_volume / 100; - return MIX_MAX_VOLUME - * musicdef_volume / 100 - * internal_volume / 100 - * volume / 100; - } + // attenuate scale by all volumes as percentages + return scale + * musicdef_volume / 100 + * internal_volume / 100 + * music_volume / 100; } 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) { internal_volume = fading_target; - Mix_VolumeMusic(get_real_volume(music_volume)); + Mix_VolumeMusic(attenuate(MIX_MAX_VOLUME)); I_StopFadingSong(); do_fading_callback(); 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); else if (fading_target > fading_source) 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; } } @@ -719,13 +715,9 @@ static void mix_gme(void *udata, Uint8 *stream, int len) // play gme into 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 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 @@ -743,13 +735,9 @@ static void mix_openmpt(void *udata, Uint8 *stream, int len) // Play module into 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 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 @@ -1398,7 +1386,7 @@ void I_SetMusicVolume(int volume) music_volume = volume; - Mix_VolumeMusic(get_real_volume(music_volume)); + Mix_VolumeMusic(attenuate(MIX_MAX_VOLUME)); } boolean I_SetSongTrack(int track) @@ -1460,7 +1448,7 @@ void I_SetInternalMusicVolume(UINT8 volume) internal_volume = volume; if (!I_SongPlaying()) return; - Mix_VolumeMusic(get_real_volume(music_volume)); + Mix_VolumeMusic(attenuate(MIX_MAX_VOLUME)); } void I_StopFadingSong(void)