Creating SunBurnLayer with ContentRepository and Scene file

Dec 24, 2011 at 8:27 AM

I am trying to create a SunBurnLayer with an empty content repository and empty scene so that I can use the Editor to load content, etc.

AddLayer(new SunBurnLayer(this, "Content/level1repository", "Content/Scenes/level1scene"));

I get a runtime error "Content\level1repository" not found

Dec 24, 2011 at 11:45 AM

I believe you need to drop the 'Content' part of the path. Here's how I'm setting mine up (my repository is called "Content.repo" in the root of my Content project and scene is called "ParkingLot" in the Scenes folder):

AddLayer(new SunBurnLayer(this, "Content", "Scenes/ParkingLot"

));

 

 

Dec 25, 2011 at 5:18 PM
Edited Dec 25, 2011 at 5:58 PM

Now getting this error:

 

Indiefreaks.Xna.Core.ContentLoadingException was unhandled
  Message=Cannot access a disposed object.
Object name: 'Microsoft.Xna.Framework.Content.ContentManager'.
  Source=Indiefreaks.Game.Framework
  StackTrace:
       at Indiefreaks.Xna.Core.GameState.b__2()
       at Indiefreaks.Xna.Threading.ThreadPool.Update()
       at Indiefreaks.Xna.Core.Application.Update(GameTime gameTime)
       at Microsoft.Xna.Framework.Game.Tick()
       at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.GameHost.OnIdle()
       at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
       at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
       at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Microsoft.Xna.Framework.WindowsGameHost.Run()
       at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
       at Microsoft.Xna.Framework.Game.Run()
       at Vapssky.HHProto.Boot.Main() in C:\Users\r@1d3n\Documents\DATA\Game Engine Related\Projects\HHProto\HHProto\HHProto\HHProtoApplication.cs:line 19
  InnerException: System.ObjectDisposedException
       Message=Cannot access a disposed object.
Object name: 'Microsoft.Xna.Framework.Content.ContentManager'.
       Source=Microsoft.Xna.Framework
       ObjectName=Microsoft.Xna.Framework.Content.ContentManager
       StackTrace:
            at Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName)
            at Indiefreaks.Xna.Rendering.SunBurnLayer.LoadContent(IContentCatalogue catalogue, ContentManager manager)
            at Indiefreaks.Xna.Core.ContentCatalogue.Add(IContentHost host)
            at Indiefreaks.Xna.Core.GameState.LoadAsynchronously()
            at Indiefreaks.Xna.Threading.DelegateWork.DoWork()
            at Indiefreaks.Xna.Threading.WorkItem.DoWork(Int32 expectedId)
       InnerException: 

ps: this is using 0.9.1.0 n sunburn 2.17

Coordinator
Dec 28, 2011 at 2:44 PM

I raised this issue before Christmas too and couldn't find time to work on it yet. I need to go back to the whole Application/GameState/Asynchronous loading code and process to find what is going wrong and why everything gets disposed when it shouldn't or why it tries to access something that is disposed.

I'll get back to you on this asap.