mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-09 10:29:45 +01:00
De-duplicate track names
Instead of copy-pasting the entire list three times over, why not put it in an easy to use "X" macro?
This commit is contained in:
parent
ad540d57f4
commit
09dbe8113b
2 changed files with 32 additions and 138 deletions
|
@ -4,6 +4,24 @@
|
|||
/* 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")
|
||||
|
||||
struct resourceheader
|
||||
{
|
||||
char name[48];
|
||||
|
|
|
@ -50,22 +50,9 @@ void musicclass::init()
|
|||
|
||||
#ifdef VVV_COMPILEMUSIC
|
||||
binaryBlob musicWriteBlob;
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/0levelcomplete.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/1pushingonwards.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/2positiveforce.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/3potentialforanything.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/4passionforexploring.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/5intermission.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/6presentingvvvvvv.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/7gamecomplete.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/8predestinedfate.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/9positiveforcereversed.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/10popularpotpourri.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/11pipedream.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/12pressurecooker.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/13pacedenergy.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/14piercingthesky.ogg");
|
||||
musicWriteBlob.AddFileToBinaryBlob("data/music/predestinedfatefinallevel.ogg");
|
||||
#define FOREACH_TRACK(track_name) musicWriteBlob.AddFileToBinaryBlob(track_name);
|
||||
TRACK_NAMES
|
||||
#undef FOREACH_TRACK
|
||||
|
||||
musicWriteBlob.writeBinaryBlob("data/BinaryMusic.vvv");
|
||||
#endif
|
||||
|
@ -81,137 +68,26 @@ void musicclass::init()
|
|||
{
|
||||
mmmmmm = true;
|
||||
usingmmmmmm = true;
|
||||
int index = musicReadBlob.getIndex("data/music/0levelcomplete.ogg");
|
||||
SDL_RWops *rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
int index;
|
||||
SDL_RWops *rw;
|
||||
|
||||
#define FOREACH_TRACK(track_name) \
|
||||
index = musicReadBlob.getIndex(track_name); \
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index)); \
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/1pushingonwards.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/2positiveforce.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/3potentialforanything.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/4passionforexploring.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/5intermission.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/6presentingvvvvvv.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/7gamecomplete.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/8predestinedfate.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/9positiveforcereversed.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/10popularpotpourri.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/11pipedream.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/12pressurecooker.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/13pacedenergy.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/14piercingthesky.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/predestinedfatefinallevel.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
TRACK_NAMES
|
||||
|
||||
bool ohCrap = musicReadBlob.unPackBinary("vvvvvvmusic.vvv");
|
||||
SDL_assert(ohCrap && "Music not found!");
|
||||
}
|
||||
|
||||
int index = musicReadBlob.getIndex("data/music/0levelcomplete.ogg");
|
||||
SDL_RWops *rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
int index;
|
||||
SDL_RWops *rw;
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/1pushingonwards.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
TRACK_NAMES
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/2positiveforce.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/3potentialforanything.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/4passionforexploring.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/5intermission.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/6presentingvvvvvv.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/7gamecomplete.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/8predestinedfate.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/9positiveforcereversed.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/10popularpotpourri.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/11pipedream.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/12pressurecooker.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/13pacedenergy.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/14piercingthesky.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
|
||||
index = musicReadBlob.getIndex("data/music/predestinedfatefinallevel.ogg");
|
||||
rw = SDL_RWFromMem(musicReadBlob.getAddress(index), musicReadBlob.getSize(index));
|
||||
musicTracks.push_back(MusicTrack( rw ));
|
||||
#undef FOREACH_TRACK
|
||||
|
||||
safeToProcessMusic= false;
|
||||
m_doFadeInVol = false;
|
||||
|
|
Loading…
Reference in a new issue