-
Notifications
You must be signed in to change notification settings - Fork 4
/
RESFile.h
47 lines (37 loc) · 1.02 KB
/
RESFile.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
#ifndef RESFILE_H
#define RESFILE_H
#include "BaseFile.h"
#include <map>
#include "GraphicBaseFile.h"
namespace SCRANTIC {
struct resource {
u16 num;
std::string filename;
u16 blob1;
u16 blob2;
u32 offset;
u32 size;
v8 data;
std::string filetype;
BaseFile *handle;
};
class RESFile : public BaseFile {
private:
void readFromRes(const std::string &path);
void readFromFiles(const std::string &path);
protected:
v8 header;
u16 resCount;
std::string resFilename;
std::map<u8, SCRANTIC::resource> resourceMap;
public:
RESFile(const std::string &name, bool readFromFile = false);
~RESFile();
SDL_Color *setPaletteForAllGraphicResources(const std::string &palFile);
BaseFile *getResource(const std::string &name);
std::map<std::string, std::vector<std::string>> getMovieList();
void repackResources(const std::string &path, const std::string &prepackedPath);
void unpackResources(const std::string &path, bool onlyFiles = false);
};
}
#endif // RESFILE_H