Feb 25, 2012 at 2:39 PM
Edited Feb 25, 2012 at 2:44 PM
I think I'm getting a little closed to solving this problem..
Currently, the error is at "_map.LoadTileSheets(_mapDisplayDevice);"
Earlier, _mapDisplayDevice is initiated as "_mapDisplayDevice = new XnaDisplayDevice(this.Content, this.GraphicsDevice);"
XnaDisplayDevice is xTile.Display.XnaDisplayDevice.
When checking the definitions in that class I found a LoadTileSheet method with the following summary:
// Loads the given tile sheet. The image source is loaded from the content pipeline
// by stripping any extension from the image source and using the resulting
// path into the content pipeline
So this XnaDisplayDevice tries to load the tilesheets through the XNA CP.. I think. Anyone have any ideas?
By looking at the source, I can see this method is implemented this way:
public void LoadTileSheet(TileSheet tileSheet)
Texture2D texture2D = m_contentManager.Load(tileSheet.ImageSource);
m_tileSheetTextures[tileSheet] = texture2D;
This is using the XNA CP, but I'd need something that works the same way, but loads from stream, similarly as I load the animations:
using (Stream titleStream = TitleContainer.OpenStream("Content/Player/" + fileName + ".png"))
anim = new Animation(Texture2D.FromStream(GraphicsDevice, titleStream), frameTime, isLooping);