diff --git a/desktop_version/src/BinaryBlob.cpp b/desktop_version/src/BinaryBlob.cpp index 0479e873..83ebaa76 100644 --- a/desktop_version/src/BinaryBlob.cpp +++ b/desktop_version/src/BinaryBlob.cpp @@ -183,8 +183,8 @@ std::vector binaryBlob::getExtra() for (size_t i = 0; i < SDL_arraysize(m_headers); i += 1) { if (m_headers[i].valid -#define FOREACH_TRACK(track_name) && SDL_strcmp(m_headers[i].name, track_name) != 0 - TRACK_NAMES +#define FOREACH_TRACK(_, track_name) && SDL_strcmp(m_headers[i].name, track_name) != 0 + TRACK_NAMES(_) #undef FOREACH_TRACK ) { result.push_back(i); diff --git a/desktop_version/src/BinaryBlob.h b/desktop_version/src/BinaryBlob.h index 3bd9087d..56ae2656 100644 --- a/desktop_version/src/BinaryBlob.h +++ b/desktop_version/src/BinaryBlob.h @@ -6,23 +6,23 @@ /* Laaaazyyyyyyy -flibit */ // #define VVV_COMPILEMUSIC -#define TRACK_NAMES \ - FOREACH_TRACK("data/music/0levelcomplete.ogg") \ - FOREACH_TRACK("data/music/1pushingonwards.ogg") \ - FOREACH_TRACK("data/music/2positiveforce.ogg") \ - FOREACH_TRACK("data/music/3potentialforanything.ogg") \ - FOREACH_TRACK("data/music/4passionforexploring.ogg") \ - FOREACH_TRACK("data/music/5intermission.ogg") \ - FOREACH_TRACK("data/music/6presentingvvvvvv.ogg") \ - FOREACH_TRACK("data/music/7gamecomplete.ogg") \ - FOREACH_TRACK("data/music/8predestinedfate.ogg") \ - FOREACH_TRACK("data/music/9positiveforcereversed.ogg") \ - FOREACH_TRACK("data/music/10popularpotpourri.ogg") \ - FOREACH_TRACK("data/music/11pipedream.ogg") \ - FOREACH_TRACK("data/music/12pressurecooker.ogg") \ - FOREACH_TRACK("data/music/13pacedenergy.ogg") \ - FOREACH_TRACK("data/music/14piercingthesky.ogg") \ - FOREACH_TRACK("data/music/predestinedfatefinallevel.ogg") +#define TRACK_NAMES(blob) \ + FOREACH_TRACK(blob, "data/music/0levelcomplete.ogg") \ + FOREACH_TRACK(blob, "data/music/1pushingonwards.ogg") \ + FOREACH_TRACK(blob, "data/music/2positiveforce.ogg") \ + FOREACH_TRACK(blob, "data/music/3potentialforanything.ogg") \ + FOREACH_TRACK(blob, "data/music/4passionforexploring.ogg") \ + FOREACH_TRACK(blob, "data/music/5intermission.ogg") \ + FOREACH_TRACK(blob, "data/music/6presentingvvvvvv.ogg") \ + FOREACH_TRACK(blob, "data/music/7gamecomplete.ogg") \ + FOREACH_TRACK(blob, "data/music/8predestinedfate.ogg") \ + FOREACH_TRACK(blob, "data/music/9positiveforcereversed.ogg") \ + FOREACH_TRACK(blob, "data/music/10popularpotpourri.ogg") \ + FOREACH_TRACK(blob, "data/music/11pipedream.ogg") \ + FOREACH_TRACK(blob, "data/music/12pressurecooker.ogg") \ + FOREACH_TRACK(blob, "data/music/13pacedenergy.ogg") \ + FOREACH_TRACK(blob, "data/music/14piercingthesky.ogg") \ + FOREACH_TRACK(blob, "data/music/predestinedfatefinallevel.ogg") struct resourceheader { diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 176e293c..bbebce99 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -64,8 +64,8 @@ void musicclass::init() #ifdef VVV_COMPILEMUSIC binaryBlob musicWriteBlob; -#define FOREACH_TRACK(track_name) musicWriteBlob.AddFileToBinaryBlob(track_name); - TRACK_NAMES +#define FOREACH_TRACK(blob, track_name) blob.AddFileToBinaryBlob(track_name); + TRACK_NAMES(musicWriteBlob) #undef FOREACH_TRACK musicWriteBlob.writeBinaryBlob("data/BinaryMusic.vvv"); @@ -87,11 +87,11 @@ void musicclass::init() int index; SDL_RWops *rw; -#define FOREACH_TRACK(track_name) \ - index = musicReadBlob.getIndex(track_name); \ - if (index >= 0 && index < musicReadBlob.max_headers) \ +#define FOREACH_TRACK(blob, track_name) \ + index = blob.getIndex(track_name); \ + if (index >= 0 && index < blob.max_headers) \ { \ - rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index)); \ + rw = SDL_RWFromMem(blob.getAddress(index), blob.getSize(index)); \ if (rw == NULL) \ { \ printf("Unable to read music file header: %s\n", SDL_GetError()); \ @@ -102,7 +102,7 @@ void musicclass::init() } \ } - TRACK_NAMES + TRACK_NAMES(musicReadBlob) num_mmmmmm_tracks += musicTracks.size(); @@ -123,7 +123,7 @@ void musicclass::init() int index; SDL_RWops *rw; - TRACK_NAMES + TRACK_NAMES(musicReadBlob) #undef FOREACH_TRACK