Fix ambiguous uses of format_to

At least in MSVC (which is not restricted from targetting C++20), these can be resolved to either std::format_to or fmt::format_to (though I'm not sure why the std one is available).  We want the latter.
This commit is contained in:
Pokechu22
2022-01-12 22:52:21 -08:00
parent ac46b91673
commit 5465775d11
6 changed files with 377 additions and 368 deletions

View File

@ -256,11 +256,12 @@ struct fmt::formatter<LitChannel>
template <typename FormatContext>
auto format(const LitChannel& chan, FormatContext& ctx) const
{
return format_to(ctx.out(),
"Material source: {0}\nEnable lighting: {1}\nLight mask: {2:x} ({2:08b})\n"
"Ambient source: {3}\nDiffuse function: {4}\nAttenuation function: {5}",
chan.matsource, chan.enablelighting ? "Yes" : "No", chan.GetFullLightMask(),
chan.ambsource, chan.diffusefunc, chan.attnfunc);
return fmt::format_to(
ctx.out(),
"Material source: {0}\nEnable lighting: {1}\nLight mask: {2:x} ({2:08b})\n"
"Ambient source: {3}\nDiffuse function: {4}\nAttenuation function: {5}",
chan.matsource, chan.enablelighting ? "Yes" : "No", chan.GetFullLightMask(), chan.ambsource,
chan.diffusefunc, chan.attnfunc);
}
};
@ -278,13 +279,13 @@ struct fmt::formatter<ClipDisable>
template <typename FormatContext>
auto format(const ClipDisable& cd, FormatContext& ctx) const
{
return format_to(ctx.out(),
"Disable clipping detection: {}\n"
"Disable trivial rejection: {}\n"
"Disable cpoly clipping acceleration: {}",
cd.disable_clipping_detection ? "Yes" : "No",
cd.disable_trivial_rejection ? "Yes" : "No",
cd.disable_cpoly_clipping_acceleration ? "Yes" : "No");
return fmt::format_to(ctx.out(),
"Disable clipping detection: {}\n"
"Disable trivial rejection: {}\n"
"Disable cpoly clipping acceleration: {}",
cd.disable_clipping_detection ? "Yes" : "No",
cd.disable_trivial_rejection ? "Yes" : "No",
cd.disable_cpoly_clipping_acceleration ? "Yes" : "No");
}
};
@ -302,8 +303,8 @@ struct fmt::formatter<INVTXSPEC>
template <typename FormatContext>
auto format(const INVTXSPEC& spec, FormatContext& ctx) const
{
return format_to(ctx.out(), "Num colors: {}\nNum normals: {}\nNum textures: {}", spec.numcolors,
spec.numnormals, spec.numtextures);
return fmt::format_to(ctx.out(), "Num colors: {}\nNum normals: {}\nNum textures: {}",
spec.numcolors, spec.numnormals, spec.numtextures);
}
};
@ -326,11 +327,11 @@ struct fmt::formatter<TexMtxInfo>
template <typename FormatContext>
auto format(const TexMtxInfo& i, FormatContext& ctx) const
{
return format_to(ctx.out(),
"Projection: {}\nInput form: {}\nTex gen type: {}\n"
"Source row: {}\nEmboss source shift: {}\nEmboss light shift: {}",
i.projection, i.inputform, i.texgentype, i.sourcerow, i.embosssourceshift,
i.embosslightshift);
return fmt::format_to(ctx.out(),
"Projection: {}\nInput form: {}\nTex gen type: {}\n"
"Source row: {}\nEmboss source shift: {}\nEmboss light shift: {}",
i.projection, i.inputform, i.texgentype, i.sourcerow, i.embosssourceshift,
i.embosslightshift);
}
};
@ -349,8 +350,8 @@ struct fmt::formatter<PostMtxInfo>
template <typename FormatContext>
auto format(const PostMtxInfo& i, FormatContext& ctx) const
{
return format_to(ctx.out(), "Index: {}\nNormalize before send operation: {}", i.index,
i.normalize ? "Yes" : "No");
return fmt::format_to(ctx.out(), "Index: {}\nNormalize before send operation: {}", i.index,
i.normalize ? "Yes" : "No");
}
};