diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2018-03-17 14:51:30 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2018-06-05 22:58:35 +0200 |
commit | f946b3da56b22c1fc32a9ffc9008374e4fb4f8c8 (patch) | |
tree | 3d8b2b0cf0e3931d2e38cce4b822f5b082d0cb92 /src/music.cpp | |
parent | 1c2d29e1a3b5afdf3933f4cc743dda35c3ebb5fb (diff) | |
download | openttd-f946b3da56b22c1fc32a9ffc9008374e4fb4f8c8.tar.xz |
Codechange: Pass a MusicSongInfo struct instead of bare filename to music drivers.
Preparation for later extending the info passed to music drivers.
Diffstat (limited to 'src/music.cpp')
-rw-r--r-- | src/music.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/music.cpp b/src/music.cpp index 4001e621e..5bfe62ebd 100644 --- a/src/music.cpp +++ b/src/music.cpp @@ -66,13 +66,16 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f if (ret) { this->num_available = 0; IniGroup *names = ini->GetGroup("names"); - for (uint i = 0, j = 1; i < lengthof(this->song_name); i++) { + for (uint i = 0, j = 1; i < lengthof(this->songinfo); i++) { const char *filename = this->files[i].filename; if (names == NULL || StrEmpty(filename)) { - this->song_name[i][0] = '\0'; + this->songinfo[i].songname[0] = '\0'; continue; } + this->songinfo[i].filename = filename; // non-owned pointer + this->songinfo[i].filetype = MTT_STANDARDMIDI; + IniItem *item = NULL; /* As we possibly add a path to the filename and we compare * on the filename with the path as in the .obm, we need to @@ -91,8 +94,8 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f return false; } - strecpy(this->song_name[i], item->value, lastof(this->song_name[i])); - this->track_nr[i] = j++; + strecpy(this->songinfo[i].songname, item->value, lastof(this->songinfo[i].songname)); + this->songinfo[i].tracknr = j++; this->num_available++; } } |