diff options
117 files changed, 4431 insertions, 2202 deletions
@@ -93,4 +93,6 @@ a license to everyone to use it as detailed in LICENSE.) * Yu Kobayashi <yukoba@accelart.jp> * Pin Zhang <zhangpin04@gmail.com> * Nick Bray <ncbray@chromium.org> (copyright owned by Google, Inc.) +* Aidan Hobson Sayers <aidanhs@cantab.net> +* Charlie Birks <admin@daftgames.net> @@ -1,2 +1,2 @@ @echo off -python %~dp0\em++ %*
\ No newline at end of file +python "%~dp0\em++" %*
\ No newline at end of file diff --git a/em-config.bat b/em-config.bat index 63b15ea4..52d1af0e 100644 --- a/em-config.bat +++ b/em-config.bat @@ -1,2 +1,2 @@ @echo off -python %~dp0\em-config %*
\ No newline at end of file +python "%~dp0\em-config" %*
\ No newline at end of file @@ -1,2 +1,2 @@ @echo off -python %~dp0\emar %*
\ No newline at end of file +python "%~dp0\emar" %*
\ No newline at end of file @@ -1577,6 +1577,35 @@ try: js_transform_tempfiles = [final] + if memory_init_file: + if shared.Settings.USE_TYPED_ARRAYS != 2: + if type(memory_init_file) == int: logging.warning('memory init file requires typed arrays mode 2') + else: + memfile = target + '.mem' + shared.try_delete(memfile) + def repl(m): + # handle chunking of the memory initializer + s = re.sub('[\[\]\n\(\)\. ]', '', m.groups(0)[0]) + s = s.replace('concat', ',') + if s[-1] == ',': s = s[:-1] + open(memfile, 'wb').write(''.join(map(lambda x: chr(int(x or '0')), s.split(',')))) + if DEBUG: + # Copy into temp dir as well, so can be run there too + temp_memfile = os.path.join(shared.EMSCRIPTEN_TEMP_DIR, os.path.basename(memfile)) + if os.path.abspath(memfile) != os.path.abspath(memfile): + shutil.copyfile(memfile, temp_memfile) + return 'loadMemoryInitializer("%s");' % os.path.basename(memfile) + src = re.sub(shared.JS.memory_initializer_pattern, repl, open(final).read(), count=1) + open(final + '.mem.js', 'w').write( |