private void UpdateGameSettings(GameSettingsAsset currentGameSettings) { databaseGameSettings.GetOrCreate <EditorSettings>().RenderingMode = currentGameSettings.GetOrCreate <EditorSettings>().RenderingMode; databaseGameSettings.GetOrCreate <RenderingSettings>().ColorSpace = currentGameSettings.GetOrCreate <RenderingSettings>().ColorSpace; databaseGameSettings.GetOrCreate <Navigation.NavigationSettings>().Groups = currentGameSettings.GetOrCreate <Navigation.NavigationSettings>().Groups; databaseGameSettings.GetOrCreate <RenderingSettings>().DefaultGraphicsProfile = currentGameSettings.GetOrCreate <RenderingSettings>().DefaultGraphicsProfile; }
protected override void ComputeParameterHash(BinarySerializationWriter writer) { base.ComputeParameterHash(writer); EnsureClonedSceneAndHash(); writer.Write(sceneHash); writer.Write(asset.SelectedGroups); var navigationSettings = gameSettingsAsset.GetOrCreate <NavigationSettings>(); writer.Write(navigationSettings.Groups); }
public GameStudioPreviewService(SessionViewModel session) { if (session == null) { throw new ArgumentNullException(nameof(session)); } this.session = session; Dispatcher = session.Dispatcher; AssetBuilderService = session.ServiceProvider.Get <GameStudioBuilderService>(); gameSettingsProvider = session.ServiceProvider.Get <GameSettingsProviderService>(); Logger = GlobalLogger.GetLogger("Preview"); loggerDebugPage = EditorDebugTools.CreateLogDebugPage(Logger, "Preview"); previewGameSettings = GameSettingsFactory.Create(); previewGameSettings.GetOrCreate <RenderingSettings>().DefaultGraphicsProfile = GraphicsProfile.Level_11_0; UpdateGameSettings(gameSettingsProvider.CurrentGameSettings); previewCompileContext.SetGameSettingsAsset(previewGameSettings); previewCompileContext.CompilationContext = typeof(PreviewCompilationContext); previewGameThread = new Thread(SafeAction.Wrap(StrideUIThread)) { IsBackground = true, Name = "PreviewGame Thread" }; previewGameThread.SetApartmentState(ApartmentState.STA); previewGameThread.Start(); // Wait for the window handle to be generated on the proper thread initializationSignal.WaitOne(); host = new GameEngineHost(windowHandle); session.AssetPropertiesChanged += OnAssetPropertyChanged; gameSettingsProvider.GameSettingsChanged += OnGameSettingsChanged; }
private void UpdateGameSettings(GameSettingsAsset gameSettings) { currentGameSettings = AssetCloner.Clone(gameSettings, AssetClonerFlags.RemoveUnloadableObjects); bool shouldRefreshAllThumbnails = false; if (renderingMode != gameSettings.GetOrCreate <EditorSettings>().RenderingMode) { renderingMode = gameSettings.GetOrCreate <EditorSettings>().RenderingMode; shouldRefreshAllThumbnails = true; } if (colorSpace != gameSettings.GetOrCreate <RenderingSettings>().ColorSpace) { colorSpace = gameSettings.GetOrCreate <RenderingSettings>().ColorSpace; shouldRefreshAllThumbnails = true; } if (graphicsProfile != gameSettings.GetOrCreate <RenderingSettings>().DefaultGraphicsProfile) { graphicsProfile = gameSettings.GetOrCreate <RenderingSettings>().DefaultGraphicsProfile; shouldRefreshAllThumbnails = true; } if (shouldRefreshAllThumbnails) { var allAssets = session.AllAssets.Select(x => x.AssetItem).ToList(); Task.Run(() => AddThumbnailAssetItems(allAssets, QueuePosition.First)); } }
private void UpdateGameSettings(GameSettingsAsset currentGameSettings) { previewGameSettings.GetOrCreate <EditorSettings>().RenderingMode = currentGameSettings.GetOrCreate <EditorSettings>().RenderingMode; previewGameSettings.GetOrCreate <RenderingSettings>().ColorSpace = currentGameSettings.GetOrCreate <RenderingSettings>().ColorSpace; }