1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00
VVVVVV/desktop_version/src/BinaryBlob.h

70 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>
#include <stdint.h>
2020-01-01 21:29:24 +01:00
/* Laaaazyyyyyyy -flibit */
// #define VVV_COMPILEMUSIC
#define TRACK_NAMES(blob) \
FOREACH_TRACK(blob, "music/0levelcomplete.ogg") \
FOREACH_TRACK(blob, "music/1pushingonwards.ogg") \
FOREACH_TRACK(blob, "music/2positiveforce.ogg") \
FOREACH_TRACK(blob, "music/3potentialforanything.ogg") \
FOREACH_TRACK(blob, "music/4passionforexploring.ogg") \
FOREACH_TRACK(blob, "music/5intermission.ogg") \
FOREACH_TRACK(blob, "music/6presentingvvvvvv.ogg") \
FOREACH_TRACK(blob, "music/7gamecomplete.ogg") \
FOREACH_TRACK(blob, "music/8predestinedfate.ogg") \
FOREACH_TRACK(blob, "music/9positiveforcereversed.ogg") \
FOREACH_TRACK(blob, "music/10popularpotpourri.ogg") \
FOREACH_TRACK(blob, "music/11pipedream.ogg") \
FOREACH_TRACK(blob, "music/12pressurecooker.ogg") \
FOREACH_TRACK(blob, "music/13pacedenergy.ogg") \
FOREACH_TRACK(blob, "music/14piercingthesky.ogg") \
FOREACH_TRACK(blob, "music/predestinedfatefinallevel.ogg")
2020-01-01 21:29:24 +01:00
struct resourceheader
{
char name[48];
int32_t start_UNUSED;
int32_t size;
uint8_t valid;
2020-01-01 21:29:24 +01:00
};
class binaryBlob
{
public:
binaryBlob(void);
2020-01-01 21:29:24 +01:00
#ifdef VVV_COMPILEMUSIC
void AddFileToBinaryBlob(const char* _path);
2020-01-01 21:29:24 +01:00
void writeBinaryBlob(const char* _name);
2020-01-01 21:29:24 +01:00
#endif
bool unPackBinary(const char* _name);
2020-01-01 21:29:24 +01:00
int getIndex(const char* _name);
2020-01-01 21:29:24 +01:00
int getSize(int _index);
2020-01-01 21:29:24 +01:00
bool nextExtra(size_t* start);
char* getAddress(int _index);
2020-01-01 21:29:24 +01:00
void clear(void);
2020-06-07 22:11:35 +02:00
static const int max_headers = 128;
#ifdef VVV_COMPILEMUSIC
int numberofHeaders;
#endif
resourceheader m_headers[max_headers];
char* m_memblocks[max_headers];
2020-01-01 21:29:24 +01:00
};
#endif /* BINARYBLOB_H */