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
111
112
113
114
115
116
|
#pragma once
#include "drawable.h"
#include "imagecache.h"
#include "texture.h"
namespace GUI
{
class TexturedBox
: public Drawable
{
public:
TexturedBox(ImageCache& image_cache, const std::string& filename,
std::size_t x0, std::size_t y0,
std::size_t dx1, std::size_t dx2, std::size_t dx3,
std::size_t dy1, std::size_t dy2, std::size_t dy3);
std::size_t width() const override;
std::size_t height() const override;
void setSize(std::size_t width, std::size_t height);
const Colour& getPixel(std::size_t x, std::size_t y) const override;
private:
Texture seg_a;
Texture seg_b;
Texture seg_c;
Texture seg_d;
Texture seg_e;
Texture seg_f;
Texture seg_g;
Texture seg_h;
Texture seg_i;
std::size_t _width{100};
std::size_t _height{100};
std::size_t dx1;
std::size_t dx2;
std::size_t dx3;
std::size_t dy1;
std::size_t dy2;
std::size_t dy3;
Colour outOfRange{0.0f, 0.0f, 0.0f, 0.0f};
};
}
|