mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 12:21:19 +00:00
In-game music credits
This commit is contained in:
parent
e52d5fd2fd
commit
5d51754936
8 changed files with 224 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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*/;
|
||||
|
|
|
@ -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<<V_ALPHASHIFT), songcreditbg);
|
||||
if (transparency < NUMTRANSMAPS)
|
||||
V_DrawThinString(x-len-10, 32, V_SNAPTOLEFT|V_ALLOWLOWERCASE|V_6WIDTHSPACE|(transparency<<V_ALPHASHIFT), va("\x1F"" %s", songCredits[cursongcredit.index].info));
|
||||
}
|
||||
|
||||
// Heads up displays drawer, call each frame
|
||||
//
|
||||
void HU_Drawer(void)
|
||||
|
@ -2144,6 +2194,10 @@ void HU_Drawer(void)
|
|||
HU_DrawCrosshair4();
|
||||
}*/
|
||||
|
||||
// draw song credits
|
||||
if (cv_songcredits.value)
|
||||
HU_DrawSongCredits();
|
||||
|
||||
// draw desynch text
|
||||
if (hu_resynching)
|
||||
{
|
||||
|
|
|
@ -4444,7 +4444,10 @@ 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_InitMusicCredit();
|
||||
}
|
||||
}
|
||||
|
||||
void K_KartPlayerAfterThink(player_t *player)
|
||||
|
|
|
@ -2450,6 +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();
|
||||
|
||||
// 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.
|
||||
|
|
144
src/s_sound.c
144
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
|
||||
/// ------------------------
|
||||
|
|
|
@ -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
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue