From 796ba531eac19a6032000ef9b2faa79c89c84188 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Thu, 29 Dec 2022 13:24:23 +0100 Subject: Cleaning code --- src/game_tab/left_panel/board/BoardCanvas.hpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (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 d4e4717..2f459c5 100644 --- a/src/game_tab/left_panel/board/BoardCanvas.hpp +++ b/src/game_tab/left_panel/board/BoardCanvas.hpp @@ -42,14 +42,29 @@ typedef std::tuple ClockTime; // Drawing buffer (ANIMATIONS) typedef struct AnimState { + /// @brief Temporary buffer to reduce latency wxBitmap *buffer; + /// @brief Should *buffer be used? bool reuseBuffer; - int frame,frames,duration,fps,duration_fast; + /// @brief Current animated frame + int frame; + /// @brief Total number of frames for the animation + int frames; + /// @brief Animation durations (in ms) + int duration,duration_fast; + /// @brief Animation FPS + std::uint8_t fps; + /// @brief Board to draw at the end of the animation std::string final_board; + /// @brief Which player is to move at the end of the animation bool final_is_black_turn; + /// @brief Final state of captured pieces at the end of the animation std::map final_captures; + /// @brief Current animated piece char piece_moved; + /// @brief Starting point of the animated piece wxPoint src; + /// @brief Translation vector of the animated piece wxPoint transVect; } AnimState; @@ -70,6 +85,7 @@ class BoardCanvas : public wxPanel { ClockTime black_time, white_time; bool frozen,lock_square_size; + // Current animation state AnimState adata; public: -- cgit v1.2.3