CuteChessCoreApplication::CuteChessCoreApplication(int& argc, char* argv[]) : QCoreApplication(argc, argv), m_engineManager(0), m_gameManager(0) { Mersenne::initialize(QTime(0,0,0).secsTo(QTime::currentTime())); QCoreApplication::setOrganizationName(QLatin1String("cutechess")); QCoreApplication::setOrganizationDomain(QLatin1String("cutechess.org")); QCoreApplication::setApplicationName(QLatin1String("cutechess")); // Use Ini format on all platforms QSettings::setDefaultFormat(QSettings::IniFormat); #if QT_VERSION >= 0x050000 qInstallMessageHandler(CuteChessCoreApplication::messageHandler); #else qInstallMsgHandler(CuteChessCoreApplication::messageHandler); #endif // Load the engines QString configFile("engines.json"); if (!QFile::exists(configFile)) configFile = configPath() + "/" + configFile; engineManager()->loadEngines(configFile); }
CuteChessApplication::CuteChessApplication(int& argc, char* argv[]) : QApplication(argc, argv), m_engineManager(nullptr), m_gameManager(nullptr), m_gameDatabaseManager(nullptr), m_gameDatabaseDialog(nullptr) { Mersenne::initialize(QTime(0,0,0).msecsTo(QTime::currentTime())); // Set the application icon QIcon icon; icon.addFile(":/icons/cutechess_512x512.png"); icon.addFile(":/icons/cutechess_256x256.png"); icon.addFile(":/icons/cutechess_128x128.png"); icon.addFile(":/icons/cutechess_64x64.png"); icon.addFile(":/icons/cutechess_32x32.png"); icon.addFile(":/icons/cutechess_24x24.png"); icon.addFile(":/icons/cutechess_16x16.png"); setWindowIcon(icon); setQuitOnLastWindowClosed(false); QCoreApplication::setOrganizationName("cutechess"); QCoreApplication::setOrganizationDomain("cutechess.org"); QCoreApplication::setApplicationName("cutechess"); QCoreApplication::setApplicationVersion(CUTECHESS_VERSION); // Use Ini format on all platforms QSettings::setDefaultFormat(QSettings::IniFormat); // Load the engines engineManager()->loadEngines(configPath() + QLatin1String("/engines.json")); // Read the game database state gameDatabaseManager()->readState(configPath() + QLatin1String("/gamedb.bin")); connect(this, SIGNAL(lastWindowClosed()), this, SLOT(onLastWindowClosed())); connect(this, SIGNAL(aboutToQuit()), this, SLOT(onAboutToQuit())); }
UIManager* EngineDomain::uiManager() { return engineManager()->uiManager(); }
SceneManager* EngineDomain::sceneManager() { return engineManager()->sceneManager(); }
VisualManager* EngineDomain::visualManager() { return engineManager()->visualManager(); }
AssetManager* EngineDomain::assetManager() { return engineManager()->assetManager(); }
PhysicsManager* EngineDomain::physicsManager() { return engineManager()->physicsManager(); }
RenderingManager* EngineDomain::renderingManager() { return engineManager()->renderingManager(); }
MeshManager* EngineDomain::meshManager() { return engineManager()->meshManager(); }
FontManager* EngineDomain::fontManager() { return engineManager()->fontManager(); }
GraphicsManager* EngineDomain::graphicsManager() { return engineManager()->graphicsManager(); }
ShaderManager* EngineDomain::shaderManager() { return engineManager()->shaderManager(); }
AudioManager * EngineDomain::audioManager() { return engineManager()->audioManager(); }
InputManager* EngineDomain::inputManager() { return engineManager()->inputManager(); }
AnimationManager* EngineDomain::animationManager() { return engineManager()->animationManager(); }
PlatformManager* EngineDomain::platformManager() { return engineManager()->platformManager(); }