| 155 | } |
| 156 | |
| 157 | BrushConstPtr parseFrontBrush(Json const& brush) { |
| 158 | String material; |
| 159 | Maybe<String> mod; |
| 160 | Maybe<float> hueshift, modhueshift; |
| 161 | Maybe<MaterialColorVariant> colorVariant; |
| 162 | |
| 163 | if (brush.isType(Json::Type::Object)) { |
| 164 | material = brush.getString("material"); |
| 165 | mod = brush.optString("mod"); |
| 166 | hueshift = brush.optFloat("hueshift"); |
| 167 | modhueshift = brush.optFloat("modhueshift"); |
| 168 | colorVariant = brush.optFloat("colorVariant"); |
| 169 | } else { |
| 170 | material = brush.getString(1); |
| 171 | if (brush.size() > 2) |
| 172 | mod = brush.getString(2); |
| 173 | } |
| 174 | return make_shared<const FrontBrush>(material, mod, hueshift, modhueshift, colorVariant); |
| 175 | } |
| 176 | |
| 177 | BrushConstPtr parseBackBrush(Json const& brush) { |
| 178 | String material; |