-
Notifications
You must be signed in to change notification settings - Fork 0
/
DroppedAssets.h
110 lines (85 loc) · 2.04 KB
/
DroppedAssets.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#pragma once
#include <string>
#include <SDL2/SDL.h>
#include "LibdragonImage.h"
#include "LibdragonSound.h"
#include "LibdragonTiledMap.h"
struct DroppedImage {
std::string image_path;
LibdragonImageType type;
SDL_Texture *image_data;
SDL_Texture *image_data_overlay;
int w, h;
float width_mult, height_mult;
char name[50] = "\0";
char dfs_folder[100] = "/\0";
int h_slices, v_slices;
DroppedImage(const char *image_path, LibdragonImageType type)
: image_path(image_path),
type(type),
image_data(nullptr),
image_data_overlay(nullptr),
w(0),
h(0),
width_mult(1),
height_mult(1),
h_slices(1),
v_slices(1) {
}
};
struct DroppedSound {
std::string sound_path;
LibdragonSoundType type;
char name[50] = "\0";
char dfs_folder[100] = "/\0";
bool compress;
bool loop;
int loop_offset;
DroppedSound(const char *sound_path, LibdragonSoundType type)
: sound_path(sound_path), type(type), compress(false), loop(false), loop_offset(0) {
}
};
struct DroppedGeneralFile {
std::string file_path;
char name[50] = "\0";
char extension[10] = "\0";
char dfs_folder[100] = "/\0";
bool copy_to_filesystem;
explicit DroppedGeneralFile(const char *file_path)
: file_path(file_path), copy_to_filesystem(true) {
}
};
struct DroppedTiledMap {
std::string file_path;
char name[50] = "\0";
char dfs_folder[100] = "/\0";
std::vector<LibdragonMapLayer> layers;
explicit DroppedTiledMap(const char *file_path) : file_path(file_path) {
}
};
struct DroppedLDtkMap {
std::string file_path;
char name[50] = "\0";
char dfs_folder[100] = "/\0";
std::vector<LibdragonMapLayer> layers;
explicit DroppedLDtkMap(const char *file_path) : file_path(file_path) {
}
};
struct DroppedFont {
std::string font_path;
SDL_Texture *font_data;
int w, h;
float width_mult, height_mult;
char name[50] = "\0";
char dfs_folder[100] = "/\0";
int font_size;
explicit DroppedFont(const char *font_path)
: font_path(font_path),
font_data(nullptr),
w(0),
h(0),
width_mult(1),
height_mult(1),
font_size(16) {
}
};