mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-07 02:26:29 +02:00
38 lines
1 KiB
C++
38 lines
1 KiB
C++
#pragma once
|
|
|
|
#include "ochess.hpp"
|
|
|
|
#include <string>
|
|
#include <unordered_map>
|
|
|
|
#define ELT_DIM 200
|
|
#define DEFAULT_SIZE 80
|
|
#define PIECE_SIZE_FACTOR 0.8 // Should be between 0 and 1
|
|
#define MAT_SIZE_FACTOR 0.4
|
|
#define DEFAULT_PIECE_THEME "assets/pieces/cburnett.png"
|
|
#define DEFAULT_SQUARE_THEME "assets/boards/chesscom_8bits.png"
|
|
|
|
class Theme {
|
|
private:
|
|
std::unordered_map<char, wxImage> skin;
|
|
std::unordered_map<char, wxBitmap *> skin_scaled;
|
|
std::uint8_t square_radius;
|
|
wxMask *RoundedMask(std::uint32_t width, std::uint8_t corner);
|
|
|
|
public:
|
|
Theme();
|
|
Theme(std::string piece, std::string square);
|
|
~Theme();
|
|
void LoadPiecesSkin(wxImage skin);
|
|
void LoadSquaresSkin(wxImage iskin);
|
|
void ResizePieces(std::uint32_t width);
|
|
void ResizeSquares(std::uint32_t width);
|
|
void ResizeSquaresAndPieces(std::uint32_t width);
|
|
void SetSquareRadius(std::uint8_t radius);
|
|
std::uint8_t GetSquareRadius();
|
|
bool Zoom(int amount);
|
|
double GetPiecesSizes();
|
|
double GetSquaresSizes();
|
|
|
|
wxBitmap *Get(char c);
|
|
};
|