| 175 | } |
| 176 | |
| 177 | BrushConstPtr parseBackBrush(Json const& brush) { |
| 178 | String material; |
| 179 | Maybe<String> mod; |
| 180 | Maybe<float> hueshift, modhueshift; |
| 181 | Maybe<MaterialColorVariant> colorVariant; |
| 182 | |
| 183 | if (brush.isType(Json::Type::Object)) { |
| 184 | material = brush.getString("material"); |
| 185 | mod = brush.optString("mod"); |
| 186 | hueshift = brush.optFloat("hueshift"); |
| 187 | modhueshift = brush.optFloat("modhueshift"); |
| 188 | colorVariant = brush.optFloat("colorVariant"); |
| 189 | } else { |
| 190 | material = brush.getString(1); |
| 191 | if (brush.size() > 2) |
| 192 | mod = brush.getString(2); |
| 193 | } |
| 194 | return make_shared<const BackBrush>(material, mod, hueshift, modhueshift, colorVariant); |
| 195 | } |
| 196 | |
| 197 | BrushConstPtr parseObjectBrush(Json const& brush) { |
| 198 | String object; |