Skip to content

Commit

Permalink
Allow custom CDA track assignments in DMAPINFO
Browse files Browse the repository at this point in the history
  • Loading branch information
viciious committed Sep 7, 2024
1 parent 54ff19d commit 58d5f04
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions d_mapinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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 = "";

Expand Down
3 changes: 2 additions & 1 deletion d_mapinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down

0 comments on commit 58d5f04

Please sign in to comment.