aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/left_panel/board/Theme.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab/left_panel/board/Theme.cpp')
-rw-r--r--src/game_tab/left_panel/board/Theme.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/game_tab/left_panel/board/Theme.cpp b/src/game_tab/left_panel/board/Theme.cpp
index 6c662dc..f72dfab 100644
--- a/src/game_tab/left_panel/board/Theme.cpp
+++ b/src/game_tab/left_panel/board/Theme.cpp
@@ -11,6 +11,8 @@ Theme::Theme() : square_radius(10) {
config->Read("board/theme/squares/path", "default").ToStdString();
wxFileName square_file(square);
CONFIG_CLOSE(config);
+ // Mat
+ skin['#']=LoadPNG("mat").ConvertToImage();
// Piece
if (piece == "default" || !piece_file.FileExists()) {
wxLogDebug("Loading piece skin from binres");
@@ -95,12 +97,18 @@ wxBitmap *Theme::Get(char c) { return (skin_scaled[c]); }
void Theme::ResizePieces(std::uint32_t width) {
for (std::pair<char, wxImage> c : skin) {
- if (c.first != 's' && c.first != 'S') {
+ if (c.first != 's' && c.first != 'S' && c.first != '#') {
if (skin_scaled.count(c.first))
delete skin_scaled[c.first];
skin_scaled[c.first] =
new wxBitmap(c.second.Scale(width, width, wxIMAGE_QUALITY_HIGH));
}
+ else if(c.first == '#'){
+ if (skin_scaled.count(c.first))
+ delete skin_scaled[c.first];
+ skin_scaled[c.first] =
+ new wxBitmap(c.second.Scale(width*MAT_SIZE_FACTOR, width*MAT_SIZE_FACTOR, wxIMAGE_QUALITY_HIGH));
+ }
}
}