Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Modified MetroHelper.AppDataFileExists to correctly work with files insi... #858

Merged
merged 1 commit into from

3 participants

@ananthonline

...de nested folders.

The current code doesn't handle cases where a the file is nested inside folders correctly. This methods handles that case and doesn't incorrectly throw a ContentLoadException.

@tomspilman
Owner

We to be honest that method and its caller should not exist to begin with.

MetroHelper.AppDataFileExists() is only used from the ContentManager.Normalize<>() calls. That is the old junk used to work around the content pipeline and allow the ContentManager to process files not packaged in XNBs. That system is an abomination that still lives because the content pipeline tools have not been finished yet.

That said... the Windows Metro code does not require that hack. You can completely use the stock XNA content pipeline tools in VS2010 to build content for a Metro MonoGame game.

IMO MetroHelper.cs should be removed and the Normalize() methods and the fallback to use them in the ContentManager should all be #if out for WinRT.

@ananthonline

I see. IMO, the problem with doing that is - we'll HAVE to use the XNA content pipeline, which probably means installing XNA Game Studio which has known compatibility problems with Windows 8. I prefer using the raw assets and am doing so for all platforms except Windows+XNA. Also - can we add a contentproj reference to a Metro game? If not, asset import will become a two stage process - first run them through the content processor and THEN add them to the project. I can see that modifying/editing assets will be a pain given that workflow, as opposed to just rebuilding them after modifying the linked (copy to output if newer) asset.

In either case - I needed it to even get my PNG assets loaded and therefore would like to see this change in the main repo so I can add it as a submodule as opposed to my own fork. Do let me know how to proceed! Thanks!

@KonajuGames
Owner
@tomspilman
Owner

we'll HAVE to use the XNA content pipeline

You will have to use the content pipeline with MonoGame within the next few months.

XNA Game Studio which has known compatibility problems with Windows 8

We use it on Windows 8 just fine. Making it install correctly is simple and documented.

http://blogs.msdn.com/b/astebner/archive/2012/02/29/10274694.aspx

can we add a contentproj reference to a Metro game?

Not at the moment... the WP8 SDK will allow it, but for now you need to create a VS2010 project and copy the content over when your done.

@ananthonline

Ok, that sounds good - I would be ok to get rid of these changes when a proper content pipeline in put in place. As it is, the current code doesn't work in certain cases that's definitely a problem.

@KonajuGames KonajuGames merged commit ebd4da6 into mono:develop3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 12, 2012
  1. @ananthonline
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 5 deletions.
  1. +2 −5 MonoGame.Framework/Windows8/MetroHelper.cs
View
7 MonoGame.Framework/Windows8/MetroHelper.cs
@@ -16,16 +16,13 @@ static public bool AppDataFileExists(string fileName)
try
{
- var localFolder = ApplicationData.Current.LocalFolder;
- var storageFile = await localFolder.GetFileAsync(fileName);
+ var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(fileName);
+ return file == null ? false : true;
}
catch (FileNotFoundException)
{
return false;
}
-
- return true;
-
}).Result;
return result;
Something went wrong with that request. Please try again.