aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab')
-rw-r--r--src/game_tab/left_panel/board/BoardCanvas.cpp2
-rw-r--r--src/game_tab/left_panel/board/BoardCanvas.hpp18
2 files changed, 18 insertions, 2 deletions
diff --git a/src/game_tab/left_panel/board/BoardCanvas.cpp b/src/game_tab/left_panel/board/BoardCanvas.cpp
index f0cf1c5..de9fac7 100644
--- a/src/game_tab/left_panel/board/BoardCanvas.cpp
+++ b/src/game_tab/left_panel/board/BoardCanvas.cpp
@@ -64,7 +64,7 @@ void BoardCanvas::OnPaint(wxPaintEvent &event) {
dc.Blit(0,0,canvas_size.x,canvas_size.y,(wxDC*)&memDC,0,0);
}
else {
- // Otherwise reuse buffer and animate. TEST CODE FOR NOW:
+ // Otherwise reuse buffer and animate
dc.DrawBitmap(*adata.buffer, 0, 0, true);
double percent=adata.frame/adata.frames;
// Draw moving piece
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<short, short, short> 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<char, std::uint8_t> 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: