summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilecell.h
blob: 534120060597a22d696b5e7927a2a322b4384d8b (plain) (blame)
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
#ifdef USE_TILE
#ifndef TILECELL_H
#define TILECELL_H

enum halo_type
{
    HALO_NONE = 0,
    HALO_RANGE = 1,
    HALO_MONSTER = 2,
    HALO_UMBRA = 3,
};

struct packed_cell
{
    // For anything that requires multiple dungeon tiles (such as waves)
    // These tiles will be placed directly on top of the bg tile.
    enum { MAX_DNGN_OVERLAY = 20 };
    int num_dngn_overlay;
    FixedVector<int, MAX_DNGN_OVERLAY> dngn_overlay;

    tileidx_t fg;
    tileidx_t bg;
    tile_flavour flv;
    tileidx_t cloud;

    bool is_bloody;
    bool is_silenced;
    char halo;
    bool is_moldy;
    bool glowing_mold;
    bool is_sanctuary;
    bool is_liquefied;
    bool mangrove_water;
    uint8_t orb_glow;
    char blood_rotation;
    bool old_blood;
    uint8_t travel_trail;
    bool quad_glow;
    uint8_t disjunct;
#if TAG_MAJOR_VERSION == 34
    uint8_t heat_aura;
#endif
    uint8_t gold_aura;

    bool operator ==(const packed_cell &other) const;
    bool operator !=(const packed_cell &other) const { return !(*this == other); }

    packed_cell() : num_dngn_overlay(0), fg(0), bg(0), cloud(0), is_bloody(false),
                    is_silenced(false), halo(HALO_NONE), is_moldy(false),
                    glowing_mold(false), is_sanctuary(false), is_liquefied(false),
                    mangrove_water(false), orb_glow(0), blood_rotation(0),
                    old_blood(false), travel_trail(0), quad_glow(false),
                    disjunct(false),
#if TAG_MAJOR_VERSION == 34
                    heat_aura(false),
#endif
                    gold_aura(0) {}

    packed_cell(const packed_cell* c) : num_dngn_overlay(c->num_dngn_overlay),
                                        fg(c->fg), bg(c->bg), flv(c->flv),
                                        cloud(c->cloud),
                                        is_bloody(c->is_bloody),
                                        is_silenced(c->is_silenced),
                                        halo(c->halo),
                                        is_moldy(c->is_moldy),
                                        glowing_mold(c->glowing_mold),
                                        is_sanctuary(c->is_sanctuary),
                                        is_liquefied(c->is_liquefied),
                                        mangrove_water(c->mangrove_water),
                                        orb_glow(c->orb_glow),
                                        blood_rotation(c->blood_rotation),
                                        old_blood(c->old_blood),
                                        travel_trail(c->travel_trail),
                                        quad_glow(c->quad_glow),
                                        disjunct(c->disjunct),
#if TAG_MAJOR_VERSION == 34
                                        heat_aura(c->heat_aura),
#endif
                                        gold_aura(c->gold_aura) {}

    void clear();
};

// For a given location, pack any waves/ink/wall shadow tiles
// that require knowledge of the surrounding env cells.
void pack_cell_overlays(const coord_def &gc, packed_cell *cell);

#endif // TILECELL_H
#endif // USE_TILE