1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-19 01:19:41 +01:00
VVVVVV/desktop_version/src/BinaryBlob.h

68 lines
1.7 KiB
C
Raw Normal View History

2020-01-01 21:29:24 +01:00
#ifndef BINARYBLOB_H
#define BINARYBLOB_H
#include <stddef.h>
2020-01-01 21:29:24 +01:00
/* Laaaazyyyyyyy -flibit */
// #define VVV_COMPILEMUSIC
#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")
2020-01-01 21:29:24 +01:00
struct resourceheader
{
char name[48];
2020-06-15 13:37:05 +02:00
int start_UNUSED;
2020-01-01 21:29:24 +01:00
int size;
bool valid;
};
class binaryBlob
{
public:
binaryBlob(void);
2020-01-01 21:29:24 +01:00
#ifdef VVV_COMPILEMUSIC
void AddFileToBinaryBlob(const char* _path);
void writeBinaryBlob(const char* _name);
#endif
bool unPackBinary(const char* _name);
int getIndex(const char* _name);
int getSize(int _index);
bool nextExtra(size_t* start);
2020-01-01 21:29:24 +01:00
char* getAddress(int _index);
void clear(void);
2020-06-07 22:11:35 +02:00
static const int max_headers = 128;
2020-01-01 21:29:24 +01:00
private:
int numberofHeaders;
resourceheader m_headers[max_headers];
char* m_memblocks[max_headers];
2020-01-01 21:29:24 +01:00
};
#endif /* BINARYBLOB_H */