Browse Source

Added relative scale flag to ParticleEmitter XML description file format.
Fixed ParticleEmitter documentation.

Lasse Öörni 14 years ago
parent
commit
97f1fbd7e1
2 changed files with 8 additions and 5 deletions
  1. 2 1
      Docs/Reference.dox
  2. 6 4
      Engine/Graphics/ParticleEmitter.cpp

+ 2 - 1
Docs/Reference.dox

@@ -644,9 +644,10 @@ Most of the parameters can take either a single value, or minimum and maximum va
 \code
 <particleemitter>
     <material name="MaterialName" />
-    <sorting enable="true|false" />
     <updateinvisible enable="true|false" />
     <relative enable="true|false" />
+    <scaled enable="true|false" />
+    <sorted enable="true|false" />
     <emittertype value="point|box|sphere" />
     <emittersize value="x y z" />
     <direction min="x1 y1 z1" max="x2 y2 z2" />

+ 6 - 4
Engine/Graphics/ParticleEmitter.cpp

@@ -85,7 +85,6 @@ void ParticleEmitter::RegisterObject(Context* context)
     ATTRIBUTE(ParticleEmitter, VAR_BOOL, "Is Visible", visible_, true, AM_DEFAULT);
     ATTRIBUTE(ParticleEmitter, VAR_BOOL, "Can Be Occluded", occludee_, true, AM_DEFAULT);
     ATTRIBUTE(ParticleEmitter, VAR_BOOL, "Cast Shadows", castShadows_, false, AM_DEFAULT);
-    ATTRIBUTE(ParticleEmitter, VAR_BOOL, "Relative Scale", scaled_, true, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(ParticleEmitter, VAR_FLOAT, "Draw Distance", GetDrawDistance, SetDrawDistance, float, 0.0f, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(ParticleEmitter, VAR_FLOAT, "Shadow Distance", GetShadowDistance, SetShadowDistance, float, 0.0f, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(ParticleEmitter, VAR_FLOAT, "Animation LOD Bias", GetAnimationLodBias, SetAnimationLodBias, float, 1.0f, AM_DEFAULT);
@@ -237,15 +236,18 @@ bool ParticleEmitter::LoadParameters(XMLFile* file)
     if (rootElem.HasChild("numparticles"))
         SetNumParticles(rootElem.GetChild("numparticles").GetInt("value"));
     
-    if (rootElem.HasChild("sorted"))
-        sorted_ = rootElem.GetChild("sorted").GetBool("enable");
-    
     if (rootElem.HasChild("updateinvisible"))
         updateInvisible_ = rootElem.GetChild("updateinvisible").GetBool("enable");
     
     if (rootElem.HasChild("relative"))
         relative_ = rootElem.GetChild("relative").GetBool("enable");
     
+    if (rootElem.HasChild("scaled"))
+        scaled_ = rootElem.GetChild("scaled").GetBool("enable");
+    
+    if (rootElem.HasChild("sorted"))
+        sorted_ = rootElem.GetChild("sorted").GetBool("enable");
+    
     if (rootElem.HasChild("animlodbias"))
         SetAnimationLodBias(rootElem.GetChild("relative").GetFloat("value"));