| 134 | } |
| 135 | |
| 136 | Tr2EffectConstant ReadConstant( EffectStream& stream, unsigned version ) |
| 137 | { |
| 138 | Tr2EffectConstant constant; |
| 139 | constant.name = BlueSharedString( stream.ReadString() ); |
| 140 | constant.offset = stream.Read<uint32_t>(); |
| 141 | constant.size = stream.Read<uint32_t>(); |
| 142 | if( version < 11 ) |
| 143 | { |
| 144 | uint8_t oldType = stream.Read<uint8_t>(); |
| 145 | switch( oldType ) |
| 146 | { |
| 147 | case 0: |
| 148 | constant.type = Tr2EffectConstant::FLOAT; |
| 149 | break; |
| 150 | case 1: |
| 151 | constant.type = Tr2EffectConstant::INT; |
| 152 | break; |
| 153 | case 2: |
| 154 | constant.type = Tr2EffectConstant::BOOL; |
| 155 | break; |
| 156 | default: |
| 157 | constant.type = Tr2EffectConstant::OTHER; |
| 158 | break; |
| 159 | } |
| 160 | } |
| 161 | else |
| 162 | { |
| 163 | constant.type = Tr2EffectConstant::Type( stream.Read<uint8_t>() ); |
| 164 | } |
| 165 | constant.dimension = stream.Read<uint8_t>(); |
| 166 | constant.elements = stream.Read<uint32_t>(); |
| 167 | constant.isSRGB = stream.Read<uint8_t>() != 0; |
| 168 | constant.isAutoregister = stream.Read<uint8_t>() != 0; |
| 169 | return constant; |
| 170 | } |
| 171 | |
| 172 | Tr2EffectResource ReadResource( EffectStream& stream, unsigned version ) |
| 173 | { |
no test coverage detected