Explorar o código

build.py: unobfuscated code.

Mr.doob %!s(int64=9) %!d(string=hai) anos
pai
achega
d220c98457
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      utils/build/build.py

+ 4 - 1
utils/build/build.py

@@ -61,7 +61,10 @@ def main(argv=None):
 			with open(filename, 'r', encoding='utf-8') as f:
 			with open(filename, 'r', encoding='utf-8') as f:
 				if filename.endswith(".glsl"):
 				if filename.endswith(".glsl"):
 					tmp.write(u'THREE.ShaderChunk[ \'' + os.path.splitext(os.path.basename(filename))[0] + u'\'] = "')
 					tmp.write(u'THREE.ShaderChunk[ \'' + os.path.splitext(os.path.basename(filename))[0] + u'\'] = "')
-					tmp.write(re.sub(r"\t*//.*\n", "", f.read()).replace('\n','\\n'))
+					text = f.read()
+					text = re.sub(r"\t*//.*\n", "", text) # strip comments
+					text = text.replace('\n','\\n') # line breaks to \n
+					tmp.write(text)
 					tmp.write(u'";\n\n')
 					tmp.write(u'";\n\n')
 				else:
 				else:
 					tmp.write(f.read())
 					tmp.write(f.read())