summaryrefslogtreecommitdiff
path: root/gles_builders.py
diff options
context:
space:
mode:
Diffstat (limited to 'gles_builders.py')
-rw-r--r--gles_builders.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/gles_builders.py b/gles_builders.py
index b5a2b24aa3..1e63a53f1a 100644
--- a/gles_builders.py
+++ b/gles_builders.py
@@ -68,12 +68,9 @@ def include_file_in_legacygl_header(filename, header_data, depth):
line = fs.readline()
- if line.find("#ifdef ") != -1 or line.find("#elif defined(") != -1:
+ if line.find("#ifdef ") != -1:
if line.find("#ifdef ") != -1:
ifdefline = line.replace("#ifdef ", "").strip()
- else:
- ifdefline = line.replace("#elif defined(", "").strip()
- ifdefline = ifdefline.replace(")", "").strip()
if line.find("_EN_") != -1:
enumbase = ifdefline[:ifdefline.find("_EN_")]
@@ -232,7 +229,11 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
fd.write("\t_FORCE_INLINE_ int get_uniform(Uniforms p_uniform) const { return _get_uniform(p_uniform); }\n\n")
if header_data.conditionals:
fd.write("\t_FORCE_INLINE_ void set_conditional(Conditionals p_conditional,bool p_enable) { _set_conditional(p_conditional,p_enable); }\n\n")
- fd.write("\t#define _FU if (get_uniform(p_uniform)<0) return; ERR_FAIL_COND( get_active()!=this );\n\n ")
+ fd.write("\t#ifdef DEBUG_ENABLED\n ")
+ fd.write("\t#define _FU if (get_uniform(p_uniform)<0) return; if (!is_version_valid()) return; ERR_FAIL_COND( get_active()!=this ); \n\n ")
+ fd.write("\t#else\n ")
+ fd.write("\t#define _FU if (get_uniform(p_uniform)<0) return; \n\n ")
+ fd.write("\t#endif\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_value) { _FU glUniform1f(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, double p_value) { _FU glUniform1f(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint8_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")