-
Notifications
You must be signed in to change notification settings - Fork 6
/
resource_mac.h
54 lines (40 loc) · 923 Bytes
/
resource_mac.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef RESOURCE_MAC_H__
#define RESOURCE_MAC_H__
#include <stdint.h>
#include "file.h"
struct ResourceMacMap {
uint16_t typesOffset;
uint16_t namesOffset;
uint16_t typesCount;
};
struct ResourceMacType {
unsigned char id[4];
uint16_t count;
uint16_t startOffset;
};
enum {
kResourceMacEntryNameLength = 64
};
struct ResourceMacEntry {
uint16_t id;
uint16_t nameOffset;
uint32_t dataOffset;
char name[kResourceMacEntryNameLength];
};
struct ResourceMac {
static const char *FILENAME1;
static const char *FILENAME2;
File _f;
uint32_t _dataOffset;
ResourceMacMap _map;
ResourceMacType *_types;
ResourceMacEntry **_entries;
int _sndIndex;
ResourceMac(const char *filePath, FileSystem *);
~ResourceMac();
bool isOpen() const { return _entries != 0; }
void load();
void loadResourceFork(uint32_t offset, uint32_t size);
const ResourceMacEntry *findEntry(const char *name) const;
};
#endif