Skip to content

Commit

Permalink
Fixed the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Comte committed May 11, 2016
1 parent 6e5ebc4 commit 1b45a28
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion C3DE.Editor/Controls/SceneListControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private void OnSelectedItemChanged(object sender, System.Windows.RoutedPropertyC
if (index > -1)
{
var item = sceneTreeView.Items[index] as TreeViewItem;
if (item != null)
if (item != null && item.Tag != null)
scene.SetSeletected(item.Tag.ToString());
}
}
Expand Down
8 changes: 4 additions & 4 deletions C3DE.Editor/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion C3DE/Components/Renderers/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public BoundingBox BoundingBox
/// </summary>
public Material Material
{
get { return materialIndex > -1 ? Scene.current.materials[materialIndex] : Scene.current.defaultMaterial; }
get { return materialIndex > -1 ? sceneObject.Scene.materials[materialIndex] : sceneObject.Scene.defaultMaterial; }
set { materialIndex = value.Index; }
}

Expand Down
4 changes: 2 additions & 2 deletions C3DE/Rendering/ForwardRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public override void Render(Scene scene)

protected virtual void RebuildRenderTargets()
{
if (needsBufferUpdate)
if (NeedsBufferUpdate)
{
sceneRT = new RenderTarget2D(m_graphicsDevice, m_graphicsDevice.Viewport.Width, m_graphicsDevice.Viewport.Height, false, SurfaceFormat.Color, DepthFormat.Depth24, 0, RenderTargetUsage.DiscardContents);
needsBufferUpdate = false;
NeedsBufferUpdate = false;
}
}

Expand Down
6 changes: 1 addition & 5 deletions C3DE/Rendering/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ public abstract class Renderer
{
protected GraphicsDevice m_graphicsDevice;
protected SpriteBatch m_spriteBatch;
protected bool needsBufferUpdate;
protected internal GUI uiManager;

public bool NeedsBufferUpdate
{
get; set;
}
public bool NeedsBufferUpdate { get; set; }

public Renderer()
{
Expand Down

0 comments on commit 1b45a28

Please sign in to comment.