コード例 #1
0
        internal static void Initialize(IServiceProvider serviceProvider, string rootDirectory)
        {
            SharedContentManager = new CCContentManager(serviceProvider, rootDirectory);
#if WINDOWS_PHONE8
            InitializeContentTypeReaders();
#endif
        }
コード例 #2
0
        void InitialiseResourceCaches()
        {
            ContentManager      = new CCContentManager(new GameServiceContainer());
            FontAtlasCache      = new CCFontAtlasCache();
            SpriteFontCache     = new CCSpriteFontCache(ContentManager);
            SpriteFrameCache    = new CCSpriteFrameCache();
            ParticleSystemCache = new CCParticleSystemCache(Scheduler);
            TextureCache        = new CCTextureCache(Scheduler);
            AnimationCache      = new CCAnimationCache();

            // Link new caches to singleton instances
            // For now, this is required because a layer's resources (e.g. sprite)
            // may be loaded prior to a gameview being associated with that layer
            CCContentManager.SharedContentManager           = ContentManager;
            CCFontAtlasCache.SharedFontAtlasCache           = FontAtlasCache;
            CCSpriteFontCache.SharedSpriteFontCache         = SpriteFontCache;
            CCSpriteFrameCache.SharedSpriteFrameCache       = SpriteFrameCache;
            CCParticleSystemCache.SharedParticleSystemCache = ParticleSystemCache;
            CCTextureCache.SharedTextureCache     = TextureCache;
            CCAnimationCache.SharedAnimationCache = AnimationCache;

            var serviceProvider = ContentManager.ServiceProvider as GameServiceContainer;

            serviceProvider.AddService(typeof(IGraphicsDeviceService), graphicsDeviceService);
        }
コード例 #3
0
        internal CCSpriteFontCache(CCContentManager cm)
        {
            FontScale = 1.0f;

            registeredFonts = new Dictionary <string, int[]>(StringComparer.OrdinalIgnoreCase);
            loadedFontsMap  = new Dictionary <string, FontMapEntry>();
            contentManager  = cm;
        }
コード例 #4
0
        protected override void LoadContent()
        {
            if (!initialized)
            {
                CCContentManager.Initialize(Game.Content.ServiceProvider, Game.Content.RootDirectory);

                base.LoadContent();

                if (ApplicationDelegate != null)
                {
                    ApplicationDelegate.ApplicationDidFinishLaunching(this, this.MainWindow);
                }

                initialized = true;
            }
            else
            {
                base.LoadContent();
            }
        }
コード例 #5
0
 internal static void Initialize(IServiceProvider serviceProvider, string rootDirectory)
 {
     SharedContentManager = new CCContentManager(serviceProvider, rootDirectory);
 }