diff --git a/include/config.h b/include/config.h index 0c774012..63df8a63 100644 --- a/include/config.h +++ b/include/config.h @@ -26,7 +26,7 @@ #pragma execution_character_set("utf-8") #endif -#define QT_UI +//#undef QT_GUI_LIB //#define DISABLE_RANDOM_MOVE //#define UCI_AUTO_RE_GO diff --git a/millgame.vcxproj b/millgame.vcxproj index fce4b98a..7f1bbc6b 100644 --- a/millgame.vcxproj +++ b/millgame.vcxproj @@ -272,7 +272,7 @@ Sync $(IntDir) Disabled - _WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;_CRT_SECURE_NO_WARNINGS;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_MULTIMEDIAWIDGETS_LIB;QT_NETWORK_LIB;QT_NETWORKAUTH_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) + QT_UI;_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;_CRT_SECURE_NO_WARNINGS;QT_CORE_LIB;QT_GUI_LIB;QT_MULTIMEDIA_LIB;QT_MULTIMEDIAWIDGETS_LIB;QT_NETWORK_LIB;QT_NETWORKAUTH_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) false MultiThreadedDebugDLL true diff --git a/src/debug.h b/src/debug.h index 6be21bac..d1238f59 100644 --- a/src/debug.h +++ b/src/debug.h @@ -23,7 +23,7 @@ #include "config.h" #include -#ifdef QT_UI +#ifdef QT_GUI_LIB #include #endif @@ -34,7 +34,7 @@ #ifdef CSTYLE_DEBUG_OUTPUT #define loggerDebug printf #else -#ifdef QT_UI +#ifdef QT_GUI_LIB #define loggerDebug qDebug #endif #endif /* CSTYLE_DEBUG_OUTPUT */ diff --git a/src/main.cpp b/src/main.cpp index ce407b15..4d8ca844 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,7 +29,7 @@ #include "tt.h" #include "uci.h" -#ifndef QT_UI +#ifndef QT_GUI_LIB int main(int argc, char* argv[]) { diff --git a/src/thread.cpp b/src/thread.cpp index d96a2230..8536051a 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -45,12 +45,12 @@ using namespace std; /// in idle_loop(). Note that 'searching' and 'exit' should be already set. Thread::Thread(size_t n -#ifdef QT_UI +#ifdef QT_GUI_LIB , QObject *parent #endif ) : idx(n), stdThread(&Thread::idle_loop, this), -#ifdef QT_UI +#ifdef QT_GUI_LIB QObject(parent), #endif timeLimit(3600) @@ -181,7 +181,7 @@ void Thread::setAi(Position *p, int tl) void Thread::emitCommand() { -#ifdef QT_UI +#ifdef QT_GUI_LIB emit command(strCommand); #else sync_cout << "bestmove " << strCommand.c_str(); @@ -195,7 +195,7 @@ void Thread::emitCommand() #ifdef ANALYZE_POSITION analyze(rootPos->side_to_move()); #endif -#endif // QT_UI +#endif // QT_GUI_LIB } #ifdef OPENING_BOOK @@ -242,10 +242,10 @@ void Thread::analyze(Color c) static int nbwin = 0; static int nwwin = 0; static int ndraw = 0; -#ifndef QT_UI +#ifndef QT_GUI_LIB int total; float bwinrate, wwinrate, drawrate; -#endif // !QT_UI +#endif // !QT_GUI_LIB int d = (int)originDepth; int v = (int)bestvalue; @@ -356,7 +356,7 @@ void Thread::analyze(Color c) cout << "轮到白方行棋" << endl; } -#ifndef QT_UI +#ifndef QT_GUI_LIB total = nbwin + nwwin + ndraw; if (total == 0) { @@ -371,7 +371,7 @@ void Thread::analyze(Color c) cout << "比分: " << nbwin << " : " << nwwin << " : " << ndraw << "\ttotal: " << total << endl; cout << fixed << setprecision(2) << bwinrate << "% : " << wwinrate << "% : " << drawrate << "%" << endl; -#endif // !QT_UI +#endif // !QT_GUI_LIB out: cout << endl << endl; diff --git a/src/thread.h b/src/thread.h index 4bbd5dfe..027cf99f 100644 --- a/src/thread.h +++ b/src/thread.h @@ -33,16 +33,16 @@ #include "thread_win32_osx.h" #include "config.h" -#ifdef QT_UI +#ifdef QT_GUI_LIB #include -#endif // QT_UI +#endif // QT_GUI_LIB /// Thread class keeps together all the thread-related stuff. We use /// per-thread pawn and material hash tables so that once we get a /// pointer to an entry its life time is unlimited and we don't have /// to care about someone changing the entry under our feet. class Thread -#ifdef QT_UI +#ifdef QT_GUI_LIB : public QObject #endif { @@ -54,7 +54,7 @@ public: NativeThread stdThread; explicit Thread(size_t n -#ifdef QT_UI +#ifdef QT_GUI_LIB , QObject *parent = nullptr #endif ); @@ -129,7 +129,7 @@ public: private: int timeLimit; -#ifdef QT_UI +#ifdef QT_GUI_LIB Q_OBJECT public: @@ -139,7 +139,7 @@ signals: #else public: void emitCommand(); -#endif // QT_UI +#endif // QT_GUI_LIB void command(const string &cmdline, bool update = true); }; diff --git a/src/ui/qt/gamecontroller.cpp b/src/ui/qt/gamecontroller.cpp index 6f10a925..24aa1dab 100644 --- a/src/ui/qt/gamecontroller.cpp +++ b/src/ui/qt/gamecontroller.cpp @@ -83,7 +83,7 @@ GameController::GameController( qRegisterMetaType("string"); -#ifdef QT_UI +#ifdef QT_GUI_LIB // 关联AI和控制器的着法命令行 connect(aiThread[BLACK], SIGNAL(command(const string &, bool)), this, SLOT(command(const string &, bool))); @@ -92,7 +92,7 @@ GameController::GameController( connect(this->gameTest, SIGNAL(command(const string &, bool)), this, SLOT(command(const string &, bool))); -#endif // QT_UI +#endif // QT_GUI_LIB #ifdef NET_FIGHT_SUPPORT #ifndef TRAINING_MODE @@ -984,14 +984,14 @@ bool GameController::command(const string &cmd, bool update /* = true */) Q_UNUSED(hasSound) #endif -#ifdef QT_UI +#ifdef QT_GUI_LIB // 防止接收滞后结束的线程发送的指令 if (sender() == aiThread[BLACK] && !isAiPlayer[BLACK]) return false; if (sender() == aiThread[WHITE] && !isAiPlayer[WHITE]) return false; -#endif // QT_UI +#endif // QT_GUI_LIB #ifndef TRAINING_MODE // 声音 diff --git a/src/ui/qt/winmain.cpp b/src/ui/qt/winmain.cpp index d890aadf..fce94f64 100644 --- a/src/ui/qt/winmain.cpp +++ b/src/ui/qt/winmain.cpp @@ -24,7 +24,7 @@ QString APP_FILENAME_DEFAULT = "MillGame"; -#ifdef QT_UI +#ifdef QT_GUI_LIB #include #include #include @@ -61,4 +61,4 @@ int main(int argc, char *argv[]) #endif // !UCT_DEMO #endif // !TRAINING_MODE -#endif // QT_UI +#endif // QT_GUI_LIB