diff --git a/src/hu_stuff.c b/src/hu_stuff.c index e30a725e9..0f861f642 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -938,8 +938,7 @@ static void HU_TickSongCredits(void) if (cursongcredit.anim > 0) { - char *str = va("\x1F"" %s", cursongcredit.def->source); - INT32 len = V_ThinStringWidth(str, V_ALLOWLOWERCASE|V_6WIDTHSPACE); + INT32 len = V_ThinStringWidth(cursongcredit.text, V_ALLOWLOWERCASE|V_6WIDTHSPACE); fixed_t destx = (len+7) * FRACUNIT; if (cursongcredit.trans > 0) @@ -2045,29 +2044,28 @@ static void HU_DrawDemoInfo(void) // void HU_DrawSongCredits(void) { - char *str; fixed_t x; fixed_t y = (r_splitscreen ? (BASEVIDHEIGHT/2)-4 : 32) * FRACUNIT; INT32 bgt; - if (!cursongcredit.def) // No def + if (!cursongcredit.def || cursongcredit.trans >= NUMTRANSMAPS) // No def { return; } - str = va("\x1F"" %s", cursongcredit.def->source); bgt = (NUMTRANSMAPS/2) + (cursongcredit.trans / 2); x = R_InterpolateFixed(cursongcredit.old_x, cursongcredit.x); if (bgt < NUMTRANSMAPS) { - V_DrawFixedPatch(x, y - (2 * FRACUNIT), FRACUNIT, V_SNAPTOLEFT|(bgt<usage, textline); -#endif + if (!stricmp(stoken, "title")) { + STRBUFCPY(def->title, textline); } else if (!stricmp(stoken, "source")) { STRBUFCPY(def->source, textline); } else if (!stricmp(stoken, "volume")) { @@ -1609,13 +1607,15 @@ void S_ShowMusicCredit(void) if (!stricmp(def->name, music_name)) { cursongcredit.def = def; + Z_Free(cursongcredit.text); + cursongcredit.text = Z_StrDup(va("\x1F"" %s - %s", def->title, def->source)); cursongcredit.anim = 5*TICRATE; - cursongcredit.x = cursongcredit.old_x =0; + cursongcredit.x = cursongcredit.old_x = 0; cursongcredit.trans = NUMTRANSMAPS; return; } - else - def = def->next; + + def = def->next; } } diff --git a/src/s_sound.h b/src/s_sound.h index adbf92533..0b1148964 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -173,7 +173,7 @@ boolean S_SpeedMusic(float speed); struct musicdef_t { char name[7]; - //char usage[256]; + char title[256]; char source[256]; int volume; musicdef_t *next; @@ -182,6 +182,7 @@ struct musicdef_t extern struct cursongcredit { musicdef_t *def; + char *text; UINT16 anim; UINT8 trans; fixed_t x;