-
Notifications
You must be signed in to change notification settings - Fork 6
/
c_tile.h
102 lines (88 loc) · 1.88 KB
/
c_tile.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
#pragma once
#include "common.h"
#include "c_imagelist.h"
typedef class c_tile c_tile;
#include "s_map_block.h"
class TileSet;
enum e_color_by
{
COLOR_NONE,
COLOR_INI,
COLOR_BIOME,
COLOR_COMBINED,
COLOR_STRUCTURE,
COLOR_TRADE,
COLOR_PALETTE,
COLOR_DIRECT
};
enum e_color_source
{
SOURCE_TEMPERATURE,
SOURCE_RAINFALL,
SOURCE_DRAINAGE,
SOURCE_SAVAGERY,
SOURCE_VOLCANISM,
SOURCE_EVIL,
SOURCE_SALINITY,
SOURCE_ELEV,
SOURCE_DEPTH
};
enum e_offset_type
{
OFFSET_NONE,
OFFSET_SIXTEEN,
OFFSET_PATH,
OFFSET_PAIR,
OFFSET_SIX,
OFFSET_FOUR,
OFFSET_RANDOM,
OFFSET_COUNT
};
enum e_layer
{
LAYER_BASE,
LAYER_OBJECT
};
struct s_sprite
{
s_sprite(void);
int x;
int y;
int width;
int height;
int index;
int origin_x;
int origin_y;
int column_height;
e_color_by color_by;
e_color_source color_source;
unsigned int palette_number;
ALLEGRO_COLOR color;
e_offset_type offset_type;
unsigned char offset_amount;
terrain_type border_terrain;
structure_type border_structure;
};
class c_tile
{
s_sprite get_from_ini(ALLEGRO_CONFIG * config, const char * section, ALLEGRO_PATH * base_path);
public:
void draw(float x, float y, int height, int bottom, int surface, s_map_block * block, TileSet * tileset, bool flip = 0, e_layer drawlayer = LAYER_BASE);
void load_ini(ALLEGRO_PATH * _path);
c_tile(void);
~c_tile(void);
inline bool operator < (const c_tile & a) const
{
return this->priority < a.priority;
};
vector<s_sprite> top_sprites;
vector<s_sprite> bottom_sprites;
vector<s_sprite> surface_sprites;
vector<s_sprite> intermediate_sprites;
vector<s_sprite> object_sprites;
int height_max;
int height_min;
int priority;
terrain_type special_terrain;
structure_type structure;
};