| 24 | } |
| 25 | |
| 26 | static AttributeSet ReadAttributeSet |
| 27 | ( |
| 28 | FILE *stream |
| 29 | ) { |
| 30 | //-------------------------------------------------------------------------- |
| 31 | // effect format: |
| 32 | // attribute count |
| 33 | // attributes (id,value) pair |
| 34 | //-------------------------------------------------------------------------- |
| 35 | |
| 36 | //-------------------------------------------------------------------------- |
| 37 | // read attribute count |
| 38 | //-------------------------------------------------------------------------- |
| 39 | |
| 40 | ushort attr_count; |
| 41 | fread_assert(&attr_count, sizeof(attr_count), stream); |
| 42 | |
| 43 | //-------------------------------------------------------------------------- |
| 44 | // read attributes |
| 45 | //-------------------------------------------------------------------------- |
| 46 | |
| 47 | SIValue values[attr_count]; |
| 48 | Attribute_ID ids[attr_count]; |
| 49 | |
| 50 | for(ushort i = 0; i < attr_count; i++) { |
| 51 | // read attribute ID |
| 52 | fread_assert(ids + i, sizeof(Attribute_ID), stream); |
| 53 | |
| 54 | // read attribute value |
| 55 | values[i] = SIValue_FromBinary(stream); |
| 56 | } |
| 57 | |
| 58 | AttributeSet attr_set = NULL; |
| 59 | AttributeSet_AddNoClone(&attr_set, ids, values, attr_count, false); |
| 60 | |
| 61 | return attr_set; |
| 62 | } |
| 63 | |
| 64 | static void ApplyCreateNode |
| 65 | ( |
no test coverage detected