From 58d5f0435909329e12408ce017abcd20070d58fd Mon Sep 17 00:00:00 2001 From: viciious Date: Sat, 7 Sep 2024 17:51:06 +0300 Subject: [PATCH] Allow custom CDA track assignments in DMAPINFO --- d_mapinfo.c | 3 +++ d_mapinfo.h | 3 ++- g_game.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/d_mapinfo.c b/d_mapinfo.c index 1a909a02f..fb7bf8cad 100644 --- a/d_mapinfo.c +++ b/d_mapinfo.c @@ -284,6 +284,8 @@ static void G_AddMapinfoKey(char* key, char* value, dmapinfo_t* mi) mi->mapNumber = D_atoi(value); else if (!D_strcasecmp(key, "music")) mi->songNum = S_SongForName(value); + else if (!D_strcasecmp(key, "cdTrack")) + mi->cdaNum = D_atoi(value); else if (!D_strcasecmp(key, "intermissionText")) mi->interText = value; else if (!D_strcasecmp(key, "secretIntermissionText")) @@ -488,6 +490,7 @@ dmapinfo_t **G_LoadMaplist(int *pmapcount, dgameinfo_t* gi) D_memset(mi, 0, sizeof(*mi)); mi->skyTexture = -1; mi->songNum = mus_none; + mi->cdaNum = 0; mi->interText = ""; mi->secretInterText = ""; diff --git a/d_mapinfo.h b/d_mapinfo.h index d9bcb7632..5d043252f 100644 --- a/d_mapinfo.h +++ b/d_mapinfo.h @@ -42,7 +42,8 @@ typedef struct VINT specials; VINT mapNumber; VINT skyTexture; - VINT songNum; + uint8_t songNum; + uint8_t cdaNum; char *name; char *next; char *secretNext; diff --git a/g_game.c b/g_game.c index 60170dc14..fce6550d4 100644 --- a/g_game.c +++ b/g_game.c @@ -143,7 +143,7 @@ void G_DoLoadLevel (void) if (netgame != gt_single && !splitscreen) S_StopSong(); - S_StartSong(music, 1, gamemap); + S_StartSong(music, 1, gamemapinfo.cdaNum ? gamemapinfo.cdaNum : gamemap); //Z_CheckHeap (mainzone); /* DEBUG */ }