From c86977ad1b22b9c68a0e74bb5ad09e021f72fac2 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Tue, 24 Jun 2025 17:51:47 +0900 Subject: [PATCH] 3d: Ensure shader fragment ends with a newline The `defines` string in load_shader() is prepended to the glsl file, but it was not terminated with a newline, so the resulting shader source looked like this: #define REIGN_ENGINE 0 #define TAPIR_ENGINE 1 #define ENGINE 1/* Copyright (C) ... * * This program is free software; ... ... This confused some OpenGL ES implementations, causing a syntax error. https://github.com/kichikuou/xsystem4-android/issues/15 --- src/3d/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3d/renderer.c b/src/3d/renderer.c index 30cf0a8..ca316be 100644 --- a/src/3d/renderer.c +++ b/src/3d/renderer.c @@ -66,7 +66,7 @@ static GLuint load_shader(const char *vertex_shader_path, const char *fragment_s snprintf(defines, sizeof(defines), "#define REIGN_ENGINE %d\n" "#define TAPIR_ENGINE %d\n" - "#define ENGINE %d", + "#define ENGINE %d\n", RE_REIGN_PLUGIN, RE_TAPIR_PLUGIN, re_plugin_version);