dump attributes to stream
| 208 | |
| 209 | // dump attributes to stream |
| 210 | static void EffectsBuffer_WriteAttributeSet |
| 211 | ( |
| 212 | const AttributeSet attrs, // attribute set to write to stream |
| 213 | EffectsBuffer *buff |
| 214 | ) { |
| 215 | //-------------------------------------------------------------------------- |
| 216 | // write attribute count |
| 217 | //-------------------------------------------------------------------------- |
| 218 | |
| 219 | ushort attr_count = AttributeSet_Count(attrs); |
| 220 | EffectsBuffer_WriteBytes(&attr_count, sizeof(attr_count), buff); |
| 221 | |
| 222 | //-------------------------------------------------------------------------- |
| 223 | // write attributes |
| 224 | //-------------------------------------------------------------------------- |
| 225 | |
| 226 | for(ushort i = 0; i < attr_count; i++) { |
| 227 | // get current attribute name and value |
| 228 | Attribute_ID attr_id; |
| 229 | SIValue attr = AttributeSet_GetIdx(attrs, i, &attr_id); |
| 230 | |
| 231 | // write attribute ID |
| 232 | EffectsBuffer_WriteBytes(&attr_id, sizeof(Attribute_ID), buff); |
| 233 | |
| 234 | // write attribute value |
| 235 | EffectsBuffer_WriteSIValue(&attr, buff); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | static inline void EffectsBuffer_IncEffectCount |
| 240 | ( |
no test coverage detected