From e069a29f99dfb6e1139f47f3bb291902752d1283 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Tue, 10 Jan 2023 11:14:25 +0100 Subject: Debug animations, LiveEngine and improve arrow/squares highlights --- src/game_tab/left_panel/board/BoardCanvas.hpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/game_tab/left_panel/board/BoardCanvas.hpp') diff --git a/src/game_tab/left_panel/board/BoardCanvas.hpp b/src/game_tab/left_panel/board/BoardCanvas.hpp index 553994c..bc850b7 100644 --- a/src/game_tab/left_panel/board/BoardCanvas.hpp +++ b/src/game_tab/left_panel/board/BoardCanvas.hpp @@ -35,6 +35,8 @@ wxDECLARE_EVENT(PLAY_MOVE_EVENT, wxCommandEvent); #define CAPTURE_FACTOR 0.35 #define SQUARE_NUM_PADDING 5 +#define DEFAULT_ARROW(SRC,DST) {(SRC),(DST),wxNullColour,1} +#define DEFAULT_SQUARE(SQUARE) {(SQUARE),wxNullColour} typedef std::tuple ClockTime; @@ -61,11 +63,20 @@ typedef struct AnimState { } AnimState; typedef struct GameState { + typedef struct Arrow { + std::string src,dst; + wxColour color=wxNullColour; + float scale=1; + } Arrow; + typedef struct Square { + std::string square; + wxColour color=wxNullColour; + } Square; std::string white, black; std::string board; std::map captures; - std::vector squares_hl; - std::vector arrows; + std::vector squares_hl; + std::vector arrows; bool is_black_turn; bool mat_black; bool mat_white; @@ -78,10 +89,11 @@ class BoardCanvas : public wxPanel { Theme *t, *t_captures; wxColour color_arrows; int arrows_offset; + std::uint8_t arrow_thickness; std::string white_player,black_player; // Current highlighted squares and arrows: - std::vector squares_hl; - std::vector arrows; + std::vector squares_hl; + std::vector arrows; // Various canvas state variables bool black_side, is_dragging, valid_drag, arrow_drag, is_black_turn; -- cgit v1.2.3