Major enhancements to the state web server. Added state-based shader instancing to avoid recompiles. Fixed issue #113 - Possible bug with REGAL_STATISTICS Corrected handling of GL_POINT_SIZE_MAX state in RegalState. Refreshed apitrace, civetweb, libpng, and GLEW from upstream.
31 lines
933 B
Python
Executable file
31 lines
933 B
Python
Executable file
#!/usr/bin/python -B
|
|
|
|
import re
|
|
|
|
def main():
|
|
files = [ 'regalweb.js', 'jquery.min.js', 'jquery-ui.min.js', 'jquery-ui.min.css' ]
|
|
outfile = open( '../../src/regal/RegalWebJs.h', 'w' )
|
|
outfile.write( "/* do not edit - generated via js2c.py from regalweb.js */\n" )
|
|
outfile.write( "namespace {\n\n" )
|
|
esc = re.compile(r'(\\|\")', re.VERBOSE)
|
|
rm = re.compile(r'(\.|-)', re.VERBOSE)
|
|
for f in files:
|
|
varname = rm.sub( '', f )
|
|
infile = open( f, 'r' )
|
|
lines = infile.readlines()
|
|
outfile.write( " const char * %s = \n" % varname )
|
|
for l in lines:
|
|
lp = esc.sub( r'\\\1', l.rstrip('\n') )
|
|
outfile.write( " \"%s\\n\"\n" % lp )
|
|
outfile.write( " ;\n\n" )
|
|
infile.close()
|
|
if f == 'regalweb.js':
|
|
outfile.write( "#if REGAL_HTTP_LOCAL_JQUERY\n" )
|
|
outfile.write( "#endif // REGAL_LOCAL_JQUERY\n\n" )
|
|
outfile.write( "}\n" )
|
|
outfile.close()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|
|
|