int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { int glDriver(); CDepthBasics kinect; Game g(kinect); std::thread glThread(glDriver), gameThread(startGame, g), cursorThread(cursorThread); kinect.Run(hInstance, nCmdShow); gameThread.join(); glThread.join(); return 0; }
void menu() { CLS; if (firstRun) { selectLang(); isAssistMode(); } firstRun = false; #ifdef _WIN32 system(Game::mainLang.title); #endif Game::mainLang.printVersion(); Game::mainLang.printMenu(); string in; cin >> in; cout << endl; if (in.length() == 1) switch (in[0]) { case '1': Game::AIFlag = NON_AI_MODE; Game::board.init(); Game::humanSide = Black; gameThread(Human, Human); case '2': Game::AIFlag = AI_MODE; Game::board.init(); Game::humanSide = Black; selectSide(); Game::diff = selectdiff(); AchillesInit(Game::diff); if (Game::humanSide == Black) gameThread(Human, AI); else gameThread(AI, Human); case '3': Game::AIFlag = AI_MODE; Game::autoFlag = true; Game::assistFlag = true; Game::board.init(); short diffB, diffW; CLS; cout << Game::mainLang.atplbs << endl << endl; diffB = selectdiff(); CLS; cout << Game::mainLang.atplws << endl << endl; diffW = selectdiff(); autoPlayThread(diffB, diffW); case '4': Game::UIFlag ^= 1; menu(); case '5': Game::board.load(); if (Game::AIFlag) { if (Game::humanSide == Black) gameThread(Human, AI); else gameThread(AI, Human); } else gameThread(Human, Human); case '6': settings(); break; case '7': Game::mainLang.help(); menu(); case '0': exit(0); } else if (in == "ABAB") debugMenu(); if (Game::debugCalled) Game::debugCalled = false; else cout << Game::mainLang.ivldipt << endl; PAUSE; menu(); }