From ffd5d14bfee7fd387fe60ae6cb1363f1713551da Mon Sep 17 00:00:00 2001 From: Indev Date: Mon, 21 Aug 2023 19:45:53 +0300 Subject: [PATCH 1/6] Make max demo size a cvar --- src/d_netcmd.c | 1 + src/g_game.c | 28 +++++++++++++++++++--------- src/g_game.h | 2 +- src/m_menu.c | 1 + 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 495c81d21..4faa19ccc 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -785,6 +785,7 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_recordmultiplayerdemos); CV_RegisterVar(&cv_netdemosyncquality); + CV_RegisterVar(&cv_maxdemosize); } // ========================================================================= diff --git a/src/g_game.c b/src/g_game.c index e778b19cc..93c502d06 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -345,6 +345,10 @@ consvar_t cv_recordmultiplayerdemos = {"netdemo_record", "Manual Save", CV_SAVE, static CV_PossibleValue_t netdemosyncquality_cons_t[] = {{1, "MIN"}, {35, "MAX"}, {0, NULL}}; consvar_t cv_netdemosyncquality = {"netdemo_syncquality", "1", CV_SAVE, netdemosyncquality_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +// Units are MiB. +static CV_PossibleValue_t maxdemosize_cons_t[] = {{10, "MIN"}, {100, "MAX"}, {0, NULL}}; +consvar_t cv_maxdemosize = {"maxdemosize", "10", CV_SAVE, maxdemosize_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + static UINT8 *savebuffer; // Analog Control @@ -6743,29 +6747,35 @@ void G_RecordDemo(const char *name) strcpy(demoname, name); strcat(demoname, ".lmp"); - //@TODO make a maxdemosize cvar - maxsize = 1024*1024*2; - if (M_CheckParm("-maxdemo") && M_IsNextParm()) - maxsize = atoi(M_GetNextParm()) * 1024; + maxsize = cv_maxdemosize.value*1024*1024; if (demobuffer) free(demobuffer); demo_p = NULL; + demo.recording = false; demobuffer = malloc(maxsize); demoend = demobuffer + maxsize; - demo.recording = true; + if (demobuffer) + demo.recording = true; + else + CONS_Alert(CONS_ERROR, "Failed to allocate demo buffer\n"); } void G_RecordMetal(void) { INT32 maxsize; - maxsize = 1024*1024; - if (M_CheckParm("-maxdemo") && M_IsNextParm()) - maxsize = atoi(M_GetNextParm()) * 1024; + maxsize = cv_maxdemosize.value*1024*1024; + if (demobuffer) + free(demobuffer); demo_p = NULL; + metalrecording = false; demobuffer = malloc(maxsize); demoend = demobuffer + maxsize; - metalrecording = true; + + if (demobuffer) + metalrecording = true; + else + CONS_Alert(CONS_ERROR, "Failed to allocate demo buffer\n"); } void G_BeginRecording(void) diff --git a/src/g_game.h b/src/g_game.h index 0f55724c0..c99404a35 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -39,7 +39,7 @@ extern UINT8 *demo_p; // ====================================== // demoplaying back and demo recording -extern consvar_t cv_recordmultiplayerdemos, cv_netdemosyncquality; +extern consvar_t cv_recordmultiplayerdemos, cv_netdemosyncquality, cv_maxdemosize; // Publicly-accessible demo vars struct demovars_s { diff --git a/src/m_menu.c b/src/m_menu.c index f698d611c..5cb6b1ff3 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -562,6 +562,7 @@ static menuitem_t MISC_ReplayOptionsMenu[] = { {IT_CVAR|IT_STRING, NULL, "Record Replays", &cv_recordmultiplayerdemos, 0}, {IT_CVAR|IT_STRING, NULL, "Sync Check Interval", &cv_netdemosyncquality, 10}, + {IT_CVAR|IT_STRING, NULL, "Max demo size (MiB)", &cv_maxdemosize, 20}, }; static tic_t playback_last_menu_interaction_leveltime = 0; -- 2.54.0 From 84da9e2724b2656fea4be37b711b54d4b2a4e08b Mon Sep 17 00:00:00 2001 From: alufolie91 Date: Mon, 21 Aug 2023 20:08:19 +0200 Subject: [PATCH 2/6] Finally add credits uwu --- src/m_menu.c | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index f698d611c..d8abc4a64 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -346,7 +346,7 @@ static void M_DeleteProtocol(void); menu_t OP_SaturnDef; menu_t OP_HudOffsetDef; menu_t OP_PlayerDistortDef; -//menu_t OP_SaturnCreditsDef; +menu_t OP_SaturnCreditsDef; // Bird menu_t OP_BirdDef; @@ -1694,13 +1694,13 @@ static menuitem_t OP_SaturnMenu[] = { {IT_HEADER, NULL, "Saturn Options", NULL, 0}, {IT_STRING | IT_CVAR, NULL, "Serverqueue waittime", &cv_connectawaittime, 30}, - //{IT_STRING | IT_CVAR, NULL, "Addon Download Speed", &cv_downloadspeed, 55}, + //{IT_STRING | IT_CVAR, NULL, "Addon Download Speed", &cv_downloadspeed, 55}, //no idea why you would wanna change it anyways {IT_STRING | IT_CVAR, NULL, "Skin Select Spinning Speed", &cv_skinselectspin, 50}, {IT_STRING | IT_CVAR, NULL, "Midnight Channel Flicker", &cv_lessflicker, 70}, {IT_SUBMENU|IT_STRING, NULL, "Player distortion...", &OP_PlayerDistortDef, 95}, {IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 110}, - //{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 130}, + {IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 130}, // uwu }; static menuitem_t OP_PlayerDistortMenu[] = @@ -1738,13 +1738,32 @@ static menuitem_t OP_HudOffsetMenu[] = {IT_STRING | IT_CVAR, NULL, "Minimap Vertical Offset", &cv_mini_yoffset, 145}, }; -/*static menuitem_t OP_SaturnCreditsMenu[] = +static menuitem_t OP_SaturnCreditsMenu[] = { - {IT_HEADER, NULL, "Saturn Credits", NULL, 0}, + {IT_HEADER, NULL, "Saturn Credits", NULL, 0}, + + {IT_HEADER, NULL, "Main Devs <3", NULL, 20}, + + {IT_STRING, NULL, "alufolie91 aka Alug", NULL, 30}, + {IT_STRING, NULL, "Indev", NULL, 40}, + + {IT_HEADER, NULL, "Testers <3", NULL, 60}, + + {IT_STRING, NULL, "Sunflower aka AnimeSonic", NULL, 70}, + {IT_STRING, NULL, "Yuz aka Yuzler", NULL, 80}, + {IT_STRING, NULL, "Democrab", NULL, 90}, + {IT_STRING, NULL, "EXpand aka Maver", NULL, 100}, + + {IT_HEADER, NULL, "Special Thanks <3", NULL, 120}, + + {IT_STRING, NULL, "xyzzy", NULL, 130}, + {IT_STRING, NULL, "Haya", NULL, 140}, + {IT_STRING, NULL, "Galactice", NULL, 150}, + {IT_STRING, NULL, "Himie and", NULL, 160}, + {IT_STRING, NULL, "The Moe Mansion / Birdhouse Team", NULL, 170}, + {IT_STRING, NULL, "All of Sunflower's Garden", NULL, 180}, - // idk need to add credits uwu - -};*/ +}; static menuitem_t OP_BirdMenu[] = { @@ -2323,7 +2342,7 @@ menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOp menu_t OP_SaturnDef = DEFAULTMENUSTYLE(NULL, OP_SaturnMenu, &OP_MainDef, 30, 30); menu_t OP_PlayerDistortDef = DEFAULTMENUSTYLE("M_VIDEO", OP_PlayerDistortMenu, &OP_SaturnDef, 30, 60); menu_t OP_HudOffsetDef = DEFAULTMENUSTYLE(NULL, OP_HudOffsetMenu, &OP_SaturnDef, 30, 30); -//menu_t OP_SaturnCreditsDef = DEFAULTMENUSTYLE(NULL, OP_SaturnCreditsMenu, &OP_SaturnDef, 30, 30); +menu_t OP_SaturnCreditsDef = DEFAULTMENUSTYLE(NULL, OP_SaturnCreditsMenu, &OP_SaturnDef, 30, 10); menu_t OP_BirdDef = DEFAULTMENUSTYLE(NULL, OP_BirdMenu, &OP_MainDef, 30, 30); menu_t OP_TiltDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_BirdDef, 30, 60); -- 2.54.0 From 8ae6d0c60f1e2e855cfdef02a621b38f88d868e9 Mon Sep 17 00:00:00 2001 From: alufolie91 Date: Tue, 22 Aug 2023 06:21:33 +0200 Subject: [PATCH 3/6] Add "Stereo Seperation" option for Tracker Modules i forget how super stereo some of those are, even to the point of being nauseating --- src/d_netcmd.c | 1 + src/m_menu.c | 2 +- src/s_sound.c | 13 ++++++++++++- src/s_sound.h | 1 + src/sdl/mixer_sound.c | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 495c81d21..02aebf1de 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -912,6 +912,7 @@ void D_RegisterClientCommands(void) #ifdef HAVE_OPENMPT CV_RegisterVar(&cv_modfilter); + CV_RegisterVar(&cv_stereosep); CV_RegisterVar(&cv_amigafilter); #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 CV_RegisterVar(&cv_amigatype); diff --git a/src/m_menu.c b/src/m_menu.c index d8abc4a64..3395bd7c6 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1418,7 +1418,7 @@ static menuitem_t OP_SoundAdvancedMenu[] = #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 {IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 62}, #endif - //{IT_STRING | IT_CVAR, NULL, "Dithering", &cv_mptdither, 82} + {IT_STRING | IT_CVAR, NULL, "Stereo Seperation", &cv_stereosep, 82}, }; #endif diff --git a/src/s_sound.c b/src/s_sound.c index ff2009b5a..d143f75db 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -67,6 +67,7 @@ static void PlaySoundIfUnfocused_OnChange(void); #ifdef HAVE_OPENMPT static void ModFilter_OnChange(void); +static void StereoSep_OnChange(void); static void AmigaFilter_OnChange(void); #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 static void AmigaType_OnChange(void); @@ -141,13 +142,16 @@ consvar_t cv_music_resync_powerups_only = {"music_resync_powerups_only", "No", C #ifdef HAVE_OPENMPT openmpt_module *openmpt_mhandle = NULL; + static CV_PossibleValue_t interpolationfilter_cons_t[] = {{0, "Default"}, {1, "None"}, {2, "Linear"}, {4, "Cubic"}, {8, "Windowed sinc"}, {0, NULL}}; consvar_t cv_modfilter = {"modfilter", "4", CV_SAVE|CV_CALL, interpolationfilter_cons_t, ModFilter_OnChange, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t stereosep_cons_t[] = {{0, "MIN"}, {200, "MAX"}, {0, NULL}}; +consvar_t cv_stereosep = {"stereoseperation", "100", CV_SAVE|CV_CALL, stereosep_cons_t, StereoSep_OnChange, 0, NULL, NULL, 0, 0, NULL}; //some tracker modules have nauseously high stereo width + static CV_PossibleValue_t amigafilter_cons_t[] = {{0, "Off"}, {1, "On"}, {0, NULL}}; consvar_t cv_amigafilter = {"amigafilter", "1", CV_SAVE|CV_CALL, amigafilter_cons_t, AmigaFilter_OnChange, 0, NULL, NULL, 0, 0, NULL}; - #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 static CV_PossibleValue_t amigatype_cons_t[] = {{0, "auto"}, {1, "a500"}, {2, "a1200"}, {0, NULL}}; consvar_t cv_amigatype = {"amigatype", "0", CV_SAVE|CV_CALL, amigatype_cons_t, AmigaType_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -2235,6 +2239,13 @@ void ModFilter_OnChange(void) } +void StereoSep_OnChange(void) +{ + if (openmpt_mhandle) + openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT, cv_stereosep.value); + +} + void AmigaFilter_OnChange(void) { if (openmpt_mhandle) diff --git a/src/s_sound.h b/src/s_sound.h index 6d9fed164..2dd39f6f4 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -44,6 +44,7 @@ extern consvar_t cv_playsoundifunfocused; #ifdef HAVE_OPENMPT extern consvar_t cv_modfilter; +extern consvar_t cv_stereosep; extern consvar_t cv_amigafilter; #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 extern consvar_t cv_amigatype; diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index b1259935c..0688f4e46 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -1257,6 +1257,7 @@ boolean I_PlaySong(boolean looping) { openmpt_module_select_subsong(openmpt_mhandle, 0); openmpt_module_ctl_set(openmpt_mhandle, "dither", "1"); + openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT, cv_stereosep.value); //have a feeling some might like it openmpt_module_ctl_set(openmpt_mhandle, "render.resampler.emulate_amiga", cv_amigafilter.value ? "1" : "0"); #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 openmpt_module_ctl_set_text(openmpt_mhandle, "render.resampler.emulate_amiga_type", cv_amigatype.string); -- 2.54.0 From e4f47c465d7a3e25e642337cf68e24662779aefe Mon Sep 17 00:00:00 2001 From: alufolie91 Date: Tue, 22 Aug 2023 06:23:47 +0200 Subject: [PATCH 4/6] clean up the openmpt menu a bit also rename the header lol --- src/m_menu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 3395bd7c6..c2188c023 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1411,14 +1411,14 @@ static menuitem_t OP_SoundOptionsMenu[] = #ifdef HAVE_OPENMPT static menuitem_t OP_SoundAdvancedMenu[] = { - {IT_HEADER, NULL, "MOD", NULL, 10}, + {IT_HEADER, NULL, "Tracker Module Options", NULL, 10}, - {IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 22}, - {IT_STRING | IT_CVAR, NULL, "Amiga Resampler", &cv_amigafilter, 42}, + {IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 42}, + {IT_STRING | IT_CVAR, NULL, "Amiga Resampler", &cv_amigafilter, 62}, #if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4 - {IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 62}, + {IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 82}, #endif - {IT_STRING | IT_CVAR, NULL, "Stereo Seperation", &cv_stereosep, 82}, + {IT_STRING | IT_CVAR, NULL, "Stereo Seperation", &cv_stereosep, 102}, }; #endif -- 2.54.0 From 46dce3042796e7518ffdb80834c9431ad8342f96 Mon Sep 17 00:00:00 2001 From: Alug <136046486+alufolie91@users.noreply.github.com> Date: Tue, 22 Aug 2023 06:38:29 +0200 Subject: [PATCH 5/6] Update README.md fiexuer sum speeling misstaeks and rearranged and maybe reworded some things --- README.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 358c6855a..a412f9172 100644 --- a/README.md +++ b/README.md @@ -2,25 +2,26 @@ [SRB2Kart](https://srb2.org/mods/) is a kart racing mod based on the 3D Sonic the Hedgehog fangame [Sonic Robo Blast 2](https://srb2.org/), based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/). -## Saturn Features +## Saturn Features (Take a look at the "Saturn Options" menu in your options c;) - Player rotation on slopes, funny squish when landing, Sprite scaling and all that - Kart Hud offsets are user changable - Access for `mobj_t` and `player_t` fields from Lua has been completely rewritten, for much better performance with many Lua scripts -- Lua shows tracebacks whenever an error occurs -- The Lua perfstat page now has multiple pages and is more organized (ps_thinkframe_page X) -- "addfilelocal" Command, for those who want to use their custom hud in netgames (Same as addfile but completely client sided) -- OpenMPT for Tracker module playback (Complete with filters) fixed looping issue while even sounding better than the old GME playback +- Lua shows Tracebacks whenever an error occurs +- The Lua Perfstats page now has multiple pages and is more organized (ps_thinkframe_page X) +- "addfilelocal" Command, for those who want to use things like their custom hud in netgames (Same as addfile but completely client sided) +- OpenMPT for Tracker module playback (Complete with filters) fixed looping issues while even sounding better than the old GME playback - Music changes now properly show the music credits -- Configurable chatlog size -- Lua hooks for Intermission -- Timeout for waiting to join a full server is configurable now +- Configurable chatlog length (yay can read those messages from 30 mins ago) +- Timeout for waiting to join a full server is configurable - Characters now spin in skin selection menu (configurable) - The minimal brightness with Shaders can be configured, now you can seeeee in dark areas (0-255 , uses Sector brightness values) +- Lua hooks for Intermission - People with lower end hardware can disable "screen textures" with "gr_screentextures" command, huge performance gain with minimal visual loss (Note intermission screen background is broken with this) -- Software mode has gotten ffloorclip, which boosts performance on maps with many Floor over Floor roads +- Software mode has gotten "ffloorclip", which boosts performance on maps with many Floor over Floor roads - Visual Portals from Haya´s HEP Client - Toggable lowercase menu´s also from Haya´s HEP client - Everything that Galaxy has +- Also: - Bird´s Crazy tilt feature is no longer turned on by default - Bird warning on the title screen has been removed @@ -28,16 +29,18 @@ - ZFigthing Textures in Opengl mode have been fixed in engine (well almost all of it) - Fof´s intersecting with slopes have less issues and now render correctly in Opengl -- Midtextures on slopes in Opengl are fixed, all those weird guardrails and fences, aswell as some of those sticking out textures from the ground on some maps should be gone -- Multiple other fixes -- Zone memory allocations have been rewritten, speeds up some map loading, and may improve performance on busy maps -- HWR Drawnodes have been refactored, this should fix a few rare crashes esp in regards to OpenGL Visportals +- Midtextures on slopes in Opengl are fixed, many weird guardrails and fences, aswell as some of those sticking out textures from the ground on some maps should be gone - The annoying depraction messages for "P_TeleportMove" and "P_AproxDistance" have been silenced - Silenced the annoying "cant find next map..." messages as theyre super useless and annoying anyways - HTTP Addon download speed has been raised dramatically +- Zone memory allocations have been rewritten, speeds up some map loading, and may improve performance on busy maps +- HWR Drawnodes have been refactored, this should fix a few rare crashes esp in regards to OpenGL Visportals +- Multiple other fixes ## Bugs +- You tell us! c: + ## Dependencies - NASM (x86 builds only) - SDL2 (Linux/OS X only) -- 2.54.0 From 36cc02e832c75f0c739f13dd05bbb76b523bc143 Mon Sep 17 00:00:00 2001 From: Alug <136046486+alufolie91@users.noreply.github.com> Date: Tue, 22 Aug 2023 06:39:12 +0200 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a412f9172..1afe055d9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [SRB2Kart](https://srb2.org/mods/) is a kart racing mod based on the 3D Sonic the Hedgehog fangame [Sonic Robo Blast 2](https://srb2.org/), based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/). -## Saturn Features (Take a look at the "Saturn Options" menu in your options c;) +## Saturn Features (Take a look at the "Saturn Options" menu c;) - Player rotation on slopes, funny squish when landing, Sprite scaling and all that - Kart Hud offsets are user changable - Access for `mobj_t` and `player_t` fields from Lua has been completely rewritten, for much better performance with many Lua scripts -- 2.54.0