]> git.mxchange.org Git - simgear.git/blobdiff - simgear/hla/HLAArrayDataElement.hxx
hla: Add propper attribute dirty handling.
[simgear.git] / simgear / hla / HLAArrayDataElement.hxx
index de3c1d0aee945e39b5db77d0e4168795ad808818..72f1478b878476d99ae371868cc1e0819a7b197c 100644 (file)
@@ -78,6 +78,9 @@ public:
     void setDataElementFactory(DataElementFactory* dataElementFactory);
     DataElementFactory* getDataElementFactory();
 
+protected:
+    virtual void _setStamp(Stamp* stamp);
+
 private:
     HLADataElement* newElement(unsigned index);
 
@@ -112,6 +115,9 @@ public:
     void setAlternativeDataElementFactory(AlternativeDataElementFactory* alternativeDataElementFactory);
     AlternativeDataElementFactory* getAlternativeDataElementFactory();
 
+protected:
+    virtual void _setStamp(Stamp* stamp);
+
 private:
     HLAVariantRecordDataElement* newElement();
 
@@ -133,7 +139,7 @@ public:
     const std::string& getValue() const
     { return _value; }
     void setValue(const std::string& value)
-    { _value = value; }
+    { _value = value; setDirty(true); }
 
     virtual bool setNumElements(unsigned count)
     {
@@ -210,11 +216,11 @@ public:
     const SGVec2<T>& getValue() const
     { return _value; }
     void setValue(const SGVec2<T>& value)
-    { _value = value; }
+    { _value = value; setDirty(true); }
 
     virtual bool setNumElements(unsigned count)
     {
-        for (unsigned i = 2; i < count; ++i)
+        for (unsigned i = count; i < 2; ++i)
             _value[i] = 0;
         return true;
     }
@@ -302,11 +308,11 @@ public:
     const SGVec3<T>& getValue() const
     { return _value; }
     void setValue(const SGVec3<T>& value)
-    { _value = value; }
+    { _value = value; setDirty(true); }
 
     virtual bool setNumElements(unsigned count)
     {
-        for (unsigned i = 3; i < count; ++i)
+        for (unsigned i = count; i < 3; ++i)
             _value[i] = 0;
         return true;
     }
@@ -394,11 +400,11 @@ public:
     const SGVec4<T>& getValue() const
     { return _value; }
     void setValue(const SGVec4<T>& value)
-    { _value = value; }
+    { _value = value; setDirty(true); }
 
     virtual bool setNumElements(unsigned count)
     {
-        for (unsigned i = 4; i < count; ++i)
+        for (unsigned i = count; i < 4; ++i)
             _value[i] = 0;
         return true;
     }
@@ -486,11 +492,11 @@ public:
     const SGQuat<T>& getValue() const
     { return _value; }
     void setValue(const SGQuat<T>& value)
-    { _value = value; }
+    { _value = value; setDirty(true); }
 
     virtual bool setNumElements(unsigned count)
     {
-        for (unsigned i = 4; i < count; ++i)
+        for (unsigned i = count; i < 4; ++i)
             _value[i] = 0;
         return true;
     }