message: gltfpack: Slightly clean up usesTextureSet
  This makes sure we don't need to repeat the names of the textures in
  comparisons.
diff: @@ -232,53 +232,50 @@ void markNeededMaterials(cgltf_data* data, std::vector<MaterialInfo>& materials,
  }
  }
  +static bool usesTextureSet(const cgltf_texture_view& view, int set)
  +{
  + return view.texture && view.texcoord == set;
  +}
  +
  bool usesTextureSet(const cgltf_material& material, int set)
  {
  if (material.has_pbr_metallic_roughness)
  {
  - const cgltf_pbr_metallic_roughness& pbr = material.pbr_metallic_roughness;
  -
  - if (pbr.base_color_texture.texture && pbr.base_color_texture.texcoord == set)
  + if (usesTextureSet(material.pbr_metallic_roughness.base_color_texture, set))
  return true;
  - if (pbr.metallic_roughness_texture.texture && pbr.metallic_roughness_texture.texcoord == set)
  + if (usesTextureSet(material.pbr_metallic_roughness.metallic_roughness_texture, set))
  return true;
  }
  if (material.has_pbr_specular_glossiness)
  {
  - const cgltf_pbr_specular_glossiness& pbr = material.pbr_specular_glossiness;
  -
  - if (pbr.diffuse_texture.texture && pbr.diffuse_texture.texcoord == set)
  + if (usesTextureSet(material.pbr_specular_glossiness.diffuse_texture, set))
  return true;
  - if (pbr.specular_glossiness_texture.texture && pbr.specular_glossiness_texture.texcoord == set)
  + if (usesTextureSet(material.pbr_specular_glossiness.specular_glossiness_texture, set))
  return true;
  }
  if (material.has_clearcoat)
  {
  - const cgltf_clearcoat& clearcoat = material.clearcoat;
  -
  - if (clearcoat.clearcoat_texture.texture && clearcoat.clearcoat_texture.texcoord == set)
  + if (usesTextureSet(material.clearcoat.clearcoat_texture, set))
  return true;
  }
  if (material.has_transmission)
  {
  - const cgltf_transmission& transmission = material.transmission;
  -
  - if (transmission.transmission_texture.texture && transmission.transmission_texture.texcoord == set)
  + if (usesTextureSet(material.transmission.transmission_texture, set))
  return true;
  }
  - if (material.normal_texture.texture && material.normal_texture.texcoord == set)
  + if (usesTextureSet(material.normal_texture, set))
  return true;
  - if (material.occlusion_texture.texture && material.occlusion_texture.texcoord == set)
  + if (usesTextureSet(material.occlusion_texture, set))
  return true;
  - if (material.emissive_texture.texture && material.emissive_texture.texcoord == set)
  + if (usesTextureSet(material.emissive_texture, set))
  return true;
  return false;
  