force file read

Jun 4, 2009 at 10:13 PM


I wanted to know how does LoadFromDisk differ from LoadToTracker ?

What is the difference between loading directly from disk and loading from content cache?




Jun 5, 2009 at 4:15 AM


Thanks for the question.

LoadFromDisk is just a convenience method that calls LoadToTracker with a null tracker and a boolean telling it to force the file to be read from disk. LoadToTracker could probably be private, but I made it public as it could potentially be useful if you were managing your own AssetTracker objects.

Loading from the content cache is the equivalent of the default ContentManager functionality. In other words, if you've ever loaded an asset with that name before, it will just return a reference to the existing object. Loading directly from disk means that ReadAsset<T> will always be called, and the file read from the file system, regardless of whether you've previously loaded the asset before. Note that the ContentTracker still stores these assets in "List<AssetTracker> untrackedAssets" so that they can be disposed when the ContentManager is unloaded.

Jun 7, 2009 at 4:39 AM

Thanks for the reply. :)

It cleared quite a few things. Great work with the Tracker system, already using it for my game.  Looking forward to more updates.