Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
 public static void PurgeSharedParticleSystemCache()
 {
     if (sharedParticleSystemCache != null)
     {
         sharedParticleSystemCache.Dispose();
         sharedParticleSystemCache = null;
     }
 }
Exemplo n.º 3
0
		public static void PurgeSharedParticleSystemCache()
		{
			if (sharedParticleSystemCache != null)
			{
				sharedParticleSystemCache.Dispose();
				sharedParticleSystemCache = null;
			}
		}
Exemplo n.º 4
0
 public CCParticleSystemCache()
     : this(CCScheduler.SharedScheduler)
 {
     sharedParticleSystemCache = this;
 }
Exemplo n.º 5
0
		public CCParticleSystemCache(CCApplication application)
			: this(application.Scheduler)
		{
            sharedParticleSystemCache = this;
		}
Exemplo n.º 6
0
 public CCParticleSystemCache(CCApplication application)
     : this(application.Scheduler)
 {
     sharedParticleSystemCache = this;
 }