forked from OpenApoc/OpenApoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.h
53 lines (43 loc) · 1.72 KB
/
data.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
#pragma once
#include "framework/fs.h"
#include "library/sp.h"
#include <vector>
namespace OpenApoc
{
class ResourceAliases;
class Sample;
class MusicTrack;
class Image;
class ImageSet;
class Palette;
class VoxelSlice;
class Video;
class PaletteImage;
class UString;
class Data
{
public:
FileSystem fs;
static Data *createData(std::vector<UString> paths);
virtual ~Data() = default;
Data(std::vector<UString> paths) : fs(paths) {}
virtual sp<Sample> loadSample(UString path) = 0;
virtual sp<MusicTrack> loadMusic(const UString &path) = 0;
virtual sp<Image> loadImage(const UString &path, bool lazy = false) = 0;
virtual sp<ImageSet> loadImageSet(const UString &path) = 0;
virtual sp<Palette> loadPalette(const UString &path) = 0;
virtual sp<VoxelSlice> loadVoxelSlice(const UString &path) = 0;
virtual sp<Video> loadVideo(const UString &path) = 0;
virtual void addSampleAlias(const UString &name, const UString &value) = 0;
virtual void addMusicAlias(const UString &name, const UString &value) = 0;
virtual void addImageAlias(const UString &name, const UString &value) = 0;
virtual void addImageSetAlias(const UString &name, const UString &value) = 0;
virtual void addPaletteAlias(const UString &name, const UString &value) = 0;
virtual void addVoxelSliceAlias(const UString &name, const UString &value) = 0;
virtual sp<PaletteImage> getFontStringCacheEntry(const UString &font_name,
const UString &text) = 0;
virtual void putFontStringCacheEntry(const UString &font_name, const UString &text,
sp<PaletteImage> &img) = 0;
virtual bool writeImage(UString systemPath, sp<Image> image, sp<Palette> palette = nullptr) = 0;
};
} // namespace OpenApoc