public void InitializeLightStyles() { LightStyles.Initialize(); //Reset the buffer so all styles will update in UpdateLightStyles Array.Fill(_cachedLightStyles, LightStyles.InvalidLightValue); }
public void Update(ITime engineTime, float deltaSeconds) { LightStyles.AnimateLights(engineTime); VectorUtils.AngleToVectors(Angles, out _viewAngles); foreach (IUpdateable updateable in _updateables) { updateable.Update(deltaSeconds); } }
private static async void OnLineNumbersVisiblePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { // Unpack the parameters and lock the UI Hilite_meHighlightStylePreviewControl @this = d.To <Hilite_meHighlightStylePreviewControl>(); await @this.AnimationSemaphore.WaitAsync(); // Update the preview if (@this.ReadLocalValue(HighlightStyleProperty) != DependencyProperty.UnsetValue) { bool light = LightStyles.Contains(@this.HighlightStyle); @this.FadeCanvas.Background = new SolidColorBrush(light ? Colors.White : Colors.Black); @this.WebControl.DefaultBackgroundColor = light ? Colors.White : Colors.Black; String preview = await @this.LoadHTMLPreviewAsync(); @this.WebControl.NavigateToString(preview); } @this.AnimationSemaphore.Release(); }
public void UpdateLightStyles(GraphicsDevice gd, SceneContext sc) { if (sc.LightStylesBuffer != null) { //Update the style buffer now, before anything is drawn for (var i = 0; i < BSPConstants.MaxLightStyles; ++i) { var value = LightStyles.GetStyleValue(i); if (_cachedLightStyles[i] != value) { _cachedLightStyles[i] = value; //Index is multiplied here because of padding. See buffer creation code gd.UpdateBuffer(sc.LightStylesBuffer, (uint)(i * Marshal.SizeOf <float>() * SceneContext.LightStylesElementMultiplier), ref value); } } } }