Esempio n. 1
0
        public void Load(ContentCache cache)
        {
            Log.Write(this, "Loading texture resource for video sprite.");

            cache.Load(resource, out texture);

            pixelData = new Color[texture.Width * texture.Height];
            texture.GetData<Color>(pixelData);

            Loaded = true;
        }
Esempio n. 2
0
        public void Load(ContentCache cache)
        {
            cache.Load(resource, out font);

            Loaded = true;
        }
Esempio n. 3
0
        public virtual void Load(ContentCache cache)
        {
            Log.Write(this, "Loading game sky.");

            cache.Load(resource, out model);

            Loaded = true;
        }
Esempio n. 4
0
        public virtual void Load(ContentCache cache)
        {
            Log.Write(this, "Loading game terrain.");

            cache.Load(resource, out model);

            if (model != null)
            {
                heightMap = model.Tag as TerrainContent;

                if (heightMap == null)
                {
                    string message = "The terrain model did not have a TerrainMap " +
                    "object attached. Are you sure you are using the " +
                    "TerrainProcessor?";
                    throw new InvalidOperationException(message);
                }
            }

            Loaded = true;
        }
Esempio n. 5
0
        /// <summary>
        /// Loads graphics for the particle system.
        /// </summary>
        public void Load(ContentCache cache)
        {
            Log.Write(this, "Loading effect resource for the video particle effect.");

            cache.Load(resource, out config);

            particles = new Particle[config.MaxParticles];

            InitializeParticleEffect();

            vertexDeclaration = new VertexDeclaration(Manager.Game.GraphicsDevice,
                                                      Particle.VertexElements);

            // Create a dynamic vertex buffer.
            int size = Particle.SizeInBytes * particles.Length;

            vertexBuffer = new DynamicVertexBuffer(Manager.Game.GraphicsDevice, size,
                                                   BufferUsage.WriteOnly |
                                                   BufferUsage.Points);

            Loaded = true;
        }
Esempio n. 6
0
        public override void Load(ContentCache cache)
        {
            Log.Write(this, "Loading model resource for video model.");

            cache.Load(resource, out model);
        }
Esempio n. 7
0
        public virtual void Load(ContentCache cache)
        {
            cache.Load(resource, out texture);

            foreach (VideoEffect effect in effects)
            {
                effect.Load(cache);
            }

            Loaded = true;
        }
Esempio n. 8
0
        public void Load(ContentCache cache)
        {
            cache.Load (@"Models\skydome", out dome);
            cache.Load (@"Effects\atmosphere", out effect);

            cache.Load (@"Textures\daysky", out day);
            cache.Load (@"Textures\sunset", out sunset);
            cache.Load (@"Textures\nightsky", out night);

            effect.CurrentTechnique = effect.Techniques["SkyDome"];

            foreach (ModelMesh mesh in dome.Meshes)
            {
                foreach (ModelMeshPart part in mesh.MeshParts)
                {
                    part.Effect = effect;
                }
            }

            realTime = true;
        }
Esempio n. 9
0
        public virtual void Load(ContentCache cache)
        {
            Log.Write(this, "Loading game terrain.");

            cache.Load(modelResource, out model);
            cache.Load(textureResource, out texture);
            cache.Load(effectResource, out effect);

            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (ModelMeshPart part in mesh.MeshParts)
                {
                    part.Effect = effect;
                }
            }

            Loaded = true;
        }