diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-02 10:12:20 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-02 10:12:20 +0100 |
| commit | 3e40032109886786e469796dced8523d60b90ee4 (patch) | |
| tree | ebc43bf9734b09a8e5887ca7877af9eac356cfd0 /src/game_tab/left_panel/GameTabLeftPanel.cpp | |
| parent | 98edb4253c0d131b855bee882530fa2b28906fc2 (diff) | |
Simplify absolute moves
Diffstat (limited to 'src/game_tab/left_panel/GameTabLeftPanel.cpp')
| -rw-r--r-- | src/game_tab/left_panel/GameTabLeftPanel.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/game_tab/left_panel/GameTabLeftPanel.cpp b/src/game_tab/left_panel/GameTabLeftPanel.cpp index fa97f6f..4aaddb4 100644 --- a/src/game_tab/left_panel/GameTabLeftPanel.cpp +++ b/src/game_tab/left_panel/GameTabLeftPanel.cpp @@ -72,34 +72,32 @@ void GameTabLeftPanel::OnPlay(wxCommandEvent &event) { } void GameTabLeftPanel::Notify(bool skip_animation) { - wxLogDebug("Called!"); // Update fen and captures std::string fen = game->GetFen(); std::map<char, std::uint8_t> captures; bool animate=false; HalfMove *m = game->GetCurrentMove(); std::string src,dst; - // Update capture and check if we should to animations during moves change: if (m){ captures = m->GetLineCaptures(); if(m->HasParent(last_move)){ - UNPACK_ABSOLUTE_MOVE(m->GetAbsoluteMove(),src,dst); + m->GetAbsoluteMove(src,dst); animate=true; }else if(m->HasChild(last_move)){ // Accessing last_move here is safe since it is still // in the tree of moves (since HasChild found it so not deleted) - UNPACK_ABSOLUTE_MOVE(last_move->GetAbsoluteMove(),dst,src); + last_move->GetAbsoluteMove(dst,src); animate=true; } } else if(game->GetNextMove()){ // First move animation HalfMove *next=game->GetNextMove(); if(next==last_move){ - UNPACK_ABSOLUTE_MOVE(game->GetNextMove()->GetAbsoluteMove(),dst,src); + game->GetNextMove()->GetAbsoluteMove(dst,src); animate=true; } } - + // Update board canvas: if(skip_animation || !animate){ board_canvas->SetupBoard(chessarbiter::FENParser::Parse(fen).board, |
