From 5d51754936b3b634cdca30c4d9fdaa526122f5a1 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Fri, 4 Jan 2019 04:44:55 -0500 Subject: [PATCH 01/11] In-game music credits --- src/d_netcmd.c | 1 + src/g_game.c | 3 ++ src/g_game.h | 1 + src/hu_stuff.c | 54 +++++++++++++++++++ src/k_kart.c | 3 ++ src/p_spec.c | 1 + src/s_sound.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++++ src/s_sound.h | 17 ++++++ 8 files changed, 224 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index f2979838..7e7560d7 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -788,6 +788,7 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_consolechat); CV_RegisterVar(&cv_chatnotifications); CV_RegisterVar(&cv_chatbacktint); + CV_RegisterVar(&cv_songcredits); //CV_RegisterVar(&cv_crosshair); //CV_RegisterVar(&cv_crosshair2); //CV_RegisterVar(&cv_crosshair3); diff --git a/src/g_game.c b/src/g_game.c index ac8e27a3..762e456a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -430,6 +430,9 @@ consvar_t cv_chatbacktint = {"chatbacktint", "On", CV_SAVE, CV_OnOff, NULL, 0, N static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Window"}, {1, "Console"}, {2, "Window (Hidden)"}, {0, NULL}}; consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +// Display song credits +consvar_t cv_songcredits = {"songcredits", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + /*consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair2 = {"crosshair2", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair3 = {"crosshair3", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/g_game.h b/src/g_game.h index 035a59bd..8deff076 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -55,6 +55,7 @@ extern INT16 rw_maximums[NUM_WEAPONS]; // used in game menu extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatspamprotection, cv_chatbacktint; +extern consvar_t cv_songcredits; //extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4; extern consvar_t cv_invertmouse/*, cv_alwaysfreelook, cv_chasefreelook, cv_mousemove*/; extern consvar_t cv_invertmouse2/*, cv_alwaysfreelook2, cv_chasefreelook2, cv_mousemove2*/; diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 9bdf9bd7..08aaec77 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -51,6 +51,7 @@ #include "lua_hook.h" #endif +#include "s_sound.h" // song credits #include "k_kart.h" // coords are scaled @@ -103,6 +104,8 @@ static patch_t *tokenicon; // crosshair 0 = off, 1 = cross, 2 = angle, 3 = point, see m_menu.c static patch_t *crosshair[HU_CROSSHAIRS]; // 3 precached crosshair graphics +// song credits +static patch_t *songcreditbg; // ------- // protos. @@ -290,6 +293,8 @@ void HU_LoadGraphics(void) tinyemeraldpics[4] = W_CachePatchName("TEMER5", PU_HUDGFX); tinyemeraldpics[5] = W_CachePatchName("TEMER6", PU_HUDGFX); tinyemeraldpics[6] = W_CachePatchName("TEMER7", PU_HUDGFX); + + songcreditbg = W_CachePatchName("MUSCRED", PU_HUDGFX); } // Initialise Heads up @@ -2050,6 +2055,51 @@ static void HU_DrawDemoInfo(void) } } + +// +// Song credits +// +boolean songcreditinit = false; + +static void HU_DrawSongCredits(void) +{ + static UINT8 transparency = NUMTRANSMAPS; + static INT32 x = 0; + UINT16 len = V_ThinStringWidth(songCredits[cursongcredit.index].info, V_ALLOWLOWERCASE|V_6WIDTHSPACE); + INT32 bgt; + + if (!songcreditinit) + { + memset(&cursongcredit,0,sizeof(struct cursongcredit)); + songcreditinit = true; + return; + } + + if (cursongcredit.anim) + { + if (transparency > 0) + transparency--; + if (x < (len+16)) + x += ((len+16) - x) / 2; + cursongcredit.anim--; + } + else + { + if (transparency < NUMTRANSMAPS) + transparency++; + if (x > 0) + x /= 2; + } + + //V_DrawThinString(0, 0, 0, transparency); + + bgt = (NUMTRANSMAPS/2)+(transparency/2); + if (bgt < NUMTRANSMAPS) + V_DrawScaledPatch(x, 30, V_SNAPTOLEFT|(bgt<flags & ML_EFFECT4)); + S_InitMusicCredit(); // Except, you can use the ML_BLOCKMONSTERS flag to change this behavior. // if (mapmusflags & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn. diff --git a/src/s_sound.c b/src/s_sound.c index 8b5d29ed..f84b9cf5 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1541,6 +1541,132 @@ static void *music_data; static UINT16 music_flags; static boolean music_looping; +songcredits_t songCredits[] = { + // Race maps + {"kmap01","Toot Toot Sonic Warrior (Instrumental) - Sonic CD"}, + {"kmap02","Chao Race (Extended Mix) - Sonic Adventure 2"}, + {"kmap03","Touhou 10.5: Broken Moon (Jazz Arrangement) - Tokyo Active NEETs"}, + {"kmap04","Mortvia Fountain - Castlevania: Curse of Darkness"}, + {"kmap05","Let's Go Away - Daytona USA"}, + {"kmap06","War Machine - Marvel vs. Capcom"}, + {"kmap07","Sonic 3D Blast: Green Grove Zone, Act 1 (Remix) - Tee Lopes"}, + {"kmap08","Sonic Drift 2: Hill Top (Remix) - SeventhSentinel"}, + {"kmap09","Industrial District - Columns III"}, + {"kmap10","Dream Uneven Bars - Mario & Sonic at the London 2012 Olympic Games"}, + {"kmap11","Moon Palace 2 - Drift City"}, + {"kmap12","Authentic Sky - Tekken 4"}, + {"kmap13","Plant Man's Stage - Rockman 6 Complete Works"}, + {"kmap14","Twinkle Cart - Sonic Adventure"}, + {"kmap15","Pleasure Castle - Sonic Adventure"}, + {"kmap16","Horizon Heights Zone, Act 2 - Sonic: After the Sequel"}, + {"kmap17","Frost Man's Stage - Mega Man 8"}, + {"kmap18","Foliage Furnace Zone, Act 1 - Sonic: After the Sequel"}, + {"kmap19","Sand Ocean - F-Zero"}, + {"kmap20","El Anoir Field South - LaTale"}, + {"kmap21","Western GunRun - LaTale"}, + {"kmap22","Jr. Street - Mario Hoops 3 on 3"}, + {"kmap23","Fight or Flight (Air Armada) - Rivals of Aether"}, + {"kmap24","White Land I - F-Zero"}, + {"kmap25","Donkey Kong Country: Fear Factory (Remix) - Vincent Rubinetti"}, + {"kmap26","Desert Palace - Sonic the Hedgehog 3"}, + {"kmap27","Aurora Atoll Zone - SeventhSentinel"}, + {"kmap28","Hol Horse - JoJo's Bizarre Adventure (Arcade)"}, + {"kmap29","Red Barrage Area - Sonic Adventure"}, + {"kmap30","Reach Out To The Truth - Persona 4 Arena"}, + {"kmap31","Ave de Rapina - Beatmania IIDX 7th Style"}, + {"kmap32","Atomic Waste Zone - Michael Staple"}, + {"kmap33","Desert Area - LaTale"}, + {"kmap34","DuckTales: The Moon (Remix) - Chris Holland, Luke Kwing"}, + {"kmap35","Eggman Empire Zone - Michael Staple"}, + {"kmap36","Shooting Star - Elwood"}, + {"kmap37","Vigaku (Theme of Ein) - Dead or Alive 2"}, + {"kmap38","Lovely Gate 3 - Sonic Adventure 2"}, + {"kmap39","The Biggest Dreamer - Digimon Rumble Arena"}, + {"kmap40","Soft Collision - Mighty Switch Force 2"}, + {"kmap41","Ganbare Dochu - Konami Krazy Racers"}, + {"kmap42","Theme of 'CHAO' - Sonic Adventure"}, + {"kmap43","Join Us 4 Happy Time - Sonic Adventure"}, + {"kmap44","Search ~ In the Midst - Ace Attorney: Justice for All"}, + {"kmap45","Venezia, Italy - Tekken"}, + {"kmap46","Balloon Panic - Sonic Drift 2"}, + {"kmap47","Dimension Heist - Sonic Mania"}, + {"kmap48","MKSC Sky Garden (Remix) - Mario Kart DS"}, + {"kmap49","MKDS Peach Gardens (Remix) - Mario Kart Wii"}, + {"kmap50","MKSC Rainbow Road (Remix) - Panman14"}, + {"kmap51","Donut Plains - Super Mario Kart"}, + {"kmap52","Mario Circuit - Super Mario Kart"}, + {"kmap53","Ghost Valley - Super Mario Kart"}, + {"kmap54","Bowser Castle - Super Mario Kart"}, + {"kmap55","Vanilla Lake - Super Mario Kart"}, + // Battle maps + {"kmapb0","Tropic Turf Zone, Act 1 - Karl Brueggemann"}, + {"kmapb1","Seascape - Knuckles' Chaotix"}, + {"kmapb2","Boss Challenge I - Diddy Kong Racing"}, + {"kmapb3","Al's Toy Barn - Toy Story 2 (PS1)"}, + {"kmapb4","SRB2: Techno Hill Zone, Act 1 (Remix) - SeventhSentinel"}, + {"kmapb5","Sonic the Hedgehog: Marble Zone (Remix) - Tee Lopes"}, + {"kmapb6","Phi Battle - Sonic Battle"}, + {"kmapb7","Khan - JoJo's Bizarre Adventure (Arcade)"}, + {"kmapb8","Underground - Wild Guns Reloaded"}, + {"kmapb9","Disease Transport - DrTapeworm"}, + {"kmapba","Shining Force II: Shrine (Remix) - gxf4c3"}, + {"kmapbb","Bad Taste Aquarium - Sonic Adventure"}, + {"kmapbc","Space Ship: Strut - Space Channel 5"}, + {"kmapbd","Strollin' the City - Karl Brueggemann"}, + {"kmapbe","Fakery Way - Sonic Adventure"}, + {"kmapbf","Twinkle Circuit - Sonic Adventure"}, + {"kmapbg","Never Let It Go - Sonic the Fighters"}, + {"kmapbh","Power Plant - Sonic Heroes"}, + {"kmapbi","Tails' Lab - Sonic Battle"}, + {"kmapbj","Mega Man X: Armored Armadillo's Stage (Arranged) - Synthescissor"}, + {"kmapbk","School Ordeal - Danganronpa V3: Killing Harmony"}, + {"kmapbl","Mementos - Persona 5"}, + {"kmapbm","Special Stage (US) - Sonic CD"}, + {"kmapbn","Battle Mode - Super Mario Kart"}, + {"kmapbp","Vanilla Lake (Beta) - Super Mario Kart"}, + {"kmapbr","Choco Mountain - Mario Kart 64"}, + // Hell maps + {"kmaph0","Neo City - Drift City"}, + {"kmaph1","World Open Finals - Mario Power Tennis"}, + {"kmaph2","Arid Sands: Day - Sonic Unleashed"}, + {"kmaph3","Graveyard Gig - Sonic & All-Stars Racing Transformed"}, + {"kmaph4","Dr. Robotnik's Mean Bean Machine: 2 Player (Remix) - Jonny Atma, The8BitDrummer"}, + {"kmaph5","Living In One More City - Nib Roc"}, + {"kmaph6","Ema Skye ~ Scientific Detective - Apollo Justice: Ace Attorney"}, + {"kmaph7","4 Minutes Before Death - Ghost Trick: Phantom Detective"}, + {"kmaph8","Napoleon Disappeared!? - Pop'n Music 10"}, + {"kmaph9","Retro Maze - Pac-Man World Rally"}, + {"kmapha","Midnight Freeze Zone - Arrow, SSNTails"}, + {"kmaphb","Townsville Raceway - Cartoon Network Racing (DS)"}, + {"kmaphc","F-Zero: Silence (Remix) - Tony Thai"}, + {"kmaphd","Rainbow Road - Super Mario Kart"}, + {"kmaphe","Meadow Match Zone - Arrow, SSNTails"}, + {"kmaphf","merge-break - xaki"}, + // Misc + {"titles","Fluvial Beat Deposits - Simon Stalenhag"}, // Stålenhag + {"vote", "Chaotic World - Knuckles' Chaotix"}, + {"voteea","Decision - Knuckles' Chaotix"}, + {"voteeb","Decision - Knuckles' Chaotix"}, + {"kinvnc","Invincibility - Sonic the Hedgehog 3"}, + {"kgrow", "Surging Power - Knuckles' Chaotix"}, + {"kstart","Race Start - Diddy Kong Racing"}, + {"estart","Phantom Ruby Ambience - Sonic Mania"}, + {"krwin", "Practice - Sora"}, + {"krok", "Practice - Sora"}, + {"krlose","Hit 'Em Up (Instrumental) - 2Pac"}, + {"krfail","Results - F-Zero"}, + {"kbwin", "Wild Charabom Defeated! - Bomberman Tournament"}, + {"kbok", "Deadly Bomber Base Cleared! - Bomberman Tournament"}, + {"kblose","You Lose! - Bomberman Tournament"}, + {"racent","Menu - Metropolis Street Racer"}, + {"wait2j","Competition Results - Sonic the Hedgehog 3"}, + {"chalng","Sonic the Hedgehog 3: Minor Boss (Dual PCM) - MarkeyJester"}, + {"credit","Moot Booxle - Chomp"}, + {NULL,NULL} +}; + +struct cursongcredit cursongcredit; + /// ------------------------ /// Music Status /// ------------------------ @@ -1605,6 +1731,24 @@ boolean S_SpeedMusic(float speed) return I_SetSongSpeed(speed); } +void S_InitMusicCredit(void) +{ + UINT16 i; + + if (!cv_songcredits.value) + return; + + for (i = 0; songCredits[i].lump; i++) + { + if (!stricmp(songCredits[i].lump, music_name)) + { + cursongcredit.index = i; + cursongcredit.anim = 5*TICRATE; + return; // Don't return when there's SOC support, to see if there's any "replacement" credits? + } + } +} + /// ------------------------ /// Music Playback /// ------------------------ diff --git a/src/s_sound.h b/src/s_sound.h index c83188cf..7ee28047 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -128,6 +128,23 @@ boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi); // Set Speed of Music boolean S_SpeedMusic(float speed); +// Music credits +extern struct cursongcredit +{ + UINT16 index; + UINT16 anim; +} cursongcredit; + +typedef struct +{ + const char *lump; + const char *info; +} songcredits_t; + +extern songcredits_t songCredits[]; + +void S_InitMusicCredit(void); + // // Music Routines // From 3e37d131edeca64295a0d033fe11001250af0313 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Fri, 4 Jan 2019 16:47:03 -0500 Subject: [PATCH 02/11] Minor touchups/cleanup --- src/hu_stuff.c | 48 +++++++++++++++++++++--------------------------- src/p_setup.c | 4 ++++ src/s_sound.c | 2 ++ src/s_sound.h | 2 ++ src/v_video.c | 12 ++++++++++-- 5 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 08aaec77..2602cda2 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -294,7 +294,7 @@ void HU_LoadGraphics(void) tinyemeraldpics[5] = W_CachePatchName("TEMER6", PU_HUDGFX); tinyemeraldpics[6] = W_CachePatchName("TEMER7", PU_HUDGFX); - songcreditbg = W_CachePatchName("MUSCRED", PU_HUDGFX); + songcreditbg = W_CachePatchName("K_SONGCR", PU_HUDGFX); } // Initialise Heads up @@ -2059,45 +2059,39 @@ static void HU_DrawDemoInfo(void) // // Song credits // -boolean songcreditinit = false; - static void HU_DrawSongCredits(void) { - static UINT8 transparency = NUMTRANSMAPS; - static INT32 x = 0; - UINT16 len = V_ThinStringWidth(songCredits[cursongcredit.index].info, V_ALLOWLOWERCASE|V_6WIDTHSPACE); + const char *str = va("\x1F"" %s", songCredits[cursongcredit.index].info); + INT32 len = V_ThinStringWidth(str, V_ALLOWLOWERCASE|V_6WIDTHSPACE); + INT32 destx = (len+7); + INT32 y = (splitscreen ? (BASEVIDHEIGHT/2)-4 : 32); INT32 bgt; - if (!songcreditinit) - { - memset(&cursongcredit,0,sizeof(struct cursongcredit)); - songcreditinit = true; - return; - } - if (cursongcredit.anim) { - if (transparency > 0) - transparency--; - if (x < (len+16)) - x += ((len+16) - x) / 2; + if (cursongcredit.trans > 0) + cursongcredit.trans--; + if (cursongcredit.x < destx) + cursongcredit.x += (destx - cursongcredit.x) / 2; + if (cursongcredit.x > destx) + cursongcredit.x = destx; cursongcredit.anim--; } else { - if (transparency < NUMTRANSMAPS) - transparency++; - if (x > 0) - x /= 2; + if (cursongcredit.trans < NUMTRANSMAPS) + cursongcredit.trans++; + if (cursongcredit.x > 0) + cursongcredit.x /= 2; + if (cursongcredit.x < 0) + cursongcredit.x = 0; } - //V_DrawThinString(0, 0, 0, transparency); - - bgt = (NUMTRANSMAPS/2)+(transparency/2); + bgt = (NUMTRANSMAPS/2)+(cursongcredit.trans/2); if (bgt < NUMTRANSMAPS) - V_DrawScaledPatch(x, 30, V_SNAPTOLEFT|(bgt<= 0x80 && (UINT8)c <= 0x8F) //color parsing! -Inuyasha 2.16.09 continue; - c = toupper(c) - HU_FONTSTART; + if (!lowercase || !tny_font[c-HU_FONTSTART]) + c = toupper(c); + c -= HU_FONTSTART; + if (c < 0 || c >= HU_FONTSIZE || !tny_font[c]) w += spacewidth; else + { w += (charwidth ? charwidth - : (option & V_6WIDTHSPACE ? max(1, SHORT(tny_font[c]->width)-1) : SHORT(tny_font[c]->width))); // Reuse this flag for the alternate bunched-up spacing + : ((option & V_6WIDTHSPACE && i < strlen(string)-1) ? max(1, SHORT(tny_font[c]->width)-1) // Reuse this flag for the alternate bunched-up spacing + : SHORT(tny_font[c]->width))); + } } + return w; } From de72403fb9f2be579af6d7810d946492f5a78879 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 9 Jan 2019 21:00:45 -0500 Subject: [PATCH 03/11] Add MUSICDEF lump for defining custom songs & replacing existing songs Very rudimentary at the moment, but it's workable --- src/d_main.c | 1 + src/hu_stuff.c | 12 +- src/k_kart.c | 2 +- src/p_setup.c | 5 + src/p_spec.c | 2 +- src/s_sound.c | 346 +++++++++++++++++++++++++++++-------------------- src/s_sound.h | 22 ++-- src/w_wad.c | 1 + 8 files changed, 233 insertions(+), 158 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 2a5993c1..29a91686 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1350,6 +1350,7 @@ void D_SRB2Main(void) I_StartupSound(); I_InitMusic(); S_InitSfxChannels(cv_soundvolume.value); + S_InitMusicDefs(); CONS_Printf("ST_Init(): Init status bar.\n"); ST_Init(); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 64580c82..a38e91a7 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2130,12 +2130,18 @@ static void HU_DrawDemoInfo(void) // static void HU_DrawSongCredits(void) { - const char *str = va("\x1F"" %s", songCredits[cursongcredit.index].info); - INT32 len = V_ThinStringWidth(str, V_ALLOWLOWERCASE|V_6WIDTHSPACE); - INT32 destx = (len+7); + char *str; + INT32 len, destx; INT32 y = (splitscreen ? (BASEVIDHEIGHT/2)-4 : 32); INT32 bgt; + if (!cursongcredit.def) // No def + return; + + str = va("\x1F"" %s", cursongcredit.def->source); + len = V_ThinStringWidth(str, V_ALLOWLOWERCASE|V_6WIDTHSPACE); + destx = (len+7); + if (cursongcredit.anim) { if (cursongcredit.trans > 0) diff --git a/src/k_kart.c b/src/k_kart.c index 63425d1a..50d19c19 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4446,7 +4446,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (P_IsLocalPlayer(player) && leveltime == (starttime + (TICRATE/2))) { S_ChangeMusicInternal(mapmusname, true); - S_InitMusicCredit(); + S_ShowMusicCredit(); } } diff --git a/src/p_setup.c b/src/p_setup.c index 57a069a1..90ac3a7c 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3439,6 +3439,11 @@ boolean P_AddWadFile(const char *wadfilename) // R_AddSkins(wadnum); // faB: wadfile index in wadfiles[] + // + // edit music defs + // + S_LoadMusicDefs(wadnum); + // // search for maps // diff --git a/src/p_spec.c b/src/p_spec.c index b6661bba..e3b54cbe 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2450,7 +2450,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) mapmusflags |= MUSIC_RELOADRESET; S_ChangeMusic(mapmusname, mapmusflags, !(line->flags & ML_EFFECT4)); - S_InitMusicCredit(); + S_ShowMusicCredit(); // Except, you can use the ML_BLOCKMONSTERS flag to change this behavior. // if (mapmusflags & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn. diff --git a/src/s_sound.c b/src/s_sound.c index 87ab6359..e3a62768 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1541,131 +1541,209 @@ static void *music_data; static UINT16 music_flags; static boolean music_looping; -songcredits_t songCredits[] = { - // Race maps - {"kmap01","Toot Toot Sonic Warrior (Instrumental) - Sonic CD"}, - {"kmap02","Chao Race (Extended Mix) - Sonic Adventure 2"}, - {"kmap03","Touhou 10.5: Broken Moon (Jazz Arrangement) - Tokyo Active NEETs"}, - {"kmap04","Mortvia Fountain - Castlevania: Curse of Darkness"}, - {"kmap05","Let's Go Away - Daytona USA"}, - {"kmap06","War Machine - Marvel vs. Capcom"}, - {"kmap07","Sonic 3D Blast: Green Grove Zone, Act 1 (Remix) - Tee Lopes"}, - {"kmap08","Sonic Drift 2: Hill Top (Remix) - SeventhSentinel"}, - {"kmap09","Industrial District - Columns III"}, - {"kmap10","Dream Uneven Bars - Mario & Sonic at the London 2012 Olympic Games"}, - {"kmap11","Moon Palace 2 - Drift City"}, - {"kmap12","Authentic Sky - Tekken 4"}, - {"kmap13","Plant Man's Stage - Rockman 6 Complete Works"}, - {"kmap14","Twinkle Cart - Sonic Adventure"}, - {"kmap15","Pleasure Castle - Sonic Adventure"}, - {"kmap16","Horizon Heights Zone, Act 2 - Sonic: After the Sequel"}, - {"kmap17","Frost Man's Stage - Mega Man 8"}, - {"kmap18","Foliage Furnace Zone, Act 1 - Sonic: After the Sequel"}, - {"kmap19","Sand Ocean - F-Zero"}, - {"kmap20","El Anoir Field South - LaTale"}, - {"kmap21","Western GunRun - LaTale"}, - {"kmap22","Jr. Street - Mario Hoops 3 on 3"}, - {"kmap23","Fight or Flight (Air Armada) - Rivals of Aether"}, - {"kmap24","White Land I - F-Zero"}, - {"kmap25","Donkey Kong Country: Fear Factory (Remix) - Vincent Rubinetti"}, - {"kmap26","Desert Palace - Sonic the Hedgehog 3"}, - {"kmap27","Aurora Atoll Zone - SeventhSentinel"}, - {"kmap28","Hol Horse - JoJo's Bizarre Adventure (Arcade)"}, - {"kmap29","Red Barrage Area - Sonic Adventure"}, - {"kmap30","Reach Out To The Truth - Persona 4 Arena"}, - {"kmap31","Ave de Rapina - Beatmania IIDX 7th Style"}, - {"kmap32","Atomic Waste Zone - Michael Staple"}, - {"kmap33","Desert Area - LaTale"}, - {"kmap34","DuckTales: The Moon (Remix) - Chris Holland, Luke Kwing"}, - {"kmap35","Eggman Empire Zone - Michael Staple"}, - {"kmap36","Shooting Star - Elwood"}, - {"kmap37","Vigaku (Theme of Ein) - Dead or Alive 2"}, - {"kmap38","Lovely Gate 3 - Sonic Adventure 2"}, - {"kmap39","The Biggest Dreamer - Digimon Rumble Arena"}, - {"kmap40","Soft Collision - Mighty Switch Force 2"}, - {"kmap41","Ganbare Dochu - Konami Krazy Racers"}, - {"kmap42","Theme of 'CHAO' - Sonic Adventure"}, - {"kmap43","Join Us 4 Happy Time - Sonic Adventure"}, - {"kmap44","Search ~ In the Midst - Ace Attorney: Justice for All"}, - {"kmap45","Venezia, Italy - Tekken"}, - {"kmap46","Balloon Panic - Sonic Drift 2"}, - {"kmap47","Dimension Heist - Sonic Mania"}, - {"kmap48","MKSC Sky Garden (Remix) - Mario Kart DS"}, - {"kmap49","MKDS Peach Gardens (Remix) - Mario Kart Wii"}, - {"kmap50","MKSC Rainbow Road (Remix) - Panman14"}, - {"kmap51","Donut Plains - Super Mario Kart"}, - {"kmap52","Mario Circuit - Super Mario Kart"}, - {"kmap53","Ghost Valley - Super Mario Kart"}, - {"kmap54","Bowser Castle - Super Mario Kart"}, - {"kmap55","Vanilla Lake - Super Mario Kart"}, - // Battle maps - {"kmapb0","Tropic Turf Zone, Act 1 - Karl Brueggemann"}, - {"kmapb1","Seascape - Knuckles' Chaotix"}, - {"kmapb2","Boss Challenge I - Diddy Kong Racing"}, - {"kmapb3","Al's Toy Barn - Toy Story 2 (PS1)"}, - {"kmapb4","SRB2: Techno Hill Zone, Act 1 (Remix) - SeventhSentinel"}, - {"kmapb5","Sonic the Hedgehog: Marble Zone (Remix) - Tee Lopes"}, - {"kmapb6","Phi Battle - Sonic Battle"}, - {"kmapb7","Khan - JoJo's Bizarre Adventure (Arcade)"}, - {"kmapb8","Underground - Wild Guns Reloaded"}, - {"kmapb9","Disease Transport - DrTapeworm"}, - {"kmapba","Shining Force II: Shrine (Remix) - gxf4c3"}, - {"kmapbb","Bad Taste Aquarium - Sonic Adventure"}, - {"kmapbc","Space Ship: Strut - Space Channel 5"}, - {"kmapbd","Strollin' the City - Karl Brueggemann"}, - {"kmapbe","Fakery Way - Sonic Adventure"}, - {"kmapbf","Twinkle Circuit - Sonic Adventure"}, - {"kmapbg","Never Let It Go - Sonic the Fighters"}, - {"kmapbh","Power Plant - Sonic Heroes"}, - {"kmapbi","Tails' Lab - Sonic Battle"}, - {"kmapbj","Mega Man X: Armored Armadillo's Stage (Arranged) - Synthescissor"}, - {"kmapbk","School Ordeal - Danganronpa V3: Killing Harmony"}, - {"kmapbl","Mementos - Persona 5"}, - {"kmapbm","Special Stage (US) - Sonic CD"}, - {"kmapbn","Battle Mode - Super Mario Kart"}, - {"kmapbp","Vanilla Lake (Beta) - Super Mario Kart"}, - {"kmapbr","Choco Mountain - Mario Kart 64"}, - // Hell maps - {"kmaph0","Neo City - Drift City"}, - {"kmaph1","World Open Finals - Mario Power Tennis"}, - {"kmaph2","Arid Sands: Day - Sonic Unleashed"}, - {"kmaph3","Graveyard Gig - Sonic & All-Stars Racing Transformed"}, - {"kmaph4","Dr. Robotnik's Mean Bean Machine: 2 Player (Remix) - Jonny Atma, The8BitDrummer"}, - {"kmaph5","Living In One More City - Nib Roc"}, - {"kmaph6","Ema Skye ~ Scientific Detective - Apollo Justice: Ace Attorney"}, - {"kmaph7","4 Minutes Before Death - Ghost Trick: Phantom Detective"}, - {"kmaph8","Napoleon Disappeared!? - Pop'n Music 10"}, - {"kmaph9","Retro Maze - Pac-Man World Rally"}, - {"kmapha","Midnight Freeze Zone - Arrow, SSNTails"}, - {"kmaphb","Townsville Raceway - Cartoon Network Racing (DS)"}, - {"kmaphc","F-Zero: Silence (Remix) - Tony Thai"}, - {"kmaphd","Rainbow Road - Super Mario Kart"}, - {"kmaphe","Meadow Match Zone - Arrow, SSNTails"}, - {"kmaphf","merge-break - xaki"}, - // Misc - {"titles","Fluvial Beat Deposits - Simon Stalenhag"}, // Stålenhag - {"vote", "Chaotic World - Knuckles' Chaotix"}, - {"voteea","Decision - Knuckles' Chaotix"}, - {"voteeb","Decision - Knuckles' Chaotix"}, - {"kinvnc","Invincibility - Sonic the Hedgehog 3"}, - {"kgrow", "Surging Power - Knuckles' Chaotix"}, - {"kstart","Race Start - Diddy Kong Racing"}, - {"estart","Phantom Ruby Ambience - Sonic Mania"}, - {"krwin", "Practice - Sora"}, - {"krok", "Practice - Sora"}, - {"krlose","Hit 'Em Up (Instrumental) - 2Pac"}, - {"krfail","Results - F-Zero"}, - {"kbwin", "Wild Charabom Defeated! - Bomberman Tournament"}, - {"kbok", "Deadly Bomber Base Cleared! - Bomberman Tournament"}, - {"kblose","You Lose! - Bomberman Tournament"}, - {"racent","Menu - Metropolis Street Racer"}, - {"wait2j","Competition Results - Sonic the Hedgehog 3"}, - {"chalng","Sonic the Hedgehog 3: Minor Boss (Dual PCM) - MarkeyJester"}, - {"credit","Moot Booxle - Chomp"}, - {NULL,NULL} -}; +/// ------------------------ +/// Music Definitions +/// ------------------------ -struct cursongcredit cursongcredit; +musicdef_t *musicdefstart = NULL; // First music definition +struct cursongcredit cursongcredit; // Currently displayed song credit info + +// +// search for music definition in wad +// +static UINT16 W_CheckForMusicDefInPwad(UINT16 wadid) +{ + UINT16 i; + lumpinfo_t *lump_p; + + lump_p = wadfiles[wadid]->lumpinfo; + for (i = 0; i < wadfiles[wadid]->numlumps; i++, lump_p++) + if (memcmp(lump_p->name, "MUSICDEF", 8) == 0) + return i; + + return INT16_MAX; // not found +} + +void S_LoadMusicDefs(UINT16 wadnum) +{ + UINT16 lump; + char *buf; + char *buf2; + char *stoken; + char *value; + size_t size; + musicdef_t *def, *prev; + UINT16 line = 1; // for better error msgs + + lump = W_CheckForMusicDefInPwad(wadnum); + if (lump == INT16_MAX) + return; + + buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE); + size = W_LumpLengthPwad(wadnum, lump); + + // for strtok + buf2 = malloc(size+1); + if (!buf2) + I_Error("S_LoadMusicDefs: No more free memory\n"); + M_Memcpy(buf2,buf,size); + buf2[size] = '\0'; + + def = prev = NULL; + + stoken = strtok (buf2, "\r\n "); + // Find music def + while (stoken) + { + /*if ((stoken[0] == '/' && stoken[1] == '/') + || (stoken[0] == '#')) // skip comments + { + stoken = strtok(NULL, "\r\n"); // skip end of line + if (def) + stoken = strtok(NULL, "\r\n= "); + else + stoken = strtok(NULL, "\r\n "); + line++; + } + else*/ if (!stricmp(stoken, "lump")) + { + value = strtok(NULL, "\r\n "); + + if (!value) + { + CONS_Alert(CONS_WARNING, "MUSICDEF: Lump '%s' is missing name. (file %s, line %d)\n", stoken, wadfiles[wadnum]->filename, line); + stoken = strtok(NULL, "\r\n"); // skip end of line + goto skip_lump; + } + + // No existing musicdefs + if (!musicdefstart) + { + musicdefstart = Z_Calloc(sizeof (musicdef_t), PU_STATIC, NULL); + STRBUFCPY(musicdefstart->name, value); + strlwr(musicdefstart->name); + def = musicdefstart; + //CONS_Printf("S_LoadMusicDefs: Initialized musicdef w/ song '%s'\n", def->name); + } + else + { + def = musicdefstart; + + // Search if this is a replacement + //CONS_Printf("S_LoadMusicDefs: Searching for song replacement...\n"); + while (def) + { + if (!stricmp(def->name, value)) + { + //CONS_Printf("S_LoadMusicDefs: Found song replacement '%s'\n", def->name); + break; + } + + prev = def; + def = def->next; + } + + // Nothing found, add to the end. + if (!def) + { + def = Z_Calloc(sizeof (musicdef_t), PU_STATIC, NULL); + STRBUFCPY(def->name, value); + strlwr(def->name); + if (prev != NULL) + prev->next = def; + //CONS_Printf("S_LoadMusicDefs: Added song '%s'\n", def->name); + } + } + +skip_lump: + stoken = strtok(NULL, "\r\n "); + line++; + } + else + { + value = strtok(NULL, "\r\n= "); + + if (!value) + { + CONS_Alert(CONS_WARNING, "MUSICDEF: Field '%s' is missing value. (file %s, line %d)\n", stoken, wadfiles[wadnum]->filename, line); + stoken = strtok(NULL, "\r\n"); // skip end of line + goto skip_field; + } + + if (!def) + { + CONS_Alert(CONS_ERROR, "MUSICDEF: No music definition before field '%s'. (file %s, line %d)\n", stoken, wadfiles[wadnum]->filename, line); + free(buf2); + return; + } + + if (!stricmp(stoken, "usage")) { +#if 0 // Ignore for now + STRBUFCPY(def->usage, value); + for (value = def->usage; *value; value++) + if (*value == '_') *value = ' '; // turn _ into spaces. + //CONS_Printf("S_LoadMusicDefs: Set usage to '%s'\n", def->usage); +#endif + } else if (!stricmp(stoken, "source")) { + STRBUFCPY(def->source, value); + for (value = def->source; *value; value++) + if (*value == '_') *value = ' '; // turn _ into spaces. + //CONS_Printf("S_LoadMusicDefs: Set source to '%s'\n", def->source); + } else { + CONS_Alert(CONS_WARNING, "MUSICDEF: Invalid field '%s'. (file %s, line %d)\n", stoken, wadfiles[wadnum]->filename, line); + } + +skip_field: + stoken = strtok(NULL, "\r\n= "); + line++; + } + } + + free(buf2); + return; +} + +// +// S_InitMusicDefs +// +// Simply load music defs in all wads. +// +void S_InitMusicDefs(void) +{ + UINT16 i; + for (i = 0; i < numwadfiles; i++) + S_LoadMusicDefs(i); +} + +// +// S_ShowMusicCredit +// +// Display current song's credit on screen +// +void S_ShowMusicCredit(void) +{ + musicdef_t *def = musicdefstart; + + if (!cv_songcredits.value) + return; + + if (!def) // No definitions + return; + + while (def) + { + if (!stricmp(def->name, music_name)) + { + cursongcredit.def = def; + cursongcredit.anim = 5*TICRATE; + cursongcredit.x = 0; + cursongcredit.trans = NUMTRANSMAPS; + return; + } + else + def = def->next; + } +} /// ------------------------ /// Music Status @@ -1731,26 +1809,6 @@ boolean S_SpeedMusic(float speed) return I_SetSongSpeed(speed); } -void S_InitMusicCredit(void) -{ - UINT16 i; - - if (!cv_songcredits.value) - return; - - for (i = 0; songCredits[i].lump; i++) - { - if (!stricmp(songCredits[i].lump, music_name)) - { - cursongcredit.index = i; - cursongcredit.anim = 5*TICRATE; - cursongcredit.x = 0; - cursongcredit.trans = NUMTRANSMAPS; - return; // Don't return when there's SOC support, to see if there's any "replacement" credits? - } - } -} - /// ------------------------ /// Music Playback /// ------------------------ diff --git a/src/s_sound.h b/src/s_sound.h index ae11065c..df90ecb1 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -129,23 +129,27 @@ boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi); boolean S_SpeedMusic(float speed); // Music credits +typedef struct musicdef_s +{ + char name[7]; + //char usage[256]; + char source[256]; + struct musicdef_s *next; +} musicdef_t; + extern struct cursongcredit { - UINT16 index; + musicdef_t *def; UINT16 anim; INT32 x; UINT8 trans; } cursongcredit; -typedef struct -{ - const char *lump; - const char *info; -} songcredits_t; +extern musicdef_t *musicdefstart; -extern songcredits_t songCredits[]; - -void S_InitMusicCredit(void); +void S_LoadMusicDefs(UINT16 wadnum); +void S_InitMusicDefs(void); +void S_ShowMusicCredit(void); // // Music Routines diff --git a/src/w_wad.c b/src/w_wad.c index 69b4cb2e..63bee97d 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1738,6 +1738,7 @@ int W_VerifyNMUSlumps(const char *filename) {"MKFNT", 5}, // Kart font changes {"K_", 2}, // Kart graphic changes + {"MUSICDEF", 8}, // Kart song definitions {NULL, 0}, }; From 565b8f87fb7c7f0f0e9bd23c885927c47762bd6a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 9 Jan 2019 21:01:56 -0500 Subject: [PATCH 04/11] Show song credits if joining mid-game Dunno if this works or not yet! --- src/p_saveg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_saveg.c b/src/p_saveg.c index 555a2614..30d01da1 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3355,6 +3355,10 @@ static inline boolean P_NetUnArchiveMisc(void) totalrings = READUINT32(save_p); lastmap = READINT16(save_p); + // Show music credits for mid-joiners + if (leveltime > (starttime + (TICRATE/2))) + S_ShowMusicCredit(); + for (i = 0; i < 4; i++) { votelevels[i][0] = READINT16(save_p); From ed36f5ac1618345262a101a5340fac2ffa529a5c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 9 Jan 2019 21:12:33 -0500 Subject: [PATCH 05/11] Accidental unselected change --- src/p_saveg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_saveg.c b/src/p_saveg.c index 30d01da1..a5b51810 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -30,6 +30,7 @@ #include "r_sky.h" #include "p_polyobj.h" #include "lua_script.h" +#include "s_sound.h" // S_ShowMusicCredit #ifdef ESLOPE #include "p_slopes.h" #endif From 2ccdd3e4b787042dacb3bfe3b218cbc008cd74d7 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 9 Jan 2019 21:13:06 -0500 Subject: [PATCH 06/11] Fix Music toggle trying to play a non-existent song in Kart --- src/s_sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index e3a62768..cc17ccd0 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2178,7 +2178,7 @@ void GameDigiMusic_OnChange(void) if (Playing()) P_RestoreMusic(&players[consoleplayer]); else - S_ChangeMusicInternal("lclear", false); + S_ChangeMusicInternal("titles", looptitle); } else { @@ -2220,7 +2220,7 @@ void GameMIDIMusic_OnChange(void) if (Playing()) P_RestoreMusic(&players[consoleplayer]); else - S_ChangeMusicInternal("lclear", false); + S_ChangeMusicInternal("titles", looptitle); } else { From d3a38a437544af807d33b6f180f684e42eb021e9 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 9 Jan 2019 21:17:10 -0500 Subject: [PATCH 07/11] Add disable for music credit showing on the change music linedef --- src/p_spec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index e3b54cbe..ca4967ce 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2450,7 +2450,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) mapmusflags |= MUSIC_RELOADRESET; S_ChangeMusic(mapmusname, mapmusflags, !(line->flags & ML_EFFECT4)); - S_ShowMusicCredit(); + if (!(line->flags & ML_EFFECT3)) + S_ShowMusicCredit(); // Except, you can use the ML_BLOCKMONSTERS flag to change this behavior. // if (mapmusflags & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn. From cff7d2795df7956c9c5b34534ea9dfd5d66ca9a5 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 9 Jan 2019 21:17:24 -0500 Subject: [PATCH 08/11] Expose S_ShowMusicCredit to Lua --- src/lua_baselib.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 6f542fae..c862ec26 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1839,6 +1839,21 @@ static int lib_sStopSoundByID(lua_State *L) return 0; } +static int lib_sShowMusicCredit(lua_State *L) +{ + player_t *player = NULL; + //HUDSAFE + if (!lua_isnone(L, 1) && lua_isuserdata(L, 1)) + { + player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + if (!player) + return LUA_ErrInvalid(L, "player_t"); + } + if (!player || P_IsLocalPlayer(player)) + S_ShowMusicCredit(); + return 0; +} + static int lib_sChangeMusic(lua_State *L) { #ifdef MUSICSLOT_COMPATIBILITY @@ -2666,6 +2681,7 @@ static luaL_Reg lib[] = { {"S_StartSoundAtVolume",lib_sStartSoundAtVolume}, {"S_StopSound",lib_sStopSound}, {"S_StopSoundByID",lib_sStopSoundByID}, + {"S_ShowMusicCredit",lib_sShowMusicCredit}, {"S_ChangeMusic",lib_sChangeMusic}, {"S_SpeedMusic",lib_sSpeedMusic}, {"S_StopMusic",lib_sStopMusic}, From 9975497a688e3ab79db36bea30afcd21fa39b5be Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 10 Jan 2019 00:35:11 -0500 Subject: [PATCH 09/11] Remove this, doesn't work --- src/p_saveg.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index a5b51810..555a2614 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -30,7 +30,6 @@ #include "r_sky.h" #include "p_polyobj.h" #include "lua_script.h" -#include "s_sound.h" // S_ShowMusicCredit #ifdef ESLOPE #include "p_slopes.h" #endif @@ -3356,10 +3355,6 @@ static inline boolean P_NetUnArchiveMisc(void) totalrings = READUINT32(save_p); lastmap = READINT16(save_p); - // Show music credits for mid-joiners - if (leveltime > (starttime + (TICRATE/2))) - S_ShowMusicCredit(); - for (i = 0; i < 4; i++) { votelevels[i][0] = READINT16(save_p); From 37e79ebfbdb9053dc11464790e50230e827d4041 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 10 Jan 2019 01:03:53 -0500 Subject: [PATCH 10/11] Redone credits for joiners in a less stupid way, + redone start ambience in a less stupid way --- src/g_game.c | 4 ++++ src/k_kart.c | 2 +- src/p_setup.c | 4 ---- src/s_sound.c | 12 ++++++++---- src/s_sound.h | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index fa7f6ce1..1e0c7e46 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2362,6 +2362,7 @@ void G_PlayerReborn(INT32 player) INT32 bumper; INT32 comebackpoints; INT32 wanted; + boolean songcredit = false; score = players[player].score; marescore = players[player].marescore; @@ -2540,10 +2541,13 @@ void G_PlayerReborn(INT32 player) strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7); mapmusname[6] = 0; mapmusflags = mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK; + songcredit = true; } } P_RestoreMusic(p); + if (songcredit) + S_ShowMusicCredit(); if (leveltime > (starttime + (TICRATE/2)) && !p->spectator) p->kartstuff[k_respawn] = 48; // Respawn effect diff --git a/src/k_kart.c b/src/k_kart.c index 50d19c19..320105ef 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4445,7 +4445,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) // Plays the music after the starting countdown. if (P_IsLocalPlayer(player) && leveltime == (starttime + (TICRATE/2))) { - S_ChangeMusicInternal(mapmusname, true); + S_ChangeMusic(mapmusname, mapmusflags, true); S_ShowMusicCredit(); } } diff --git a/src/p_setup.c b/src/p_setup.c index 90ac3a7c..49b22184 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2869,10 +2869,6 @@ boolean P_SetupLevel(boolean skipprecip) // As oddly named as this is, this handles music only. // We should be fine starting it here. S_Start(); - // SRB2 Kart - Yes this is weird, but we don't want the music to start until after the countdown is finished - // but we do still need the mapmusname to be changed - if (leveltime < (starttime + (TICRATE/2))) - S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); //S_StopMusic(); levelfadecol = (encoremode && !ranspecialwipe ? 122 : 120); diff --git a/src/s_sound.c b/src/s_sound.c index cc17ccd0..856aa045 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -101,7 +101,7 @@ consvar_t cv_numChannels = {"snd_channels", "64", CV_SAVE|CV_CALL, CV_Unsigned, #endif consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE|CV_NOSHOWHELP, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +//consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE|CV_NOSHOWHELP, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; // Sound system toggles, saved into the config consvar_t cv_gamedigimusic = {"digimusic", "On", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, GameDigiMusic_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -263,7 +263,7 @@ void S_RegisterSoundStuff(void) #endif CV_RegisterVar(&surround); CV_RegisterVar(&cv_samplerate); - CV_RegisterVar(&cv_resetmusic); + //CV_RegisterVar(&cv_resetmusic); CV_RegisterVar(&cv_gamesounds); CV_RegisterVar(&cv_gamedigimusic); #ifndef NO_MIDI @@ -2043,9 +2043,13 @@ void S_Start(void) mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK); } - if (cv_resetmusic.value) + //if (cv_resetmusic.value) // Starting ambience should always be restarted S_StopMusic(); - S_ChangeMusic(mapmusname, mapmusflags, true); + + if (leveltime < (starttime + (TICRATE/2))) // SRB2Kart + S_ChangeMusic((encoremode ? "estart" : "kstart"), 0, false); + else + S_ChangeMusic(mapmusname, mapmusflags, true); } static void Command_Tunes_f(void) diff --git a/src/s_sound.h b/src/s_sound.h index df90ecb1..1ad519c2 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -27,7 +27,7 @@ extern consvar_t stereoreverse; extern consvar_t cv_soundvolume, cv_digmusicvolume;//, cv_midimusicvolume; extern consvar_t cv_numChannels; extern consvar_t surround; -extern consvar_t cv_resetmusic; +//extern consvar_t cv_resetmusic; extern consvar_t cv_gamedigimusic; #ifndef NO_MIDI extern consvar_t cv_gamemidimusic; From 6c4decfef312f88710bfeb0451fd10489c3e80b9 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Thu, 10 Jan 2019 13:52:58 -0600 Subject: [PATCH 11/11] Don't check splitscreen in OLDCHAT --- src/hu_stuff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 0ca871f0..8173c065 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -66,7 +66,7 @@ typedef struct #ifdef NETSPLITSCREEN #define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640) #else -#define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640 || splitscreen) +#define OLDCHAT (cv_consolechat.value == 1 || dedicated || vid.width < 640) #endif #define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot. #define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted.