Пример #1
0
        void setFullscreen(GameWindow& mWindow, bool mFullscreen)
        {
            fullscreen = mFullscreen;

            mWindow.setSize(getWidth(), getHeight());
            mWindow.setFullscreen(getFullscreen());
            mWindow.setMouseCursorVisible(Config::getMouseVisible());

            recalculateSizes();
        }
Пример #2
0
int main(int argc, char* argv[])
{
	SSVU_TEST_RUN_ALL();

	vector<string> overrideIds; for(int i{0}; i < argc; ++i) overrideIds.emplace_back(argv[i]);

	if(contains(overrideIds, "server"))
	{
		HGAssets levelOnlyAssets{true};
		Online::initializeValidators(levelOnlyAssets);
		Online::OHServer ohServer;
		ohServer.start();
		return 0;
	}

	createProfilesFolder();

	Online::initializeClient();
	Online::tryConnectToServer();

	Config::loadConfig(overrideIds);

	GameWindow window;
	window.setTitle("Open Hexagon " + toStr(Config::getVersion()) + " - by vittorio romeo");
	Config::setTimerStatic(window, Config::getTimerStatic());
	window.setSize(Config::getWidth(), Config::getHeight());
	window.setPixelMult(Config::getPixelMultiplier());
	window.setFullscreen(Config::getFullscreen());
	window.setVsync(Config::getVsync());
	window.setFPSLimited(Config::getLimitFPS());
	window.setMaxFPS(Config::getMaxFPS());
	window.setMouseCursorVisible(false);

	HGAssets assets;
	Online::initializeValidators(assets);
	HexagonGame hg{assets, window};
	MenuGame mg{assets, hg, window};
	hg.mgPtr = &mg;

	assets.refreshVolumes();
	window.setGameState(mg.getGame()); mg.init();
	window.run();

	if(Online::getLoginStatus() != Online::LoginStat::Logged) Online::logout();

	Config::saveConfig(); assets.pSaveCurrent(); saveLogToFile("log.txt");
	return 0;
}
Пример #3
0
        void setCurrentResolutionAuto(GameWindow& mWindow)
        {
            if(fullscreen)
            {
                fullscreenAutoResolution = true;
                applyAutoFullscreenResolution();
            }
            else
            {
                windowedAutoResolution = true;
                applyAutoWindowedResolution();
            }

            mWindow.setSize(getWidth(), getHeight());
            mWindow.setFullscreen(getFullscreen());
            mWindow.setMouseCursorVisible(Config::getMouseVisible());
            recalculateSizes();
        }
Пример #4
0
		void setCurrentResolution(GameWindow& mWindow, unsigned int mWidth, unsigned int mHeight)
		{
			if(fullscreen)
			{
				fullscreenAutoResolution = false;
				fullscreenWidth = mWidth;
				fullscreenHeight = mHeight;
			}
			else
			{
				windowedAutoResolution = false;
				windowedWidth = mWidth;
				windowedHeight = mHeight;
			}

			mWindow.setSize(getWidth(), getHeight());
			mWindow.setFullscreen(getFullscreen());
			mWindow.setMouseCursorVisible(false);
			recalculateSizes();
		}