Cocos2DXNA / cocos2d-xna

XNA Port of Cocos2d-X
www.cocos2dxna.com
227 stars 123 forks source link

Cache failed assets by type to allow content loading fallback by type #427

Closed doubleday closed 10 years ago

doubleday commented 10 years ago

Hi I created a little patch to allow content loading of native assets for CCLabelBMFont.

Problem is that the content loading fallback doesn't work in

    public static CCBMFontConfiguration Create(string fntFile)
    {
        try
        {
            return CCContentManager.SharedContentManager.Load<CCBMFontConfiguration>(fntFile);
        }
        catch (ContentLoadException)
        {
            var pRet = new CCBMFontConfiguration();
            if (pRet.InitWithFNTFile(fntFile))
            {
                return pRet;
            }
        }
        return null;
    }

InitWithFNTFile(fntFile) tries loading the asset as string but its already marked as failed asset.

Dunno if thats the right way to do it.

I'm still a bit behind master because it currently doesn't build for ios. But I think the ContentManager should merge.

totallyeviljake commented 10 years ago

Doesn't build for iOS? I build it on ios nearly every day without any problems.