diff --git a/include/config.h b/include/config.h index 2da69acd..05740b1b 100644 --- a/include/config.h +++ b/include/config.h @@ -52,7 +52,7 @@ //#define PVS_AI #define MTDF_AI -#ifdef WIN32 +#ifdef _MSC_VER #define PERFECT_AI_SUPPORT #endif diff --git a/src/test/test.cpp b/src/test/test.cpp index 3a227012..0846a2e2 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -31,7 +31,9 @@ #include "option.h" #include "test.h" +#ifdef PERFECT_AI_SUPPORT #include "perfect/perfect.h" +#endif #ifdef TEST_MODE #ifdef QT_GUI_LIB @@ -220,9 +222,11 @@ void Test::readFromMemory() sharedMemory.unlock(); readStr = str; +#ifdef PERFECT_AI_SUPPORT if (gameOptions.getPerfectAiEnabled()) { perfect_command(str.toStdString().c_str()); } +#endif emit command(str.toStdString()); } diff --git a/src/ui/qt/game.cpp b/src/ui/qt/game.cpp index 930b7636..19b1b05c 100644 --- a/src/ui/qt/game.cpp +++ b/src/ui/qt/game.cpp @@ -40,7 +40,9 @@ #include "client.h" #include "option.h" +#ifdef PERFECT_AI_SUPPORT #include "perfect/perfect.h" +#endif using namespace std; @@ -230,9 +232,11 @@ void Game::gameReset() moveHistory.emplace_back(bak); } +#ifdef PERFECT_AI_SUPPORT if (gameOptions.getPerfectAiEnabled()) { perfect_reset(); } +#endif position.reset(); elapsedSeconds[BLACK] = elapsedSeconds[WHITE] = 0; @@ -596,11 +600,13 @@ void Game::setPerfectAi(bool enabled) gameOptions.setPerfectAiEnabled(enabled); settings->setValue("Options/PerfectAI", enabled); +#ifdef PERFECT_AI_SUPPORT if (enabled) { perfect_reset(); } else { perfect_exit(); } +#endif } void Game::setIDS(bool enabled) @@ -918,9 +924,11 @@ bool Game::actionPiece(QPointF p) } if (result) { +#ifdef PERFECT_AI_SUPPORT if (gameOptions.getPerfectAiEnabled()) { perfect_command((char *)position.record); } +#endif moveHistory.emplace_back(position.record);