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

		recalculateSizes();

		mWindow.setSize(getWidth(), getHeight());
		mWindow.setFullscreen(fullscreen);
	}
Пример #2
0
		void setFullscreen(GameWindow& mWindow, bool mFullscreen)
		{
			fullscreen = mFullscreen;

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

			recalculateSizes();
		}
Пример #3
0
	void loadConfig(vector<string> mOverridesIds)
	{
		log("loading config");

		Json::Value root{getJsonFileRoot("config.json")};

		for(auto filePath : getAllFilePaths("ConfigOverrides/", ".json"))
			configOverridesRootMap.insert(make_pair(path(filePath).stem().string(), getJsonFileRoot(filePath)));

		for(string overrideId : mOverridesIds)
		{
			Json::Value overrideRoot{configOverridesRootMap.find(overrideId)->second};

			for(Json::ValueIterator itr{overrideRoot.begin()}; itr != overrideRoot.end(); itr++)
				root[itr.key().asString()] = *itr;
		}

		zoomFactor = 				root["zoom_factor"].asFloat();
		pixelMultiplier = 			root["pixel_multiplier"].asInt();
		playerSpeed = 				root["player_speed"].asFloat();
		playerFocusSpeed = 			root["player_focus_speed"].asFloat();
		playerSize = 				root["player_size"].asFloat();
		noRotation = 				root["no_rotation"].asBool();
		noBackground = 				root["no_background"].asBool();
		blackAndWhite = 			root["black_and_white"].asBool();
		noSound = 					root["no_sound"].asBool();
		noMusic = 					root["no_music"].asBool();
		soundVolume = 				root["sound_volume"].asInt();
		musicVolume = 				root["music_volume"].asInt();
		staticFrameTime = 			root["static_frametime"].asBool();
		staticFrameTimeValue = 		root["static_frametime_value"].asFloat();
		limitFps = 					root["limit_fps"].asBool();
		vsync = 					root["vsync"].asBool();
		autoZoomFactor = 			root["auto_zoom_factor"].asBool();
		fullscreen = 				root["fullscreen"].asBool();
		windowedAutoResolution =	root["windowed_auto_resolution"].asBool();
		windowedWidth = 			root["windowed_width"].asInt();
		windowedHeight = 			root["windowed_height"].asInt();
		fullscreenAutoResolution =	root["fullscreen_auto_resolution"].asBool();
		fullscreenWidth = 			root["fullscreen_width"].asInt();
		fullscreenHeight = 			root["fullscreen_height"].asInt();

		if(windowedAutoResolution)
		{
			windowedWidth = VideoMode::getDesktopMode().width;
			windowedHeight = VideoMode::getDesktopMode().height;
		}
		if(fullscreenAutoResolution)
		{
			fullscreenWidth = VideoMode::getDesktopMode().width;
			fullscreenHeight = VideoMode::getDesktopMode().height;
		}

		recalculateSizes();
	}
Пример #4
0
		void setCurrentResolutionAuto(GameWindow& mWindow)
		{
			if(fullscreen)
			{
				fullscreenAutoResolution = true;
				applyAutoFullscreenResolution();
			}
			else
			{
				windowedAutoResolution = true;
				applyAutoWindowedResolution();
			}

			mWindow.setSize(getWidth(), getHeight());
			mWindow.setFullscreen(getFullscreen());
			mWindow.setMouseCursorVisible(false);
			recalculateSizes();
		}
Пример #5
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();
		}
Пример #6
0
		void loadConfig(const vector<string>& mOverridesIds)
		{
			lo("::loadConfig") << "loading config" << endl;

			for(const auto& p : getScan<ssvufs::Mode::Single, ssvufs::Type::File, ssvufs::Pick::ByExt>("ConfigOverrides/", ".json"))
			{
				if(contains(mOverridesIds, p.getFileNameNoExtensions()))
				{
					const auto& overrideRoot(readFromFile(p));
					for(auto itr(begin(overrideRoot)); itr != end(overrideRoot); ++itr) root[getKey(itr)] = *itr;
				}
			}

			lvm.syncFromObj();

			if(getWindowedAutoResolution()) applyAutoWindowedResolution();
			if(getFullscreenAutoResolution()) applyAutoFullscreenResolution();

			recalculateSizes();

		}