DPSF 2.2.2 to 2.3.0

Top  Previous  Next

1 - Removed the mcRandomNumber particle system class variable

 

Instead you should now just use the RandomNumber public property instead, so just change "mcRandomNumber" to "RandomNumber".

 

 

2 - Changed the namespace of the DPSF Demo particle systems from DPSF.ParticleSystems to DPSF_Demo.ParticleSystems

 

All of the particle systems included in the DPSF Demo used to be in the namespace DPSF.ParticleSystems, but have been changed to be in DPSF_Demo.ParticleSystems.  So if you were using one of the particle systems included in the demo and overwrite it with the new version, you may need to add a "using DPSF_Demo.ParticleSystems" statement to your code, or you change the particle system file back to using DPSF.ParticleSystems for the namespace.

 

 

3 - Moved the LerpEmittersPositionAndOrientation and LerpEmittersPositionAndOrientationOnNextUpdate properties from the particle system class to the Emitter class

 

Now that DPSF supports multiple emitters per particle system, these 2 properties have been moved from the particle system class into the Emitter class so that they can be configured individually for each emitter in the particle system.  To make it work like it did before just change:

       particleSystem.LerpEmittersPositionAndOrienation = newValue;

to:

       particleSystem.Emitter.LerpEmittersPositionAndOrientation = newValue;

 

 

4 - Changed the MagnetList property on the default particle systems from a LinkedList<DefaultParticleSystemMagnet> to a List<DefaultParticleSystemMagnet>

 

So if you were iterating over the particle system's MagnetList, you will need to change from iterating over it with LinkedListNodes to iterating over it as a regular list (e.g. use a foreach loop).

 

 

5 - Changed IDPSFParticleVertex interface to simply implement Microsoft.XNA.Framework.Graphics.IVertexType

 

If you had written your own vertex structure you will need to modify it to simply comply with the IVertexType requirements, as the IDPSFParticleVertex requirements were all removed.

 

For example, the old DefaultTexturedQuadParticleVertex was changed from:

 

       public struct DefaultTexturedQuadParticleVertex : IDPSFParticleVertex

       {

               /// <summary>

               /// The Position of the vertex in 3D space. The position of this vertex

               /// relative to the quads other three vertices determines the Particle's orientation.

               /// </summary>

               public Vector3 Position;

 

               /// <summary>

               /// The Coordinate of the Texture that this Vertex corresponds to

               /// </summary>

               public Vector2 TextureCoordinate;

 

               /// <summary>

               /// The Color to tint the Texture

               /// </summary>

               public Color Color;

 

               // Describe the vertex structure used to display a Particle

               private static readonly VertexElement[] msVertexElements =

               {

                       new VertexElement(0, VertexElementFormat.Vector3,

                                                                       VertexElementUsage.Position, 0),

 

                       new VertexElement(12, VertexElementFormat.Vector2,

                                                                        VertexElementUsage.TextureCoordinate, 0),

 

                       new VertexElement(20, VertexElementFormat.Color,

                                                                        VertexElementUsage.Color, 0)

               };

 

               // The size of the vertex structure in bytes

               private const int miSizeInBytes = 24;

 

               /// <summary>

               /// An array describing the attributes of each Vertex

               /// </summary>

               public VertexElement[] VertexElements

               {

                       get { return DefaultTexturedQuadParticleVertex.msVertexElements; }

               }

 

               /// <summary>

               /// The Size of one Vertex in Bytes

               /// </summary>

               public int SizeInBytes

               {

                       get { return DefaultTexturedQuadParticleVertex.miSizeInBytes; }

               }

       }

 

to:

 

       public struct DefaultTexturedQuadParticleVertex : IDPSFParticleVertex

       {

               /// <summary>

               /// The Position of the vertex in 3D space. The position of this vertex

               /// relative to the quads other three vertices determines the Particle's orientation.

               /// </summary>

               public Vector3 Position;

 

               /// <summary>

               /// The Coordinate of the Texture that this Vertex corresponds to

               /// </summary>

               public Vector2 TextureCoordinate;

 

               /// <summary>

               /// The Color to tint the Texture

               /// </summary>

               public Color Color;

 

               // Describe the vertex structure used to display a Particle

               private static readonly VertexDeclaration vertexDeclaration = new VertexDeclaration

               (

                       new VertexElement(0, VertexElementFormat.Vector3,

                                                                       VertexElementUsage.Position, 0),

 

                       new VertexElement(12, VertexElementFormat.Vector2,

                                                                        VertexElementUsage.TextureCoordinate, 0),

 

                       new VertexElement(20, VertexElementFormat.Color,

                                                                        VertexElementUsage.Color, 0)

               };

 

               /// <summary>

               /// An array describing the attributes of each Vertex

               /// </summary>

               public VertexDeclaration VertexDeclaration

               {

                       get { return DefaultTexturedQuadParticleVertex.vertexDeclaration; }

               }

       }

 

So you can see that the VertexElement[] array gets changed to a VertexDeclaration, the VertexElements property is removed and replaced with the VertexDeclaration property, and the SizeInBytes variable and property is removed as it is no longer needed.

 

 

6 - Changed the DPSF Splash Screen particle system to be in the DPSF.SplashScreen namespace

 

If you update the DPSF Splash Screen to the new version, you will need to add a "using DPSF.SplashScreen" to your code file so it can find the particle system class in the new namespace (or you could change the namespace of the splash screen particle system class back to DPSF.ParticleSystems).