Commit 747bf136 authored by twinaphex's avatar twinaphex
Browse files

Simplify strip_parameter_pragmas

parent 145f3ca2
...@@ -480,11 +480,11 @@ error: ...@@ -480,11 +480,11 @@ error:
return false; return false;
} }
static void gl_glsl_strip_parameter_pragmas(char *source) static void gl_glsl_strip_parameter_pragmas(char *source, const char *str)
{ {
/* #pragma parameter lines tend to have " characters in them, /* #pragma parameter lines tend to have " characters in them,
* which is not legal GLSL. */ * which is not legal GLSL. */
char *s = strstr(source, "#pragma parameter"); char *s = strstr(source, str);
while (s) while (s)
{ {
...@@ -492,7 +492,7 @@ static void gl_glsl_strip_parameter_pragmas(char *source) ...@@ -492,7 +492,7 @@ static void gl_glsl_strip_parameter_pragmas(char *source)
* so we can just replace the entire line with spaces. */ * so we can just replace the entire line with spaces. */
while (*s != '\0' && *s != '\n') while (*s != '\0' && *s != '\n')
*s++ = ' '; *s++ = ' ';
s = strstr(s, "#pragma parameter"); s = strstr(s, str);
} }
} }
...@@ -506,7 +506,7 @@ static bool gl_glsl_load_source_path(struct video_shader_pass *pass, ...@@ -506,7 +506,7 @@ static bool gl_glsl_load_source_path(struct video_shader_pass *pass,
if (nitems <= 0 || len <= 0) if (nitems <= 0 || len <= 0)
return false; return false;
gl_glsl_strip_parameter_pragmas(pass->source.string.vertex); gl_glsl_strip_parameter_pragmas(pass->source.string.vertex, "#pragma parameter");
pass->source.string.fragment = strdup(pass->source.string.vertex); pass->source.string.fragment = strdup(pass->source.string.vertex);
return pass->source.string.fragment && pass->source.string.vertex; return pass->source.string.fragment && pass->source.string.vertex;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment