diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 97b6c9358..4a2a0cc0f 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -539,11 +539,6 @@ void D_ResetTiccmds(void) D_Clearticcmd(textcmds[i]->tic); } -ticcmd_t *D_LocalTiccmd(UINT8 ss) -{ - return &localcmds[ss][0]; -} - void SendKick(UINT8 playernum, UINT8 msg) { UINT8 buf[2]; diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 8ad038a36..65884362b 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -662,7 +662,6 @@ extern UINT8 playernode[MAXPLAYERS]; INT32 D_NumPlayers(void); void D_ResetTiccmds(void); -ticcmd_t *D_LocalTiccmd(UINT8 ss); tic_t GetLag(INT32 node); //UINT8 GetFreeXCmdSize(UINT8 playerid); diff --git a/src/d_player.h b/src/d_player.h index 7ecef63de..a1e4a0b20 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -555,6 +555,8 @@ typedef struct player_s fixed_t spinoutrot; // When a player spins out, this value increments modulus 360. + tic_t dancetime; + fixed_t fovadd; // adjust FOV for hw rendering } player_t; diff --git a/src/doomstat.h b/src/doomstat.h index 6e1aa2485..f6e708be6 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -299,8 +299,6 @@ typedef struct #define LF_NORELOAD 8 ///< Don't reload level on death #define LF_NOZONE 16 ///< Don't include "ZONE" on level title #define LF_SECTIONRACE 32 ///< Section race level -#define LF_SUBTRACTNUM 64 ///< Use subtractive position number (for bright levels) - #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen diff --git a/src/g_game.h b/src/g_game.h index e50557a9d..8027d86f2 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -187,6 +187,8 @@ extern consvar_t cv_sloperolldist; extern consvar_t cv_sparkroll; extern consvar_t cv_spinoutroll; +extern consvar_t cv_squishdance; + extern consvar_t cv_playerblendeffects; extern consvar_t cv_cechotoggle; diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index 43e320fc0..822389758 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -255,7 +255,8 @@ enum EPolyFlags PF_RemoveYWrap = 0x00010000, // Force clamp texture on Y PF_ForceWrapX = 0x00020000, // Force repeat texture on X PF_ForceWrapY = 0x00040000, // Forces repeat texture on Y - PF_Ripple = 0x00100000 // Water ripple effect. The current backend doesn't use it for anything. + PF_Ripple = 0x00100000, // Water ripple effect. The current backend doesn't use it for anything. + PF_Skydecal = 0x20000000 // Enables smaller polygon offset, to be used for skywalls only // 0x20000000 // 0x40000000 // 0x80000000 diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 75a62f596..2c736708b 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1214,7 +1214,7 @@ static void HWR_DrawSkyWallList(void) GL_UnSetShader(); for (i = 0; i < skyWallVertexArraySize; i++) { - GL_DrawPolygon(&surf, skyWallVertexArray + i * 4, 4, PF_Occlude|PF_Invisible|PF_NoTexture); + GL_DrawPolygon(&surf, skyWallVertexArray + i * 4, 4, PF_Occlude|PF_Invisible|PF_NoTexture|PF_Skydecal); } } @@ -1236,7 +1236,7 @@ static void HWR_DrawSkyWall(FOutVector *wallVerts, FSurfaceInfo *Surf) else { HWR_SetCurrentTexture(NULL); - HWR_ProjectWall(wallVerts, Surf, PF_Invisible|PF_NoTexture, 255, NULL); + HWR_ProjectWall(wallVerts, Surf, PF_Invisible|PF_NoTexture|PF_Skydecal, 255, NULL); } // PF_Invisible so it's not drawn into the colour buffer // PF_NoTexture for no texture diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 4621658ce..cbdf7def9 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -1529,7 +1529,7 @@ void GL_SetBlend(FBITFIELD PolyFlags) { const FBITFIELD Xor = CurrentPolyFlags^PolyFlags;; - if (Xor & (PF_Blending|PF_RemoveYWrap|PF_ForceWrapX|PF_ForceWrapY|PF_Occlude|PF_NoTexture|PF_Modulated|PF_NoDepthTest|PF_Decal|PF_Invisible)) + if (Xor & (PF_Blending|PF_RemoveYWrap|PF_ForceWrapX|PF_ForceWrapY|PF_Occlude|PF_NoTexture|PF_Modulated|PF_NoDepthTest|PF_Decal|PF_Skydecal|PF_Invisible)) { if (Xor & PF_Blending) // if blending mode must be changed GL_SetBlendMode(PolyFlags & PF_Blending); @@ -1545,7 +1545,21 @@ void GL_SetBlend(FBITFIELD PolyFlags) if (Xor & PF_Decal) { if (PolyFlags & PF_Decal) + { + pglPolygonOffset(-1.0f, -1.0f); pglEnable(GL_POLYGON_OFFSET_FILL); + } + else + pglDisable(GL_POLYGON_OFFSET_FILL); + } + + if (Xor & PF_Skydecal) + { + if (PolyFlags & PF_Skydecal) + { + pglPolygonOffset(-0.45f, -0.45f); // dont let skywalls draw over actual walls tho + pglEnable(GL_POLYGON_OFFSET_FILL); + } else pglDisable(GL_POLYGON_OFFSET_FILL); } diff --git a/src/info.c b/src/info.c index fcf0029e9..7afc76bf6 100644 --- a/src/info.c +++ b/src/info.c @@ -2614,7 +2614,7 @@ state_t states[NUMSTATES] = {SPR_KINV, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_KARTINVULN_SMALL3}, // S_KARTINVULN_SMALL2 {SPR_KINV, FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_KARTINVULN_SMALL4}, // S_KARTINVULN_SMALL3 {SPR_KINV, FF_FULLBRIGHT|3, 1, {NULL}, 0, 0, S_KARTINVULN_SMALL5}, // S_KARTINVULN_SMALL4 - {SPR_KINV, FF_FULLBRIGHT|4, 1, {NULL}, 0, 0, S_NULL}, // S_KARTINVULN_SMALL5 + {SPR_KINV, FF_FULLBRIGHT|4, 1, {NULL}, 0, 0, S_NULL}, // S_KARTINVULN_SMALL5 {SPR_KINV, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_KARTINVULN_LARGE2}, // S_KARTINVULN_LARGE1 {SPR_KINV, FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_KARTINVULN_LARGE3}, // S_KARTINVULN_LARGE2 diff --git a/src/k_kart.c b/src/k_kart.c index a982007a1..2a75eaa5d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -153,6 +153,8 @@ static CV_PossibleValue_t saltyheight_t[] = {{FRACUNIT/4, "MIN"}, {2*FRACUNIT, " consvar_t cv_saltyheight = {"hardcodehopheight", "1", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, saltyheight_t, saltyhop_onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_saltyroll = {"hardcodehoproll", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_squishdance = {"squishdance", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + static void saltyhop_onchange(void) { // reset everything when toggling saltyhop @@ -1005,6 +1007,8 @@ void K_RegisterClientKartStuff(void) CV_RegisterVar(&cv_slamsound); + CV_RegisterVar(&cv_squishdance); + CV_RegisterVar(&cv_lessflicker); CV_RegisterVar(&cv_mouseturn); diff --git a/src/p_setup.c b/src/p_setup.c index 2582261e9..a56dfab23 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -615,10 +615,10 @@ static void P_SetupDirectionalLight(void) if (gamemap != oldmap || encoremode != oldencore || reinitmaplight) { - maplighting.contrast = M_RandomRange(0, 58); - maplighting.backlight = 0; - maplighting.directional = M_RandomRange(0, 1); // either on or off - maplighting.angle = M_RandomRange(-382, 382); + lighting->light_contrast = M_RandomRange(0, 58); + lighting->sprite_backlight = 0; + lighting->use_light_angle = M_RandomRange(0, 1); // either on or off + lighting->light_angle = M_RandomRange(-382, 382); reinitmaplight = false; } @@ -627,13 +627,6 @@ static void P_SetupDirectionalLight(void) oldencore = encoremode; return; } - else if (lighting->use_custom_light == false) - { - maplighting.contrast = 8; - maplighting.backlight = 0; - maplighting.directional = false; - maplighting.angle = 0; - } maplighting.contrast = lighting->light_contrast; maplighting.backlight = lighting->sprite_backlight; diff --git a/src/p_user.c b/src/p_user.c index 536ebc771..c9712048e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4439,6 +4439,37 @@ DoABarrelRoll (player_t *player) #define SPINOUTROTSPEED (24 * FRACUNIT) #define MAXSPINROT (360 * FRACUNIT) +static void P_DoFunnyDance (player_t *player) +{ + static tic_t time = 0; + fixed_t bounce; + fixed_t work, bpm; + angle_t ang; + + if (player->spectator || !player->mo || player->kartstuff[k_respawn] || player->mo->salty_jump) // this looks jank as hell during hop + return; + + bounce = 0; + + // bpm = FLOAT_TO_FIXED(mapmusic.bpm) << maybe can get the tempo and beat detection lib to work for bpm autodetection + bpm = FixedDiv((60*TICRATE)<= (FRACUNIT>>1)) // prevent overflow jump - takes about 15 minutes + time = (work>>FRACBITS); + + work = FixedDiv(work*180, bpm); + + ang = (FixedAngle(work)>>ANGLETOFINESHIFT) & FINEMASK; + bounce = (FINESINE(ang) - FRACUNIT/2); + + player->mo->spritexscale -= bounce/2; + player->mo->spriteyscale += bounce/2; + + time++; // bruh +} + // // P_PlayerThink // @@ -4976,6 +5007,16 @@ void P_PlayerThink(player_t *player) if (player->losstime && !player->powers[pw_flashing]) player->losstime--; + if (cv_squishdance.value && (cmd->buttons & BT_CUSTOM3)) + { + player->dancetime++; + + if (player->dancetime > TICRATE*2) + P_DoFunnyDance(player); + } + else + player->dancetime = 0; + // Flash player after being hit. if (!(player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should. || player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either. diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 1262707a8..b622c4c45 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -501,9 +501,6 @@ FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num) write_backtrace(BT_CRASH_REASON_SIGNAL(num)); #endif - if (demo.recording) - G_SaveDemo(); - I_ReportSignal(num, 0); I_ShutdownSystem(); signal(num, SIG_DFL); //default signal action @@ -884,9 +881,6 @@ static void signal_handler_child(INT32 num) write_backtrace(BT_CRASH_REASON_SIGNAL(num)); #endif - if (demo.recording) - G_SaveDemo(); - signal(num, SIG_DFL); //default signal action raise(num); }