CI and common update:
-added webpage deploymnet stage -added separate build stage which build all binaries and generate documentation -added Emscripten build stage for merge to master only -added VBO batch rendering (current default, no render mode switch yet) -fixed camera positioning calculation -fixed buffer issue with WebGL -added viewport scalling (at least 300 pixels height). Pixels are scalled if screen is bigger. -center demos gameplay area -added fullpage html template for Emscripten build
This commit is contained in:
parent
f67eb452cc
commit
54a6d5dec2
29 changed files with 1167 additions and 322 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import ntpath
|
||||
import sys
|
||||
import imp
|
||||
|
||||
def compile(sources, output):
|
||||
files = []
|
||||
|
|
@ -36,8 +37,10 @@ compiler = 'ldc2 '
|
|||
shared_flags = ''
|
||||
clean = 0
|
||||
demo = 0
|
||||
only_bc = 0
|
||||
multi = 0
|
||||
sources = ['tests', 'source']
|
||||
emc_flags = '-s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS="[\'png\']" --preload-file assets '
|
||||
emc_flags = '-s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS="[\'png\']" '
|
||||
ldc_flags = '--d-version=ECSEmscripten --d-version=SDL_209 --d-version=BindSDL_Static --d-version=BindSDL_Image --d-version=MM_USE_POSIX_THREADS '
|
||||
import_paths = ['external/sources', 'external/imports', 'external/wasm_imports', '../source', 'utils/source', 'simple/source']
|
||||
|
||||
|
|
@ -60,6 +63,8 @@ for arg in sys.argv[1:]:
|
|||
shared_flags += '-Oz '
|
||||
elif(arg == '-g'):
|
||||
shared_flags += '-g '
|
||||
elif(arg == '--multi'):
|
||||
multi = 1
|
||||
elif(arg == '-g4'):
|
||||
ldc_flags += '-g '
|
||||
emc_flags += '-g4 --source-map-base ./ '
|
||||
|
|
@ -79,6 +84,8 @@ for arg in sys.argv[1:]:
|
|||
emc_flags += '-s USE_PTHREADS=1 '
|
||||
elif(arg == '--demo=simple'):
|
||||
demo = 0
|
||||
elif(arg == '--only-bc'):
|
||||
only_bc = 1
|
||||
else:
|
||||
print('unknown argument: ' + arg)
|
||||
exit()
|
||||
|
|
@ -92,8 +99,17 @@ compile(['source'], 'demo.bc')
|
|||
if clean or os.path.exists('../ecs.bc') == 0 or os.path.isfile('../ecs.bc') == 0:
|
||||
compile(['../source'], '../ecs.bc')
|
||||
|
||||
emcc_cmd = 'emcc -v ' + shared_flags + emc_flags + '-s ERROR_ON_UNDEFINED_SYMBOLS=0 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 -s ALLOW_MEMORY_GROWTH=1 -s MINIFY_HTML=0 -s WASM_MEM_MAX=2048MB -s MALLOC=dlmalloc -s WASM=1 -o ecs_demo.html '
|
||||
if only_bc:
|
||||
exit()
|
||||
|
||||
if multi:
|
||||
emcc_cmd = 'emcc ' + shared_flags + emc_flags + '--pre-js build/assets.js -s FORCE_FILESYSTEM=1 -s MAX_WEBGL_VERSION=2 --emrun -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 -s ALLOW_MEMORY_GROWTH=1 -s WASM_MEM_MAX=2048MB -s MALLOC=dlmalloc -s WASM=1 {0} -o {1} --shell-file emscripten_multi_shell.html '
|
||||
else:
|
||||
emcc_cmd = 'emcc ' + shared_flags + emc_flags + '--pre-js build/assets.js -s FORCE_FILESYSTEM=1 -s MAX_WEBGL_VERSION=2 --emrun -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 -s ALLOW_MEMORY_GROWTH=1 -s WASM_MEM_MAX=2048MB -s MALLOC=dlmalloc -s WASM=1 -o build/ecs_demo.html --shell-file emscripten_shell.html '
|
||||
|
||||
#emcc_cmd = 'emcc -v ' + shared_flags + emc_flags + '-s MAX_WEBGL_VERSION=2 --emrun -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 -s ALLOW_MEMORY_GROWTH=1 -s WASM_MEM_MAX=2048MB -s MALLOC=dlmalloc -s WASM=1 -o build/ecs_demo.html --shell-file emscripten_shell.html '
|
||||
#-s ALLOW_MEMORY_GROWTH=1 -s PROXY_TO_PTHREAD=1 -Wl,--no-check-features -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s TOTAL_MEMORY=512MB
|
||||
#-s MAX_WEBGL_VERSION=2
|
||||
|
||||
emcc_cmd += '../ecs.bc '
|
||||
emcc_cmd += 'utils.bc '
|
||||
|
|
@ -103,6 +119,24 @@ emcc_cmd += 'cimgui.bc '
|
|||
emcc_cmd += 'mmutils.bc '
|
||||
emcc_cmd += 'demo.bc '
|
||||
|
||||
print(emcc_cmd)
|
||||
os.system("mkdir build")
|
||||
|
||||
emscripten = imp.load_source('', os.path.expanduser("~") + '/.emscripten')
|
||||
pack_cmd = emscripten.EMSCRIPTEN_ROOT + '/tools/file_packager.py build/assets.data --preload assets --js-output=build/assets.js'
|
||||
print('Packafing files: ' + pack_cmd)
|
||||
|
||||
os.system(pack_cmd)
|
||||
|
||||
if multi:
|
||||
final_cmd = emcc_cmd.format('','build/ecs_demo.html')
|
||||
print(final_cmd)
|
||||
os.system(final_cmd)
|
||||
final_cmd = emcc_cmd.format('-s USE_PTHREADS=1','build/ecs_demo_mt.js')
|
||||
print(final_cmd)
|
||||
os.system(final_cmd)
|
||||
else:
|
||||
print(emcc_cmd)
|
||||
os.system(emcc_cmd)
|
||||
|
||||
os.system('rm build/assets.js')
|
||||
|
||||
os.system(emcc_cmd)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue