vkd3d-compiler is hardly the only program to print usage instructions on all
invalid invocations, but it's rather annoying to have one's whole screen wiped
due to a typo. It also makes it hard to notice the actual error messages printed
on e.g. `vkd3d-compiler -x`.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
programs/vkd3d-compiler/main.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c
index 4d7d628ca..4e56e8fa5 100644
--- a/programs/vkd3d-compiler/main.c
+++ b/programs/vkd3d-compiler/main.c
@@ -209,6 +209,7 @@ struct options
enum vkd3d_shader_source_type source_type;
enum vkd3d_shader_target_type target_type;
bool preprocess_only;
+ bool print_help;
bool print_version;
bool print_source_types;
bool print_target_types;
@@ -446,6 +447,11 @@ static bool parse_command_line(int argc, char **argv, struct options *options)
options->preprocess_only = true;
break;
+ case 'h':
+ case OPTION_HELP:
+ options->print_help = true;
+ return true;
+
case OPTION_OUTPUT:
case 'o':
options->output_filename = optarg;
@@ -623,9 +629,12 @@ int main(int argc, char **argv)
int ret;
if (!parse_command_line(argc, argv, &options))
+ return 1;
+
+ if (options.print_help)
{
print_usage(argv[0]);
- return 1;
+ return 0;
}
if (options.print_version)
--
2.34.1
When the last vertex is coincident with the first vertex, the last
segment should be suppressed for both END_OPEN and END_CLOSED.
When the last, zero length segment is not omitted
d2d_geometry_intersect_self will add invalid segments.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51139
Signed-off-by: Stefan Brüns <stefan.bruens(a)rwth-aachen.de>
---
dlls/d2d1/geometry.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
index a7074899fda..95aaf199ad2 100644
--- a/dlls/d2d1/geometry.c
+++ b/dlls/d2d1/geometry.c
@@ -2917,8 +2917,9 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_EndFigure(ID2D1GeometrySink *ifa
{
++geometry->u.path.segment_count;
figure->flags |= D2D_FIGURE_FLAG_CLOSED;
- if (!memcmp(&figure->vertices[0], &figure->vertices[figure->vertex_count - 1], sizeof(*figure->vertices)))
- --figure->vertex_count;
+ }
+ if (!memcmp(&figure->vertices[0], &figure->vertices[figure->vertex_count - 1], sizeof(*figure->vertices))) {
+ --figure->vertex_count;
}
if (!d2d_geometry_add_figure_outline(geometry, figure, figure_end))
--
2.34.1