webruby 0.2.7 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/webruby/environment.rb +24 -8
- data/lib/webruby/rake/files.rake +6 -22
- data/lib/webruby/rake/general.rake +1 -1
- data/lib/webruby/rake/mruby.rake +1 -0
- data/lib/webruby/utility.rb +14 -0
- data/modules/mruby/AUTHORS +14 -0
- data/modules/mruby/CONTRIBUTING.md +7 -4
- data/modules/mruby/INSTALL +28 -11
- data/modules/mruby/MITL +13 -13
- data/modules/mruby/Makefile +4 -5
- data/modules/mruby/README.md +54 -49
- data/modules/mruby/Rakefile +36 -6
- data/modules/mruby/benchmark/ao-render.rb +1 -2
- data/modules/mruby/benchmark/bm_app_lc_fizzbuzz.rb +52 -0
- data/modules/mruby/benchmark/fib39.rb +0 -0
- data/modules/mruby/bintest/mrbc.rb +12 -0
- data/modules/mruby/build_config.rb +32 -2
- data/modules/mruby/doc/api/README.md +30 -0
- data/modules/mruby/doc/api/mruby.h.md +69 -0
- data/modules/mruby/doc/compile/README.md +208 -99
- data/modules/mruby/doc/debugger/README.md +370 -0
- data/modules/mruby/doc/language/Core.md +1590 -0
- data/modules/mruby/doc/language/README.md +9 -0
- data/modules/mruby/doc/language/generator.rb +15 -0
- data/modules/mruby/doc/language/mrbdoc/lib/mrbdoc_analyze.rb +231 -0
- data/modules/mruby/doc/language/mrbdoc/lib/mrbdoc_docu.rb +118 -0
- data/modules/mruby/doc/language/mrbdoc/mrbdoc.rb +38 -0
- data/modules/mruby/doc/mrbconf/README.md +160 -0
- data/modules/mruby/doc/mrbgems/README.md +136 -66
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake +1 -1
- data/modules/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c +1 -1
- data/modules/mruby/examples/mrbgems/c_extension_example/mrbgem.rake +1 -1
- data/modules/mruby/examples/mrbgems/c_extension_example/src/example.c +1 -1
- data/modules/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake +1 -1
- data/modules/mruby/examples/targets/{ArduinoDue.rb → build_config_ArduinoDue.rb} +32 -6
- data/modules/mruby/examples/targets/build_config_IntelGalileo.rb +106 -0
- data/modules/mruby/examples/targets/{chipKitMax32.rb → build_config_chipKITMax32.rb} +26 -7
- data/modules/mruby/include/mrbconf.h +25 -1
- data/modules/mruby/include/mruby/array.h +32 -22
- data/modules/mruby/include/mruby/boxing_nan.h +94 -0
- data/modules/mruby/include/mruby/boxing_no.h +49 -0
- data/modules/mruby/include/mruby/boxing_word.h +119 -0
- data/modules/mruby/include/mruby/class.h +15 -13
- data/modules/mruby/include/mruby/compile.h +43 -36
- data/modules/mruby/include/mruby/data.h +13 -5
- data/modules/mruby/include/mruby/debug.h +9 -9
- data/modules/mruby/include/mruby/dump.h +32 -23
- data/modules/mruby/include/mruby/error.h +36 -0
- data/modules/mruby/include/mruby/gc.h +11 -6
- data/modules/mruby/include/mruby/hash.h +12 -12
- data/modules/mruby/include/mruby/irep.h +9 -3
- data/modules/mruby/include/mruby/khash.h +58 -41
- data/modules/mruby/include/mruby/numeric.h +38 -4
- data/modules/mruby/include/mruby/object.h +55 -0
- data/modules/mruby/include/mruby/opcode.h +160 -0
- data/modules/mruby/include/mruby/proc.h +19 -5
- data/modules/mruby/include/mruby/range.h +4 -3
- data/modules/mruby/include/mruby/re.h +20 -0
- data/modules/mruby/include/mruby/string.h +86 -47
- data/modules/mruby/include/mruby/value.h +100 -374
- data/modules/mruby/include/mruby/variable.h +34 -32
- data/modules/mruby/include/mruby/version.h +40 -0
- data/modules/mruby/include/mruby.h +211 -139
- data/modules/mruby/minirake +16 -9
- data/modules/mruby/mrbgems/default.gembox +12 -0
- data/modules/mruby/mrbgems/full-core.gembox +3 -3
- data/modules/mruby/mrbgems/mruby-array-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +488 -8
- data/modules/mruby/mrbgems/mruby-array-ext/src/array.c +57 -31
- data/modules/mruby/mrbgems/mruby-array-ext/test/array.rb +231 -45
- data/modules/mruby/mrbgems/mruby-bin-debugger/bintest/mrdb.rb +286 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/bintest/print.rb +701 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/mrbgem.rake +9 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +516 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.h +26 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c +235 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.h +14 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +78 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.h +13 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c +428 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c +501 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +58 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c +54 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +746 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +163 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +16 -0
- data/modules/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdberror.h +20 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/bintest/mirb.rb +12 -0
- data/modules/mruby/mrbgems/mruby-bin-mirb/mrbgem.rake +14 -1
- data/modules/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +154 -72
- data/modules/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +46 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +37 -28
- data/modules/mruby/mrbgems/mruby-bin-mruby-config/mrbgem.rake +30 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby-config/mruby-config +16 -0
- data/modules/mruby/mrbgems/mruby-bin-mruby-config/mruby-config.bat +30 -0
- data/modules/mruby/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb +73 -0
- data/modules/mruby/mrbgems/mruby-bin-strip/mrbgem.rake +6 -0
- data/modules/mruby/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c +155 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +555 -21
- data/modules/mruby/mrbgems/mruby-enum-ext/test/enum.rb +119 -0
- data/modules/mruby/mrbgems/mruby-enum-lazy/mrbgem.rake +7 -0
- data/modules/mruby/mrbgems/mruby-enum-lazy/mrblib/lazy.rb +150 -0
- data/modules/mruby/mrbgems/mruby-enum-lazy/test/lazy.rb +47 -0
- data/modules/mruby/mrbgems/mruby-enumerator/mrbgem.rake +7 -0
- data/modules/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +636 -0
- data/modules/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +537 -0
- data/modules/mruby/mrbgems/mruby-eval/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-eval/src/eval.c +243 -4
- data/modules/mruby/mrbgems/mruby-eval/test/eval.rb +80 -0
- data/modules/mruby/mrbgems/mruby-exit/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-exit/src/mruby-exit.c +1 -1
- data/modules/mruby/mrbgems/mruby-fiber/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-fiber/src/fiber.c +157 -51
- data/modules/mruby/mrbgems/mruby-fiber/test/fiber.rb +179 -35
- data/modules/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +3 -0
- data/modules/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +241 -1
- data/modules/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +11 -19
- data/modules/mruby/mrbgems/mruby-hash-ext/test/hash.rb +138 -1
- data/modules/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +5 -0
- data/modules/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +183 -0
- data/modules/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +53 -0
- data/modules/mruby/mrbgems/mruby-math/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-math/src/math.c +107 -14
- data/modules/mruby/mrbgems/mruby-math/test/math.rb +16 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +5 -0
- data/modules/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +9 -1
- data/modules/mruby/mrbgems/mruby-object-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +19 -0
- data/modules/mruby/mrbgems/mruby-object-ext/src/object.c +5 -8
- data/modules/mruby/mrbgems/mruby-object-ext/test/object.rb +16 -0
- data/modules/mruby/mrbgems/mruby-objectspace/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +121 -53
- data/modules/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +27 -4
- data/modules/mruby/mrbgems/mruby-print/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-print/src/print.c +3 -5
- data/modules/mruby/mrbgems/mruby-proc-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/src/proc.c +89 -19
- data/modules/mruby/mrbgems/mruby-proc-ext/test/proc.c +56 -0
- data/modules/mruby/mrbgems/mruby-proc-ext/test/proc.rb +47 -0
- data/modules/mruby/mrbgems/mruby-random/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.c +30 -25
- data/modules/mruby/mrbgems/mruby-random/src/mt19937ar.h +6 -3
- data/modules/mruby/mrbgems/mruby-random/src/random.c +157 -137
- data/modules/mruby/mrbgems/mruby-random/src/random.h +3 -3
- data/modules/mruby/mrbgems/mruby-random/test/random.rb +9 -9
- data/modules/mruby/mrbgems/mruby-range-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-range-ext/src/range.c +57 -3
- data/modules/mruby/mrbgems/mruby-range-ext/test/range.rb +9 -0
- data/modules/mruby/mrbgems/mruby-sprintf/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-sprintf/mrblib/string.rb +9 -0
- data/modules/mruby/mrbgems/mruby-sprintf/src/sprintf.c +29 -23
- data/modules/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +7 -2
- data/modules/mruby/mrbgems/mruby-string-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +250 -11
- data/modules/mruby/mrbgems/mruby-string-ext/src/string.c +220 -5
- data/modules/mruby/mrbgems/mruby-string-ext/test/string.rb +326 -4
- data/modules/mruby/mrbgems/mruby-string-utf8/mrbgem.rake +2 -0
- data/modules/mruby/mrbgems/mruby-string-utf8/src/string.c +486 -52
- data/modules/mruby/mrbgems/mruby-string-utf8/test/string.rb +97 -14
- data/modules/mruby/mrbgems/mruby-struct/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-struct/mrblib/struct.rb +31 -0
- data/modules/mruby/mrbgems/mruby-struct/src/struct.c +178 -196
- data/modules/mruby/mrbgems/mruby-struct/test/struct.rb +115 -61
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-symbol-ext/mrblib/symbol.rb +22 -17
- data/modules/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +20 -11
- data/modules/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +14 -0
- data/modules/mruby/mrbgems/mruby-time/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-time/mrblib/time.rb +9 -0
- data/modules/mruby/mrbgems/mruby-time/src/time.c +98 -37
- data/modules/mruby/mrbgems/mruby-time/test/time.rb +152 -148
- data/modules/mruby/mrbgems/mruby-toplevel-ext/mrbgem.rake +1 -0
- data/modules/mruby/mrbgems/mruby-toplevel-ext/test/toplevel.rb +1 -1
- data/modules/mruby/mrblib/array.rb +110 -4
- data/modules/mruby/mrblib/class.rb +1 -22
- data/modules/mruby/mrblib/compar.rb +10 -30
- data/modules/mruby/mrblib/enum.rb +64 -52
- data/modules/mruby/mrblib/error.rb +9 -4
- data/modules/mruby/mrblib/hash.rb +164 -23
- data/modules/mruby/mrblib/kernel.rb +26 -22
- data/modules/mruby/mrblib/mrblib.rake +4 -4
- data/modules/mruby/mrblib/numeric.rb +22 -9
- data/modules/mruby/mrblib/range.rb +24 -2
- data/modules/mruby/mrblib/string.rb +15 -3
- data/modules/mruby/src/array.c +279 -339
- data/modules/mruby/src/backtrace.c +68 -16
- data/modules/mruby/src/class.c +539 -379
- data/modules/mruby/src/codegen.c +424 -207
- data/modules/mruby/src/compar.c +1 -1
- data/modules/mruby/src/crc.c +7 -6
- data/modules/mruby/src/debug.c +37 -36
- data/modules/mruby/src/dump.c +463 -213
- data/modules/mruby/src/enum.c +1 -1
- data/modules/mruby/src/error.c +91 -92
- data/modules/mruby/src/error.h +3 -19
- data/modules/mruby/src/etc.c +85 -82
- data/modules/mruby/src/gc.c +134 -108
- data/modules/mruby/src/hash.c +161 -565
- data/modules/mruby/src/init.c +2 -13
- data/modules/mruby/src/kernel.c +217 -251
- data/modules/mruby/src/load.c +280 -283
- data/modules/mruby/src/mrb_throw.h +41 -0
- data/modules/mruby/src/mruby_core.rake +57 -7
- data/modules/mruby/src/node.h +104 -104
- data/modules/mruby/src/numeric.c +221 -208
- data/modules/mruby/src/object.c +41 -42
- data/modules/mruby/src/opcode.h +2 -160
- data/modules/mruby/src/parse.y +3430 -3223
- data/modules/mruby/src/pool.c +13 -9
- data/modules/mruby/src/print.c +20 -17
- data/modules/mruby/src/proc.c +77 -21
- data/modules/mruby/src/range.c +55 -45
- data/modules/mruby/src/state.c +95 -31
- data/modules/mruby/src/string.c +462 -468
- data/modules/mruby/src/symbol.c +95 -85
- data/modules/mruby/src/variable.c +104 -74
- data/modules/mruby/src/version.c +13 -0
- data/modules/mruby/src/vm.c +528 -296
- data/modules/mruby/tasks/libmruby.rake +9 -5
- data/modules/mruby/tasks/mrbgem_spec.rake +130 -26
- data/modules/mruby/tasks/mrbgems.rake +21 -11
- data/modules/mruby/tasks/mrbgems_test.rake +46 -40
- data/modules/mruby/tasks/mruby_build.rake +54 -12
- data/modules/mruby/tasks/mruby_build_commands.rake +34 -5
- data/modules/mruby/tasks/mruby_build_gem.rake +25 -3
- data/modules/mruby/tasks/ruby_ext.rake +11 -2
- data/modules/mruby/tasks/toolchains/clang.rake +2 -1
- data/modules/mruby/tasks/toolchains/gcc.rake +26 -3
- data/modules/mruby/tasks/toolchains/visualcpp.rake +17 -8
- data/modules/mruby/test/assert.rb +30 -8
- data/modules/mruby/test/bintest.rb +10 -0
- data/modules/mruby/test/driver.c +74 -24
- data/modules/mruby/test/init_mrbtest.c +21 -2
- data/modules/mruby/test/mrbtest.rake +27 -5
- data/modules/mruby/test/t/argumenterror.rb +0 -5
- data/modules/mruby/test/t/array.rb +23 -7
- data/modules/mruby/test/t/bs_block.rb +32 -0
- data/modules/mruby/test/t/class.rb +29 -5
- data/modules/mruby/test/t/comparable.rb +20 -12
- data/modules/mruby/test/t/enumerable.rb +33 -7
- data/modules/mruby/test/t/exception.rb +63 -38
- data/modules/mruby/test/t/false.rb +2 -4
- data/modules/mruby/test/t/float.rb +39 -4
- data/modules/mruby/test/t/hash.rb +40 -6
- data/modules/mruby/test/t/indexerror.rb +0 -4
- data/modules/mruby/test/t/integer.rb +41 -5
- data/modules/mruby/test/t/kernel.rb +90 -3
- data/modules/mruby/test/t/localjumperror.rb +4 -4
- data/modules/mruby/test/t/methods.rb +1 -1
- data/modules/mruby/test/t/module.rb +43 -13
- data/modules/mruby/test/t/nameerror.rb +0 -4
- data/modules/mruby/test/t/nil.rb +5 -0
- data/modules/mruby/test/t/nomethoderror.rb +11 -2
- data/modules/mruby/test/t/numeric.rb +18 -4
- data/modules/mruby/test/t/proc.rb +59 -6
- data/modules/mruby/test/t/range.rb +15 -5
- data/modules/mruby/test/t/rangeerror.rb +0 -4
- data/modules/mruby/test/t/standarderror.rb +0 -4
- data/modules/mruby/test/t/string.rb +56 -12
- data/modules/mruby/test/t/superclass.rb +46 -0
- data/modules/mruby/test/t/symbol.rb +0 -4
- data/modules/mruby/test/t/syntax.rb +134 -1
- data/modules/mruby/test/t/true.rb +2 -4
- data/modules/mruby/test/t/typeerror.rb +0 -5
- data/modules/mruby/test/t/unicode.rb +35 -0
- data/modules/mruby/tools/mrbc/mrbc.c +9 -12
- data/modules/mruby/travis_config.rb +22 -2
- metadata +98 -1299
- data/modules/emscripten/AUTHORS +0 -117
- data/modules/emscripten/CONTRIBUTING.markdown +0 -5
- data/modules/emscripten/ChangeLog +0 -468
- data/modules/emscripten/LICENSE +0 -94
- data/modules/emscripten/README.markdown +0 -14
- data/modules/emscripten/cmake/Modules/FindOpenAL.cmake +0 -26
- data/modules/emscripten/cmake/Platform/Emscripten.cmake +0 -228
- data/modules/emscripten/em++ +0 -12
- data/modules/emscripten/em++.bat +0 -2
- data/modules/emscripten/em-config +0 -24
- data/modules/emscripten/em-config.bat +0 -2
- data/modules/emscripten/emar +0 -24
- data/modules/emscripten/emar.bat +0 -2
- data/modules/emscripten/emcc +0 -2069
- data/modules/emscripten/emcc.bat +0 -2
- data/modules/emscripten/emcc.py +0 -5
- data/modules/emscripten/emconfigure +0 -27
- data/modules/emscripten/emconfigure.bat +0 -2
- data/modules/emscripten/emlink.py +0 -33
- data/modules/emscripten/emmake +0 -29
- data/modules/emscripten/emmake.bat +0 -2
- data/modules/emscripten/emranlib +0 -9
- data/modules/emscripten/emranlib.bat +0 -2
- data/modules/emscripten/emrun +0 -1087
- data/modules/emscripten/emrun.bat +0 -2
- data/modules/emscripten/emscons +0 -20
- data/modules/emscripten/emscripten.py +0 -1347
- data/modules/emscripten/package.json +0 -7
- data/modules/emscripten/patches/README +0 -4
- data/modules/emscripten/patches/series +0 -2
- data/modules/emscripten/scons-tools/closure.py +0 -28
- data/modules/emscripten/scons-tools/emscripten.py +0 -364
- data/modules/emscripten/scons-tools/llvm.py +0 -34
- data/modules/emscripten/src/analyzer.js +0 -1781
- data/modules/emscripten/src/closure-externs.js +0 -110
- data/modules/emscripten/src/compiler.html +0 -48
- data/modules/emscripten/src/compiler.js +0 -331
- data/modules/emscripten/src/compiler_phase.html +0 -33
- data/modules/emscripten/src/corruptionCheck.js +0 -98
- data/modules/emscripten/src/determinstic.js +0 -20
- data/modules/emscripten/src/embind/embind.js +0 -1677
- data/modules/emscripten/src/embind/emval.js +0 -284
- data/modules/emscripten/src/emrun_postjs.js +0 -20
- data/modules/emscripten/src/emrun_prejs.js +0 -5
- data/modules/emscripten/src/emscripten-source-map.min.js +0 -31
- data/modules/emscripten/src/experimental/allow_loopvars_from_memsetcpy_inasm.diff +0 -97
- data/modules/emscripten/src/experimental/batching.diff +0 -44
- data/modules/emscripten/src/experimental/functypeopt.diff +0 -113
- data/modules/emscripten/src/experimental/multiple_heaps.diff +0 -175
- data/modules/emscripten/src/experimental/noncallgraphprofiling.diff +0 -197
- data/modules/emscripten/src/experimental/optimize_memcpy_for_ta1.diff +0 -124
- data/modules/emscripten/src/experimental/remove__label__s.diff +0 -140
- data/modules/emscripten/src/experimental/renderer_cache_hash.diff +0 -99
- data/modules/emscripten/src/experimental/sdl_key_forwarding.diff +0 -57
- data/modules/emscripten/src/experimental/simplifyGeneratedFunctionsDetection.diff +0 -336
- data/modules/emscripten/src/experimental/stringCache.diff +0 -147
- data/modules/emscripten/src/fastLong.js +0 -299
- data/modules/emscripten/src/gl-matrix.js +0 -1952
- data/modules/emscripten/src/headless.js +0 -295
- data/modules/emscripten/src/headlessCanvas.js +0 -618
- data/modules/emscripten/src/hello_world.js +0 -92
- data/modules/emscripten/src/intertyper.js +0 -1228
- data/modules/emscripten/src/jsifier.js +0 -1969
- data/modules/emscripten/src/library.js +0 -9196
- data/modules/emscripten/src/library_browser.js +0 -988
- data/modules/emscripten/src/library_egl.js +0 -564
- data/modules/emscripten/src/library_fs.js +0 -1619
- data/modules/emscripten/src/library_gc.js +0 -236
- data/modules/emscripten/src/library_gl.js +0 -5194
- data/modules/emscripten/src/library_glfw.js +0 -585
- data/modules/emscripten/src/library_glut.js +0 -504
- data/modules/emscripten/src/library_idbfs.js +0 -216
- data/modules/emscripten/src/library_jansson.js +0 -320
- data/modules/emscripten/src/library_memfs.js +0 -303
- data/modules/emscripten/src/library_nodefs.js +0 -286
- data/modules/emscripten/src/library_openal.js +0 -915
- data/modules/emscripten/src/library_path.js +0 -133
- data/modules/emscripten/src/library_sdl.js +0 -2728
- data/modules/emscripten/src/library_sockfs.js +0 -578
- data/modules/emscripten/src/library_strtok_r.c +0 -97
- data/modules/emscripten/src/library_tty.js +0 -146
- data/modules/emscripten/src/library_uuid.js +0 -140
- data/modules/emscripten/src/library_xlib.js +0 -23
- data/modules/emscripten/src/long.js +0 -1609
- data/modules/emscripten/src/modules.js +0 -543
- data/modules/emscripten/src/parseTools.js +0 -2723
- data/modules/emscripten/src/postamble.js +0 -239
- data/modules/emscripten/src/postamble_sharedlib.js +0 -16
- data/modules/emscripten/src/preamble.js +0 -1233
- data/modules/emscripten/src/preamble_sharedlib.js +0 -25
- data/modules/emscripten/src/proxyClient.js +0 -82
- data/modules/emscripten/src/proxyWorker.js +0 -143
- data/modules/emscripten/src/relooper/README.markdown +0 -14
- data/modules/emscripten/src/relooper/Relooper.cpp +0 -1301
- data/modules/emscripten/src/relooper/Relooper.h +0 -257
- data/modules/emscripten/src/relooper/doit.sh +0 -70
- data/modules/emscripten/src/relooper/emscripten/glue.js +0 -67
- data/modules/emscripten/src/relooper/emscripten/test.js +0 -44
- data/modules/emscripten/src/relooper/fuzzer.py +0 -131
- data/modules/emscripten/src/relooper/ministring.h +0 -35
- data/modules/emscripten/src/relooper/paper.pdf +0 -0
- data/modules/emscripten/src/relooper/test.cpp +0 -290
- data/modules/emscripten/src/relooper/test.txt +0 -317
- data/modules/emscripten/src/relooper/test2.c +0 -44
- data/modules/emscripten/src/relooper/test2.txt +0 -26
- data/modules/emscripten/src/relooper/test3.c +0 -42
- data/modules/emscripten/src/relooper/test3.txt +0 -56
- data/modules/emscripten/src/relooper/test4.cpp +0 -40
- data/modules/emscripten/src/relooper/test4.txt +0 -44
- data/modules/emscripten/src/relooper/test5.cpp +0 -40
- data/modules/emscripten/src/relooper/test5.txt +0 -56
- data/modules/emscripten/src/relooper/test6.cpp +0 -31
- data/modules/emscripten/src/relooper/test6.txt +0 -26
- data/modules/emscripten/src/relooper/test_dead.cpp +0 -28
- data/modules/emscripten/src/relooper/test_dead.txt +0 -9
- data/modules/emscripten/src/relooper/test_debug.cpp +0 -30
- data/modules/emscripten/src/relooper/test_debug.txt +0 -142
- data/modules/emscripten/src/relooper/test_fuzz1.cpp +0 -52
- data/modules/emscripten/src/relooper/test_fuzz1.txt +0 -72
- data/modules/emscripten/src/relooper/test_fuzz2.cpp +0 -34
- data/modules/emscripten/src/relooper/test_fuzz2.txt +0 -30
- data/modules/emscripten/src/relooper/test_fuzz3.cpp +0 -36
- data/modules/emscripten/src/relooper/test_fuzz3.txt +0 -25
- data/modules/emscripten/src/relooper/test_fuzz4.cpp +0 -38
- data/modules/emscripten/src/relooper/test_fuzz4.txt +0 -41
- data/modules/emscripten/src/relooper/test_fuzz5.cpp +0 -57
- data/modules/emscripten/src/relooper/test_fuzz5.txt +0 -86
- data/modules/emscripten/src/relooper/test_fuzz6.cpp +0 -322
- data/modules/emscripten/src/relooper/test_fuzz6.txt +0 -291
- data/modules/emscripten/src/relooper/test_inf.cpp +0 -813
- data/modules/emscripten/src/relooper/test_inf.txt +0 -1131
- data/modules/emscripten/src/relooper/testit.sh +0 -62
- data/modules/emscripten/src/relooper/updateit.sh +0 -17
- data/modules/emscripten/src/runtime.js +0 -604
- data/modules/emscripten/src/settings.js +0 -476
- data/modules/emscripten/src/shell.html +0 -95
- data/modules/emscripten/src/shell.js +0 -173
- data/modules/emscripten/src/shell_sharedlib.js +0 -29
- data/modules/emscripten/src/simd.js +0 -1128
- data/modules/emscripten/src/socket.io.js +0 -3870
- data/modules/emscripten/src/struct_info.json +0 -1077
- data/modules/emscripten/src/utility.js +0 -411
- data/modules/emscripten/src/wrtcp.js +0 -821
- data/modules/emscripten/system/bin/sdl-config +0 -13
- data/modules/emscripten/system/include/AL/al.h +0 -172
- data/modules/emscripten/system/include/AL/alc.h +0 -84
- data/modules/emscripten/system/include/EGL/egl.h +0 -329
- data/modules/emscripten/system/include/EGL/eglext.h +0 -398
- data/modules/emscripten/system/include/EGL/eglplatform.h +0 -141
- data/modules/emscripten/system/include/GL/freeglut_std.h +0 -628
- data/modules/emscripten/system/include/GL/gl.h +0 -2241
- data/modules/emscripten/system/include/GL/glew.h +0 -6
- data/modules/emscripten/system/include/GL/glext.h +0 -11127
- data/modules/emscripten/system/include/GL/glfw.h +0 -518
- data/modules/emscripten/system/include/GL/glu.h +0 -353
- data/modules/emscripten/system/include/GL/glut.h +0 -21
- data/modules/emscripten/system/include/GLES/gl.h +0 -770
- data/modules/emscripten/system/include/GLES/glext.h +0 -1278
- data/modules/emscripten/system/include/GLES/glplatform.h +0 -30
- data/modules/emscripten/system/include/GLES2/gl2.h +0 -621
- data/modules/emscripten/system/include/GLES2/gl2ext.h +0 -803
- data/modules/emscripten/system/include/GLES2/gl2platform.h +0 -30
- data/modules/emscripten/system/include/KHR/khrplatform.h +0 -277
- data/modules/emscripten/system/include/SDL/COPYING +0 -19
- data/modules/emscripten/system/include/SDL/SDL.h +0 -162
- data/modules/emscripten/system/include/SDL/SDL_assert.h +0 -241
- data/modules/emscripten/system/include/SDL/SDL_atomic.h +0 -318
- data/modules/emscripten/system/include/SDL/SDL_audio.h +0 -509
- data/modules/emscripten/system/include/SDL/SDL_blendmode.h +0 -60
- data/modules/emscripten/system/include/SDL/SDL_clipboard.h +0 -75
- data/modules/emscripten/system/include/SDL/SDL_compat.h +0 -365
- data/modules/emscripten/system/include/SDL/SDL_config.h +0 -48
- data/modules/emscripten/system/include/SDL/SDL_config.h.in +0 -297
- data/modules/emscripten/system/include/SDL/SDL_config_android.h +0 -133
- data/modules/emscripten/system/include/SDL/SDL_config_iphoneos.h +0 -148
- data/modules/emscripten/system/include/SDL/SDL_config_macosx.h +0 -172
- data/modules/emscripten/system/include/SDL/SDL_config_minimal.h +0 -74
- data/modules/emscripten/system/include/SDL/SDL_config_nintendods.h +0 -129
- data/modules/emscripten/system/include/SDL/SDL_config_pandora.h +0 -125
- data/modules/emscripten/system/include/SDL/SDL_config_windows.h +0 -207
- data/modules/emscripten/system/include/SDL/SDL_config_wiz.h +0 -119
- data/modules/emscripten/system/include/SDL/SDL_copying.h +0 -20
- data/modules/emscripten/system/include/SDL/SDL_cpuinfo.h +0 -150
- data/modules/emscripten/system/include/SDL/SDL_endian.h +0 -248
- data/modules/emscripten/system/include/SDL/SDL_error.h +0 -77
- data/modules/emscripten/system/include/SDL/SDL_events.h +0 -640
- data/modules/emscripten/system/include/SDL/SDL_gesture.h +0 -91
- data/modules/emscripten/system/include/SDL/SDL_gfxPrimitives.h +0 -246
- data/modules/emscripten/system/include/SDL/SDL_haptic.h +0 -1200
- data/modules/emscripten/system/include/SDL/SDL_hints.h +0 -206
- data/modules/emscripten/system/include/SDL/SDL_image.h +0 -138
- data/modules/emscripten/system/include/SDL/SDL_input.h +0 -87
- data/modules/emscripten/system/include/SDL/SDL_joystick.h +0 -208
- data/modules/emscripten/system/include/SDL/SDL_keyboard.h +0 -169
- data/modules/emscripten/system/include/SDL/SDL_keycode.h +0 -344
- data/modules/emscripten/system/include/SDL/SDL_loadso.h +0 -85
- data/modules/emscripten/system/include/SDL/SDL_log.h +0 -211
- data/modules/emscripten/system/include/SDL/SDL_main.h +0 -98
- data/modules/emscripten/system/include/SDL/SDL_mixer.h +0 -634
- data/modules/emscripten/system/include/SDL/SDL_mouse.h +0 -213
- data/modules/emscripten/system/include/SDL/SDL_mutex.h +0 -248
- data/modules/emscripten/system/include/SDL/SDL_name.h +0 -11
- data/modules/emscripten/system/include/SDL/SDL_opengl.h +0 -11116
- data/modules/emscripten/system/include/SDL/SDL_opengles.h +0 -38
- data/modules/emscripten/system/include/SDL/SDL_opengles2.h +0 -38
- data/modules/emscripten/system/include/SDL/SDL_pixels.h +0 -423
- data/modules/emscripten/system/include/SDL/SDL_platform.h +0 -160
- data/modules/emscripten/system/include/SDL/SDL_power.h +0 -79
- data/modules/emscripten/system/include/SDL/SDL_quit.h +0 -58
- data/modules/emscripten/system/include/SDL/SDL_rect.h +0 -136
- data/modules/emscripten/system/include/SDL/SDL_render.h +0 -615
- data/modules/emscripten/system/include/SDL/SDL_revision.h +0 -2
- data/modules/emscripten/system/include/SDL/SDL_revision.h.orig +0 -2
- data/modules/emscripten/system/include/SDL/SDL_rotozoom.h +0 -123
- data/modules/emscripten/system/include/SDL/SDL_rwops.h +0 -220
- data/modules/emscripten/system/include/SDL/SDL_scancode.h +0 -398
- data/modules/emscripten/system/include/SDL/SDL_shape.h +0 -147
- data/modules/emscripten/system/include/SDL/SDL_stdinc.h +0 -764
- data/modules/emscripten/system/include/SDL/SDL_surface.h +0 -499
- data/modules/emscripten/system/include/SDL/SDL_syswm.h +0 -241
- data/modules/emscripten/system/include/SDL/SDL_thread.h +0 -182
- data/modules/emscripten/system/include/SDL/SDL_timer.h +0 -108
- data/modules/emscripten/system/include/SDL/SDL_touch.h +0 -124
- data/modules/emscripten/system/include/SDL/SDL_ttf.h +0 -249
- data/modules/emscripten/system/include/SDL/SDL_types.h +0 -29
- data/modules/emscripten/system/include/SDL/SDL_version.h +0 -166
- data/modules/emscripten/system/include/SDL/SDL_video.h +0 -820
- data/modules/emscripten/system/include/SDL/begin_code.h +0 -135
- data/modules/emscripten/system/include/SDL/close_code.h +0 -37
- data/modules/emscripten/system/include/X11/X.h +0 -717
- data/modules/emscripten/system/include/X11/Xatom.h +0 -79
- data/modules/emscripten/system/include/X11/Xfuncproto.h +0 -127
- data/modules/emscripten/system/include/X11/Xlib.h +0 -4023
- data/modules/emscripten/system/include/X11/Xosdefs.h +0 -116
- data/modules/emscripten/system/include/X11/Xutil.h +0 -826
- data/modules/emscripten/system/include/X11/keysym.h +0 -73
- data/modules/emscripten/system/include/X11/keysymdef.h +0 -2389
- data/modules/emscripten/system/include/compat/ctype.h +0 -34
- data/modules/emscripten/system/include/compat/malloc.h +0 -48
- data/modules/emscripten/system/include/compat/math.h +0 -14
- data/modules/emscripten/system/include/compat/netdb.h +0 -22
- data/modules/emscripten/system/include/compat/stdarg.h +0 -16
- data/modules/emscripten/system/include/compat/stdlib.h +0 -16
- data/modules/emscripten/system/include/compat/string.h +0 -17
- data/modules/emscripten/system/include/compat/sys/socketvar.h +0 -14
- data/modules/emscripten/system/include/compat/sys/stat.h +0 -20
- data/modules/emscripten/system/include/compat/sys/timeb.h +0 -35
- data/modules/emscripten/system/include/compat/time.h +0 -18
- data/modules/emscripten/system/include/compat/unistd.h +0 -16
- data/modules/emscripten/system/include/compat/wchar.h +0 -23
- data/modules/emscripten/system/include/compat/wctype.h +0 -23
- data/modules/emscripten/system/include/compat/xlocale.h +0 -19
- data/modules/emscripten/system/include/emscripten/bind.h +0 -1210
- data/modules/emscripten/system/include/emscripten/emmintrin.h +0 -87
- data/modules/emscripten/system/include/emscripten/emscripten.h +0 -519
- data/modules/emscripten/system/include/emscripten/val.h +0 -311
- data/modules/emscripten/system/include/emscripten/vector.h +0 -34
- data/modules/emscripten/system/include/emscripten/wire.h +0 -393
- data/modules/emscripten/system/include/emscripten/xmmintrin.h +0 -131
- data/modules/emscripten/system/include/execinfo.h +0 -44
- data/modules/emscripten/system/include/gc.h +0 -70
- data/modules/emscripten/system/include/gfx/png.h +0 -3798
- data/modules/emscripten/system/include/gfx/pngconf.h +0 -1665
- data/modules/emscripten/system/include/gfx/tiff.h +0 -654
- data/modules/emscripten/system/include/gfx/tiffconf.h +0 -104
- data/modules/emscripten/system/include/gfx/tiffio.h +0 -526
- data/modules/emscripten/system/include/gfx/tiffvers.h +0 -9
- data/modules/emscripten/system/include/jansson.h +0 -323
- data/modules/emscripten/system/include/jansson_config.h +0 -54
- data/modules/emscripten/system/include/libc/aio.h +0 -69
- data/modules/emscripten/system/include/libc/alloca.h +0 -21
- data/modules/emscripten/system/include/libc/ar.h +0 -25
- data/modules/emscripten/system/include/libc/arpa/ftp.h +0 -35
- data/modules/emscripten/system/include/libc/arpa/inet.h +0 -36
- data/modules/emscripten/system/include/libc/arpa/nameser.h +0 -467
- data/modules/emscripten/system/include/libc/arpa/nameser_compat.h +0 -2
- data/modules/emscripten/system/include/libc/arpa/telnet.h +0 -251
- data/modules/emscripten/system/include/libc/arpa/tftp.h +0 -31
- data/modules/emscripten/system/include/libc/assert.h +0 -19
- data/modules/emscripten/system/include/libc/bits/alltypes.h +0 -397
- data/modules/emscripten/system/include/libc/bits/endian.h +0 -1
- data/modules/emscripten/system/include/libc/bits/errno.h +0 -134
- data/modules/emscripten/system/include/libc/bits/fcntl.h +0 -38
- data/modules/emscripten/system/include/libc/bits/fenv.h +0 -34
- data/modules/emscripten/system/include/libc/bits/float.h +0 -17
- data/modules/emscripten/system/include/libc/bits/io.h +0 -0
- data/modules/emscripten/system/include/libc/bits/ioctl.h +0 -197
- data/modules/emscripten/system/include/libc/bits/ipc.h +0 -14
- data/modules/emscripten/system/include/libc/bits/limits.h +0 -8
- data/modules/emscripten/system/include/libc/bits/mman.h +0 -62
- data/modules/emscripten/system/include/libc/bits/msg.h +0 -16
- data/modules/emscripten/system/include/libc/bits/posix.h +0 -2
- data/modules/emscripten/system/include/libc/bits/reg.h +0 -19
- data/modules/emscripten/system/include/libc/bits/setjmp.h +0 -1
- data/modules/emscripten/system/include/libc/bits/shm.h +0 -18
- data/modules/emscripten/system/include/libc/bits/signal.h +0 -112
- data/modules/emscripten/system/include/libc/bits/socket.h +0 -17
- data/modules/emscripten/system/include/libc/bits/stat.h +0 -22
- data/modules/emscripten/system/include/libc/bits/statfs.h +0 -7
- data/modules/emscripten/system/include/libc/bits/stdarg.h +0 -4
- data/modules/emscripten/system/include/libc/bits/stdint.h +0 -20
- data/modules/emscripten/system/include/libc/bits/syscall.h +0 -696
- data/modules/emscripten/system/include/libc/bits/termios.h +0 -160
- data/modules/emscripten/system/include/libc/bits/user.h +0 -48
- data/modules/emscripten/system/include/libc/byteswap.h +0 -26
- data/modules/emscripten/system/include/libc/complex.h +0 -125
- data/modules/emscripten/system/include/libc/cpio.h +0 -29
- data/modules/emscripten/system/include/libc/crypt.h +0 -20
- data/modules/emscripten/system/include/libc/ctype.h +0 -67
- data/modules/emscripten/system/include/libc/dirent.h +0 -79
- data/modules/emscripten/system/include/libc/dlfcn.h +0 -42
- data/modules/emscripten/system/include/libc/elf.h +0 -2555
- data/modules/emscripten/system/include/libc/endian.h +0 -82
- data/modules/emscripten/system/include/libc/err.h +0 -25
- data/modules/emscripten/system/include/libc/errno.h +0 -27
- data/modules/emscripten/system/include/libc/fcntl.h +0 -175
- data/modules/emscripten/system/include/libc/features.h +0 -32
- data/modules/emscripten/system/include/libc/fenv.h +0 -28
- data/modules/emscripten/system/include/libc/float.h +0 -34
- data/modules/emscripten/system/include/libc/fnmatch.h +0 -29
- data/modules/emscripten/system/include/libc/ftw.h +0 -42
- data/modules/emscripten/system/include/libc/getopt.h +0 -31
- data/modules/emscripten/system/include/libc/glob.h +0 -48
- data/modules/emscripten/system/include/libc/grp.h +0 -52
- data/modules/emscripten/system/include/libc/iconv.h +0 -24
- data/modules/emscripten/system/include/libc/ifaddrs.h +0 -35
- data/modules/emscripten/system/include/libc/inttypes.h +0 -227
- data/modules/emscripten/system/include/libc/iso646.h +0 -20
- data/modules/emscripten/system/include/libc/langinfo.h +0 -88
- data/modules/emscripten/system/include/libc/lastlog.h +0 -1
- data/modules/emscripten/system/include/libc/libgen.h +0 -15
- data/modules/emscripten/system/include/libc/libintl.h +0 -25
- data/modules/emscripten/system/include/libc/limits.h +0 -146
- data/modules/emscripten/system/include/libc/link.h +0 -54
- data/modules/emscripten/system/include/libc/locale.h +0 -82
- data/modules/emscripten/system/include/libc/malloc.h +0 -0
- data/modules/emscripten/system/include/libc/math.h +0 -422
- data/modules/emscripten/system/include/libc/memory.h +0 -1
- data/modules/emscripten/system/include/libc/mntent.h +0 -44
- data/modules/emscripten/system/include/libc/monetary.h +0 -23
- data/modules/emscripten/system/include/libc/mqueue.h +0 -36
- data/modules/emscripten/system/include/libc/net/ethernet.h +0 -55
- data/modules/emscripten/system/include/libc/net/if.h +0 -135
- data/modules/emscripten/system/include/libc/net/if_arp.h +0 -133
- data/modules/emscripten/system/include/libc/net/route.h +0 -124
- data/modules/emscripten/system/include/libc/netdb.h +0 -161
- data/modules/emscripten/system/include/libc/netinet/ether.h +0 -14
- data/modules/emscripten/system/include/libc/netinet/icmp6.h +0 -305
- data/modules/emscripten/system/include/libc/netinet/if_ether.h +0 -126
- data/modules/emscripten/system/include/libc/netinet/in.h +0 -336
- data/modules/emscripten/system/include/libc/netinet/in_systm.h +0 -9
- data/modules/emscripten/system/include/libc/netinet/ip.h +0 -186
- data/modules/emscripten/system/include/libc/netinet/ip6.h +0 -142
- data/modules/emscripten/system/include/libc/netinet/ip_icmp.h +0 -192
- data/modules/emscripten/system/include/libc/netinet/tcp.h +0 -71
- data/modules/emscripten/system/include/libc/netinet/udp.h +0 -35
- data/modules/emscripten/system/include/libc/netpacket/packet.h +0 -44
- data/modules/emscripten/system/include/libc/nl_types.h +0 -22
- data/modules/emscripten/system/include/libc/paths.h +0 -32
- data/modules/emscripten/system/include/libc/poll.h +0 -46
- data/modules/emscripten/system/include/libc/pthread.h +0 -222
- data/modules/emscripten/system/include/libc/pty.h +0 -18
- data/modules/emscripten/system/include/libc/pwd.h +0 -49
- data/modules/emscripten/system/include/libc/readme.txt +0 -3
- data/modules/emscripten/system/include/libc/regex.h +0 -62
- data/modules/emscripten/system/include/libc/resolv.h +0 -144
- data/modules/emscripten/system/include/libc/sched.h +0 -132
- data/modules/emscripten/system/include/libc/search.h +0 -51
- data/modules/emscripten/system/include/libc/semaphore.h +0 -35
- data/modules/emscripten/system/include/libc/setjmp.h +0 -42
- data/modules/emscripten/system/include/libc/shadow.h +0 -44
- data/modules/emscripten/system/include/libc/signal.h +0 -255
- data/modules/emscripten/system/include/libc/spawn.h +0 -74
- data/modules/emscripten/system/include/libc/stdalign.h +0 -15
- data/modules/emscripten/system/include/libc/stdarg.h +0 -25
- data/modules/emscripten/system/include/libc/stdbool.h +0 -14
- data/modules/emscripten/system/include/libc/stddef.h +0 -18
- data/modules/emscripten/system/include/libc/stdint.h +0 -117
- data/modules/emscripten/system/include/libc/stdio.h +0 -199
- data/modules/emscripten/system/include/libc/stdio_ext.h +0 -34
- data/modules/emscripten/system/include/libc/stdlib.h +0 -171
- data/modules/emscripten/system/include/libc/stdnoreturn.h +0 -5
- data/modules/emscripten/system/include/libc/string.h +0 -102
- data/modules/emscripten/system/include/libc/strings.h +0 -35
- data/modules/emscripten/system/include/libc/stropts.h +0 -139
- data/modules/emscripten/system/include/libc/sys/acct.h +0 -75
- data/modules/emscripten/system/include/libc/sys/cachectl.h +0 -22
- data/modules/emscripten/system/include/libc/sys/dir.h +0 -2
- data/modules/emscripten/system/include/libc/sys/epoll.h +0 -67
- data/modules/emscripten/system/include/libc/sys/errno.h +0 -2
- data/modules/emscripten/system/include/libc/sys/eventfd.h +0 -26
- data/modules/emscripten/system/include/libc/sys/fcntl.h +0 -2
- data/modules/emscripten/system/include/libc/sys/file.h +0 -21
- data/modules/emscripten/system/include/libc/sys/fsuid.h +0 -20
- data/modules/emscripten/system/include/libc/sys/inotify.h +0 -57
- data/modules/emscripten/system/include/libc/sys/io.h +0 -17
- data/modules/emscripten/system/include/libc/sys/ioctl.h +0 -14
- data/modules/emscripten/system/include/libc/sys/ipc.h +0 -42
- data/modules/emscripten/system/include/libc/sys/klog.h +0 -14
- data/modules/emscripten/system/include/libc/sys/mman.h +0 -55
- data/modules/emscripten/system/include/libc/sys/mount.h +0 -72
- data/modules/emscripten/system/include/libc/sys/msg.h +0 -52
- data/modules/emscripten/system/include/libc/sys/mtio.h +0 -188
- data/modules/emscripten/system/include/libc/sys/param.h +0 -35
- data/modules/emscripten/system/include/libc/sys/personality.h +0 -46
- data/modules/emscripten/system/include/libc/sys/poll.h +0 -2
- data/modules/emscripten/system/include/libc/sys/prctl.h +0 -101
- data/modules/emscripten/system/include/libc/sys/procfs.h +0 -65
- data/modules/emscripten/system/include/libc/sys/ptrace.h +0 -96
- data/modules/emscripten/system/include/libc/sys/reboot.h +0 -20
- data/modules/emscripten/system/include/libc/sys/reg.h +0 -9
- data/modules/emscripten/system/include/libc/sys/resource.h +0 -103
- data/modules/emscripten/system/include/libc/sys/select.h +0 -42
- data/modules/emscripten/system/include/libc/sys/sem.h +0 -82
- data/modules/emscripten/system/include/libc/sys/sendfile.h +0 -22
- data/modules/emscripten/system/include/libc/sys/shm.h +0 -61
- data/modules/emscripten/system/include/libc/sys/signal.h +0 -2
- data/modules/emscripten/system/include/libc/sys/signalfd.h +0 -44
- data/modules/emscripten/system/include/libc/sys/socket.h +0 -299
- data/modules/emscripten/system/include/libc/sys/stat.h +0 -114
- data/modules/emscripten/system/include/libc/sys/statfs.h +0 -32
- data/modules/emscripten/system/include/libc/sys/statvfs.h +0 -57
- data/modules/emscripten/system/include/libc/sys/stropts.h +0 -1
- data/modules/emscripten/system/include/libc/sys/swap.h +0 -21
- data/modules/emscripten/system/include/libc/sys/syscall.h +0 -6
- data/modules/emscripten/system/include/libc/sys/sysctl.h +0 -17
- data/modules/emscripten/system/include/libc/sys/sysinfo.h +0 -36
- data/modules/emscripten/system/include/libc/sys/syslog.h +0 -1
- data/modules/emscripten/system/include/libc/sys/sysmacros.h +0 -15
- data/modules/emscripten/system/include/libc/sys/termios.h +0 -2
- data/modules/emscripten/system/include/libc/sys/time.h +0 -57
- data/modules/emscripten/system/include/libc/sys/timerfd.h +0 -24
- data/modules/emscripten/system/include/libc/sys/times.h +0 -26
- data/modules/emscripten/system/include/libc/sys/timex.h +0 -98
- data/modules/emscripten/system/include/libc/sys/ttydefaults.h +0 -39
- data/modules/emscripten/system/include/libc/sys/types.h +0 -91
- data/modules/emscripten/system/include/libc/sys/ucontext.h +0 -1
- data/modules/emscripten/system/include/libc/sys/uio.h +0 -48
- data/modules/emscripten/system/include/libc/sys/un.h +0 -32
- data/modules/emscripten/system/include/libc/sys/user.h +0 -16
- data/modules/emscripten/system/include/libc/sys/utsname.h +0 -30
- data/modules/emscripten/system/include/libc/sys/vfs.h +0 -1
- data/modules/emscripten/system/include/libc/sys/wait.h +0 -55
- data/modules/emscripten/system/include/libc/sys/xattr.h +0 -30
- data/modules/emscripten/system/include/libc/syscall.h +0 -1
- data/modules/emscripten/system/include/libc/sysexits.h +0 -21
- data/modules/emscripten/system/include/libc/syslog.h +0 -104
- data/modules/emscripten/system/include/libc/tar.h +0 -33
- data/modules/emscripten/system/include/libc/termios.h +0 -46
- data/modules/emscripten/system/include/libc/tgmath.h +0 -270
- data/modules/emscripten/system/include/libc/time.h +0 -132
- data/modules/emscripten/system/include/libc/ucontext.h +0 -25
- data/modules/emscripten/system/include/libc/ulimit.h +0 -17
- data/modules/emscripten/system/include/libc/unistd.h +0 -519
- data/modules/emscripten/system/include/libc/utime.h +0 -24
- data/modules/emscripten/system/include/libc/utmp.h +0 -47
- data/modules/emscripten/system/include/libc/utmpx.h +0 -58
- data/modules/emscripten/system/include/libc/values.h +0 -39
- data/modules/emscripten/system/include/libc/wchar.h +0 -183
- data/modules/emscripten/system/include/libc/wctype.h +0 -77
- data/modules/emscripten/system/include/libc/wordexp.h +0 -42
- data/modules/emscripten/system/include/libcxx/CREDITS.TXT +0 -123
- data/modules/emscripten/system/include/libcxx/LICENSE.txt +0 -76
- data/modules/emscripten/system/include/libcxx/__bit_reference +0 -1287
- data/modules/emscripten/system/include/libcxx/__config +0 -610
- data/modules/emscripten/system/include/libcxx/__debug +0 -218
- data/modules/emscripten/system/include/libcxx/__functional_03 +0 -2130
- data/modules/emscripten/system/include/libcxx/__functional_base +0 -615
- data/modules/emscripten/system/include/libcxx/__functional_base_03 +0 -1087
- data/modules/emscripten/system/include/libcxx/__hash_table +0 -2457
- data/modules/emscripten/system/include/libcxx/__locale +0 -1445
- data/modules/emscripten/system/include/libcxx/__mutex_base +0 -407
- data/modules/emscripten/system/include/libcxx/__split_buffer +0 -654
- data/modules/emscripten/system/include/libcxx/__sso_allocator +0 -77
- data/modules/emscripten/system/include/libcxx/__std_stream +0 -359
- data/modules/emscripten/system/include/libcxx/__tree +0 -2309
- data/modules/emscripten/system/include/libcxx/__tuple +0 -305
- data/modules/emscripten/system/include/libcxx/__tuple_03 +0 -27
- data/modules/emscripten/system/include/libcxx/__undef_min_max +0 -27
- data/modules/emscripten/system/include/libcxx/algorithm +0 -5679
- data/modules/emscripten/system/include/libcxx/array +0 -342
- data/modules/emscripten/system/include/libcxx/atomic +0 -1531
- data/modules/emscripten/system/include/libcxx/bitset +0 -1081
- data/modules/emscripten/system/include/libcxx/cassert +0 -25
- data/modules/emscripten/system/include/libcxx/ccomplex +0 -29
- data/modules/emscripten/system/include/libcxx/cctype +0 -164
- data/modules/emscripten/system/include/libcxx/cerrno +0 -393
- data/modules/emscripten/system/include/libcxx/cfenv +0 -82
- data/modules/emscripten/system/include/libcxx/cfloat +0 -78
- data/modules/emscripten/system/include/libcxx/chrono +0 -1027
- data/modules/emscripten/system/include/libcxx/cinttypes +0 -259
- data/modules/emscripten/system/include/libcxx/ciso646 +0 -25
- data/modules/emscripten/system/include/libcxx/climits +0 -48
- data/modules/emscripten/system/include/libcxx/clocale +0 -53
- data/modules/emscripten/system/include/libcxx/cmath +0 -1690
- data/modules/emscripten/system/include/libcxx/codecvt +0 -550
- data/modules/emscripten/system/include/libcxx/complex +0 -1567
- data/modules/emscripten/system/include/libcxx/complex.h +0 -35
- data/modules/emscripten/system/include/libcxx/condition_variable +0 -256
- data/modules/emscripten/system/include/libcxx/csetjmp +0 -52
- data/modules/emscripten/system/include/libcxx/csignal +0 -58
- data/modules/emscripten/system/include/libcxx/cstdarg +0 -48
- data/modules/emscripten/system/include/libcxx/cstdbool +0 -32
- data/modules/emscripten/system/include/libcxx/cstddef +0 -103
- data/modules/emscripten/system/include/libcxx/cstdint +0 -191
- data/modules/emscripten/system/include/libcxx/cstdio +0 -182
- data/modules/emscripten/system/include/libcxx/cstdlib +0 -172
- data/modules/emscripten/system/include/libcxx/cstring +0 -112
- data/modules/emscripten/system/include/libcxx/ctgmath +0 -29
- data/modules/emscripten/system/include/libcxx/ctime +0 -72
- data/modules/emscripten/system/include/libcxx/cwchar +0 -217
- data/modules/emscripten/system/include/libcxx/cwctype +0 -213
- data/modules/emscripten/system/include/libcxx/deque +0 -2873
- data/modules/emscripten/system/include/libcxx/dynarray +0 -311
- data/modules/emscripten/system/include/libcxx/exception +0 -250
- data/modules/emscripten/system/include/libcxx/ext/__hash +0 -46
- data/modules/emscripten/system/include/libcxx/ext/hash_map +0 -1007
- data/modules/emscripten/system/include/libcxx/ext/hash_set +0 -661
- data/modules/emscripten/system/include/libcxx/forward_list +0 -1663
- data/modules/emscripten/system/include/libcxx/fstream +0 -1431
- data/modules/emscripten/system/include/libcxx/functional +0 -2418
- data/modules/emscripten/system/include/libcxx/future +0 -2615
- data/modules/emscripten/system/include/libcxx/initializer_list +0 -118
- data/modules/emscripten/system/include/libcxx/iomanip +0 -651
- data/modules/emscripten/system/include/libcxx/ios +0 -1023
- data/modules/emscripten/system/include/libcxx/iosfwd +0 -194
- data/modules/emscripten/system/include/libcxx/iostream +0 -60
- data/modules/emscripten/system/include/libcxx/istream +0 -1716
- data/modules/emscripten/system/include/libcxx/iterator +0 -1568
- data/modules/emscripten/system/include/libcxx/limits +0 -813
- data/modules/emscripten/system/include/libcxx/list +0 -2355
- data/modules/emscripten/system/include/libcxx/locale +0 -4465
- data/modules/emscripten/system/include/libcxx/map +0 -2045
- data/modules/emscripten/system/include/libcxx/memory +0 -5448
- data/modules/emscripten/system/include/libcxx/mutex +0 -566
- data/modules/emscripten/system/include/libcxx/new +0 -146
- data/modules/emscripten/system/include/libcxx/numeric +0 -197
- data/modules/emscripten/system/include/libcxx/optional +0 -697
- data/modules/emscripten/system/include/libcxx/ostream +0 -1295
- data/modules/emscripten/system/include/libcxx/queue +0 -717
- data/modules/emscripten/system/include/libcxx/random +0 -6725
- data/modules/emscripten/system/include/libcxx/ratio +0 -487
- data/modules/emscripten/system/include/libcxx/readme.txt +0 -1
- data/modules/emscripten/system/include/libcxx/regex +0 -6487
- data/modules/emscripten/system/include/libcxx/scoped_allocator +0 -578
- data/modules/emscripten/system/include/libcxx/set +0 -1189
- data/modules/emscripten/system/include/libcxx/shared_mutex +0 -419
- data/modules/emscripten/system/include/libcxx/sstream +0 -972
- data/modules/emscripten/system/include/libcxx/stack +0 -292
- data/modules/emscripten/system/include/libcxx/stdexcept +0 -162
- data/modules/emscripten/system/include/libcxx/streambuf +0 -564
- data/modules/emscripten/system/include/libcxx/string +0 -4198
- data/modules/emscripten/system/include/libcxx/strstream +0 -400
- data/modules/emscripten/system/include/libcxx/support/ibm/limits.h +0 -99
- data/modules/emscripten/system/include/libcxx/support/ibm/support.h +0 -54
- data/modules/emscripten/system/include/libcxx/support/ibm/xlocale.h +0 -326
- data/modules/emscripten/system/include/libcxx/support/solaris/floatingpoint.h +0 -5
- data/modules/emscripten/system/include/libcxx/support/solaris/wchar.h +0 -38
- data/modules/emscripten/system/include/libcxx/support/solaris/xlocale.h +0 -146
- data/modules/emscripten/system/include/libcxx/support/win32/limits_win32.h +0 -79
- data/modules/emscripten/system/include/libcxx/support/win32/locale_win32.h +0 -129
- data/modules/emscripten/system/include/libcxx/support/win32/math_win32.h +0 -115
- data/modules/emscripten/system/include/libcxx/support/win32/support.h +0 -119
- data/modules/emscripten/system/include/libcxx/system_error +0 -642
- data/modules/emscripten/system/include/libcxx/tgmath.h +0 -29
- data/modules/emscripten/system/include/libcxx/thread +0 -458
- data/modules/emscripten/system/include/libcxx/tuple +0 -1102
- data/modules/emscripten/system/include/libcxx/type_traits +0 -3292
- data/modules/emscripten/system/include/libcxx/typeindex +0 -103
- data/modules/emscripten/system/include/libcxx/typeinfo +0 -124
- data/modules/emscripten/system/include/libcxx/unordered_map +0 -2078
- data/modules/emscripten/system/include/libcxx/unordered_set +0 -1379
- data/modules/emscripten/system/include/libcxx/utility +0 -768
- data/modules/emscripten/system/include/libcxx/valarray +0 -4779
- data/modules/emscripten/system/include/libcxx/vector +0 -3246
- data/modules/emscripten/system/include/unwind.h +0 -154
- data/modules/emscripten/system/include/uuid/uuid.h +0 -35
- data/modules/emscripten/system/include/zconf.h +0 -428
- data/modules/emscripten/system/include/zlib.h +0 -1613
- data/modules/emscripten/system/lib/compiler-rt/LICENSE.TXT +0 -97
- data/modules/emscripten/system/lib/compiler-rt/divdi3.c +0 -47
- data/modules/emscripten/system/lib/compiler-rt/int_endianness.h +0 -116
- data/modules/emscripten/system/lib/compiler-rt/int_lib.h +0 -46
- data/modules/emscripten/system/lib/compiler-rt/int_math.h +0 -67
- data/modules/emscripten/system/lib/compiler-rt/int_types.h +0 -140
- data/modules/emscripten/system/lib/compiler-rt/int_util.h +0 -29
- data/modules/emscripten/system/lib/compiler-rt/muldi3.c +0 -56
- data/modules/emscripten/system/lib/compiler-rt/readme.txt +0 -20
- data/modules/emscripten/system/lib/compiler-rt/udivdi3.c +0 -36
- data/modules/emscripten/system/lib/compiler-rt/udivmoddi4.c +0 -251
- data/modules/emscripten/system/lib/debugging.cpp +0 -24
- data/modules/emscripten/system/lib/dlmalloc.c +0 -6297
- data/modules/emscripten/system/lib/embind/bind.cpp +0 -63
- data/modules/emscripten/system/lib/libc/gen/err.c +0 -49
- data/modules/emscripten/system/lib/libc/gen/errx.c +0 -49
- data/modules/emscripten/system/lib/libc/gen/verr.c +0 -58
- data/modules/emscripten/system/lib/libc/gen/verrx.c +0 -51
- data/modules/emscripten/system/lib/libc/gen/vwarn.c +0 -55
- data/modules/emscripten/system/lib/libc/gen/vwarnx.c +0 -48
- data/modules/emscripten/system/lib/libc/gen/warn.c +0 -49
- data/modules/emscripten/system/lib/libc/gen/warnx.c +0 -49
- data/modules/emscripten/system/lib/libc/musl/COPYRIGHT +0 -92
- data/modules/emscripten/system/lib/libc/musl/readme.txt +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/ctype/alpha.h +0 -125
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalnum.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswalpha.c +0 -14
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswblank.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswcntrl.c +0 -10
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswctype.c +0 -63
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswdigit.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswgraph.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswlower.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswprint.c +0 -19
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswpunct.c +0 -12
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswspace.c +0 -19
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswupper.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/ctype/iswxdigit.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/ctype/nonspacing.h +0 -62
- data/modules/emscripten/system/lib/libc/musl/src/ctype/punct.h +0 -109
- data/modules/emscripten/system/lib/libc/musl/src/ctype/towctrans.c +0 -268
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcswidth.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wctrans.c +0 -16
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wcwidth.c +0 -29
- data/modules/emscripten/system/lib/libc/musl/src/ctype/wide.h +0 -42
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.c +0 -22
- data/modules/emscripten/system/lib/libc/musl/src/internal/libc.h +0 -71
- data/modules/emscripten/system/lib/libc/musl/src/internal/locale_impl.h +0 -5
- data/modules/emscripten/system/lib/libc/musl/src/internal/stdio_impl.h +0 -92
- data/modules/emscripten/system/lib/libc/musl/src/locale/big5.h +0 -1085
- data/modules/emscripten/system/lib/libc/musl/src/locale/codepages.h +0 -238
- data/modules/emscripten/system/lib/libc/musl/src/locale/gb18030.h +0 -1836
- data/modules/emscripten/system/lib/libc/musl/src/locale/hkscs.h +0 -390
- data/modules/emscripten/system/lib/libc/musl/src/locale/iconv.c +0 -454
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswalnum_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswalpha_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswblank_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswcntrl_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswctype_l.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswdigit_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswgraph_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswlower_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswprint_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswpunct_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswspace_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswupper_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/iswxdigit_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/jis0208.h +0 -550
- data/modules/emscripten/system/lib/libc/musl/src/locale/ksc.h +0 -640
- data/modules/emscripten/system/lib/libc/musl/src/locale/legacychars.h +0 -39
- data/modules/emscripten/system/lib/libc/musl/src/locale/strfmon.c +0 -101
- data/modules/emscripten/system/lib/libc/musl/src/locale/strxfrm.c +0 -18
- data/modules/emscripten/system/lib/libc/musl/src/locale/towctrans_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/towlower_l.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/locale/towupper_l.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcscoll.c +0 -16
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcscoll_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcsxfrm.c +0 -21
- data/modules/emscripten/system/lib/libc/musl/src/locale/wcsxfrm_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/wctrans_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/locale/wctype_l.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/btowc.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.c +0 -38
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/internal.h +0 -22
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mblen.c +0 -17
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrlen.c +0 -18
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbrtowc.c +0 -57
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsinit.c +0 -17
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsnrtowcs.c +0 -65
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbsrtowcs.c +0 -100
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbstowcs.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/mbtowc.c +0 -53
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcrtomb.c +0 -38
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsnrtombs.c +0 -52
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcsrtombs.c +0 -58
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wcstombs.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctob.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/multibyte/wctomb.c +0 -18
- data/modules/emscripten/system/lib/libc/musl/src/regex/regcomp.c +0 -3352
- data/modules/emscripten/system/lib/libc/musl/src/regex/regerror.c +0 -35
- data/modules/emscripten/system/lib/libc/musl/src/regex/regexec.c +0 -1011
- data/modules/emscripten/system/lib/libc/musl/src/regex/tre-mem.c +0 -158
- data/modules/emscripten/system/lib/libc/musl/src/regex/tre.h +0 -231
- data/modules/emscripten/system/lib/libc/musl/src/stdio/fwprintf.c +0 -13
- data/modules/emscripten/system/lib/libc/musl/src/stdio/swprintf.c +0 -14
- data/modules/emscripten/system/lib/libc/musl/src/stdio/vfwprintf.c +0 -361
- data/modules/emscripten/system/lib/libc/musl/src/stdio/vswprintf.c +0 -53
- data/modules/emscripten/system/lib/libc/musl/src/stdio/vwprintf.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/stdio/wprintf.c +0 -13
- data/modules/emscripten/system/lib/libc/musl/src/stdlib/ecvt.c +0 -19
- data/modules/emscripten/system/lib/libc/musl/src/stdlib/fcvt.c +0 -25
- data/modules/emscripten/system/lib/libc/musl/src/stdlib/gcvt.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpcpy.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wcpncpy.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscasecmp_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscat.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcschr.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscmp.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscpy.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcscspn.c +0 -10
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsdup.c +0 -11
- data/modules/emscripten/system/lib/libc/musl/src/string/wcslen.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncasecmp_l.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncat.c +0 -10
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncmp.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsncpy.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsnlen.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcspbrk.c +0 -7
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsrchr.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsspn.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wcsstr.c +0 -108
- data/modules/emscripten/system/lib/libc/musl/src/string/wcstok.c +0 -12
- data/modules/emscripten/system/lib/libc/musl/src/string/wcswcs.c +0 -6
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemchr.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcmp.c +0 -8
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemcpy.c +0 -9
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemmove.c +0 -12
- data/modules/emscripten/system/lib/libc/musl/src/string/wmemset.c +0 -9
- data/modules/emscripten/system/lib/libc/stdlib/getopt_long.c +0 -511
- data/modules/emscripten/system/lib/libc/stdlib/strtod.c +0 -305
- data/modules/emscripten/system/lib/libc.symbols +0 -81
- data/modules/emscripten/system/lib/libcextra.symbols +0 -115
- data/modules/emscripten/system/lib/libcxx/CREDITS.TXT +0 -123
- data/modules/emscripten/system/lib/libcxx/LICENSE.txt +0 -76
- data/modules/emscripten/system/lib/libcxx/algorithm.cpp +0 -84
- data/modules/emscripten/system/lib/libcxx/bind.cpp +0 -30
- data/modules/emscripten/system/lib/libcxx/chrono.cpp +0 -132
- data/modules/emscripten/system/lib/libcxx/condition_variable.cpp +0 -81
- data/modules/emscripten/system/lib/libcxx/debug.cpp +0 -530
- data/modules/emscripten/system/lib/libcxx/exception.cpp +0 -307
- data/modules/emscripten/system/lib/libcxx/future.cpp +0 -291
- data/modules/emscripten/system/lib/libcxx/hash.cpp +0 -570
- data/modules/emscripten/system/lib/libcxx/ios.cpp +0 -460
- data/modules/emscripten/system/lib/libcxx/iostream.cpp +0 -68
- data/modules/emscripten/system/lib/libcxx/locale.cpp +0 -6169
- data/modules/emscripten/system/lib/libcxx/memory.cpp +0 -223
- data/modules/emscripten/system/lib/libcxx/mutex.cpp +0 -253
- data/modules/emscripten/system/lib/libcxx/new.cpp +0 -239
- data/modules/emscripten/system/lib/libcxx/optional.cpp +0 -25
- data/modules/emscripten/system/lib/libcxx/random.cpp +0 -74
- data/modules/emscripten/system/lib/libcxx/readme.txt +0 -1
- data/modules/emscripten/system/lib/libcxx/regex.cpp +0 -325
- data/modules/emscripten/system/lib/libcxx/shared_mutex.cpp +0 -101
- data/modules/emscripten/system/lib/libcxx/stdexcept.cpp +0 -200
- data/modules/emscripten/system/lib/libcxx/string.cpp +0 -530
- data/modules/emscripten/system/lib/libcxx/strstream.cpp +0 -329
- data/modules/emscripten/system/lib/libcxx/support/solaris/README +0 -4
- data/modules/emscripten/system/lib/libcxx/support/solaris/mbsnrtowcs.inc +0 -76
- data/modules/emscripten/system/lib/libcxx/support/solaris/wcsnrtombs.inc +0 -93
- data/modules/emscripten/system/lib/libcxx/support/solaris/xlocale.c +0 -245
- data/modules/emscripten/system/lib/libcxx/support/win32/locale_win32.cpp +0 -95
- data/modules/emscripten/system/lib/libcxx/support/win32/support.cpp +0 -166
- data/modules/emscripten/system/lib/libcxx/symbols +0 -2699
- data/modules/emscripten/system/lib/libcxx/system_error.cpp +0 -205
- data/modules/emscripten/system/lib/libcxx/thread.cpp +0 -225
- data/modules/emscripten/system/lib/libcxx/typeinfo.cpp +0 -73
- data/modules/emscripten/system/lib/libcxx/utility.cpp +0 -17
- data/modules/emscripten/system/lib/libcxx/valarray.cpp +0 -56
- data/modules/emscripten/system/lib/libcxxabi/CREDITS.TXT +0 -38
- data/modules/emscripten/system/lib/libcxxabi/LICENSE.TXT +0 -76
- data/modules/emscripten/system/lib/libcxxabi/include/cxa_demangle.h +0 -167
- data/modules/emscripten/system/lib/libcxxabi/include/cxxabi.h +0 -175
- data/modules/emscripten/system/lib/libcxxabi/lib/buildit +0 -99
- data/modules/emscripten/system/lib/libcxxabi/readme.txt +0 -1
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.cpp +0 -50
- data/modules/emscripten/system/lib/libcxxabi/src/abort_message.h +0 -33
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_aux_runtime.cpp +0 -34
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_demangle.cpp +0 -11036
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.cpp +0 -622
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception.hpp +0 -123
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_exception_storage.cpp +0 -91
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_guard.cpp +0 -231
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.cpp +0 -125
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_handlers.hpp +0 -54
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_new_delete.cpp +0 -242
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_personality.cpp +0 -1055
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_unexpected.cpp +0 -27
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_vector.cpp +0 -367
- data/modules/emscripten/system/lib/libcxxabi/src/cxa_virtual.cpp +0 -31
- data/modules/emscripten/system/lib/libcxxabi/src/exception.cpp +0 -41
- data/modules/emscripten/system/lib/libcxxabi/src/fallback_malloc.ipp +0 -174
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp +0 -1146
- data/modules/emscripten/system/lib/libcxxabi/src/private_typeinfo.h +0 -248
- data/modules/emscripten/system/lib/libcxxabi/src/stdexcept.cpp +0 -169
- data/modules/emscripten/system/lib/libcxxabi/src/typeinfo.cpp +0 -53
- data/modules/emscripten/system/lib/libcxxabi/symbols +0 -236
- data/modules/emscripten/system/lib/sdl.cpp +0 -13
- data/modules/emscripten/system/lib/sdl.symbols +0 -1
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/CppHeaderParser.py +0 -2347
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/__init__.py +0 -4
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/doc/CppHeaderParser.html +0 -657
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/SampleClass.h +0 -147
- data/modules/emscripten/third_party/CppHeaderParser/CppHeaderParser/examples/readSampleClass.py +0 -74
- data/modules/emscripten/third_party/CppHeaderParser/PKG-INFO +0 -249
- data/modules/emscripten/third_party/CppHeaderParser/README.html +0 -544
- data/modules/emscripten/third_party/CppHeaderParser/README.txt +0 -226
- data/modules/emscripten/third_party/CppHeaderParser/setup.py +0 -43
- data/modules/emscripten/third_party/ansidecl.h +0 -371
- data/modules/emscripten/third_party/closure-compiler/COPYING +0 -202
- data/modules/emscripten/third_party/closure-compiler/README +0 -292
- data/modules/emscripten/third_party/closure-compiler/compiler.jar +0 -0
- data/modules/emscripten/third_party/closure-compiler/readme.txt +0 -3
- data/modules/emscripten/third_party/cp-demangle.h +0 -161
- data/modules/emscripten/third_party/demangle.h +0 -549
- data/modules/emscripten/third_party/demangler.py +0 -49
- data/modules/emscripten/third_party/gcc_demangler.c +0 -4226
- data/modules/emscripten/third_party/gcc_demangler.js +0 -21282
- data/modules/emscripten/third_party/jni/emjvm.cpp +0 -133
- data/modules/emscripten/third_party/jni/emjvm.h +0 -8
- data/modules/emscripten/third_party/jni/emjvm.js +0 -185
- data/modules/emscripten/third_party/jni/jni.h +0 -1154
- data/modules/emscripten/third_party/libiberty.h +0 -634
- data/modules/emscripten/third_party/lzma.js/README.markdown +0 -37
- data/modules/emscripten/third_party/lzma.js/doit.bat +0 -4
- data/modules/emscripten/third_party/lzma.js/doit.sh +0 -44
- data/modules/emscripten/third_party/lzma.js/lzip/AUTHORS +0 -7
- data/modules/emscripten/third_party/lzma.js/lzip/COPYING +0 -676
- data/modules/emscripten/third_party/lzma.js/lzip/ChangeLog +0 -201
- data/modules/emscripten/third_party/lzma.js/lzip/INSTALL +0 -56
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile +0 -160
- data/modules/emscripten/third_party/lzma.js/lzip/Makefile.in +0 -138
- data/modules/emscripten/third_party/lzma.js/lzip/NEWS +0 -22
- data/modules/emscripten/third_party/lzma.js/lzip/README +0 -77
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.cc +0 -204
- data/modules/emscripten/third_party/lzma.js/lzip/arg_parser.h +0 -106
- data/modules/emscripten/third_party/lzma.js/lzip/configure +0 -192
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.cc +0 -252
- data/modules/emscripten/third_party/lzma.js/lzip/decoder.h +0 -268
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.cc +0 -643
- data/modules/emscripten/third_party/lzma.js/lzip/encoder.h +0 -582
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.cc +0 -378
- data/modules/emscripten/third_party/lzma.js/lzip/fast_encoder.h +0 -171
- data/modules/emscripten/third_party/lzma.js/lzip/lzip.h +0 -264
- data/modules/emscripten/third_party/lzma.js/lzip/main.cc +0 -545
- data/modules/emscripten/third_party/lzma.js/lzma-decoder.js +0 -27
- data/modules/emscripten/third_party/lzma.js/lzma-full.js +0 -27
- data/modules/emscripten/third_party/lzma.js/native_test.sh +0 -5
- data/modules/emscripten/third_party/lzma.js/post.js +0 -13
- data/modules/emscripten/third_party/lzma.js/pre.js +0 -13
- data/modules/emscripten/third_party/lzma.js/test-decoder.js +0 -39
- data/modules/emscripten/third_party/lzma.js/test-full.html +0 -9
- data/modules/emscripten/third_party/lzma.js/test-full.js +0 -78
- data/modules/emscripten/third_party/ply/ANNOUNCE +0 -40
- data/modules/emscripten/third_party/ply/CHANGES +0 -1093
- data/modules/emscripten/third_party/ply/PKG-INFO +0 -22
- data/modules/emscripten/third_party/ply/README +0 -271
- data/modules/emscripten/third_party/ply/TODO +0 -16
- data/modules/emscripten/third_party/ply/doc/internal.html +0 -874
- data/modules/emscripten/third_party/ply/doc/makedoc.py +0 -194
- data/modules/emscripten/third_party/ply/doc/ply.html +0 -3262
- data/modules/emscripten/third_party/ply/example/BASIC/README +0 -79
- data/modules/emscripten/third_party/ply/example/BASIC/basic.py +0 -71
- data/modules/emscripten/third_party/ply/example/BASIC/basiclex.py +0 -74
- data/modules/emscripten/third_party/ply/example/BASIC/basiclog.py +0 -79
- data/modules/emscripten/third_party/ply/example/BASIC/basinterp.py +0 -441
- data/modules/emscripten/third_party/ply/example/BASIC/basparse.py +0 -424
- data/modules/emscripten/third_party/ply/example/BASIC/dim.bas +0 -14
- data/modules/emscripten/third_party/ply/example/BASIC/func.bas +0 -5
- data/modules/emscripten/third_party/ply/example/BASIC/gcd.bas +0 -22
- data/modules/emscripten/third_party/ply/example/BASIC/gosub.bas +0 -13
- data/modules/emscripten/third_party/ply/example/BASIC/hello.bas +0 -4
- data/modules/emscripten/third_party/ply/example/BASIC/linear.bas +0 -17
- data/modules/emscripten/third_party/ply/example/BASIC/maxsin.bas +0 -12
- data/modules/emscripten/third_party/ply/example/BASIC/powers.bas +0 -13
- data/modules/emscripten/third_party/ply/example/BASIC/rand.bas +0 -4
- data/modules/emscripten/third_party/ply/example/BASIC/sales.bas +0 -20
- data/modules/emscripten/third_party/ply/example/BASIC/sears.bas +0 -18
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt1.bas +0 -5
- data/modules/emscripten/third_party/ply/example/BASIC/sqrt2.bas +0 -4
- data/modules/emscripten/third_party/ply/example/GardenSnake/GardenSnake.py +0 -709
- data/modules/emscripten/third_party/ply/example/GardenSnake/README +0 -5
- data/modules/emscripten/third_party/ply/example/README +0 -10
- data/modules/emscripten/third_party/ply/example/ansic/README +0 -2
- data/modules/emscripten/third_party/ply/example/ansic/clex.py +0 -164
- data/modules/emscripten/third_party/ply/example/ansic/cparse.py +0 -863
- data/modules/emscripten/third_party/ply/example/calc/calc.py +0 -107
- data/modules/emscripten/third_party/ply/example/calcdebug/calc.py +0 -113
- data/modules/emscripten/third_party/ply/example/classcalc/calc.py +0 -157
- data/modules/emscripten/third_party/ply/example/cleanup.sh +0 -2
- data/modules/emscripten/third_party/ply/example/closurecalc/calc.py +0 -130
- data/modules/emscripten/third_party/ply/example/hedit/hedit.py +0 -48
- data/modules/emscripten/third_party/ply/example/newclasscalc/calc.py +0 -160
- data/modules/emscripten/third_party/ply/example/optcalc/README +0 -9
- data/modules/emscripten/third_party/ply/example/optcalc/calc.py +0 -119
- data/modules/emscripten/third_party/ply/example/unicalc/calc.py +0 -117
- data/modules/emscripten/third_party/ply/example/yply/README +0 -41
- data/modules/emscripten/third_party/ply/example/yply/ylex.py +0 -112
- data/modules/emscripten/third_party/ply/example/yply/yparse.py +0 -217
- data/modules/emscripten/third_party/ply/example/yply/yply.py +0 -53
- data/modules/emscripten/third_party/ply/ply/__init__.py +0 -4
- data/modules/emscripten/third_party/ply/ply/cpp.py +0 -898
- data/modules/emscripten/third_party/ply/ply/ctokens.py +0 -133
- data/modules/emscripten/third_party/ply/ply/lex.py +0 -1058
- data/modules/emscripten/third_party/ply/ply/yacc.py +0 -3276
- data/modules/emscripten/third_party/ply/setup.py +0 -31
- data/modules/emscripten/third_party/ply/test/README +0 -7
- data/modules/emscripten/third_party/ply/test/calclex.py +0 -49
- data/modules/emscripten/third_party/ply/test/cleanup.sh +0 -4
- data/modules/emscripten/third_party/ply/test/lex_closure.py +0 -54
- data/modules/emscripten/third_party/ply/test/lex_doc1.py +0 -26
- data/modules/emscripten/third_party/ply/test/lex_dup1.py +0 -29
- data/modules/emscripten/third_party/ply/test/lex_dup2.py +0 -33
- data/modules/emscripten/third_party/ply/test/lex_dup3.py +0 -31
- data/modules/emscripten/third_party/ply/test/lex_empty.py +0 -20
- data/modules/emscripten/third_party/ply/test/lex_error1.py +0 -24
- data/modules/emscripten/third_party/ply/test/lex_error2.py +0 -26
- data/modules/emscripten/third_party/ply/test/lex_error3.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_error4.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_hedit.py +0 -47
- data/modules/emscripten/third_party/ply/test/lex_ignore.py +0 -31
- data/modules/emscripten/third_party/ply/test/lex_ignore2.py +0 -29
- data/modules/emscripten/third_party/ply/test/lex_literal1.py +0 -25
- data/modules/emscripten/third_party/ply/test/lex_literal2.py +0 -25
- data/modules/emscripten/third_party/ply/test/lex_many_tokens.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_module.py +0 -10
- data/modules/emscripten/third_party/ply/test/lex_module_import.py +0 -42
- data/modules/emscripten/third_party/ply/test/lex_object.py +0 -55
- data/modules/emscripten/third_party/ply/test/lex_opt_alias.py +0 -54
- data/modules/emscripten/third_party/ply/test/lex_optimize.py +0 -50
- data/modules/emscripten/third_party/ply/test/lex_optimize2.py +0 -50
- data/modules/emscripten/third_party/ply/test/lex_optimize3.py +0 -52
- data/modules/emscripten/third_party/ply/test/lex_re1.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_re2.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_re3.py +0 -29
- data/modules/emscripten/third_party/ply/test/lex_rule1.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_rule2.py +0 -29
- data/modules/emscripten/third_party/ply/test/lex_rule3.py +0 -27
- data/modules/emscripten/third_party/ply/test/lex_state1.py +0 -40
- data/modules/emscripten/third_party/ply/test/lex_state2.py +0 -40
- data/modules/emscripten/third_party/ply/test/lex_state3.py +0 -42
- data/modules/emscripten/third_party/ply/test/lex_state4.py +0 -41
- data/modules/emscripten/third_party/ply/test/lex_state5.py +0 -40
- data/modules/emscripten/third_party/ply/test/lex_state_noerror.py +0 -39
- data/modules/emscripten/third_party/ply/test/lex_state_norule.py +0 -40
- data/modules/emscripten/third_party/ply/test/lex_state_try.py +0 -45
- data/modules/emscripten/third_party/ply/test/lex_token1.py +0 -19
- data/modules/emscripten/third_party/ply/test/lex_token2.py +0 -22
- data/modules/emscripten/third_party/ply/test/lex_token3.py +0 -24
- data/modules/emscripten/third_party/ply/test/lex_token4.py +0 -26
- data/modules/emscripten/third_party/ply/test/lex_token5.py +0 -31
- data/modules/emscripten/third_party/ply/test/lex_token_dup.py +0 -29
- data/modules/emscripten/third_party/ply/test/testlex.py +0 -606
- data/modules/emscripten/third_party/ply/test/testyacc.py +0 -347
- data/modules/emscripten/third_party/ply/test/yacc_badargs.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_badid.py +0 -77
- data/modules/emscripten/third_party/ply/test/yacc_badprec.py +0 -64
- data/modules/emscripten/third_party/ply/test/yacc_badprec2.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_badprec3.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_badrule.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_badtok.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_dup.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_error1.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_error2.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_error3.py +0 -67
- data/modules/emscripten/third_party/ply/test/yacc_error4.py +0 -72
- data/modules/emscripten/third_party/ply/test/yacc_inf.py +0 -56
- data/modules/emscripten/third_party/ply/test/yacc_literal.py +0 -69
- data/modules/emscripten/third_party/ply/test/yacc_misplaced.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_missing1.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_nested.py +0 -33
- data/modules/emscripten/third_party/ply/test/yacc_nodoc.py +0 -67
- data/modules/emscripten/third_party/ply/test/yacc_noerror.py +0 -66
- data/modules/emscripten/third_party/ply/test/yacc_nop.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_notfunc.py +0 -66
- data/modules/emscripten/third_party/ply/test/yacc_notok.py +0 -67
- data/modules/emscripten/third_party/ply/test/yacc_prec1.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_rr.py +0 -72
- data/modules/emscripten/third_party/ply/test/yacc_rr_unused.py +0 -30
- data/modules/emscripten/third_party/ply/test/yacc_simple.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_sr.py +0 -63
- data/modules/emscripten/third_party/ply/test/yacc_term1.py +0 -68
- data/modules/emscripten/third_party/ply/test/yacc_unused.py +0 -77
- data/modules/emscripten/third_party/ply/test/yacc_unused_rule.py +0 -72
- data/modules/emscripten/third_party/ply/test/yacc_uprec.py +0 -63
- data/modules/emscripten/third_party/ply/test/yacc_uprec2.py +0 -63
- data/modules/emscripten/third_party/readme.txt +0 -7
- data/modules/emscripten/third_party/stb_image.c +0 -4673
- data/modules/emscripten/third_party/websockify/CHANGES.txt +0 -23
- data/modules/emscripten/third_party/websockify/LICENSE.txt +0 -16
- data/modules/emscripten/third_party/websockify/MANIFEST.in +0 -1
- data/modules/emscripten/third_party/websockify/Makefile +0 -11
- data/modules/emscripten/third_party/websockify/README.md +0 -168
- data/modules/emscripten/third_party/websockify/Windows/Windows Service Readme.txt +0 -39
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Program.cs +0 -24
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.Designer.cs +0 -61
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.cs +0 -19
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.resx +0 -129
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Properties/AssemblyInfo.cs +0 -36
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.Designer.cs +0 -37
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/Service1.cs +0 -41
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.csproj +0 -75
- data/modules/emscripten/third_party/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.sln +0 -20
- data/modules/emscripten/third_party/websockify/docs/LICENSE.GPL-3 +0 -621
- data/modules/emscripten/third_party/websockify/docs/LICENSE.LGPL-3 +0 -165
- data/modules/emscripten/third_party/websockify/docs/LICENSE.MPL-2.0 +0 -373
- data/modules/emscripten/third_party/websockify/docs/TODO +0 -9
- data/modules/emscripten/third_party/websockify/docs/flash_policy.txt +0 -4
- data/modules/emscripten/third_party/websockify/docs/latency_results.txt +0 -114
- data/modules/emscripten/third_party/websockify/docs/notes +0 -17
- data/modules/emscripten/third_party/websockify/docs/release.txt +0 -9
- data/modules/emscripten/third_party/websockify/docs/websockify.1 +0 -110
- data/modules/emscripten/third_party/websockify/include/VT100.js +0 -919
- data/modules/emscripten/third_party/websockify/include/base64.js +0 -114
- data/modules/emscripten/third_party/websockify/include/keysym.js +0 -99
- data/modules/emscripten/third_party/websockify/include/util.js +0 -359
- data/modules/emscripten/third_party/websockify/include/web-socket-js/README.txt +0 -109
- data/modules/emscripten/third_party/websockify/include/web-socket-js/WebSocketMain.swf +0 -0
- data/modules/emscripten/third_party/websockify/include/web-socket-js/swfobject.js +0 -4
- data/modules/emscripten/third_party/websockify/include/web-socket-js/web_socket.js +0 -391
- data/modules/emscripten/third_party/websockify/include/websock.js +0 -422
- data/modules/emscripten/third_party/websockify/include/webutil.js +0 -216
- data/modules/emscripten/third_party/websockify/include/wsirc.js +0 -235
- data/modules/emscripten/third_party/websockify/include/wstelnet.js +0 -335
- data/modules/emscripten/third_party/websockify/other/Makefile +0 -14
- data/modules/emscripten/third_party/websockify/other/README.md +0 -51
- data/modules/emscripten/third_party/websockify/other/launch.sh +0 -108
- data/modules/emscripten/third_party/websockify/other/project.clj +0 -13
- data/modules/emscripten/third_party/websockify/other/websocket.c +0 -802
- data/modules/emscripten/third_party/websockify/other/websocket.h +0 -84
- data/modules/emscripten/third_party/websockify/other/websocket.rb +0 -456
- data/modules/emscripten/third_party/websockify/other/websockify.c +0 -385
- data/modules/emscripten/third_party/websockify/other/websockify.clj +0 -233
- data/modules/emscripten/third_party/websockify/other/websockify.js +0 -196
- data/modules/emscripten/third_party/websockify/other/websockify.rb +0 -171
- data/modules/emscripten/third_party/websockify/other/wswrap +0 -22
- data/modules/emscripten/third_party/websockify/rebind +0 -18
- data/modules/emscripten/third_party/websockify/rebind.c +0 -94
- data/modules/emscripten/third_party/websockify/run +0 -5
- data/modules/emscripten/third_party/websockify/setup.py +0 -30
- data/modules/emscripten/third_party/websockify/tests/b64_vs_utf8.py +0 -29
- data/modules/emscripten/third_party/websockify/tests/base64.html +0 -91
- data/modules/emscripten/third_party/websockify/tests/base64.js +0 -12
- data/modules/emscripten/third_party/websockify/tests/echo.html +0 -148
- data/modules/emscripten/third_party/websockify/tests/echo.py +0 -75
- data/modules/emscripten/third_party/websockify/tests/echo.rb +0 -62
- data/modules/emscripten/third_party/websockify/tests/latency.html +0 -290
- data/modules/emscripten/third_party/websockify/tests/latency.py +0 -75
- data/modules/emscripten/third_party/websockify/tests/load.html +0 -250
- data/modules/emscripten/third_party/websockify/tests/load.py +0 -167
- data/modules/emscripten/third_party/websockify/tests/plain_echo.html +0 -168
- data/modules/emscripten/third_party/websockify/tests/simple.html +0 -68
- data/modules/emscripten/third_party/websockify/tests/utf8-list.py +0 -22
- data/modules/emscripten/third_party/websockify/websockify/__init__.py +0 -2
- data/modules/emscripten/third_party/websockify/websockify/websocket.py +0 -982
- data/modules/emscripten/third_party/websockify/websockify/websocketproxy.py +0 -393
- data/modules/emscripten/third_party/websockify/websockify.py +0 -5
- data/modules/emscripten/third_party/websockify/wsirc.html +0 -99
- data/modules/emscripten/third_party/websockify/wstelnet.html +0 -74
- data/modules/emscripten/tools/__init__.py +0 -0
- data/modules/emscripten/tools/asm_module.py +0 -275
- data/modules/emscripten/tools/autodebugger.py +0 -291
- data/modules/emscripten/tools/autodebugger_c.py +0 -37
- data/modules/emscripten/tools/autodebugger_indenter.py +0 -18
- data/modules/emscripten/tools/autodebugger_js.py +0 -47
- data/modules/emscripten/tools/autodediffer.py +0 -60
- data/modules/emscripten/tools/bindings_generator.py +0 -832
- data/modules/emscripten/tools/bisect_pair.py +0 -88
- data/modules/emscripten/tools/cache.py +0 -196
- data/modules/emscripten/tools/clean_webconsole.py +0 -34
- data/modules/emscripten/tools/crunch-worker.js +0 -124
- data/modules/emscripten/tools/diff_autodebugger.py +0 -15
- data/modules/emscripten/tools/eliminator/asm-eliminator-test-output.js +0 -307
- data/modules/emscripten/tools/eliminator/asm-eliminator-test.js +0 -382
- data/modules/emscripten/tools/eliminator/eliminator-test-output.js +0 -6136
- data/modules/emscripten/tools/eliminator/eliminator-test.js +0 -8879
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.html +0 -888
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/README.org +0 -463
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/bin/uglifyjs +0 -317
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/docstyle.css +0 -75
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/object-ast.js +0 -75
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/parse-js.js +0 -1363
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/process.js +0 -2005
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/lib/squeeze-more.js +0 -51
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/package.json +0 -22
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/beautify.js +0 -28
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/testparser.js +0 -402
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array1.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array2.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array3.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/array4.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/assignment.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/concatstring.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/const.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/forstatement.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/if.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue10.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue11.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue13.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue14.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue16.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue17.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue20.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue21.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue25.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue27.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue28.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue29.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue30.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue34.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue4.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue48.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue50.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue53.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue68.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue69.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/issue9.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/mangle.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/var.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/expected/with.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array1.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array2.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array3.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/array4.js +0 -6
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/assignment.js +0 -20
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/concatstring.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/const.js +0 -5
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/forstatement.js +0 -10
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/if.js +0 -6
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn.js +0 -9
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js +0 -16
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue10.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue11.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue13.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue14.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue16.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue17.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue20.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue21.js +0 -6
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue25.js +0 -7
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue27.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue28.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue29.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue30.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue34.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue4.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue48.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue50.js +0 -9
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue53.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue68.js +0 -5
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue69.js +0 -1
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/issue9.js +0 -4
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/mangle.js +0 -5
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/var.js +0 -3
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/compress/test/with.js +0 -2
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/test/unit/scripts.js +0 -55
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/hoist.js +0 -33
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument.js +0 -97
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/instrument2.js +0 -138
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/tmp/test.js +0 -16
- data/modules/emscripten/tools/eliminator/node_modules/uglify-js/uglify-js.js +0 -17
- data/modules/emscripten/tools/eliminator/safe-eliminator-test-output.js +0 -85
- data/modules/emscripten/tools/eliminator/safe-eliminator-test.js +0 -103
- data/modules/emscripten/tools/emconfiguren.py +0 -19
- data/modules/emscripten/tools/emmaken.py +0 -230
- data/modules/emscripten/tools/emmakenxx.py +0 -18
- data/modules/emscripten/tools/exec_llvm.py +0 -50
- data/modules/emscripten/tools/file2json.py +0 -49
- data/modules/emscripten/tools/file_packager.py +0 -719
- data/modules/emscripten/tools/find_bigfuncs.py +0 -23
- data/modules/emscripten/tools/find_bigis.py +0 -18
- data/modules/emscripten/tools/find_bigvars.py +0 -24
- data/modules/emscripten/tools/fix_closure.py +0 -88
- data/modules/emscripten/tools/gen_struct_info.py +0 -509
- data/modules/emscripten/tools/ie7_fix.py +0 -14
- data/modules/emscripten/tools/js-optimizer.js +0 -4023
- data/modules/emscripten/tools/js_optimizer.py +0 -357
- data/modules/emscripten/tools/jsrun.py +0 -37
- data/modules/emscripten/tools/ll-strip.py +0 -56
- data/modules/emscripten/tools/make_file.py +0 -19
- data/modules/emscripten/tools/make_minigzip.py +0 -13
- data/modules/emscripten/tools/merge_asm.py +0 -26
- data/modules/emscripten/tools/namespacer.py +0 -95
- data/modules/emscripten/tools/nativize_llvm.py +0 -34
- data/modules/emscripten/tools/node_modules/source-map/CHANGELOG.md +0 -58
- data/modules/emscripten/tools/node_modules/source-map/LICENSE +0 -28
- data/modules/emscripten/tools/node_modules/source-map/Makefile.dryice.js +0 -166
- data/modules/emscripten/tools/node_modules/source-map/README.md +0 -347
- data/modules/emscripten/tools/node_modules/source-map/build/assert-shim.js +0 -56
- data/modules/emscripten/tools/node_modules/source-map/build/mini-require.js +0 -152
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-source-map.jsm +0 -20
- data/modules/emscripten/tools/node_modules/source-map/build/prefix-utils.jsm +0 -18
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-browser.js +0 -8
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-source-map.jsm +0 -6
- data/modules/emscripten/tools/node_modules/source-map/build/suffix-utils.jsm +0 -21
- data/modules/emscripten/tools/node_modules/source-map/build/test-prefix.js +0 -8
- data/modules/emscripten/tools/node_modules/source-map/build/test-suffix.js +0 -3
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/array-set.js +0 -96
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64-vlq.js +0 -144
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/base64.js +0 -42
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/binary-search.js +0 -81
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-consumer.js +0 -430
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-map-generator.js +0 -381
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/source-node.js +0 -353
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map/util.js +0 -117
- data/modules/emscripten/tools/node_modules/source-map/lib/source-map.js +0 -8
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/LICENSE +0 -58
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/README.md +0 -119
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/amdefine.js +0 -299
- data/modules/emscripten/tools/node_modules/source-map/node_modules/amdefine/package.json +0 -33
- data/modules/emscripten/tools/node_modules/source-map/package.json +0 -74
- data/modules/emscripten/tools/node_modules/source-map/test/run-tests.js +0 -73
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-api.js +0 -26
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-array-set.js +0 -71
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64-vlq.js +0 -24
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-base64.js +0 -35
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-binary-search.js +0 -54
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-dog-fooding.js +0 -72
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-consumer.js +0 -306
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-map-generator.js +0 -391
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/test-source-node.js +0 -282
- data/modules/emscripten/tools/node_modules/source-map/test/source-map/util.js +0 -152
- data/modules/emscripten/tools/reproduceriter.js +0 -216
- data/modules/emscripten/tools/reproduceriter.py +0 -160
- data/modules/emscripten/tools/response_file.py +0 -34
- data/modules/emscripten/tools/scan_js.py +0 -20
- data/modules/emscripten/tools/scan_ll.py +0 -18
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/__init__.py +0 -3
- data/modules/emscripten/tools/scons/site_scons/site_tools/emscripten/emscripten.py +0 -46
- data/modules/emscripten/tools/settings_template_readonly.py +0 -49
- data/modules/emscripten/tools/shared.py +0 -1705
- data/modules/emscripten/tools/source-maps/sourcemap2json.js +0 -15
- data/modules/emscripten/tools/source-maps/sourcemapper.js +0 -208
- data/modules/emscripten/tools/split.py +0 -105
- data/modules/emscripten/tools/split_asm.py +0 -30
- data/modules/emscripten/tools/tempfiles.py +0 -41
- data/modules/emscripten/tools/test-js-optimizer-asm-last-output.js +0 -75
- data/modules/emscripten/tools/test-js-optimizer-asm-last.js +0 -91
- data/modules/emscripten/tools/test-js-optimizer-asm-minlast-output.js +0 -2
- data/modules/emscripten/tools/test-js-optimizer-asm-minlast.js +0 -8
- data/modules/emscripten/tools/test-js-optimizer-asm-outline1-output.js +0 -929
- data/modules/emscripten/tools/test-js-optimizer-asm-outline1.js +0 -351
- data/modules/emscripten/tools/test-js-optimizer-asm-outline2-output.js +0 -793
- data/modules/emscripten/tools/test-js-optimizer-asm-outline2.js +0 -606
- data/modules/emscripten/tools/test-js-optimizer-asm-outline3-output.js +0 -28
- data/modules/emscripten/tools/test-js-optimizer-asm-outline3.js +0 -30
- data/modules/emscripten/tools/test-js-optimizer-asm-pre-output.js +0 -522
- data/modules/emscripten/tools/test-js-optimizer-asm-pre.js +0 -533
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min-output.js +0 -36
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-min.js +0 -37
- data/modules/emscripten/tools/test-js-optimizer-asm-regs-output.js +0 -106
- data/modules/emscripten/tools/test-js-optimizer-asm-regs.js +0 -110
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate-output.js +0 -9
- data/modules/emscripten/tools/test-js-optimizer-asm-relocate.js +0 -12
- data/modules/emscripten/tools/test-js-optimizer-output.js +0 -291
- data/modules/emscripten/tools/test-js-optimizer-regs-output.js +0 -232
- data/modules/emscripten/tools/test-js-optimizer-regs.js +0 -237
- data/modules/emscripten/tools/test-js-optimizer-t2-output.js +0 -91
- data/modules/emscripten/tools/test-js-optimizer-t2.js +0 -92
- data/modules/emscripten/tools/test-js-optimizer-t2c-output.js +0 -17
- data/modules/emscripten/tools/test-js-optimizer-t2c.js +0 -18
- data/modules/emscripten/tools/test-js-optimizer-t3-output.js +0 -49
- data/modules/emscripten/tools/test-js-optimizer-t3.js +0 -50
- data/modules/emscripten/tools/test-js-optimizer.js +0 -401
- data/modules/emscripten/tools/validate_asmjs.py +0 -82
- data/modules/mruby/mrblib/print.rb +0 -18
- data/modules/mruby/src/re.h +0 -12
@@ -1,2728 +0,0 @@
|
|
1
|
-
//"use strict";
|
2
|
-
|
3
|
-
// See browser tests for examples (tests/runner.py, search for sdl_). Run with
|
4
|
-
// python tests/runner.py browser
|
5
|
-
|
6
|
-
// Notes:
|
7
|
-
// SDL_VIDEORESIZE: This is sent when the canvas is resized. Note that the user
|
8
|
-
// cannot manually do so, so this is only sent when the
|
9
|
-
// program manually resizes it (emscripten_set_canvas_size
|
10
|
-
// or otherwise).
|
11
|
-
|
12
|
-
var LibrarySDL = {
|
13
|
-
$SDL__deps: ['$FS', '$PATH', '$Browser'],
|
14
|
-
$SDL: {
|
15
|
-
defaults: {
|
16
|
-
width: 320,
|
17
|
-
height: 200,
|
18
|
-
copyOnLock: true
|
19
|
-
},
|
20
|
-
|
21
|
-
version: null,
|
22
|
-
|
23
|
-
surfaces: {},
|
24
|
-
// A pool of freed canvas elements. Reusing them avoids GC pauses.
|
25
|
-
canvasPool: [],
|
26
|
-
events: [],
|
27
|
-
fonts: [null],
|
28
|
-
|
29
|
-
// The currently preloaded audio elements ready to be played
|
30
|
-
audios: [null],
|
31
|
-
rwops: [null],
|
32
|
-
// The currently playing audio element. There's only one music track.
|
33
|
-
music: {
|
34
|
-
audio: null,
|
35
|
-
volume: 1.0
|
36
|
-
},
|
37
|
-
mixerFrequency: 22050,
|
38
|
-
mixerFormat: {{{ cDefine('AUDIO_S16LSB') }}}, //0x8010, // AUDIO_S16LSB
|
39
|
-
mixerNumChannels: 2,
|
40
|
-
mixerChunkSize: 1024,
|
41
|
-
channelMinimumNumber: 0,
|
42
|
-
|
43
|
-
GL: false, // Set to true if we call SDL_SetVideoMode with SDL_OPENGL, and if so, we do not create 2D canvases&contexts for blitting
|
44
|
-
// Note that images loaded before SDL_SetVideoMode will not get this optimization
|
45
|
-
|
46
|
-
// all possible GL attributes, with their default value
|
47
|
-
glAttributes: {
|
48
|
-
0: 3, /* SDL_GL_RED_SIZE */
|
49
|
-
1: 3, /* SDL_GL_GREEN_SIZE */
|
50
|
-
2: 2, /* SDL_GL_BLUE_SIZE */
|
51
|
-
3: 0, /* SDL_GL_ALPHA_SIZE */
|
52
|
-
4: 0, /* SDL_GL_BUFFER_SIZE */
|
53
|
-
5: 1, /* SDL_GL_DOUBLEBUFFER */
|
54
|
-
6: 16, /* SDL_GL_DEPTH_SIZE */
|
55
|
-
7: 0, /* SDL_GL_STENCIL_SIZE */
|
56
|
-
8: 0, /* SDL_GL_ACCUM_RED_SIZE */
|
57
|
-
9: 0, /* SDL_GL_ACCUM_GREEN_SIZE */
|
58
|
-
10: 0, /* SDL_GL_ACCUM_BLUE_SIZE */
|
59
|
-
11: 0, /* SDL_GL_ACCUM_ALPHA_SIZE */
|
60
|
-
12: 0, /* SDL_GL_STEREO */
|
61
|
-
13: 0, /* SDL_GL_MULTISAMPLEBUFFERS */
|
62
|
-
14: 0, /* SDL_GL_MULTISAMPLESAMPLES */
|
63
|
-
15: 1, /* SDL_GL_ACCELERATED_VISUAL */
|
64
|
-
16: 0, /* SDL_GL_RETAINED_BACKING */
|
65
|
-
17: 0, /* SDL_GL_CONTEXT_MAJOR_VERSION */
|
66
|
-
18: 0 /* SDL_GL_CONTEXT_MINOR_VERSION */
|
67
|
-
},
|
68
|
-
|
69
|
-
keyboardState: null,
|
70
|
-
keyboardMap: {},
|
71
|
-
|
72
|
-
canRequestFullscreen: false,
|
73
|
-
isRequestingFullscreen: false,
|
74
|
-
|
75
|
-
textInput: false,
|
76
|
-
|
77
|
-
startTime: null,
|
78
|
-
initFlags: 0, // The flags passed to SDL_Init
|
79
|
-
buttonState: 0,
|
80
|
-
modState: 0,
|
81
|
-
DOMButtons: [0, 0, 0],
|
82
|
-
|
83
|
-
DOMEventToSDLEvent: {},
|
84
|
-
|
85
|
-
keyCodes: { // DOM code ==> SDL code. See https://developer.mozilla.org/en/Document_Object_Model_%28DOM%29/KeyboardEvent and SDL_keycode.h
|
86
|
-
46: 127, // SDLK_DEL == '\177'
|
87
|
-
38: 1106, // up arrow
|
88
|
-
40: 1105, // down arrow
|
89
|
-
37: 1104, // left arrow
|
90
|
-
39: 1103, // right arrow
|
91
|
-
|
92
|
-
33: 1099, // pagedup
|
93
|
-
34: 1102, // pagedown
|
94
|
-
|
95
|
-
17: 1248, // control (right, or left)
|
96
|
-
18: 1250, // alt
|
97
|
-
173: 45, // minus
|
98
|
-
16: 1249, // shift
|
99
|
-
|
100
|
-
96: 88 | 1<<10, // keypad 0
|
101
|
-
97: 89 | 1<<10, // keypad 1
|
102
|
-
98: 90 | 1<<10, // keypad 2
|
103
|
-
99: 91 | 1<<10, // keypad 3
|
104
|
-
100: 92 | 1<<10, // keypad 4
|
105
|
-
101: 93 | 1<<10, // keypad 5
|
106
|
-
102: 94 | 1<<10, // keypad 6
|
107
|
-
103: 95 | 1<<10, // keypad 7
|
108
|
-
104: 96 | 1<<10, // keypad 8
|
109
|
-
105: 97 | 1<<10, // keypad 9
|
110
|
-
|
111
|
-
112: 58 | 1<<10, // F1
|
112
|
-
113: 59 | 1<<10, // F2
|
113
|
-
114: 60 | 1<<10, // F3
|
114
|
-
115: 61 | 1<<10, // F4
|
115
|
-
116: 62 | 1<<10, // F5
|
116
|
-
117: 63 | 1<<10, // F6
|
117
|
-
118: 64 | 1<<10, // F7
|
118
|
-
119: 65 | 1<<10, // F8
|
119
|
-
120: 66 | 1<<10, // F9
|
120
|
-
121: 67 | 1<<10, // F10
|
121
|
-
122: 68 | 1<<10, // F11
|
122
|
-
123: 69 | 1<<10, // F12
|
123
|
-
|
124
|
-
188: 44, // comma
|
125
|
-
190: 46, // period
|
126
|
-
191: 47, // slash (/)
|
127
|
-
192: 96, // backtick/backquote (`)
|
128
|
-
},
|
129
|
-
|
130
|
-
scanCodes: { // SDL keycode ==> SDL scancode. See SDL_scancode.h
|
131
|
-
97: 4, // A
|
132
|
-
98: 5,
|
133
|
-
99: 6,
|
134
|
-
100: 7,
|
135
|
-
101: 8,
|
136
|
-
102: 9,
|
137
|
-
103: 10,
|
138
|
-
104: 11,
|
139
|
-
105: 12,
|
140
|
-
106: 13,
|
141
|
-
107: 14,
|
142
|
-
108: 15,
|
143
|
-
109: 16,
|
144
|
-
110: 17,
|
145
|
-
111: 18,
|
146
|
-
112: 19,
|
147
|
-
113: 20,
|
148
|
-
114: 21,
|
149
|
-
115: 22,
|
150
|
-
116: 23,
|
151
|
-
117: 24,
|
152
|
-
118: 25,
|
153
|
-
119: 26,
|
154
|
-
120: 27,
|
155
|
-
121: 28,
|
156
|
-
122: 29, // Z
|
157
|
-
49: 30, // 1
|
158
|
-
50: 31,
|
159
|
-
51: 32,
|
160
|
-
52: 33,
|
161
|
-
53: 34,
|
162
|
-
54: 35,
|
163
|
-
55: 36,
|
164
|
-
56: 37,
|
165
|
-
57: 38, // 9
|
166
|
-
48: 39, // 0
|
167
|
-
13: 40, // return
|
168
|
-
27: 41, // escape
|
169
|
-
8: 42, // backspace
|
170
|
-
9: 43, // tab
|
171
|
-
32: 44, // space
|
172
|
-
61: 46, // equals
|
173
|
-
91: 47, // left bracket
|
174
|
-
93: 48, // right bracket
|
175
|
-
92: 49, // backslash
|
176
|
-
59: 51, // ;
|
177
|
-
96: 52, // apostrophe
|
178
|
-
44: 54, // comma
|
179
|
-
46: 55, // period
|
180
|
-
47: 56, // slash
|
181
|
-
305: 224, // ctrl
|
182
|
-
308: 226, // alt
|
183
|
-
},
|
184
|
-
loadRect: function(rect) {
|
185
|
-
return {
|
186
|
-
x: {{{ makeGetValue('rect + ' + C_STRUCTS.SDL_Rect.x, '0', 'i32') }}},
|
187
|
-
y: {{{ makeGetValue('rect + ' + C_STRUCTS.SDL_Rect.y, '0', 'i32') }}},
|
188
|
-
w: {{{ makeGetValue('rect + ' + C_STRUCTS.SDL_Rect.w, '0', 'i32') }}},
|
189
|
-
h: {{{ makeGetValue('rect + ' + C_STRUCTS.SDL_Rect.h, '0', 'i32') }}}
|
190
|
-
};
|
191
|
-
},
|
192
|
-
|
193
|
-
// Load SDL color into a CSS-style color specification
|
194
|
-
loadColorToCSSRGB: function(color) {
|
195
|
-
var rgba = {{{ makeGetValue('color', '0', 'i32') }}};
|
196
|
-
return 'rgb(' + (rgba&255) + ',' + ((rgba >> 8)&255) + ',' + ((rgba >> 16)&255) + ')';
|
197
|
-
},
|
198
|
-
loadColorToCSSRGBA: function(color) {
|
199
|
-
var rgba = {{{ makeGetValue('color', '0', 'i32') }}};
|
200
|
-
return 'rgba(' + (rgba&255) + ',' + ((rgba >> 8)&255) + ',' + ((rgba >> 16)&255) + ',' + (((rgba >> 24)&255)/255) + ')';
|
201
|
-
},
|
202
|
-
|
203
|
-
translateColorToCSSRGBA: function(rgba) {
|
204
|
-
return 'rgba(' + (rgba&0xff) + ',' + (rgba>>8 & 0xff) + ',' + (rgba>>16 & 0xff) + ',' + (rgba>>>24)/0xff + ')';
|
205
|
-
},
|
206
|
-
|
207
|
-
translateRGBAToCSSRGBA: function(r, g, b, a) {
|
208
|
-
return 'rgba(' + (r&0xff) + ',' + (g&0xff) + ',' + (b&0xff) + ',' + (a&0xff)/255 + ')';
|
209
|
-
},
|
210
|
-
|
211
|
-
translateRGBAToColor: function(r, g, b, a) {
|
212
|
-
return r | g << 8 | b << 16 | a << 24;
|
213
|
-
},
|
214
|
-
|
215
|
-
makeSurface: function(width, height, flags, usePageCanvas, source, rmask, gmask, bmask, amask) {
|
216
|
-
flags = flags || 0;
|
217
|
-
var surf = _malloc({{{ C_STRUCTS.SDL_Surface.__size__ }}}); // SDL_Surface has 15 fields of quantum size
|
218
|
-
var buffer = _malloc(width*height*4); // TODO: only allocate when locked the first time
|
219
|
-
var pixelFormat = _malloc({{{ C_STRUCTS.SDL_PixelFormat.__size__ }}});
|
220
|
-
flags |= 1; // SDL_HWSURFACE - this tells SDL_MUSTLOCK that this needs to be locked
|
221
|
-
|
222
|
-
//surface with SDL_HWPALETTE flag is 8bpp surface (1 byte)
|
223
|
-
var is_SDL_HWPALETTE = flags & 0x00200000;
|
224
|
-
var bpp = is_SDL_HWPALETTE ? 1 : 4;
|
225
|
-
|
226
|
-
{{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.flags, 'flags', 'i32') }}} // SDL_Surface.flags
|
227
|
-
{{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.format, 'pixelFormat', 'void*') }}} // SDL_Surface.format TODO
|
228
|
-
{{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.w, 'width', 'i32') }}} // SDL_Surface.w
|
229
|
-
{{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.h, 'height', 'i32') }}} // SDL_Surface.h
|
230
|
-
{{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.pitch, 'width * bpp', 'i32') }}} // SDL_Surface.pitch, assuming RGBA or indexed for now,
|
231
|
-
// since that is what ImageData gives us in browsers
|
232
|
-
{{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.pixels, 'buffer', 'void*') }}} // SDL_Surface.pixels
|
233
|
-
{{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.clip_rect, '0', 'i32*') }}} // SDL_Surface.offset
|
234
|
-
|
235
|
-
{{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.refcount, '1', 'i32') }}}
|
236
|
-
|
237
|
-
{{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.format, cDefine('SDL_PIXELFORMAT_RGBA8888'), 'i32') }}} // SDL_PIXELFORMAT_RGBA8888
|
238
|
-
{{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.palette, '0', 'i32') }}} // TODO
|
239
|
-
{{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.BitsPerPixel, 'bpp * 8', 'i8') }}}
|
240
|
-
{{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.BytesPerPixel, 'bpp', 'i8') }}}
|
241
|
-
|
242
|
-
{{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Rmask, 'rmask || 0x000000ff', 'i32') }}}
|
243
|
-
{{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Gmask, 'gmask || 0x0000ff00', 'i32') }}}
|
244
|
-
{{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Bmask, 'bmask || 0x00ff0000', 'i32') }}}
|
245
|
-
{{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Amask, 'amask || 0xff000000', 'i32') }}}
|
246
|
-
|
247
|
-
// Decide if we want to use WebGL or not
|
248
|
-
var useWebGL = (flags & 0x04000000) != 0; // SDL_OPENGL
|
249
|
-
SDL.GL = SDL.GL || useWebGL;
|
250
|
-
var canvas;
|
251
|
-
if (!usePageCanvas) {
|
252
|
-
if (SDL.canvasPool.length > 0) {
|
253
|
-
canvas = SDL.canvasPool.pop();
|
254
|
-
} else {
|
255
|
-
canvas = document.createElement('canvas');
|
256
|
-
}
|
257
|
-
canvas.width = width;
|
258
|
-
canvas.height = height;
|
259
|
-
} else {
|
260
|
-
canvas = Module['canvas'];
|
261
|
-
}
|
262
|
-
|
263
|
-
var webGLContextAttributes = {
|
264
|
-
antialias: ((SDL.glAttributes[13 /*SDL_GL_MULTISAMPLEBUFFERS*/] != 0) && (SDL.glAttributes[14 /*SDL_GL_MULTISAMPLESAMPLES*/] > 1)),
|
265
|
-
depth: (SDL.glAttributes[6 /*SDL_GL_DEPTH_SIZE*/] > 0),
|
266
|
-
stencil: (SDL.glAttributes[7 /*SDL_GL_STENCIL_SIZE*/] > 0)
|
267
|
-
};
|
268
|
-
|
269
|
-
var ctx = Browser.createContext(canvas, useWebGL, usePageCanvas, webGLContextAttributes);
|
270
|
-
|
271
|
-
SDL.surfaces[surf] = {
|
272
|
-
width: width,
|
273
|
-
height: height,
|
274
|
-
canvas: canvas,
|
275
|
-
ctx: ctx,
|
276
|
-
surf: surf,
|
277
|
-
buffer: buffer,
|
278
|
-
pixelFormat: pixelFormat,
|
279
|
-
alpha: 255,
|
280
|
-
flags: flags,
|
281
|
-
locked: 0,
|
282
|
-
usePageCanvas: usePageCanvas,
|
283
|
-
source: source,
|
284
|
-
|
285
|
-
isFlagSet: function(flag) {
|
286
|
-
return flags & flag;
|
287
|
-
}
|
288
|
-
};
|
289
|
-
|
290
|
-
return surf;
|
291
|
-
},
|
292
|
-
|
293
|
-
// Copy data from the C++-accessible storage to the canvas backing
|
294
|
-
// for surface with HWPALETTE flag(8bpp depth)
|
295
|
-
copyIndexedColorData: function(surfData, rX, rY, rW, rH) {
|
296
|
-
// HWPALETTE works with palette
|
297
|
-
// setted by SDL_SetColors
|
298
|
-
if (!surfData.colors) {
|
299
|
-
return;
|
300
|
-
}
|
301
|
-
|
302
|
-
var fullWidth = Module['canvas'].width;
|
303
|
-
var fullHeight = Module['canvas'].height;
|
304
|
-
|
305
|
-
var startX = rX || 0;
|
306
|
-
var startY = rY || 0;
|
307
|
-
var endX = (rW || (fullWidth - startX)) + startX;
|
308
|
-
var endY = (rH || (fullHeight - startY)) + startY;
|
309
|
-
|
310
|
-
var buffer = surfData.buffer;
|
311
|
-
var data = surfData.image.data;
|
312
|
-
var colors = surfData.colors;
|
313
|
-
|
314
|
-
for (var y = startY; y < endY; ++y) {
|
315
|
-
var indexBase = y * fullWidth;
|
316
|
-
var colorBase = indexBase * 4;
|
317
|
-
for (var x = startX; x < endX; ++x) {
|
318
|
-
// HWPALETTE have only 256 colors (not rgba)
|
319
|
-
var index = {{{ makeGetValue('buffer + indexBase + x', '0', 'i8', null, true) }}} * 3;
|
320
|
-
var colorOffset = colorBase + x * 4;
|
321
|
-
|
322
|
-
data[colorOffset ] = colors[index ];
|
323
|
-
data[colorOffset +1] = colors[index +1];
|
324
|
-
data[colorOffset +2] = colors[index +2];
|
325
|
-
//unused: data[colorOffset +3] = color[index +3];
|
326
|
-
}
|
327
|
-
}
|
328
|
-
},
|
329
|
-
|
330
|
-
freeSurface: function(surf) {
|
331
|
-
var refcountPointer = surf + {{{ C_STRUCTS.SDL_Surface.refcount }}};
|
332
|
-
var refcount = {{{ makeGetValue('refcountPointer', '0', 'i32') }}};
|
333
|
-
if (refcount > 1) {
|
334
|
-
{{{ makeSetValue('refcountPointer', '0', 'refcount - 1', 'i32') }}};
|
335
|
-
return;
|
336
|
-
}
|
337
|
-
|
338
|
-
var info = SDL.surfaces[surf];
|
339
|
-
if (!info.usePageCanvas && info.canvas) SDL.canvasPool.push(info.canvas);
|
340
|
-
_free(info.buffer);
|
341
|
-
_free(info.pixelFormat);
|
342
|
-
_free(surf);
|
343
|
-
SDL.surfaces[surf] = null;
|
344
|
-
},
|
345
|
-
|
346
|
-
touchX: 0, touchY: 0,
|
347
|
-
savedKeydown: null,
|
348
|
-
|
349
|
-
receiveEvent: function(event) {
|
350
|
-
switch(event.type) {
|
351
|
-
case 'touchstart':
|
352
|
-
event.preventDefault();
|
353
|
-
var touch = event.touches[0];
|
354
|
-
touchX = touch.pageX;
|
355
|
-
touchY = touch.pageY;
|
356
|
-
var event = {
|
357
|
-
type: 'mousedown',
|
358
|
-
button: 0,
|
359
|
-
pageX: touchX,
|
360
|
-
pageY: touchY
|
361
|
-
};
|
362
|
-
SDL.DOMButtons[0] = 1;
|
363
|
-
SDL.events.push(event);
|
364
|
-
break;
|
365
|
-
case 'touchmove':
|
366
|
-
event.preventDefault();
|
367
|
-
var touch = event.touches[0];
|
368
|
-
touchX = touch.pageX;
|
369
|
-
touchY = touch.pageY;
|
370
|
-
event = {
|
371
|
-
type: 'mousemove',
|
372
|
-
button: 0,
|
373
|
-
pageX: touchX,
|
374
|
-
pageY: touchY
|
375
|
-
};
|
376
|
-
SDL.events.push(event);
|
377
|
-
break;
|
378
|
-
case 'touchend':
|
379
|
-
event.preventDefault();
|
380
|
-
event = {
|
381
|
-
type: 'mouseup',
|
382
|
-
button: 0,
|
383
|
-
pageX: touchX,
|
384
|
-
pageY: touchY
|
385
|
-
};
|
386
|
-
SDL.DOMButtons[0] = 0;
|
387
|
-
SDL.events.push(event);
|
388
|
-
break;
|
389
|
-
case 'mousemove':
|
390
|
-
if (Browser.pointerLock) {
|
391
|
-
// workaround for firefox bug 750111
|
392
|
-
if ('mozMovementX' in event) {
|
393
|
-
event['movementX'] = event['mozMovementX'];
|
394
|
-
event['movementY'] = event['mozMovementY'];
|
395
|
-
}
|
396
|
-
// workaround for Firefox bug 782777
|
397
|
-
if (event['movementX'] == 0 && event['movementY'] == 0) {
|
398
|
-
// ignore a mousemove event if it doesn't contain any movement info
|
399
|
-
// (without pointer lock, we infer movement from pageX/pageY, so this check is unnecessary)
|
400
|
-
event.preventDefault();
|
401
|
-
return;
|
402
|
-
}
|
403
|
-
}
|
404
|
-
// fall through
|
405
|
-
case 'keydown': case 'keyup': case 'keypress': case 'mousedown': case 'mouseup': case 'DOMMouseScroll': case 'mousewheel':
|
406
|
-
// If we preventDefault on keydown events, the subsequent keypress events
|
407
|
-
// won't fire. However, it's fine (and in some cases necessary) to
|
408
|
-
// preventDefault for keys that don't generate a character. Otherwise,
|
409
|
-
// preventDefault is the right thing to do in general.
|
410
|
-
if (event.type !== 'keydown' || (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */)) {
|
411
|
-
event.preventDefault();
|
412
|
-
}
|
413
|
-
|
414
|
-
if (event.type == 'DOMMouseScroll' || event.type == 'mousewheel') {
|
415
|
-
var button = (event.type == 'DOMMouseScroll' ? event.detail : -event.wheelDelta) > 0 ? 4 : 3;
|
416
|
-
var event2 = {
|
417
|
-
type: 'mousedown',
|
418
|
-
button: button,
|
419
|
-
pageX: event.pageX,
|
420
|
-
pageY: event.pageY
|
421
|
-
};
|
422
|
-
SDL.events.push(event2);
|
423
|
-
event = {
|
424
|
-
type: 'mouseup',
|
425
|
-
button: button,
|
426
|
-
pageX: event.pageX,
|
427
|
-
pageY: event.pageY
|
428
|
-
};
|
429
|
-
} else if (event.type == 'mousedown') {
|
430
|
-
SDL.DOMButtons[event.button] = 1;
|
431
|
-
} else if (event.type == 'mouseup') {
|
432
|
-
// ignore extra ups, can happen if we leave the canvas while pressing down, then return,
|
433
|
-
// since we add a mouseup in that case
|
434
|
-
if (!SDL.DOMButtons[event.button]) {
|
435
|
-
return;
|
436
|
-
}
|
437
|
-
|
438
|
-
SDL.DOMButtons[event.button] = 0;
|
439
|
-
}
|
440
|
-
|
441
|
-
// We can only request fullscreen as the result of user input.
|
442
|
-
// Due to this limitation, we toggle a boolean on keydown which
|
443
|
-
// SDL_WM_ToggleFullScreen will check and subsequently set another
|
444
|
-
// flag indicating for us to request fullscreen on the following
|
445
|
-
// keyup. This isn't perfect, but it enables SDL_WM_ToggleFullScreen
|
446
|
-
// to work as the result of a keypress (which is an extremely
|
447
|
-
// common use case).
|
448
|
-
if (event.type === 'keydown') {
|
449
|
-
SDL.canRequestFullscreen = true;
|
450
|
-
} else if (event.type === 'keyup') {
|
451
|
-
if (SDL.isRequestingFullscreen) {
|
452
|
-
Module['requestFullScreen'](true, true);
|
453
|
-
SDL.isRequestingFullscreen = false;
|
454
|
-
}
|
455
|
-
SDL.canRequestFullscreen = false;
|
456
|
-
}
|
457
|
-
|
458
|
-
// SDL expects a unicode character to be passed to its keydown events.
|
459
|
-
// Unfortunately, the browser APIs only provide a charCode property on
|
460
|
-
// keypress events, so we must backfill in keydown events with their
|
461
|
-
// subsequent keypress event's charCode.
|
462
|
-
if (event.type === 'keypress' && SDL.savedKeydown) {
|
463
|
-
// charCode is read-only
|
464
|
-
SDL.savedKeydown.keypressCharCode = event.charCode;
|
465
|
-
SDL.savedKeydown = null;
|
466
|
-
} else if (event.type === 'keydown') {
|
467
|
-
SDL.savedKeydown = event;
|
468
|
-
}
|
469
|
-
|
470
|
-
// Don't push keypress events unless SDL_StartTextInput has been called.
|
471
|
-
if (event.type !== 'keypress' || SDL.textInput) {
|
472
|
-
SDL.events.push(event);
|
473
|
-
}
|
474
|
-
break;
|
475
|
-
case 'mouseout':
|
476
|
-
// Un-press all pressed mouse buttons, because we might miss the release outside of the canvas
|
477
|
-
for (var i = 0; i < 3; i++) {
|
478
|
-
if (SDL.DOMButtons[i]) {
|
479
|
-
SDL.events.push({
|
480
|
-
type: 'mouseup',
|
481
|
-
button: i,
|
482
|
-
pageX: event.pageX,
|
483
|
-
pageY: event.pageY
|
484
|
-
});
|
485
|
-
SDL.DOMButtons[i] = 0;
|
486
|
-
}
|
487
|
-
}
|
488
|
-
event.preventDefault();
|
489
|
-
break;
|
490
|
-
case 'blur':
|
491
|
-
case 'visibilitychange': {
|
492
|
-
// Un-press all pressed keys: TODO
|
493
|
-
for (var code in SDL.keyboardMap) {
|
494
|
-
SDL.events.push({
|
495
|
-
type: 'keyup',
|
496
|
-
keyCode: SDL.keyboardMap[code]
|
497
|
-
});
|
498
|
-
}
|
499
|
-
event.preventDefault();
|
500
|
-
break;
|
501
|
-
}
|
502
|
-
case 'unload':
|
503
|
-
if (Browser.mainLoop.runner) {
|
504
|
-
SDL.events.push(event);
|
505
|
-
// Force-run a main event loop, since otherwise this event will never be caught!
|
506
|
-
Browser.mainLoop.runner();
|
507
|
-
}
|
508
|
-
return;
|
509
|
-
case 'resize':
|
510
|
-
SDL.events.push(event);
|
511
|
-
// manually triggered resize event doesn't have a preventDefault member
|
512
|
-
if (event.preventDefault) {
|
513
|
-
event.preventDefault();
|
514
|
-
}
|
515
|
-
break;
|
516
|
-
}
|
517
|
-
if (SDL.events.length >= 10000) {
|
518
|
-
Module.printErr('SDL event queue full, dropping events');
|
519
|
-
SDL.events = SDL.events.slice(0, 10000);
|
520
|
-
}
|
521
|
-
return;
|
522
|
-
},
|
523
|
-
|
524
|
-
handleEvent: function(event) {
|
525
|
-
if (event.handled) return;
|
526
|
-
event.handled = true;
|
527
|
-
|
528
|
-
switch (event.type) {
|
529
|
-
case 'keydown': case 'keyup': {
|
530
|
-
var down = event.type === 'keydown';
|
531
|
-
var code = event.keyCode;
|
532
|
-
if (code >= 65 && code <= 90) {
|
533
|
-
code += 32; // make lowercase for SDL
|
534
|
-
} else {
|
535
|
-
code = SDL.keyCodes[event.keyCode] || event.keyCode;
|
536
|
-
}
|
537
|
-
|
538
|
-
{{{ makeSetValue('SDL.keyboardState', 'code', 'down', 'i8') }}};
|
539
|
-
// TODO: lmeta, rmeta, numlock, capslock, KMOD_MODE, KMOD_RESERVED
|
540
|
-
SDL.modState = ({{{ makeGetValue('SDL.keyboardState', '1248', 'i8') }}} ? 0x0040 | 0x0080 : 0) | // KMOD_LCTRL & KMOD_RCTRL
|
541
|
-
({{{ makeGetValue('SDL.keyboardState', '1249', 'i8') }}} ? 0x0001 | 0x0002 : 0) | // KMOD_LSHIFT & KMOD_RSHIFT
|
542
|
-
({{{ makeGetValue('SDL.keyboardState', '1250', 'i8') }}} ? 0x0100 | 0x0200 : 0); // KMOD_LALT & KMOD_RALT
|
543
|
-
|
544
|
-
if (down) {
|
545
|
-
SDL.keyboardMap[code] = event.keyCode; // save the DOM input, which we can use to unpress it during blur
|
546
|
-
} else {
|
547
|
-
delete SDL.keyboardMap[code];
|
548
|
-
}
|
549
|
-
|
550
|
-
break;
|
551
|
-
}
|
552
|
-
case 'mousedown': case 'mouseup':
|
553
|
-
if (event.type == 'mousedown') {
|
554
|
-
// SDL_BUTTON(x) is defined as (1 << ((x)-1)). SDL buttons are 1-3,
|
555
|
-
// and DOM buttons are 0-2, so this means that the below formula is
|
556
|
-
// correct.
|
557
|
-
SDL.buttonState |= 1 << event.button;
|
558
|
-
} else if (event.type == 'mouseup') {
|
559
|
-
SDL.buttonState &= ~(1 << event.button);
|
560
|
-
}
|
561
|
-
// fall through
|
562
|
-
case 'mousemove': {
|
563
|
-
Browser.calculateMouseEvent(event);
|
564
|
-
break;
|
565
|
-
}
|
566
|
-
}
|
567
|
-
},
|
568
|
-
|
569
|
-
makeCEvent: function(event, ptr) {
|
570
|
-
if (typeof event === 'number') {
|
571
|
-
// This is a pointer to a native C event that was SDL_PushEvent'ed
|
572
|
-
_memcpy(ptr, event, {{{ C_STRUCTS.SDL_KeyboardEvent.__size__ }}}); // XXX
|
573
|
-
return;
|
574
|
-
}
|
575
|
-
|
576
|
-
SDL.handleEvent(event);
|
577
|
-
|
578
|
-
switch (event.type) {
|
579
|
-
case 'keydown': case 'keyup': {
|
580
|
-
var down = event.type === 'keydown';
|
581
|
-
//Module.print('Received key event: ' + event.keyCode);
|
582
|
-
var key = event.keyCode;
|
583
|
-
if (key >= 65 && key <= 90) {
|
584
|
-
key += 32; // make lowercase for SDL
|
585
|
-
} else {
|
586
|
-
key = SDL.keyCodes[event.keyCode] || event.keyCode;
|
587
|
-
}
|
588
|
-
var scan;
|
589
|
-
if (key >= 1024) {
|
590
|
-
scan = key - 1024;
|
591
|
-
} else {
|
592
|
-
scan = SDL.scanCodes[key] || key;
|
593
|
-
}
|
594
|
-
|
595
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}}
|
596
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.state, 'down ? 1 : 0', 'i8') }}}
|
597
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.repeat, '0', 'i8') }}} // TODO
|
598
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.scancode, 'scan', 'i32') }}}
|
599
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.sym, 'key', 'i32') }}}
|
600
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.mod, 'SDL.modState', 'i16') }}}
|
601
|
-
// some non-character keys (e.g. backspace and tab) won't have keypressCharCode set, fill in with the keyCode.
|
602
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.unicode, 'event.keypressCharCode || key', 'i32') }}}
|
603
|
-
|
604
|
-
break;
|
605
|
-
}
|
606
|
-
case 'keypress': {
|
607
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_TextInputEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}}
|
608
|
-
// Not filling in windowID for now
|
609
|
-
var cStr = intArrayFromString(String.fromCharCode(event.charCode));
|
610
|
-
for (var i = 0; i < cStr.length; ++i) {
|
611
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_TextInputEvent.text + ' + i', 'cStr[i]', 'i8') }}};
|
612
|
-
}
|
613
|
-
break;
|
614
|
-
}
|
615
|
-
case 'mousedown': case 'mouseup': case 'mousemove': {
|
616
|
-
if (event.type != 'mousemove') {
|
617
|
-
var down = event.type === 'mousedown';
|
618
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseButtonEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}};
|
619
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseButtonEvent.button, 'event.button+1', 'i8') }}}; // DOM buttons are 0-2, SDL 1-3
|
620
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseButtonEvent.state, 'down ? 1 : 0', 'i8') }}};
|
621
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseButtonEvent.x, 'Browser.mouseX', 'i32') }}};
|
622
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseButtonEvent.y, 'Browser.mouseY', 'i32') }}};
|
623
|
-
} else {
|
624
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseMotionEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}};
|
625
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseMotionEvent.state, 'SDL.buttonState', 'i8') }}};
|
626
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseMotionEvent.x, 'Browser.mouseX', 'i32') }}};
|
627
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseMotionEvent.y, 'Browser.mouseY', 'i32') }}};
|
628
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseMotionEvent.xrel, 'Browser.mouseMovementX', 'i32') }}};
|
629
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_MouseMotionEvent.yrel, 'Browser.mouseMovementY', 'i32') }}};
|
630
|
-
}
|
631
|
-
break;
|
632
|
-
}
|
633
|
-
case 'unload': {
|
634
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}};
|
635
|
-
break;
|
636
|
-
}
|
637
|
-
case 'resize': {
|
638
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}};
|
639
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_ResizeEvent.w, 'event.w', 'i32') }}};
|
640
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_ResizeEvent.h, 'event.h', 'i32') }}};
|
641
|
-
break;
|
642
|
-
}
|
643
|
-
case 'joystick_button_up': case 'joystick_button_down': {
|
644
|
-
var state = event.type === 'joystick_button_up' ? 0 : 1;
|
645
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_JoyButtonEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}};
|
646
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_JoyButtonEvent.which, 'event.index', 'i8') }}};
|
647
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_JoyButtonEvent.button, 'event.button', 'i8') }}};
|
648
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_JoyButtonEvent.state, 'state', 'i8') }}};
|
649
|
-
break;
|
650
|
-
}
|
651
|
-
case 'joystick_axis_motion': {
|
652
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_JoyAxisEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}};
|
653
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_JoyAxisEvent.which, 'event.index', 'i8') }}};
|
654
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_JoyAxisEvent.axis, 'event.axis', 'i8') }}};
|
655
|
-
{{{ makeSetValue('ptr', C_STRUCTS.SDL_JoyAxisEvent.value, 'SDL.joystickAxisValueConversion(event.value)', 'i32') }}};
|
656
|
-
break;
|
657
|
-
}
|
658
|
-
default: throw 'Unhandled SDL event: ' + event.type;
|
659
|
-
}
|
660
|
-
},
|
661
|
-
|
662
|
-
estimateTextWidth: function(fontData, text) {
|
663
|
-
var h = fontData.size;
|
664
|
-
var fontString = h + 'px ' + fontData.name;
|
665
|
-
var tempCtx = SDL.ttfContext;
|
666
|
-
#if ASSERTIONS
|
667
|
-
assert(tempCtx, 'TTF_Init must have been called');
|
668
|
-
#endif
|
669
|
-
tempCtx.save();
|
670
|
-
tempCtx.font = fontString;
|
671
|
-
var ret = tempCtx.measureText(text).width | 0;
|
672
|
-
tempCtx.restore();
|
673
|
-
return ret;
|
674
|
-
},
|
675
|
-
|
676
|
-
// Sound
|
677
|
-
|
678
|
-
// Channels are a SDL abstraction for allowing multiple sound tracks to be
|
679
|
-
// played at the same time. We don't need to actually implement the mixing
|
680
|
-
// since the browser engine handles that for us. Therefore, in JS we just
|
681
|
-
// maintain a list of channels and return IDs for them to the SDL consumer.
|
682
|
-
allocateChannels: function(num) { // called from Mix_AllocateChannels and init
|
683
|
-
if (SDL.numChannels && SDL.numChannels >= num && num != 0) return;
|
684
|
-
SDL.numChannels = num;
|
685
|
-
SDL.channels = [];
|
686
|
-
for (var i = 0; i < num; i++) {
|
687
|
-
SDL.channels[i] = {
|
688
|
-
audio: null,
|
689
|
-
volume: 1.0
|
690
|
-
};
|
691
|
-
}
|
692
|
-
},
|
693
|
-
|
694
|
-
setGetVolume: function(info, volume) {
|
695
|
-
if (!info) return 0;
|
696
|
-
var ret = info.volume * 128; // MIX_MAX_VOLUME
|
697
|
-
if (volume != -1) {
|
698
|
-
info.volume = volume / 128;
|
699
|
-
if (info.audio) info.audio.volume = info.volume;
|
700
|
-
}
|
701
|
-
return ret;
|
702
|
-
},
|
703
|
-
|
704
|
-
// Debugging
|
705
|
-
|
706
|
-
debugSurface: function(surfData) {
|
707
|
-
console.log('dumping surface ' + [surfData.surf, surfData.source, surfData.width, surfData.height]);
|
708
|
-
var image = surfData.ctx.getImageData(0, 0, surfData.width, surfData.height);
|
709
|
-
var data = image.data;
|
710
|
-
var num = Math.min(surfData.width, surfData.height);
|
711
|
-
for (var i = 0; i < num; i++) {
|
712
|
-
console.log(' diagonal ' + i + ':' + [data[i*surfData.width*4 + i*4 + 0], data[i*surfData.width*4 + i*4 + 1], data[i*surfData.width*4 + i*4 + 2], data[i*surfData.width*4 + i*4 + 3]]);
|
713
|
-
}
|
714
|
-
},
|
715
|
-
|
716
|
-
// Joystick helper methods and state
|
717
|
-
|
718
|
-
joystickEventState: 1, // SDL_ENABLE
|
719
|
-
lastJoystickState: {}, // Map from SDL_Joystick* to their last known state. Required to determine if a change has occurred.
|
720
|
-
// Maps Joystick names to pointers. Allows us to avoid reallocating memory for
|
721
|
-
// joystick names each time this function is called.
|
722
|
-
joystickNamePool: {},
|
723
|
-
recordJoystickState: function(joystick, state) {
|
724
|
-
// Standardize button state.
|
725
|
-
var buttons = new Array(state.buttons.length);
|
726
|
-
for (var i = 0; i < state.buttons.length; i++) {
|
727
|
-
buttons[i] = SDL.getJoystickButtonState(state.buttons[i]);
|
728
|
-
}
|
729
|
-
|
730
|
-
SDL.lastJoystickState[joystick] = {
|
731
|
-
buttons: buttons,
|
732
|
-
axes: state.axes.slice(0),
|
733
|
-
timestamp: state.timestamp,
|
734
|
-
index: state.index,
|
735
|
-
id: state.id
|
736
|
-
};
|
737
|
-
},
|
738
|
-
// Retrieves the button state of the given gamepad button.
|
739
|
-
// Abstracts away implementation differences.
|
740
|
-
// Returns 'true' if pressed, 'false' otherwise.
|
741
|
-
getJoystickButtonState: function(button) {
|
742
|
-
if (typeof button === 'object') {
|
743
|
-
// Current gamepad API editor's draft (Firefox Nightly)
|
744
|
-
// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#idl-def-GamepadButton
|
745
|
-
return button.pressed;
|
746
|
-
} else {
|
747
|
-
// Current gamepad API working draft (Firefox / Chrome Stable)
|
748
|
-
// http://www.w3.org/TR/2012/WD-gamepad-20120529/#gamepad-interface
|
749
|
-
return button > 0;
|
750
|
-
}
|
751
|
-
},
|
752
|
-
// Queries for and inserts controller events into the SDL queue.
|
753
|
-
queryJoysticks: function() {
|
754
|
-
for (var joystick in SDL.lastJoystickState) {
|
755
|
-
var state = SDL.getGamepad(joystick - 1);
|
756
|
-
var prevState = SDL.lastJoystickState[joystick];
|
757
|
-
// Check only if the timestamp has differed.
|
758
|
-
// NOTE: Timestamp is not available in Firefox.
|
759
|
-
if (typeof state.timestamp !== 'number' || state.timestamp !== prevState.timestamp) {
|
760
|
-
var i;
|
761
|
-
for (i = 0; i < state.buttons.length; i++) {
|
762
|
-
var buttonState = SDL.getJoystickButtonState(state.buttons[i]);
|
763
|
-
// NOTE: The previous state already has a boolean representation of
|
764
|
-
// its button, so no need to standardize its button state here.
|
765
|
-
if (buttonState !== prevState.buttons[i]) {
|
766
|
-
// Insert button-press event.
|
767
|
-
SDL.events.push({
|
768
|
-
type: buttonState ? 'joystick_button_down' : 'joystick_button_up',
|
769
|
-
joystick: joystick,
|
770
|
-
index: joystick - 1,
|
771
|
-
button: i
|
772
|
-
});
|
773
|
-
}
|
774
|
-
}
|
775
|
-
for (i = 0; i < state.axes.length; i++) {
|
776
|
-
if (state.axes[i] !== prevState.axes[i]) {
|
777
|
-
// Insert axes-change event.
|
778
|
-
SDL.events.push({
|
779
|
-
type: 'joystick_axis_motion',
|
780
|
-
joystick: joystick,
|
781
|
-
index: joystick - 1,
|
782
|
-
axis: i,
|
783
|
-
value: state.axes[i]
|
784
|
-
});
|
785
|
-
}
|
786
|
-
}
|
787
|
-
|
788
|
-
SDL.recordJoystickState(joystick, state);
|
789
|
-
}
|
790
|
-
}
|
791
|
-
},
|
792
|
-
// Converts the double-based browser axis value [-1, 1] into SDL's 16-bit
|
793
|
-
// value [-32768, 32767]
|
794
|
-
joystickAxisValueConversion: function(value) {
|
795
|
-
// Ensures that 0 is 0, 1 is 32767, and -1 is 32768.
|
796
|
-
return Math.ceil(((value+1) * 32767.5) - 32768);
|
797
|
-
},
|
798
|
-
|
799
|
-
getGamepads: function() {
|
800
|
-
var fcn = navigator.getGamepads || navigator.webkitGamepads || navigator.mozGamepads || navigator.gamepads || navigator.webkitGetGamepads;
|
801
|
-
if (fcn !== undefined) {
|
802
|
-
// The function must be applied on the navigator object.
|
803
|
-
return fcn.apply(navigator);
|
804
|
-
} else {
|
805
|
-
return [];
|
806
|
-
}
|
807
|
-
},
|
808
|
-
|
809
|
-
// Helper function: Returns the gamepad if available, or null if not.
|
810
|
-
getGamepad: function(deviceIndex) {
|
811
|
-
var gamepads = SDL.getGamepads();
|
812
|
-
if (gamepads.length > deviceIndex && deviceIndex >= 0) {
|
813
|
-
return gamepads[deviceIndex];
|
814
|
-
}
|
815
|
-
return null;
|
816
|
-
},
|
817
|
-
},
|
818
|
-
|
819
|
-
SDL_Linked_Version: function() {
|
820
|
-
if (SDL.version === null) {
|
821
|
-
SDL.version = _malloc({{{ C_STRUCTS.SDL_version.__size__ }}});
|
822
|
-
{{{ makeSetValue('SDL.version + ' + C_STRUCTS.SDL_version.major, '0', '1', 'i8') }}}
|
823
|
-
{{{ makeSetValue('SDL.version + ' + C_STRUCTS.SDL_version.minor, '0', '3', 'i8') }}}
|
824
|
-
{{{ makeSetValue('SDL.version + ' + C_STRUCTS.SDL_version.patch, '0', '0', 'i8') }}}
|
825
|
-
}
|
826
|
-
return SDL.version;
|
827
|
-
},
|
828
|
-
|
829
|
-
SDL_Init: function(initFlags) {
|
830
|
-
SDL.startTime = Date.now();
|
831
|
-
SDL.initFlags = initFlags;
|
832
|
-
|
833
|
-
// capture all key events. we just keep down and up, but also capture press to prevent default actions
|
834
|
-
if (!Module['doNotCaptureKeyboard']) {
|
835
|
-
document.addEventListener("keydown", SDL.receiveEvent);
|
836
|
-
document.addEventListener("keyup", SDL.receiveEvent);
|
837
|
-
document.addEventListener("keypress", SDL.receiveEvent);
|
838
|
-
window.addEventListener("blur", SDL.receiveEvent);
|
839
|
-
document.addEventListener("visibilitychange", SDL.receiveEvent);
|
840
|
-
}
|
841
|
-
|
842
|
-
if (initFlags & 0x200) {
|
843
|
-
// SDL_INIT_JOYSTICK
|
844
|
-
// Firefox will not give us Joystick data unless we register this NOP
|
845
|
-
// callback.
|
846
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=936104
|
847
|
-
addEventListener("gamepadconnected", function() {});
|
848
|
-
}
|
849
|
-
|
850
|
-
window.addEventListener("unload", SDL.receiveEvent);
|
851
|
-
SDL.keyboardState = _malloc(0x10000); // Our SDL needs 512, but 64K is safe for older SDLs
|
852
|
-
_memset(SDL.keyboardState, 0, 0x10000);
|
853
|
-
// Initialize this structure carefully for closure
|
854
|
-
SDL.DOMEventToSDLEvent['keydown'] = 0x300 /* SDL_KEYDOWN */;
|
855
|
-
SDL.DOMEventToSDLEvent['keyup'] = 0x301 /* SDL_KEYUP */;
|
856
|
-
SDL.DOMEventToSDLEvent['keypress'] = 0x303 /* SDL_TEXTINPUT */;
|
857
|
-
SDL.DOMEventToSDLEvent['mousedown'] = 0x401 /* SDL_MOUSEBUTTONDOWN */;
|
858
|
-
SDL.DOMEventToSDLEvent['mouseup'] = 0x402 /* SDL_MOUSEBUTTONUP */;
|
859
|
-
SDL.DOMEventToSDLEvent['mousemove'] = 0x400 /* SDL_MOUSEMOTION */;
|
860
|
-
SDL.DOMEventToSDLEvent['unload'] = 0x100 /* SDL_QUIT */;
|
861
|
-
SDL.DOMEventToSDLEvent['resize'] = 0x7001 /* SDL_VIDEORESIZE/SDL_EVENT_COMPAT2 */;
|
862
|
-
// These are not technically DOM events; the HTML gamepad API is poll-based.
|
863
|
-
// However, we define them here, as the rest of the SDL code assumes that
|
864
|
-
// all SDL events originate as DOM events.
|
865
|
-
SDL.DOMEventToSDLEvent['joystick_axis_motion'] = 0x600 /* SDL_JOYAXISMOTION */;
|
866
|
-
SDL.DOMEventToSDLEvent['joystick_button_down'] = 0x603 /* SDL_JOYBUTTONDOWN */;
|
867
|
-
SDL.DOMEventToSDLEvent['joystick_button_up'] = 0x604 /* SDL_JOYBUTTONUP */;
|
868
|
-
return 0; // success
|
869
|
-
},
|
870
|
-
|
871
|
-
SDL_WasInit__deps: ['SDL_Init'],
|
872
|
-
SDL_WasInit: function() {
|
873
|
-
if (SDL.startTime === null) {
|
874
|
-
_SDL_Init();
|
875
|
-
}
|
876
|
-
return 1;
|
877
|
-
},
|
878
|
-
|
879
|
-
SDL_GetVideoInfo: function() {
|
880
|
-
// %struct.SDL_VideoInfo = type { i32, i32, %struct.SDL_PixelFormat*, i32, i32 } - 5 fields of quantum size
|
881
|
-
var ret = _malloc(5*Runtime.QUANTUM_SIZE);
|
882
|
-
{{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*0', '0', '0', 'i32') }}} // TODO
|
883
|
-
{{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*1', '0', '0', 'i32') }}} // TODO
|
884
|
-
{{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*2', '0', '0', 'void*') }}}
|
885
|
-
{{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*3', '0', 'Module["canvas"].width', 'i32') }}}
|
886
|
-
{{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*4', '0', 'Module["canvas"].height', 'i32') }}}
|
887
|
-
return ret;
|
888
|
-
},
|
889
|
-
|
890
|
-
SDL_ListModes: function(format, flags) {
|
891
|
-
return -1; // -1 == all modes are ok. TODO
|
892
|
-
},
|
893
|
-
|
894
|
-
SDL_VideoModeOK: function(width, height, depth, flags) {
|
895
|
-
// SDL_VideoModeOK returns 0 if the requested mode is not supported under any bit depth, or returns the
|
896
|
-
// bits-per-pixel of the closest available mode with the given width, height and requested surface flags
|
897
|
-
return depth; // all modes are ok.
|
898
|
-
},
|
899
|
-
|
900
|
-
SDL_AudioDriverName__deps: ['SDL_VideoDriverName'],
|
901
|
-
SDL_AudioDriverName: function(buf, max_size) {
|
902
|
-
return _SDL_VideoDriverName(buf, max_size);
|
903
|
-
},
|
904
|
-
|
905
|
-
SDL_VideoDriverName: function(buf, max_size) {
|
906
|
-
if (SDL.startTime === null) {
|
907
|
-
return 0; //return NULL
|
908
|
-
}
|
909
|
-
//driverName - emscripten_sdl_driver
|
910
|
-
var driverName = [101, 109, 115, 99, 114, 105, 112, 116, 101,
|
911
|
-
110, 95, 115, 100, 108, 95, 100, 114, 105, 118, 101, 114];
|
912
|
-
|
913
|
-
var index = 0;
|
914
|
-
var size = driverName.length;
|
915
|
-
|
916
|
-
if (max_size <= size) {
|
917
|
-
size = max_size - 1; //-1 cause null-terminator
|
918
|
-
}
|
919
|
-
|
920
|
-
while (index < size) {
|
921
|
-
var value = driverName[index];
|
922
|
-
{{{ makeSetValue('buf', 'index', 'value', 'i8') }}};
|
923
|
-
index++;
|
924
|
-
}
|
925
|
-
|
926
|
-
{{{ makeSetValue('buf', 'index', '0', 'i8') }}};
|
927
|
-
return buf;
|
928
|
-
},
|
929
|
-
|
930
|
-
SDL_SetVideoMode: function(width, height, depth, flags) {
|
931
|
-
['mousedown', 'mouseup', 'mousemove', 'DOMMouseScroll', 'mousewheel', 'mouseout'].forEach(function(event) {
|
932
|
-
Module['canvas'].addEventListener(event, SDL.receiveEvent, true);
|
933
|
-
});
|
934
|
-
|
935
|
-
// (0,0) means 'use fullscreen' in native; in Emscripten, use the current canvas size.
|
936
|
-
if (width == 0 && height == 0) {
|
937
|
-
var canvas = Module['canvas'];
|
938
|
-
width = canvas.width;
|
939
|
-
height = canvas.height;
|
940
|
-
}
|
941
|
-
|
942
|
-
Browser.setCanvasSize(width, height, true);
|
943
|
-
// Free the old surface first.
|
944
|
-
if (SDL.screen) {
|
945
|
-
SDL.freeSurface(SDL.screen);
|
946
|
-
SDL.screen = null;
|
947
|
-
}
|
948
|
-
SDL.screen = SDL.makeSurface(width, height, flags, true, 'screen');
|
949
|
-
if (!SDL.addedResizeListener) {
|
950
|
-
SDL.addedResizeListener = true;
|
951
|
-
Browser.resizeListeners.push(function(w, h) {
|
952
|
-
SDL.receiveEvent({
|
953
|
-
type: 'resize',
|
954
|
-
w: w,
|
955
|
-
h: h
|
956
|
-
});
|
957
|
-
});
|
958
|
-
}
|
959
|
-
return SDL.screen;
|
960
|
-
},
|
961
|
-
|
962
|
-
SDL_GetVideoSurface: function() {
|
963
|
-
return SDL.screen;
|
964
|
-
},
|
965
|
-
|
966
|
-
SDL_QuitSubSystem: function(flags) {
|
967
|
-
Module.print('SDL_QuitSubSystem called (and ignored)');
|
968
|
-
},
|
969
|
-
|
970
|
-
SDL_Quit: function() {
|
971
|
-
for (var i = 0; i < SDL.numChannels; ++i) {
|
972
|
-
if (SDL.channels[i].audio) {
|
973
|
-
SDL.channels[i].audio.pause();
|
974
|
-
}
|
975
|
-
}
|
976
|
-
if (SDL.music.audio) {
|
977
|
-
SDL.music.audio.pause();
|
978
|
-
}
|
979
|
-
Module.print('SDL_Quit called (and ignored)');
|
980
|
-
},
|
981
|
-
|
982
|
-
// Copy data from the canvas backing to a C++-accessible storage
|
983
|
-
SDL_LockSurface: function(surf) {
|
984
|
-
var surfData = SDL.surfaces[surf];
|
985
|
-
|
986
|
-
surfData.locked++;
|
987
|
-
if (surfData.locked > 1) return 0;
|
988
|
-
|
989
|
-
// Mark in C/C++-accessible SDL structure
|
990
|
-
// SDL_Surface has the following fields: Uint32 flags, SDL_PixelFormat *format; int w, h; Uint16 pitch; void *pixels; ...
|
991
|
-
// So we have fields all of the same size, and 5 of them before us.
|
992
|
-
// TODO: Use macros like in library.js
|
993
|
-
{{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.pixels, 'surfData.buffer', 'void*') }}};
|
994
|
-
|
995
|
-
if (surf == SDL.screen && Module.screenIsReadOnly && surfData.image) return 0;
|
996
|
-
|
997
|
-
surfData.image = surfData.ctx.getImageData(0, 0, surfData.width, surfData.height);
|
998
|
-
if (surf == SDL.screen) {
|
999
|
-
var data = surfData.image.data;
|
1000
|
-
var num = data.length;
|
1001
|
-
for (var i = 0; i < num/4; i++) {
|
1002
|
-
data[i*4+3] = 255; // opacity, as canvases blend alpha
|
1003
|
-
}
|
1004
|
-
}
|
1005
|
-
|
1006
|
-
if (SDL.defaults.copyOnLock) {
|
1007
|
-
// Copy pixel data to somewhere accessible to 'C/C++'
|
1008
|
-
if (surfData.isFlagSet(0x00200000 /* SDL_HWPALETTE */)) {
|
1009
|
-
// If this is neaded then
|
1010
|
-
// we should compact the data from 32bpp to 8bpp index.
|
1011
|
-
// I think best way to implement this is use
|
1012
|
-
// additional colorMap hash (color->index).
|
1013
|
-
// Something like this:
|
1014
|
-
//
|
1015
|
-
// var size = surfData.width * surfData.height;
|
1016
|
-
// var data = '';
|
1017
|
-
// for (var i = 0; i<size; i++) {
|
1018
|
-
// var color = SDL.translateRGBAToColor(
|
1019
|
-
// surfData.image.data[i*4 ],
|
1020
|
-
// surfData.image.data[i*4 +1],
|
1021
|
-
// surfData.image.data[i*4 +2],
|
1022
|
-
// 255);
|
1023
|
-
// var index = surfData.colorMap[color];
|
1024
|
-
// {{{ makeSetValue('surfData.buffer', 'i', 'index', 'i8') }}};
|
1025
|
-
// }
|
1026
|
-
throw 'CopyOnLock is not supported for SDL_LockSurface with SDL_HWPALETTE flag set' + new Error().stack;
|
1027
|
-
} else {
|
1028
|
-
#if USE_TYPED_ARRAYS == 2
|
1029
|
-
HEAPU8.set(surfData.image.data, surfData.buffer);
|
1030
|
-
#else
|
1031
|
-
var num2 = surfData.image.data.length;
|
1032
|
-
for (var i = 0; i < num2; i++) {
|
1033
|
-
{{{ makeSetValue('surfData.buffer', 'i', 'surfData.image.data[i]', 'i8') }}};
|
1034
|
-
}
|
1035
|
-
#endif
|
1036
|
-
}
|
1037
|
-
}
|
1038
|
-
|
1039
|
-
return 0;
|
1040
|
-
},
|
1041
|
-
|
1042
|
-
// Copy data from the C++-accessible storage to the canvas backing
|
1043
|
-
SDL_UnlockSurface: function(surf) {
|
1044
|
-
assert(!SDL.GL); // in GL mode we do not keep around 2D canvases and contexts
|
1045
|
-
|
1046
|
-
var surfData = SDL.surfaces[surf];
|
1047
|
-
|
1048
|
-
surfData.locked--;
|
1049
|
-
if (surfData.locked > 0) return;
|
1050
|
-
|
1051
|
-
// Copy pixel data to image
|
1052
|
-
if (surfData.isFlagSet(0x00200000 /* SDL_HWPALETTE */)) {
|
1053
|
-
SDL.copyIndexedColorData(surfData);
|
1054
|
-
} else if (!surfData.colors) {
|
1055
|
-
var data = surfData.image.data;
|
1056
|
-
var buffer = surfData.buffer;
|
1057
|
-
#if USE_TYPED_ARRAYS == 2
|
1058
|
-
assert(buffer % 4 == 0, 'Invalid buffer offset: ' + buffer);
|
1059
|
-
var src = buffer >> 2;
|
1060
|
-
var dst = 0;
|
1061
|
-
var isScreen = surf == SDL.screen;
|
1062
|
-
var num;
|
1063
|
-
if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) {
|
1064
|
-
// IE10/IE11: ImageData objects are backed by the deprecated CanvasPixelArray,
|
1065
|
-
// not UInt8ClampedArray. These don't have buffers, so we need to revert
|
1066
|
-
// to copying a byte at a time. We do the undefined check because modern
|
1067
|
-
// browsers do not define CanvasPixelArray anymore.
|
1068
|
-
num = data.length;
|
1069
|
-
while (dst < num) {
|
1070
|
-
var val = HEAP32[src]; // This is optimized. Instead, we could do {{{ makeGetValue('buffer', 'dst', 'i32') }}};
|
1071
|
-
data[dst ] = val & 0xff;
|
1072
|
-
data[dst+1] = (val >> 8) & 0xff;
|
1073
|
-
data[dst+2] = (val >> 16) & 0xff;
|
1074
|
-
data[dst+3] = isScreen ? 0xff : ((val >> 24) & 0xff);
|
1075
|
-
src++;
|
1076
|
-
dst += 4;
|
1077
|
-
}
|
1078
|
-
} else {
|
1079
|
-
var data32 = new Uint32Array(data.buffer);
|
1080
|
-
num = data32.length;
|
1081
|
-
if (isScreen) {
|
1082
|
-
while (dst < num) {
|
1083
|
-
// HEAP32[src++] is an optimization. Instead, we could do {{{ makeGetValue('buffer', 'dst', 'i32') }}};
|
1084
|
-
data32[dst++] = HEAP32[src++] | 0xff000000;
|
1085
|
-
}
|
1086
|
-
} else {
|
1087
|
-
while (dst < num) {
|
1088
|
-
data32[dst++] = HEAP32[src++];
|
1089
|
-
}
|
1090
|
-
}
|
1091
|
-
}
|
1092
|
-
#else
|
1093
|
-
var num = surfData.image.data.length;
|
1094
|
-
for (var i = 0; i < num; i++) {
|
1095
|
-
// We may need to correct signs here. Potentially you can hardcode a write of 255 to alpha, say, and
|
1096
|
-
// the compiler may decide to write -1 in the llvm bitcode...
|
1097
|
-
data[i] = {{{ makeGetValue('buffer', 'i', 'i8', null, true) }}};
|
1098
|
-
if (i % 4 == 3) data[i] = 0xff;
|
1099
|
-
}
|
1100
|
-
#endif
|
1101
|
-
} else {
|
1102
|
-
var width = Module['canvas'].width;
|
1103
|
-
var height = Module['canvas'].height;
|
1104
|
-
var s = surfData.buffer;
|
1105
|
-
var data = surfData.image.data;
|
1106
|
-
var colors = surfData.colors;
|
1107
|
-
for (var y = 0; y < height; y++) {
|
1108
|
-
var base = y*width*4;
|
1109
|
-
for (var x = 0; x < width; x++) {
|
1110
|
-
// See comment above about signs
|
1111
|
-
var val = {{{ makeGetValue('s++', '0', 'i8', null, true) }}} * 3;
|
1112
|
-
var start = base + x*4;
|
1113
|
-
data[start] = colors[val];
|
1114
|
-
data[start+1] = colors[val+1];
|
1115
|
-
data[start+2] = colors[val+2];
|
1116
|
-
}
|
1117
|
-
s += width*3;
|
1118
|
-
}
|
1119
|
-
}
|
1120
|
-
// Copy to canvas
|
1121
|
-
surfData.ctx.putImageData(surfData.image, 0, 0);
|
1122
|
-
// Note that we save the image, so future writes are fast. But, memory is not yet released
|
1123
|
-
},
|
1124
|
-
|
1125
|
-
SDL_Flip: function(surf) {
|
1126
|
-
// We actually do this in Unlock, since the screen surface has as its canvas
|
1127
|
-
// backing the page canvas element
|
1128
|
-
},
|
1129
|
-
|
1130
|
-
SDL_UpdateRect: function(surf, x, y, w, h) {
|
1131
|
-
// We actually do the whole screen in Unlock...
|
1132
|
-
},
|
1133
|
-
|
1134
|
-
SDL_UpdateRects: function(surf, numrects, rects) {
|
1135
|
-
// We actually do the whole screen in Unlock...
|
1136
|
-
},
|
1137
|
-
|
1138
|
-
SDL_Delay: function(delay) {
|
1139
|
-
if (!ENVIRONMENT_IS_WORKER) abort('SDL_Delay called on the main thread! Potential infinite loop, quitting.');
|
1140
|
-
// horrible busy-wait, but in a worker it at least does not block rendering
|
1141
|
-
var now = Date.now();
|
1142
|
-
while (Date.now() - now < delay) {}
|
1143
|
-
},
|
1144
|
-
|
1145
|
-
SDL_WM_SetCaption: function(title, icon) {
|
1146
|
-
title = title && Pointer_stringify(title);
|
1147
|
-
icon = icon && Pointer_stringify(icon);
|
1148
|
-
},
|
1149
|
-
|
1150
|
-
SDL_EnableKeyRepeat: function(delay, interval) {
|
1151
|
-
// TODO
|
1152
|
-
},
|
1153
|
-
|
1154
|
-
SDL_GetKeyboardState: function(numKeys) {
|
1155
|
-
if (numKeys) {
|
1156
|
-
{{{ makeSetValue('numKeys', 0, 0x10000, 'i32') }}};
|
1157
|
-
}
|
1158
|
-
return SDL.keyboardState;
|
1159
|
-
},
|
1160
|
-
|
1161
|
-
SDL_GetKeyState__deps: ['SDL_GetKeyboardState'],
|
1162
|
-
SDL_GetKeyState: function() {
|
1163
|
-
return _SDL_GetKeyboardState();
|
1164
|
-
},
|
1165
|
-
|
1166
|
-
SDL_GetKeyName: function(key) {
|
1167
|
-
if (!SDL.keyName) {
|
1168
|
-
SDL.keyName = allocate(intArrayFromString('unknown key'), 'i8', ALLOC_NORMAL);
|
1169
|
-
}
|
1170
|
-
return SDL.keyName;
|
1171
|
-
},
|
1172
|
-
|
1173
|
-
SDL_GetModState: function() {
|
1174
|
-
return SDL.modState;
|
1175
|
-
},
|
1176
|
-
|
1177
|
-
SDL_GetMouseState: function(x, y) {
|
1178
|
-
if (x) {{{ makeSetValue('x', '0', 'Browser.mouseX', 'i32') }}};
|
1179
|
-
if (y) {{{ makeSetValue('y', '0', 'Browser.mouseY', 'i32') }}};
|
1180
|
-
return SDL.buttonState;
|
1181
|
-
},
|
1182
|
-
|
1183
|
-
SDL_WarpMouse: function(x, y) {
|
1184
|
-
return; // TODO: implement this in a non-buggy way. Need to keep relative mouse movements correct after calling this
|
1185
|
-
var rect = Module["canvas"].getBoundingClientRect();
|
1186
|
-
SDL.events.push({
|
1187
|
-
type: 'mousemove',
|
1188
|
-
pageX: x + (window.scrollX + rect.left),
|
1189
|
-
pageY: y + (window.scrollY + rect.top)
|
1190
|
-
});
|
1191
|
-
},
|
1192
|
-
|
1193
|
-
SDL_ShowCursor: function(toggle) {
|
1194
|
-
switch (toggle) {
|
1195
|
-
case 0: // SDL_DISABLE
|
1196
|
-
if (Browser.isFullScreen) { // only try to lock the pointer when in full screen mode
|
1197
|
-
Module['canvas'].requestPointerLock();
|
1198
|
-
return 0;
|
1199
|
-
} else { // else return SDL_ENABLE to indicate the failure
|
1200
|
-
return 1;
|
1201
|
-
}
|
1202
|
-
break;
|
1203
|
-
case 1: // SDL_ENABLE
|
1204
|
-
Module['canvas'].exitPointerLock();
|
1205
|
-
return 1;
|
1206
|
-
break;
|
1207
|
-
case -1: // SDL_QUERY
|
1208
|
-
return !Browser.pointerLock;
|
1209
|
-
break;
|
1210
|
-
default:
|
1211
|
-
console.log( "SDL_ShowCursor called with unknown toggle parameter value: " + toggle + "." );
|
1212
|
-
break;
|
1213
|
-
}
|
1214
|
-
},
|
1215
|
-
|
1216
|
-
SDL_GetError: function() {
|
1217
|
-
if (!SDL.errorMessage) {
|
1218
|
-
SDL.errorMessage = allocate(intArrayFromString("unknown SDL-emscripten error"), 'i8', ALLOC_NORMAL);
|
1219
|
-
}
|
1220
|
-
return SDL.errorMessage;
|
1221
|
-
},
|
1222
|
-
|
1223
|
-
SDL_CreateRGBSurface: function(flags, width, height, depth, rmask, gmask, bmask, amask) {
|
1224
|
-
return SDL.makeSurface(width, height, flags, false, 'CreateRGBSurface', rmask, gmask, bmask, amask);
|
1225
|
-
},
|
1226
|
-
|
1227
|
-
SDL_CreateRGBSurfaceFrom: function(pixels, width, height, depth, pitch, rmask, gmask, bmask, amask) {
|
1228
|
-
// TODO: Actually fill pixel data to created surface.
|
1229
|
-
// TODO: Take into account depth and pitch parameters.
|
1230
|
-
console.log('TODO: Partially unimplemented SDL_CreateRGBSurfaceFrom called!');
|
1231
|
-
return SDL.makeSurface(width, height, 0, false, 'CreateRGBSurfaceFrom', rmask, gmask, bmask, amask);
|
1232
|
-
},
|
1233
|
-
|
1234
|
-
SDL_DisplayFormatAlpha: function(surf) {
|
1235
|
-
var oldData = SDL.surfaces[surf];
|
1236
|
-
var ret = SDL.makeSurface(oldData.width, oldData.height, oldData.flags, false, 'copy:' + oldData.source);
|
1237
|
-
var newData = SDL.surfaces[ret];
|
1238
|
-
//newData.ctx.putImageData(oldData.ctx.getImageData(0, 0, oldData.width, oldData.height), 0, 0);
|
1239
|
-
newData.ctx.drawImage(oldData.canvas, 0, 0);
|
1240
|
-
return ret;
|
1241
|
-
},
|
1242
|
-
|
1243
|
-
SDL_FreeSurface: function(surf) {
|
1244
|
-
if (surf) SDL.freeSurface(surf);
|
1245
|
-
},
|
1246
|
-
|
1247
|
-
SDL_UpperBlit__deps: ['SDL_LockSurface'],
|
1248
|
-
SDL_UpperBlit: function(src, srcrect, dst, dstrect) {
|
1249
|
-
var srcData = SDL.surfaces[src];
|
1250
|
-
var dstData = SDL.surfaces[dst];
|
1251
|
-
var sr, dr;
|
1252
|
-
if (srcrect) {
|
1253
|
-
sr = SDL.loadRect(srcrect);
|
1254
|
-
} else {
|
1255
|
-
sr = { x: 0, y: 0, w: srcData.width, h: srcData.height };
|
1256
|
-
}
|
1257
|
-
if (dstrect) {
|
1258
|
-
dr = SDL.loadRect(dstrect);
|
1259
|
-
} else {
|
1260
|
-
dr = { x: 0, y: 0, w: -1, h: -1 };
|
1261
|
-
}
|
1262
|
-
var oldAlpha = dstData.ctx.globalAlpha;
|
1263
|
-
dstData.ctx.globalAlpha = srcData.alpha/255;
|
1264
|
-
dstData.ctx.drawImage(srcData.canvas, sr.x, sr.y, sr.w, sr.h, dr.x, dr.y, sr.w, sr.h);
|
1265
|
-
dstData.ctx.globalAlpha = oldAlpha;
|
1266
|
-
if (dst != SDL.screen) {
|
1267
|
-
// XXX As in IMG_Load, for compatibility we write out |pixels|
|
1268
|
-
console.log('WARNING: copying canvas data to memory for compatibility');
|
1269
|
-
_SDL_LockSurface(dst);
|
1270
|
-
dstData.locked--; // The surface is not actually locked in this hack
|
1271
|
-
}
|
1272
|
-
return 0;
|
1273
|
-
},
|
1274
|
-
|
1275
|
-
SDL_LowerBlit: 'SDL_UpperBlit',
|
1276
|
-
|
1277
|
-
SDL_FillRect: function(surf, rect, color) {
|
1278
|
-
var surfData = SDL.surfaces[surf];
|
1279
|
-
assert(!surfData.locked); // but we could unlock and re-lock if we must..
|
1280
|
-
|
1281
|
-
if (surfData.isFlagSet(0x00200000 /* SDL_HWPALETTE */)) {
|
1282
|
-
//in SDL_HWPALETTE color is index (0..255)
|
1283
|
-
//so we should translate 1 byte value to
|
1284
|
-
//32 bit canvas
|
1285
|
-
var index = color * 3;
|
1286
|
-
color = SDL.translateRGBAToColor(surfData.colors[index], surfData.colors[index +1], surfData.colors[index +2], 255);
|
1287
|
-
}
|
1288
|
-
|
1289
|
-
var r = rect ? SDL.loadRect(rect) : { x: 0, y: 0, w: surfData.width, h: surfData.height };
|
1290
|
-
surfData.ctx.save();
|
1291
|
-
surfData.ctx.fillStyle = SDL.translateColorToCSSRGBA(color);
|
1292
|
-
surfData.ctx.fillRect(r.x, r.y, r.w, r.h);
|
1293
|
-
surfData.ctx.restore();
|
1294
|
-
return 0;
|
1295
|
-
},
|
1296
|
-
|
1297
|
-
SDL_BlitSurface__deps: ['SDL_UpperBlit'],
|
1298
|
-
SDL_BlitSurface: function(src, srcrect, dst, dstrect) {
|
1299
|
-
return _SDL_UpperBlit(src, srcrect, dst, dstrect);
|
1300
|
-
},
|
1301
|
-
|
1302
|
-
zoomSurface: function(src, x, y, smooth) {
|
1303
|
-
var srcData = SDL.surfaces[src];
|
1304
|
-
var w = srcData.width * x;
|
1305
|
-
var h = srcData.height * y;
|
1306
|
-
var ret = SDL.makeSurface(Math.abs(w), Math.abs(h), srcData.flags, false, 'zoomSurface');
|
1307
|
-
var dstData = SDL.surfaces[ret];
|
1308
|
-
if (x >= 0 && y >= 0) dstData.ctx.drawImage(srcData.canvas, 0, 0, w, h);
|
1309
|
-
else {
|
1310
|
-
dstData.ctx.save();
|
1311
|
-
dstData.ctx.scale(x < 0 ? -1 : 1, y < 0 ? -1 : 1);
|
1312
|
-
dstData.ctx.drawImage(srcData.canvas, w < 0 ? w : 0, h < 0 ? h : 0, Math.abs(w), Math.abs(h));
|
1313
|
-
// XXX I think this should work according to the spec, but currently
|
1314
|
-
// fails on FF: dstData.ctx.drawImage(srcData.canvas, 0, 0, w, h);
|
1315
|
-
dstData.ctx.restore();
|
1316
|
-
}
|
1317
|
-
return ret;
|
1318
|
-
},
|
1319
|
-
|
1320
|
-
rotozoomSurface__deps: ['zoomSurface'],
|
1321
|
-
rotozoomSurface: function(src, angle, zoom, smooth) {
|
1322
|
-
if (angle % 360 === 0) {
|
1323
|
-
return _zoomSurface(src, zoom, zoom, smooth);
|
1324
|
-
}
|
1325
|
-
var srcData = SDL.surfaces[src];
|
1326
|
-
var w = srcData.width * zoom;
|
1327
|
-
var h = srcData.height * zoom;
|
1328
|
-
var diagonal = Math.ceil(Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)));
|
1329
|
-
var ret = SDL.makeSurface(diagonal, diagonal, srcData.flags, false, 'rotozoomSurface');
|
1330
|
-
var dstData = SDL.surfaces[ret];
|
1331
|
-
dstData.ctx.translate(diagonal / 2, diagonal / 2);
|
1332
|
-
dstData.ctx.rotate(-angle * Math.PI / 180);
|
1333
|
-
dstData.ctx.drawImage(srcData.canvas, -w / 2, -h / 2, w, h);
|
1334
|
-
return ret;
|
1335
|
-
},
|
1336
|
-
|
1337
|
-
SDL_SetAlpha: function(surf, flag, alpha) {
|
1338
|
-
SDL.surfaces[surf].alpha = alpha;
|
1339
|
-
},
|
1340
|
-
|
1341
|
-
SDL_SetColorKey: function(surf, flag, key) {
|
1342
|
-
// SetColorKey assigns one color to be rendered as transparent. I don't
|
1343
|
-
// think the canvas API allows for anything like this, and iterating through
|
1344
|
-
// each pixel to replace that color seems prohibitively expensive.
|
1345
|
-
Runtime.warnOnce('SDL_SetColorKey is a no-op for performance reasons');
|
1346
|
-
return 0;
|
1347
|
-
},
|
1348
|
-
|
1349
|
-
SDL_GetTicks: function() {
|
1350
|
-
return Math.floor(Date.now() - SDL.startTime);
|
1351
|
-
},
|
1352
|
-
|
1353
|
-
SDL_PollEvent: function(ptr) {
|
1354
|
-
if (SDL.initFlags & 0x200 && SDL.joystickEventState) {
|
1355
|
-
// If SDL_INIT_JOYSTICK was supplied AND the joystick system is configured
|
1356
|
-
// to automatically query for events, query for joystick events.
|
1357
|
-
SDL.queryJoysticks();
|
1358
|
-
}
|
1359
|
-
if (SDL.events.length === 0) return 0;
|
1360
|
-
if (ptr) {
|
1361
|
-
SDL.makeCEvent(SDL.events.shift(), ptr);
|
1362
|
-
}
|
1363
|
-
return 1;
|
1364
|
-
},
|
1365
|
-
|
1366
|
-
SDL_PushEvent: function(ptr) {
|
1367
|
-
SDL.events.push(ptr); // XXX Should we copy it? Not clear from API
|
1368
|
-
return 0;
|
1369
|
-
},
|
1370
|
-
|
1371
|
-
SDL_PeepEvents: function(events, numEvents, action, from, to) {
|
1372
|
-
switch(action) {
|
1373
|
-
case 2: { // SDL_GETEVENT
|
1374
|
-
assert(numEvents == 1);
|
1375
|
-
var got = 0;
|
1376
|
-
while (SDL.events.length > 0 && numEvents > 0) {
|
1377
|
-
var type = SDL.DOMEventToSDLEvent[SDL.events[0].type];
|
1378
|
-
if (type < from || type > to) break;
|
1379
|
-
SDL.makeCEvent(SDL.events.shift(), events);
|
1380
|
-
got++;
|
1381
|
-
numEvents--;
|
1382
|
-
// events += sizeof(..)
|
1383
|
-
}
|
1384
|
-
return got;
|
1385
|
-
}
|
1386
|
-
default: throw 'SDL_PeepEvents does not yet support that action: ' + action;
|
1387
|
-
}
|
1388
|
-
},
|
1389
|
-
|
1390
|
-
SDL_PumpEvents: function(){
|
1391
|
-
SDL.events.forEach(function(event) {
|
1392
|
-
SDL.handleEvent(event);
|
1393
|
-
});
|
1394
|
-
},
|
1395
|
-
|
1396
|
-
SDL_SetColors: function(surf, colors, firstColor, nColors) {
|
1397
|
-
var surfData = SDL.surfaces[surf];
|
1398
|
-
|
1399
|
-
// we should create colors array
|
1400
|
-
// only once cause client code
|
1401
|
-
// often wants to change portion
|
1402
|
-
// of palette not all palette.
|
1403
|
-
if (!surfData.colors) {
|
1404
|
-
surfData.colors = new Uint8Array(256 * 3); //256 RGB colors
|
1405
|
-
}
|
1406
|
-
|
1407
|
-
for (var i = 0; i < nColors; ++i) {
|
1408
|
-
var index = (firstColor + i) * 3;
|
1409
|
-
surfData.colors[index] = {{{ makeGetValue('colors', 'i*4', 'i8', null, true) }}};
|
1410
|
-
surfData.colors[index + 1] = {{{ makeGetValue('colors', 'i*4 + 1', 'i8', null, true) }}};
|
1411
|
-
surfData.colors[index + 2] = {{{ makeGetValue('colors', 'i*4 + 2', 'i8', null, true) }}};
|
1412
|
-
}
|
1413
|
-
|
1414
|
-
return 1;
|
1415
|
-
},
|
1416
|
-
|
1417
|
-
SDL_SetPalette__deps: ['SDL_SetColors'],
|
1418
|
-
SDL_SetPalette: function(surf, flags, colors, firstColor, nColors) {
|
1419
|
-
return _SDL_SetColors(surf, colors, firstColor, nColors);
|
1420
|
-
},
|
1421
|
-
|
1422
|
-
SDL_MapRGB: function(fmt, r, g, b) {
|
1423
|
-
// Canvas screens are always RGBA. We assume the machine is little-endian.
|
1424
|
-
return r&0xff|(g&0xff)<<8|(b&0xff)<<16|0xff000000;
|
1425
|
-
},
|
1426
|
-
|
1427
|
-
SDL_MapRGBA: function(fmt, r, g, b, a) {
|
1428
|
-
// Canvas screens are always RGBA. We assume the machine is little-endian.
|
1429
|
-
return r&0xff|(g&0xff)<<8|(b&0xff)<<16|(a&0xff)<<24;
|
1430
|
-
},
|
1431
|
-
|
1432
|
-
SDL_GetAppState: function() {
|
1433
|
-
var state = 0;
|
1434
|
-
|
1435
|
-
if (Browser.pointerLock) {
|
1436
|
-
state |= 0x01; // SDL_APPMOUSEFOCUS
|
1437
|
-
}
|
1438
|
-
if (document.hasFocus()) {
|
1439
|
-
state |= 0x02; // SDL_APPINPUTFOCUS
|
1440
|
-
}
|
1441
|
-
state |= 0x04; // SDL_APPACTIVE
|
1442
|
-
|
1443
|
-
return state;
|
1444
|
-
},
|
1445
|
-
|
1446
|
-
SDL_WM_GrabInput: function() {},
|
1447
|
-
|
1448
|
-
SDL_WM_ToggleFullScreen: function(surf) {
|
1449
|
-
if (Browser.isFullScreen) {
|
1450
|
-
Module['canvas'].cancelFullScreen();
|
1451
|
-
return 1;
|
1452
|
-
} else {
|
1453
|
-
if (!SDL.canRequestFullscreen) {
|
1454
|
-
return 0;
|
1455
|
-
}
|
1456
|
-
SDL.isRequestingFullscreen = true;
|
1457
|
-
return 1;
|
1458
|
-
}
|
1459
|
-
},
|
1460
|
-
|
1461
|
-
// SDL_Image
|
1462
|
-
|
1463
|
-
IMG_Init: function(flags) {
|
1464
|
-
return flags; // We support JPG, PNG, TIF because browsers do
|
1465
|
-
},
|
1466
|
-
|
1467
|
-
IMG_Load_RW__deps: ['SDL_LockSurface', 'SDL_FreeRW'],
|
1468
|
-
IMG_Load_RW: function(rwopsID, freeSrc) {
|
1469
|
-
try {
|
1470
|
-
// stb_image integration support
|
1471
|
-
function cleanup() {
|
1472
|
-
if (rwops && freeSrc) _SDL_FreeRW(rwopsID);
|
1473
|
-
};
|
1474
|
-
function addCleanup(func) {
|
1475
|
-
var old = cleanup;
|
1476
|
-
cleanup = function added_cleanup() {
|
1477
|
-
old();
|
1478
|
-
func();
|
1479
|
-
}
|
1480
|
-
}
|
1481
|
-
function callStbImage(func, params) {
|
1482
|
-
var x = Module['_malloc']({{{ QUANTUM_SIZE }}});
|
1483
|
-
var y = Module['_malloc']({{{ QUANTUM_SIZE }}});
|
1484
|
-
var comp = Module['_malloc']({{{ QUANTUM_SIZE }}});
|
1485
|
-
addCleanup(function() {
|
1486
|
-
Module['_free'](x);
|
1487
|
-
Module['_free'](y);
|
1488
|
-
Module['_free'](comp);
|
1489
|
-
if (data) Module['_stbi_image_free'](data);
|
1490
|
-
});
|
1491
|
-
var data = Module['_' + func].apply(null, params.concat([x, y, comp, 0]));
|
1492
|
-
if (!data) return null;
|
1493
|
-
return {
|
1494
|
-
rawData: true,
|
1495
|
-
data: data,
|
1496
|
-
width: {{{ makeGetValue('x', 0, 'i32') }}},
|
1497
|
-
height: {{{ makeGetValue('y', 0, 'i32') }}},
|
1498
|
-
size: {{{ makeGetValue('x', 0, 'i32') }}} * {{{ makeGetValue('y', 0, 'i32') }}} * {{{ makeGetValue('comp', 0, 'i32') }}},
|
1499
|
-
bpp: {{{ makeGetValue('comp', 0, 'i32') }}}
|
1500
|
-
};
|
1501
|
-
}
|
1502
|
-
|
1503
|
-
var rwops = SDL.rwops[rwopsID];
|
1504
|
-
if (rwops === undefined) {
|
1505
|
-
return 0;
|
1506
|
-
}
|
1507
|
-
|
1508
|
-
var filename = rwops.filename;
|
1509
|
-
if (filename === undefined) {
|
1510
|
-
#if STB_IMAGE
|
1511
|
-
var raw = callStbImage('stbi_load_from_memory', [rwops.bytes, rwops.count]);
|
1512
|
-
if (!raw) return 0;
|
1513
|
-
#else
|
1514
|
-
Runtime.warnOnce('Only file names that have been preloaded are supported for IMG_Load_RW. Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js)');
|
1515
|
-
return 0;
|
1516
|
-
#endif
|
1517
|
-
}
|
1518
|
-
|
1519
|
-
if (!raw) {
|
1520
|
-
filename = PATH.resolve(filename);
|
1521
|
-
var raw = Module["preloadedImages"][filename];
|
1522
|
-
if (!raw) {
|
1523
|
-
if (raw === null) Module.printErr('Trying to reuse preloaded image, but freePreloadedMediaOnUse is set!');
|
1524
|
-
#if STB_IMAGE
|
1525
|
-
var name = Module['_malloc'](filename.length+1);
|
1526
|
-
writeStringToMemory(filename, name);
|
1527
|
-
addCleanup(function() {
|
1528
|
-
Module['_free'](name);
|
1529
|
-
});
|
1530
|
-
var raw = callStbImage('stbi_load', [name]);
|
1531
|
-
if (!raw) return 0;
|
1532
|
-
#else
|
1533
|
-
Runtime.warnOnce('Cannot find preloaded image ' + filename);
|
1534
|
-
Runtime.warnOnce('Cannot find preloaded image ' + filename + '. Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js)');
|
1535
|
-
return 0;
|
1536
|
-
#endif
|
1537
|
-
} else if (Module['freePreloadedMediaOnUse']) {
|
1538
|
-
Module["preloadedImages"][filename] = null;
|
1539
|
-
}
|
1540
|
-
}
|
1541
|
-
|
1542
|
-
var surf = SDL.makeSurface(raw.width, raw.height, 0, false, 'load:' + filename);
|
1543
|
-
var surfData = SDL.surfaces[surf];
|
1544
|
-
surfData.ctx.globalCompositeOperation = "copy";
|
1545
|
-
if (!raw.rawData) {
|
1546
|
-
surfData.ctx.drawImage(raw, 0, 0, raw.width, raw.height, 0, 0, raw.width, raw.height);
|
1547
|
-
} else {
|
1548
|
-
var imageData = surfData.ctx.getImageData(0, 0, surfData.width, surfData.height);
|
1549
|
-
if (raw.bpp == 4) {
|
1550
|
-
imageData.data.set({{{ makeHEAPView('U8', 'raw.data', 'raw.data+raw.size') }}});
|
1551
|
-
} else if (raw.bpp == 3) {
|
1552
|
-
var pixels = raw.size/3;
|
1553
|
-
var data = imageData.data;
|
1554
|
-
var sourcePtr = raw.data;
|
1555
|
-
var destPtr = 0;
|
1556
|
-
for (var i = 0; i < pixels; i++) {
|
1557
|
-
data[destPtr++] = {{{ makeGetValue('sourcePtr++', 0, 'i8', null, 1) }}};
|
1558
|
-
data[destPtr++] = {{{ makeGetValue('sourcePtr++', 0, 'i8', null, 1) }}};
|
1559
|
-
data[destPtr++] = {{{ makeGetValue('sourcePtr++', 0, 'i8', null, 1) }}};
|
1560
|
-
data[destPtr++] = 255;
|
1561
|
-
}
|
1562
|
-
} else {
|
1563
|
-
Module.printErr('cannot handle bpp ' + raw.bpp);
|
1564
|
-
return 0;
|
1565
|
-
}
|
1566
|
-
surfData.ctx.putImageData(imageData, 0, 0);
|
1567
|
-
}
|
1568
|
-
surfData.ctx.globalCompositeOperation = "source-over";
|
1569
|
-
// XXX SDL does not specify that loaded images must have available pixel data, in fact
|
1570
|
-
// there are cases where you just want to blit them, so you just need the hardware
|
1571
|
-
// accelerated version. However, code everywhere seems to assume that the pixels
|
1572
|
-
// are in fact available, so we retrieve it here. This does add overhead though.
|
1573
|
-
_SDL_LockSurface(surf);
|
1574
|
-
surfData.locked--; // The surface is not actually locked in this hack
|
1575
|
-
if (SDL.GL) {
|
1576
|
-
// After getting the pixel data, we can free the canvas and context if we do not need to do 2D canvas blitting
|
1577
|
-
surfData.canvas = surfData.ctx = null;
|
1578
|
-
}
|
1579
|
-
return surf;
|
1580
|
-
} finally {
|
1581
|
-
cleanup();
|
1582
|
-
}
|
1583
|
-
},
|
1584
|
-
SDL_LoadBMP: 'IMG_Load',
|
1585
|
-
SDL_LoadBMP_RW: 'IMG_Load_RW',
|
1586
|
-
IMG_Load__deps: ['IMG_Load_RW', 'SDL_RWFromFile'],
|
1587
|
-
IMG_Load: function(filename){
|
1588
|
-
var rwops = _SDL_RWFromFile(filename);
|
1589
|
-
var result = _IMG_Load_RW(rwops, 1);
|
1590
|
-
return result;
|
1591
|
-
},
|
1592
|
-
|
1593
|
-
// SDL_Audio
|
1594
|
-
|
1595
|
-
SDL_OpenAudio: function(desired, obtained) {
|
1596
|
-
try {
|
1597
|
-
SDL.audio = {
|
1598
|
-
freq: {{{ makeGetValue('desired', C_STRUCTS.SDL_AudioSpec.freq, 'i32', 0, 1) }}},
|
1599
|
-
format: {{{ makeGetValue('desired', C_STRUCTS.SDL_AudioSpec.format, 'i16', 0, 1) }}},
|
1600
|
-
channels: {{{ makeGetValue('desired', C_STRUCTS.SDL_AudioSpec.channels, 'i8', 0, 1) }}},
|
1601
|
-
samples: {{{ makeGetValue('desired', C_STRUCTS.SDL_AudioSpec.samples, 'i16', 0, 1) }}}, // Samples in the CB buffer per single sound channel.
|
1602
|
-
callback: {{{ makeGetValue('desired', C_STRUCTS.SDL_AudioSpec.callback, 'void*', 0, 1) }}},
|
1603
|
-
userdata: {{{ makeGetValue('desired', C_STRUCTS.SDL_AudioSpec.userdata, 'void*', 0, 1) }}},
|
1604
|
-
paused: true,
|
1605
|
-
timer: null
|
1606
|
-
};
|
1607
|
-
// The .silence field tells the constant sample value that corresponds to the safe un-skewed silence value for the wave data.
|
1608
|
-
if (SDL.audio.format == 0x0008 /*AUDIO_U8*/) {
|
1609
|
-
SDL.audio.silence = 128; // Audio ranges in [0, 255], so silence is half-way in between.
|
1610
|
-
} else if (SDL.audio.format == 0x8010 /*AUDIO_S16LSB*/) {
|
1611
|
-
SDL.audio.silence = 0; // Signed data in range [-32768, 32767], silence is 0.
|
1612
|
-
} else {
|
1613
|
-
throw 'Invalid SDL audio format ' + SDL.audio.format + '!';
|
1614
|
-
}
|
1615
|
-
// Round the desired audio frequency up to the next 'common' frequency value.
|
1616
|
-
// Web Audio API spec states 'An implementation must support sample-rates in at least the range 22050 to 96000.'
|
1617
|
-
if (SDL.audio.freq <= 0) {
|
1618
|
-
throw 'Unsupported sound frequency ' + SDL.audio.freq + '!';
|
1619
|
-
} else if (SDL.audio.freq <= 22050) {
|
1620
|
-
SDL.audio.freq = 22050; // Take it safe and clamp everything lower than 22kHz to that.
|
1621
|
-
} else if (SDL.audio.freq <= 32000) {
|
1622
|
-
SDL.audio.freq = 32000;
|
1623
|
-
} else if (SDL.audio.freq <= 44100) {
|
1624
|
-
SDL.audio.freq = 44100;
|
1625
|
-
} else if (SDL.audio.freq <= 48000) {
|
1626
|
-
SDL.audio.freq = 48000;
|
1627
|
-
} else if (SDL.audio.freq <= 96000) {
|
1628
|
-
SDL.audio.freq = 96000;
|
1629
|
-
} else {
|
1630
|
-
throw 'Unsupported sound frequency ' + SDL.audio.freq + '!';
|
1631
|
-
}
|
1632
|
-
if (SDL.audio.channels == 0) {
|
1633
|
-
SDL.audio.channels = 1; // In SDL both 0 and 1 mean mono.
|
1634
|
-
} else if (SDL.audio.channels < 0 || SDL.audio.channels > 32) {
|
1635
|
-
throw 'Unsupported number of audio channels for SDL audio: ' + SDL.audio.channels + '!';
|
1636
|
-
} else if (SDL.audio.channels != 1 && SDL.audio.channels != 2) { // Unsure what SDL audio spec supports. Web Audio spec supports up to 32 channels.
|
1637
|
-
console.log('Warning: Using untested number of audio channels ' + SDL.audio.channels);
|
1638
|
-
}
|
1639
|
-
if (SDL.audio.samples < 128 || SDL.audio.samples > 524288 /* arbitrary cap */) {
|
1640
|
-
throw 'Unsupported audio callback buffer size ' + SDL.audio.samples + '!';
|
1641
|
-
} else if ((SDL.audio.samples & (SDL.audio.samples-1)) != 0) {
|
1642
|
-
throw 'Audio callback buffer size ' + SDL.audio.samples + ' must be a power-of-two!';
|
1643
|
-
}
|
1644
|
-
|
1645
|
-
var totalSamples = SDL.audio.samples*SDL.audio.channels;
|
1646
|
-
SDL.audio.bytesPerSample = (SDL.audio.format == 0x0008 /*AUDIO_U8*/ || SDL.audio.format == 0x8008 /*AUDIO_S8*/) ? 1 : 2;
|
1647
|
-
SDL.audio.bufferSize = totalSamples*SDL.audio.bytesPerSample;
|
1648
|
-
SDL.audio.buffer = _malloc(SDL.audio.bufferSize);
|
1649
|
-
|
1650
|
-
// To account for jittering in frametimes, always have multiple audio buffers queued up for the audio output device.
|
1651
|
-
// This helps that we won't starve that easily if a frame takes long to complete.
|
1652
|
-
SDL.audio.numSimultaneouslyQueuedBuffers = Module['SDL_numSimultaneouslyQueuedBuffers'] || 3;
|
1653
|
-
|
1654
|
-
// Create a callback function that will be routinely called to ask more audio data from the user application.
|
1655
|
-
SDL.audio.caller = function SDL_audio_caller() {
|
1656
|
-
if (!SDL.audio) {
|
1657
|
-
return;
|
1658
|
-
}
|
1659
|
-
Runtime.dynCall('viii', SDL.audio.callback, [SDL.audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize]);
|
1660
|
-
SDL.audio.pushAudio(SDL.audio.buffer, SDL.audio.bufferSize);
|
1661
|
-
};
|
1662
|
-
|
1663
|
-
SDL.audio.audioOutput = new Audio();
|
1664
|
-
// As a workaround use Mozilla Audio Data API on Firefox until it ships with Web Audio and sound quality issues are fixed.
|
1665
|
-
if (typeof(SDL.audio.audioOutput['mozSetup'])==='function') {
|
1666
|
-
SDL.audio.audioOutput['mozSetup'](SDL.audio.channels, SDL.audio.freq); // use string attributes on mozOutput for closure compiler
|
1667
|
-
SDL.audio.mozBuffer = new Float32Array(totalSamples);
|
1668
|
-
SDL.audio.nextPlayTime = 0;
|
1669
|
-
SDL.audio.pushAudio = function SDL_audio_pushAudio(ptr, size) {
|
1670
|
-
--SDL.audio.numAudioTimersPending;
|
1671
|
-
var mozBuffer = SDL.audio.mozBuffer;
|
1672
|
-
// The input audio data for SDL audio is either 8-bit or 16-bit interleaved across channels, output for Mozilla Audio Data API
|
1673
|
-
// needs to be Float32 interleaved, so perform a sample conversion.
|
1674
|
-
if (SDL.audio.format == 0x8010 /*AUDIO_S16LSB*/) {
|
1675
|
-
for (var i = 0; i < totalSamples; i++) {
|
1676
|
-
mozBuffer[i] = ({{{ makeGetValue('ptr', 'i*2', 'i16', 0, 0) }}}) / 0x8000;
|
1677
|
-
}
|
1678
|
-
} else if (SDL.audio.format == 0x0008 /*AUDIO_U8*/) {
|
1679
|
-
for (var i = 0; i < totalSamples; i++) {
|
1680
|
-
var v = ({{{ makeGetValue('ptr', 'i', 'i8', 0, 0) }}});
|
1681
|
-
mozBuffer[i] = ((v >= 0) ? v-128 : v+128) /128;
|
1682
|
-
}
|
1683
|
-
}
|
1684
|
-
// Submit the audio data to audio device.
|
1685
|
-
SDL.audio.audioOutput['mozWriteAudio'](mozBuffer);
|
1686
|
-
|
1687
|
-
// Compute when the next audio callback should be called.
|
1688
|
-
var curtime = Date.now() / 1000.0 - SDL.audio.startTime;
|
1689
|
-
#if ASSERTIONS
|
1690
|
-
if (curtime > SDL.audio.nextPlayTime && SDL.audio.nextPlayTime != 0) {
|
1691
|
-
console.log('warning: Audio callback had starved sending audio by ' + (curtime - SDL.audio.nextPlayTime) + ' seconds.');
|
1692
|
-
}
|
1693
|
-
#endif
|
1694
|
-
var playtime = Math.max(curtime, SDL.audio.nextPlayTime);
|
1695
|
-
var buffer_duration = SDL.audio.samples / SDL.audio.freq;
|
1696
|
-
SDL.audio.nextPlayTime = playtime + buffer_duration;
|
1697
|
-
// Schedule the next audio callback call to occur when the current one finishes.
|
1698
|
-
SDL.audio.timer = Browser.safeSetTimeout(SDL.audio.caller, 1000.0 * (playtime-curtime));
|
1699
|
-
++SDL.audio.numAudioTimersPending;
|
1700
|
-
// And also schedule extra buffers _now_ if we have too few in queue.
|
1701
|
-
if (SDL.audio.numAudioTimersPending < SDL.audio.numSimultaneouslyQueuedBuffers) {
|
1702
|
-
++SDL.audio.numAudioTimersPending;
|
1703
|
-
Browser.safeSetTimeout(SDL.audio.caller, 1.0);
|
1704
|
-
}
|
1705
|
-
}
|
1706
|
-
} else {
|
1707
|
-
// Initialize Web Audio API if we haven't done so yet. Note: Only initialize Web Audio context ever once on the web page,
|
1708
|
-
// since initializing multiple times fails on Chrome saying 'audio resources have been exhausted'.
|
1709
|
-
if (!SDL.audioContext) {
|
1710
|
-
if (typeof(AudioContext) === 'function') {
|
1711
|
-
SDL.audioContext = new AudioContext();
|
1712
|
-
} else if (typeof(webkitAudioContext) === 'function') {
|
1713
|
-
SDL.audioContext = new webkitAudioContext();
|
1714
|
-
} else {
|
1715
|
-
throw 'Web Audio API is not available!';
|
1716
|
-
}
|
1717
|
-
}
|
1718
|
-
SDL.audio.soundSource = new Array(); // Use an array of sound sources as a ring buffer to queue blocks of synthesized audio to Web Audio API.
|
1719
|
-
SDL.audio.nextSoundSource = 0; // Index of the next sound buffer in the ring buffer queue to play.
|
1720
|
-
SDL.audio.nextPlayTime = 0; // Time in seconds when the next audio block is due to start.
|
1721
|
-
|
1722
|
-
// The pushAudio function with a new audio buffer whenever there is new audio data to schedule to be played back on the device.
|
1723
|
-
SDL.audio.pushAudio=function(ptr,sizeBytes) {
|
1724
|
-
try {
|
1725
|
-
--SDL.audio.numAudioTimersPending;
|
1726
|
-
|
1727
|
-
var sizeSamples = sizeBytes / SDL.audio.bytesPerSample; // How many samples fit in the callback buffer?
|
1728
|
-
var sizeSamplesPerChannel = sizeSamples / SDL.audio.channels; // How many samples per a single channel fit in the cb buffer?
|
1729
|
-
if (sizeSamplesPerChannel != SDL.audio.samples) {
|
1730
|
-
throw 'Received mismatching audio buffer size!';
|
1731
|
-
}
|
1732
|
-
// Allocate new sound buffer to be played.
|
1733
|
-
var source = SDL.audioContext['createBufferSource']();
|
1734
|
-
if (SDL.audio.soundSource[SDL.audio.nextSoundSource]) {
|
1735
|
-
SDL.audio.soundSource[SDL.audio.nextSoundSource]['disconnect'](); // Explicitly disconnect old source, since we know it shouldn't be running anymore.
|
1736
|
-
}
|
1737
|
-
SDL.audio.soundSource[SDL.audio.nextSoundSource] = source;
|
1738
|
-
var soundBuffer = SDL.audioContext['createBuffer'](SDL.audio.channels,sizeSamplesPerChannel,SDL.audio.freq);
|
1739
|
-
SDL.audio.soundSource[SDL.audio.nextSoundSource]['connect'](SDL.audioContext['destination']);
|
1740
|
-
|
1741
|
-
// The input audio data is interleaved across the channels, i.e. [L, R, L, R, L, R, ...] and is either 8-bit or 16-bit as
|
1742
|
-
// supported by the SDL API. The output audio wave data for Web Audio API must be in planar buffers of [-1,1]-normalized Float32 data,
|
1743
|
-
// so perform a buffer conversion for the data.
|
1744
|
-
var numChannels = SDL.audio.channels;
|
1745
|
-
for(var i = 0; i < numChannels; ++i) {
|
1746
|
-
var channelData = soundBuffer['getChannelData'](i);
|
1747
|
-
if (channelData.length != sizeSamplesPerChannel) {
|
1748
|
-
throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + sizeSamplesPerChannel + ' samples!';
|
1749
|
-
}
|
1750
|
-
if (SDL.audio.format == 0x8010 /*AUDIO_S16LSB*/) {
|
1751
|
-
for(var j = 0; j < sizeSamplesPerChannel; ++j) {
|
1752
|
-
channelData[j] = ({{{ makeGetValue('ptr', '(j*numChannels + i)*2', 'i16', 0, 0) }}}) / 0x8000;
|
1753
|
-
}
|
1754
|
-
} else if (SDL.audio.format == 0x0008 /*AUDIO_U8*/) {
|
1755
|
-
for(var j = 0; j < sizeSamplesPerChannel; ++j) {
|
1756
|
-
var v = ({{{ makeGetValue('ptr', 'j*numChannels + i', 'i8', 0, 0) }}});
|
1757
|
-
channelData[j] = ((v >= 0) ? v-128 : v+128) /128;
|
1758
|
-
}
|
1759
|
-
}
|
1760
|
-
}
|
1761
|
-
// Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=883675 by setting the buffer only after filling. The order is important here!
|
1762
|
-
source['buffer'] = soundBuffer;
|
1763
|
-
|
1764
|
-
// Schedule the generated sample buffer to be played out at the correct time right after the previously scheduled
|
1765
|
-
// sample buffer has finished.
|
1766
|
-
var curtime = SDL.audioContext['currentTime'];
|
1767
|
-
#if ASSERTIONS
|
1768
|
-
if (curtime > SDL.audio.nextPlayTime && SDL.audio.nextPlayTime != 0) {
|
1769
|
-
console.log('warning: Audio callback had starved sending audio by ' + (curtime - SDL.audio.nextPlayTime) + ' seconds.');
|
1770
|
-
}
|
1771
|
-
#endif
|
1772
|
-
var playtime = Math.max(curtime, SDL.audio.nextPlayTime);
|
1773
|
-
SDL.audio.soundSource[SDL.audio.nextSoundSource]['start'](playtime);
|
1774
|
-
var buffer_duration = sizeSamplesPerChannel / SDL.audio.freq;
|
1775
|
-
SDL.audio.nextPlayTime = playtime + buffer_duration;
|
1776
|
-
SDL.audio.nextSoundSource = (SDL.audio.nextSoundSource + 1) % 4;
|
1777
|
-
var secsUntilNextCall = playtime-curtime;
|
1778
|
-
|
1779
|
-
// Queue the next audio frame push to be performed when the previously queued buffer has finished playing.
|
1780
|
-
if (SDL.audio.numAudioTimersPending == 0) {
|
1781
|
-
var preemptBufferFeedMSecs = buffer_duration/2.0;
|
1782
|
-
SDL.audio.timer = Browser.safeSetTimeout(SDL.audio.caller, Math.max(0.0, 1000.0*secsUntilNextCall-preemptBufferFeedMSecs));
|
1783
|
-
++SDL.audio.numAudioTimersPending;
|
1784
|
-
}
|
1785
|
-
|
1786
|
-
// If we are risking starving, immediately queue extra buffers.
|
1787
|
-
if (secsUntilNextCall <= buffer_duration && SDL.audio.numAudioTimersPending < SDL.audio.numSimultaneouslyQueuedBuffers) {
|
1788
|
-
++SDL.audio.numAudioTimersPending;
|
1789
|
-
Browser.safeSetTimeout(SDL.audio.caller, 1.0);
|
1790
|
-
}
|
1791
|
-
} catch(e) {
|
1792
|
-
console.log('Web Audio API error playing back audio: ' + e.toString());
|
1793
|
-
}
|
1794
|
-
}
|
1795
|
-
}
|
1796
|
-
|
1797
|
-
if (obtained) {
|
1798
|
-
// Report back the initialized audio parameters.
|
1799
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.freq, 'SDL.audio.freq', 'i32') }}};
|
1800
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.format, 'SDL.audio.format', 'i16') }}};
|
1801
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.channels, 'SDL.audio.channels', 'i8') }}};
|
1802
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.silence, 'SDL.audio.silence', 'i8') }}};
|
1803
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.samples, 'SDL.audio.samples', 'i16') }}};
|
1804
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.callback, 'SDL.audio.callback', '*') }}};
|
1805
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.userdata, 'SDL.audio.userdata', '*') }}};
|
1806
|
-
}
|
1807
|
-
SDL.allocateChannels(32);
|
1808
|
-
|
1809
|
-
} catch(e) {
|
1810
|
-
console.log('Initializing SDL audio threw an exception: "' + e.toString() + '"! Continuing without audio.');
|
1811
|
-
SDL.audio = null;
|
1812
|
-
SDL.allocateChannels(0);
|
1813
|
-
if (obtained) {
|
1814
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.freq, 0, 'i32') }}};
|
1815
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.format, 0, 'i16') }}};
|
1816
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.channels, 0, 'i8') }}};
|
1817
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.silence, 0, 'i8') }}};
|
1818
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.samples, 0, 'i16') }}};
|
1819
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.callback, 0, '*') }}};
|
1820
|
-
{{{ makeSetValue('obtained', C_STRUCTS.SDL_AudioSpec.userdata, 0, '*') }}};
|
1821
|
-
}
|
1822
|
-
}
|
1823
|
-
if (!SDL.audio) {
|
1824
|
-
return -1;
|
1825
|
-
}
|
1826
|
-
return 0;
|
1827
|
-
},
|
1828
|
-
|
1829
|
-
SDL_PauseAudio: function(pauseOn) {
|
1830
|
-
if (!SDL.audio) {
|
1831
|
-
return;
|
1832
|
-
}
|
1833
|
-
if (pauseOn) {
|
1834
|
-
if (SDL.audio.timer !== undefined) {
|
1835
|
-
clearTimeout(SDL.audio.timer);
|
1836
|
-
SDL.audio.numAudioTimersPending = 0;
|
1837
|
-
SDL.audio.timer = undefined;
|
1838
|
-
}
|
1839
|
-
} else if (!SDL.audio.timer) {
|
1840
|
-
// Start the audio playback timer callback loop.
|
1841
|
-
SDL.audio.numAudioTimersPending = 1;
|
1842
|
-
SDL.audio.timer = Browser.safeSetTimeout(SDL.audio.caller, 1);
|
1843
|
-
SDL.audio.startTime = Date.now() / 1000.0; // Only used for Mozilla Audio Data API. Not needed for Web Audio API.
|
1844
|
-
}
|
1845
|
-
SDL.audio.paused = pauseOn;
|
1846
|
-
},
|
1847
|
-
|
1848
|
-
SDL_CloseAudio__deps: ['SDL_PauseAudio', 'free'],
|
1849
|
-
SDL_CloseAudio: function() {
|
1850
|
-
if (SDL.audio) {
|
1851
|
-
try{
|
1852
|
-
for(var i = 0; i < SDL.audio.soundSource.length; ++i) {
|
1853
|
-
if (!(typeof(SDL.audio.soundSource[i]==='undefined'))) {
|
1854
|
-
SDL.audio.soundSource[i].stop(0);
|
1855
|
-
}
|
1856
|
-
}
|
1857
|
-
} catch(e) {}
|
1858
|
-
SDL.audio.soundSource = null;
|
1859
|
-
_SDL_PauseAudio(1);
|
1860
|
-
_free(SDL.audio.buffer);
|
1861
|
-
SDL.audio = null;
|
1862
|
-
SDL.allocateChannels(0);
|
1863
|
-
}
|
1864
|
-
},
|
1865
|
-
|
1866
|
-
SDL_LockAudio: function() {},
|
1867
|
-
SDL_UnlockAudio: function() {},
|
1868
|
-
|
1869
|
-
SDL_CreateMutex: function() { return 0 },
|
1870
|
-
SDL_LockMutex: function() {},
|
1871
|
-
SDL_UnlockMutex: function() {},
|
1872
|
-
SDL_mutexP: function() { return 0 },
|
1873
|
-
SDL_mutexV: function() { return 0 },
|
1874
|
-
SDL_DestroyMutex: function() {},
|
1875
|
-
|
1876
|
-
SDL_CreateCond: function() { return 0 },
|
1877
|
-
SDL_CondSignal: function() {},
|
1878
|
-
SDL_CondWait: function() {},
|
1879
|
-
SDL_DestroyCond: function() {},
|
1880
|
-
|
1881
|
-
SDL_StartTextInput: function() {
|
1882
|
-
SDL.textInput = true;
|
1883
|
-
},
|
1884
|
-
SDL_StopTextInput: function() {
|
1885
|
-
SDL.textInput = false;
|
1886
|
-
},
|
1887
|
-
|
1888
|
-
// SDL Mixer
|
1889
|
-
|
1890
|
-
Mix_Init: function(flags) {
|
1891
|
-
if (!flags) return 0;
|
1892
|
-
return 8; /* MIX_INIT_OGG */
|
1893
|
-
},
|
1894
|
-
Mix_Quit: function(){},
|
1895
|
-
|
1896
|
-
Mix_OpenAudio: function(frequency, format, channels, chunksize) {
|
1897
|
-
SDL.allocateChannels(32);
|
1898
|
-
// Just record the values for a later call to Mix_QuickLoad_RAW
|
1899
|
-
SDL.mixerFrequency = frequency;
|
1900
|
-
SDL.mixerFormat = format;
|
1901
|
-
SDL.mixerNumChannels = channels;
|
1902
|
-
SDL.mixerChunkSize = chunksize;
|
1903
|
-
return 0;
|
1904
|
-
},
|
1905
|
-
|
1906
|
-
Mix_CloseAudio: 'SDL_CloseAudio',
|
1907
|
-
|
1908
|
-
Mix_AllocateChannels: function(num) {
|
1909
|
-
SDL.allocateChannels(num);
|
1910
|
-
return num;
|
1911
|
-
},
|
1912
|
-
|
1913
|
-
Mix_ChannelFinished: function(func) {
|
1914
|
-
SDL.channelFinished = func;
|
1915
|
-
},
|
1916
|
-
|
1917
|
-
Mix_Volume: function(channel, volume) {
|
1918
|
-
if (channel == -1) {
|
1919
|
-
for (var i = 0; i < SDL.numChannels-1; i++) {
|
1920
|
-
_Mix_Volume(i, volume);
|
1921
|
-
}
|
1922
|
-
return _Mix_Volume(SDL.numChannels-1, volume);
|
1923
|
-
}
|
1924
|
-
return SDL.setGetVolume(SDL.channels[channel], volume);
|
1925
|
-
},
|
1926
|
-
|
1927
|
-
Mix_SetPanning: function() {
|
1928
|
-
return 0; // error
|
1929
|
-
},
|
1930
|
-
|
1931
|
-
Mix_LoadWAV_RW: function(rwopsID, freesrc) {
|
1932
|
-
var rwops = SDL.rwops[rwopsID];
|
1933
|
-
|
1934
|
-
if (rwops === undefined)
|
1935
|
-
return 0;
|
1936
|
-
|
1937
|
-
var filename = '';
|
1938
|
-
var audio;
|
1939
|
-
var bytes;
|
1940
|
-
|
1941
|
-
if (rwops.filename !== undefined) {
|
1942
|
-
filename = PATH.resolve(rwops.filename);
|
1943
|
-
var raw = Module["preloadedAudios"][filename];
|
1944
|
-
if (!raw) {
|
1945
|
-
if (raw === null) Module.printErr('Trying to reuse preloaded audio, but freePreloadedMediaOnUse is set!');
|
1946
|
-
Runtime.warnOnce('Cannot find preloaded audio ' + filename);
|
1947
|
-
|
1948
|
-
// see if we can read the file-contents from the in-memory FS
|
1949
|
-
try {
|
1950
|
-
bytes = FS.readFile(filename);
|
1951
|
-
} catch (e) {
|
1952
|
-
Module.printErr('Couldn\'t find file for: ' + filename);
|
1953
|
-
return 0;
|
1954
|
-
}
|
1955
|
-
}
|
1956
|
-
if (Module['freePreloadedMediaOnUse']) {
|
1957
|
-
Module["preloadedAudios"][filename] = null;
|
1958
|
-
}
|
1959
|
-
audio = raw;
|
1960
|
-
}
|
1961
|
-
else if (rwops.bytes !== undefined) {
|
1962
|
-
bytes = HEAPU8.subarray(rwops.bytes, rwops.bytes + rwops.count);
|
1963
|
-
}
|
1964
|
-
else {
|
1965
|
-
return 0;
|
1966
|
-
}
|
1967
|
-
|
1968
|
-
// Here, we didn't find a preloaded audio but we either were passed a filepath for
|
1969
|
-
// which we loaded bytes, or we were passed some bytes
|
1970
|
-
if (audio === undefined && bytes) {
|
1971
|
-
var blob = new Blob([bytes], {type: rwops.mimetype});
|
1972
|
-
var url = URL.createObjectURL(blob);
|
1973
|
-
audio = new Audio();
|
1974
|
-
audio.src = url;
|
1975
|
-
}
|
1976
|
-
|
1977
|
-
var id = SDL.audios.length;
|
1978
|
-
// Keep the loaded audio in the audio arrays, ready for playback
|
1979
|
-
SDL.audios.push({
|
1980
|
-
source: filename,
|
1981
|
-
audio: audio
|
1982
|
-
});
|
1983
|
-
return id;
|
1984
|
-
},
|
1985
|
-
|
1986
|
-
Mix_QuickLoad_RAW: function(mem, len) {
|
1987
|
-
var audio = new Audio();
|
1988
|
-
// Record the number of channels and frequency for later usage
|
1989
|
-
audio.numChannels = SDL.mixerNumChannels;
|
1990
|
-
audio.frequency = SDL.mixerFrequency;
|
1991
|
-
var numSamples = len >> 1; // len is the length in bytes, and the array contains 16-bit PCM values
|
1992
|
-
var buffer = new Float32Array(numSamples);
|
1993
|
-
for (var i = 0; i < numSamples; ++i) {
|
1994
|
-
buffer[i] = ({{{ makeGetValue('mem', 'i*2', 'i16', 0, 0) }}}) / 0x8000; // hardcoded 16-bit audio, signed (TODO: reSign if not ta2?)
|
1995
|
-
}
|
1996
|
-
// FIXME: doesn't make sense to keep the audio element in the buffer
|
1997
|
-
var id = SDL.audios.length;
|
1998
|
-
SDL.audios.push({
|
1999
|
-
source: '',
|
2000
|
-
audio: audio,
|
2001
|
-
buffer: buffer
|
2002
|
-
});
|
2003
|
-
return id;
|
2004
|
-
},
|
2005
|
-
|
2006
|
-
Mix_FreeChunk: function(id) {
|
2007
|
-
SDL.audios[id] = null;
|
2008
|
-
},
|
2009
|
-
Mix_ReserveChannels: function(num) {
|
2010
|
-
SDL.channelMinimumNumber = num;
|
2011
|
-
},
|
2012
|
-
Mix_PlayChannel: function(channel, id, loops) {
|
2013
|
-
// TODO: handle loops
|
2014
|
-
|
2015
|
-
// Get the audio element associated with the ID
|
2016
|
-
var info = SDL.audios[id];
|
2017
|
-
if (!info) return -1;
|
2018
|
-
var audio = info.audio;
|
2019
|
-
if (!audio) return -1;
|
2020
|
-
|
2021
|
-
// If the user asks us to allocate a channel automatically, get the first
|
2022
|
-
// free one.
|
2023
|
-
if (channel == -1) {
|
2024
|
-
for (var i = SDL.channelMinimumNumber; i < SDL.numChannels; i++) {
|
2025
|
-
if (!SDL.channels[i].audio) {
|
2026
|
-
channel = i;
|
2027
|
-
break;
|
2028
|
-
}
|
2029
|
-
}
|
2030
|
-
if (channel == -1) {
|
2031
|
-
Module.printErr('All ' + SDL.numChannels + ' channels in use!');
|
2032
|
-
return -1;
|
2033
|
-
}
|
2034
|
-
}
|
2035
|
-
// We clone the audio node to utilize the preloaded audio buffer, since
|
2036
|
-
// the browser has already preloaded the audio file.
|
2037
|
-
var channelInfo = SDL.channels[channel];
|
2038
|
-
channelInfo.audio = audio = audio.cloneNode(true);
|
2039
|
-
audio.numChannels = info.audio.numChannels;
|
2040
|
-
audio.frequency = info.audio.frequency;
|
2041
|
-
// TODO: handle N loops. Behavior matches Mix_PlayMusic
|
2042
|
-
audio.loop = loops != 0;
|
2043
|
-
audio['onended'] = function SDL_audio_onended() { // TODO: cache these
|
2044
|
-
channelInfo.audio = null;
|
2045
|
-
if (SDL.channelFinished) {
|
2046
|
-
Runtime.getFuncWrapper(SDL.channelFinished, 'vi')(channel);
|
2047
|
-
}
|
2048
|
-
}
|
2049
|
-
// Either play the element, or load the dynamic data into it
|
2050
|
-
if (info.buffer) {
|
2051
|
-
var contextCtor = null;
|
2052
|
-
if (audio && ('mozSetup' in audio)) { // Audio Data API
|
2053
|
-
try {
|
2054
|
-
audio['mozSetup'](audio.numChannels, audio.frequency);
|
2055
|
-
audio["mozWriteAudio"](info.buffer);
|
2056
|
-
} catch (e) {
|
2057
|
-
// Workaround for Firefox bug 783052
|
2058
|
-
// ignore this exception!
|
2059
|
-
}
|
2060
|
-
/*
|
2061
|
-
} else if (contextCtor = (window.AudioContext || // WebAudio API
|
2062
|
-
window.webkitAudioContext)) {
|
2063
|
-
var currentIndex = 0;
|
2064
|
-
var numChannels = parseInt(audio.numChannels);
|
2065
|
-
var context = new contextCtor();
|
2066
|
-
var source = context.createBufferSource();
|
2067
|
-
source.loop = false;
|
2068
|
-
source.buffer = context.createBuffer(numChannels, 1, audio.frequency);
|
2069
|
-
var jsNode = context.createJavaScriptNode(2048, numChannels, numChannels);
|
2070
|
-
jsNode.onaudioprocess = function jsNode_onaudioprocess(event) {
|
2071
|
-
var buffers = new Array(numChannels);
|
2072
|
-
for (var i = 0; i < numChannels; ++i) {
|
2073
|
-
buffers[i] = event.outputBuffer.getChannelData(i);
|
2074
|
-
}
|
2075
|
-
var remaining = info.buffer.length - currentIndex;
|
2076
|
-
if (remaining > 2048) {
|
2077
|
-
remaining = 2048;
|
2078
|
-
}
|
2079
|
-
for (var i = 0; i < remaining;) {
|
2080
|
-
for (var j = 0; j < numChannels; ++j) {
|
2081
|
-
buffers[j][i] = info.buffer[currentIndex + i + j] * audio.volume;
|
2082
|
-
}
|
2083
|
-
i += j;
|
2084
|
-
}
|
2085
|
-
currentIndex += remaining * numChannels;
|
2086
|
-
for (var i = remaining; i < 2048;) {
|
2087
|
-
for (var j = 0; j < numChannels; ++j) {
|
2088
|
-
buffers[j][i] = 0; // silence
|
2089
|
-
}
|
2090
|
-
i += j;
|
2091
|
-
}
|
2092
|
-
};
|
2093
|
-
source.connect(jsNode);
|
2094
|
-
jsNode.connect(context.destination);
|
2095
|
-
source.noteOn(0);
|
2096
|
-
*/
|
2097
|
-
}
|
2098
|
-
} else {
|
2099
|
-
audio.play();
|
2100
|
-
}
|
2101
|
-
audio.volume = channelInfo.volume;
|
2102
|
-
return channel;
|
2103
|
-
},
|
2104
|
-
Mix_PlayChannelTimed: 'Mix_PlayChannel', // XXX ignore Timing
|
2105
|
-
|
2106
|
-
Mix_FadingChannel: function(channel) {
|
2107
|
-
return 0; // MIX_NO_FADING, TODO
|
2108
|
-
},
|
2109
|
-
|
2110
|
-
Mix_HaltChannel: function(channel) {
|
2111
|
-
function halt(channel) {
|
2112
|
-
var info = SDL.channels[channel];
|
2113
|
-
if (info.audio) {
|
2114
|
-
info.audio.pause();
|
2115
|
-
info.audio = null;
|
2116
|
-
}
|
2117
|
-
if (SDL.channelFinished) {
|
2118
|
-
Runtime.getFuncWrapper(SDL.channelFinished, 'vi')(channel);
|
2119
|
-
}
|
2120
|
-
}
|
2121
|
-
if (channel != -1) {
|
2122
|
-
halt(channel);
|
2123
|
-
} else {
|
2124
|
-
for (var i = 0; i < SDL.channels.length; ++i) halt(i);
|
2125
|
-
}
|
2126
|
-
return 0;
|
2127
|
-
},
|
2128
|
-
|
2129
|
-
Mix_HookMusicFinished__deps: ['Mix_HaltMusic'],
|
2130
|
-
Mix_HookMusicFinished: function(func) {
|
2131
|
-
SDL.hookMusicFinished = func;
|
2132
|
-
if (SDL.music.audio) { // ensure the callback will be called, if a music is already playing
|
2133
|
-
SDL.music.audio['onended'] = _Mix_HaltMusic;
|
2134
|
-
}
|
2135
|
-
},
|
2136
|
-
|
2137
|
-
Mix_VolumeMusic: function(volume) {
|
2138
|
-
return SDL.setGetVolume(SDL.music, volume);
|
2139
|
-
},
|
2140
|
-
|
2141
|
-
Mix_LoadMUS_RW: 'Mix_LoadWAV_RW',
|
2142
|
-
Mix_LoadMUS__deps: ['Mix_LoadMUS_RW', 'SDL_RWFromFile', 'SDL_FreeRW'],
|
2143
|
-
Mix_LoadMUS: function(filename) {
|
2144
|
-
var rwops = _SDL_RWFromFile(filename);
|
2145
|
-
var result = _Mix_LoadMUS_RW(rwops);
|
2146
|
-
_SDL_FreeRW(rwops);
|
2147
|
-
return result;
|
2148
|
-
},
|
2149
|
-
|
2150
|
-
Mix_FreeMusic: 'Mix_FreeChunk',
|
2151
|
-
|
2152
|
-
Mix_PlayMusic__deps: ['Mix_HaltMusic'],
|
2153
|
-
Mix_PlayMusic: function(id, loops) {
|
2154
|
-
loops = Math.max(loops, 1);
|
2155
|
-
var audio = SDL.audios[id].audio;
|
2156
|
-
if (!audio) return 0;
|
2157
|
-
audio.loop = loops != 0; // TODO: handle N loops for finite N
|
2158
|
-
if (SDL.audios[id].buffer) {
|
2159
|
-
audio["mozWriteAudio"](SDL.audios[id].buffer);
|
2160
|
-
} else {
|
2161
|
-
audio.play();
|
2162
|
-
}
|
2163
|
-
audio.volume = SDL.music.volume;
|
2164
|
-
audio['onended'] = _Mix_HaltMusic; // will send callback
|
2165
|
-
if (SDL.music.audio) {
|
2166
|
-
if (!SDL.music.audio.paused) {
|
2167
|
-
Module.printErr('Music is already playing. ' + SDL.music.source);
|
2168
|
-
}
|
2169
|
-
SDL.music.audio.pause();
|
2170
|
-
}
|
2171
|
-
SDL.music.audio = audio;
|
2172
|
-
return 0;
|
2173
|
-
},
|
2174
|
-
|
2175
|
-
Mix_PauseMusic: function() {
|
2176
|
-
var audio = SDL.music.audio;
|
2177
|
-
if (!audio) return 0;
|
2178
|
-
audio.pause();
|
2179
|
-
return 0;
|
2180
|
-
},
|
2181
|
-
|
2182
|
-
Mix_ResumeMusic: function() {
|
2183
|
-
var audio = SDL.music.audio;
|
2184
|
-
if (!audio) return 0;
|
2185
|
-
audio.play();
|
2186
|
-
return 0;
|
2187
|
-
},
|
2188
|
-
|
2189
|
-
Mix_HaltMusic: function() {
|
2190
|
-
var audio = SDL.music.audio;
|
2191
|
-
if (!audio) return 0;
|
2192
|
-
audio.src = audio.src; // rewind
|
2193
|
-
audio.pause();
|
2194
|
-
SDL.music.audio = null;
|
2195
|
-
if (SDL.hookMusicFinished) {
|
2196
|
-
Runtime.dynCall('v', SDL.hookMusicFinished);
|
2197
|
-
}
|
2198
|
-
return 0;
|
2199
|
-
},
|
2200
|
-
|
2201
|
-
Mix_FadeInMusicPos: 'Mix_PlayMusic', // XXX ignore fading in effect
|
2202
|
-
|
2203
|
-
Mix_FadeOutMusic: 'Mix_HaltMusic', // XXX ignore fading out effect
|
2204
|
-
|
2205
|
-
Mix_PlayingMusic: function() {
|
2206
|
-
return (SDL.music.audio && !SDL.music.audio.paused) ? 1 : 0;
|
2207
|
-
},
|
2208
|
-
|
2209
|
-
// http://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer_38.html#SEC38
|
2210
|
-
// "Note: Does not check if the channel has been paused."
|
2211
|
-
Mix_Playing: function(channel) {
|
2212
|
-
if (channel === -1) {
|
2213
|
-
var count = 0;
|
2214
|
-
for (var i = 0; i < SDL.channels.length; i++) {
|
2215
|
-
count += _Mix_Playing(i);
|
2216
|
-
}
|
2217
|
-
return count;
|
2218
|
-
}
|
2219
|
-
var info = SDL.channels[channel];
|
2220
|
-
if (info && info.audio && !info.audio.paused) {
|
2221
|
-
return 1;
|
2222
|
-
}
|
2223
|
-
return 0;
|
2224
|
-
},
|
2225
|
-
|
2226
|
-
Mix_Pause: function(channel) {
|
2227
|
-
if (channel === -1) {
|
2228
|
-
for (var i = 0; i<SDL.channels.length;i++) {
|
2229
|
-
_Mix_Pause(i);
|
2230
|
-
}
|
2231
|
-
return;
|
2232
|
-
}
|
2233
|
-
var info = SDL.channels[channel];
|
2234
|
-
if (info && info.audio) {
|
2235
|
-
info.audio.pause();
|
2236
|
-
} else {
|
2237
|
-
Module.printErr('Mix_Pause: no sound found for channel: ' + channel);
|
2238
|
-
}
|
2239
|
-
},
|
2240
|
-
|
2241
|
-
// http://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer_39.html#SEC39
|
2242
|
-
Mix_Paused: function(channel) {
|
2243
|
-
if (channel === -1) {
|
2244
|
-
var pausedCount = 0;
|
2245
|
-
for (var i = 0; i<SDL.channels.length;i++) {
|
2246
|
-
pausedCount += _Mix_Paused(i);
|
2247
|
-
}
|
2248
|
-
return pausedCount;
|
2249
|
-
}
|
2250
|
-
var info = SDL.channels[channel];
|
2251
|
-
if (info && info.audio && info.audio.paused) {
|
2252
|
-
return 1;
|
2253
|
-
}
|
2254
|
-
return 0;
|
2255
|
-
},
|
2256
|
-
|
2257
|
-
Mix_PausedMusic: function() {
|
2258
|
-
return (SDL.music.audio && SDL.music.audio.paused) ? 1 : 0;
|
2259
|
-
},
|
2260
|
-
|
2261
|
-
// http://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer_33.html#SEC33
|
2262
|
-
Mix_Resume: function(channel) {
|
2263
|
-
if (channel === -1) {
|
2264
|
-
for (var i = 0; i<SDL.channels.length;i++) {
|
2265
|
-
_Mix_Resume(i);
|
2266
|
-
}
|
2267
|
-
return;
|
2268
|
-
}
|
2269
|
-
var info = SDL.channels[channel];
|
2270
|
-
if (info && info.audio) {
|
2271
|
-
info.audio.play();
|
2272
|
-
}
|
2273
|
-
},
|
2274
|
-
|
2275
|
-
// SDL TTF
|
2276
|
-
|
2277
|
-
TTF_Init: function() {
|
2278
|
-
var canvas = document.createElement('canvas');
|
2279
|
-
SDL.ttfContext = canvas.getContext('2d');
|
2280
|
-
return 0;
|
2281
|
-
},
|
2282
|
-
|
2283
|
-
TTF_OpenFont: function(filename, size) {
|
2284
|
-
filename = FS.standardizePath(Pointer_stringify(filename));
|
2285
|
-
var id = SDL.fonts.length;
|
2286
|
-
SDL.fonts.push({
|
2287
|
-
name: filename, // but we don't actually do anything with it..
|
2288
|
-
size: size
|
2289
|
-
});
|
2290
|
-
return id;
|
2291
|
-
},
|
2292
|
-
|
2293
|
-
TTF_CloseFont: function(font) {
|
2294
|
-
SDL.fonts[font] = null;
|
2295
|
-
},
|
2296
|
-
|
2297
|
-
TTF_RenderText_Solid: function(font, text, color) {
|
2298
|
-
// XXX the font and color are ignored
|
2299
|
-
text = Pointer_stringify(text) || ' '; // if given an empty string, still return a valid surface
|
2300
|
-
var fontData = SDL.fonts[font];
|
2301
|
-
var w = SDL.estimateTextWidth(fontData, text);
|
2302
|
-
var h = fontData.size;
|
2303
|
-
var color = SDL.loadColorToCSSRGB(color); // XXX alpha breaks fonts?
|
2304
|
-
var fontString = h + 'px ' + fontData.name;
|
2305
|
-
var surf = SDL.makeSurface(w, h, 0, false, 'text:' + text); // bogus numbers..
|
2306
|
-
var surfData = SDL.surfaces[surf];
|
2307
|
-
surfData.ctx.save();
|
2308
|
-
surfData.ctx.fillStyle = color;
|
2309
|
-
surfData.ctx.font = fontString;
|
2310
|
-
surfData.ctx.textBaseline = 'top';
|
2311
|
-
surfData.ctx.fillText(text, 0, 0);
|
2312
|
-
surfData.ctx.restore();
|
2313
|
-
return surf;
|
2314
|
-
},
|
2315
|
-
TTF_RenderText_Blended: 'TTF_RenderText_Solid', // XXX ignore blending vs. solid
|
2316
|
-
TTF_RenderText_Shaded: 'TTF_RenderText_Solid', // XXX ignore blending vs. solid
|
2317
|
-
TTF_RenderUTF8_Solid: 'TTF_RenderText_Solid',
|
2318
|
-
|
2319
|
-
TTF_SizeText: function(font, text, w, h) {
|
2320
|
-
var fontData = SDL.fonts[font];
|
2321
|
-
if (w) {
|
2322
|
-
{{{ makeSetValue('w', '0', 'SDL.estimateTextWidth(fontData, Pointer_stringify(text))', 'i32') }}};
|
2323
|
-
}
|
2324
|
-
if (h) {
|
2325
|
-
{{{ makeSetValue('h', '0', 'fontData.size', 'i32') }}};
|
2326
|
-
}
|
2327
|
-
return 0;
|
2328
|
-
},
|
2329
|
-
|
2330
|
-
TTF_FontAscent: function(font) {
|
2331
|
-
var fontData = SDL.fonts[font];
|
2332
|
-
return Math.floor(fontData.size*0.98); // XXX
|
2333
|
-
},
|
2334
|
-
|
2335
|
-
TTF_FontDescent: function(font) {
|
2336
|
-
var fontData = SDL.fonts[font];
|
2337
|
-
return Math.floor(fontData.size*0.02); // XXX
|
2338
|
-
},
|
2339
|
-
|
2340
|
-
TTF_FontHeight: function(font) {
|
2341
|
-
var fontData = SDL.fonts[font];
|
2342
|
-
return fontData.size;
|
2343
|
-
},
|
2344
|
-
|
2345
|
-
// SDL gfx
|
2346
|
-
|
2347
|
-
$SDL_gfx: {
|
2348
|
-
drawRectangle: function(surf, x1, y1, x2, y2, action, cssColor) {
|
2349
|
-
x1 = x1 << 16 >> 16;
|
2350
|
-
y1 = y1 << 16 >> 16;
|
2351
|
-
x2 = x2 << 16 >> 16;
|
2352
|
-
y2 = y2 << 16 >> 16;
|
2353
|
-
var surfData = SDL.surfaces[surf];
|
2354
|
-
assert(!surfData.locked); // but we could unlock and re-lock if we must..
|
2355
|
-
// TODO: if ctx does not change, leave as is, and also do not re-set xStyle etc.
|
2356
|
-
var x = x1 < x2 ? x1 : x2;
|
2357
|
-
var y = y1 < y2 ? y1 : y2;
|
2358
|
-
var w = Math.abs(x2 - x1);
|
2359
|
-
var h = Math.abs(y2 - y1);
|
2360
|
-
surfData.ctx.save();
|
2361
|
-
surfData.ctx[action + 'Style'] = cssColor;
|
2362
|
-
surfData.ctx[action + 'Rect'](x, y, w, h);
|
2363
|
-
surfData.ctx.restore();
|
2364
|
-
},
|
2365
|
-
drawLine: function(surf, x1, y1, x2, y2, cssColor) {
|
2366
|
-
x1 = x1 << 16 >> 16;
|
2367
|
-
y1 = y1 << 16 >> 16;
|
2368
|
-
x2 = x2 << 16 >> 16;
|
2369
|
-
y2 = y2 << 16 >> 16;
|
2370
|
-
var surfData = SDL.surfaces[surf];
|
2371
|
-
assert(!surfData.locked); // but we could unlock and re-lock if we must..
|
2372
|
-
surfData.ctx.save();
|
2373
|
-
surfData.ctx.strokeStyle = cssColor;
|
2374
|
-
surfData.ctx.beginPath();
|
2375
|
-
surfData.ctx.moveTo(x1, y1);
|
2376
|
-
surfData.ctx.lineTo(x2, y2);
|
2377
|
-
surfData.ctx.stroke();
|
2378
|
-
surfData.ctx.restore();
|
2379
|
-
},
|
2380
|
-
// See http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
|
2381
|
-
drawEllipse: function(surf, x, y, rx, ry, action, cssColor) {
|
2382
|
-
x = x << 16 >> 16;
|
2383
|
-
y = y << 16 >> 16;
|
2384
|
-
rx = rx << 16 >> 16;
|
2385
|
-
ry = ry << 16 >> 16;
|
2386
|
-
var surfData = SDL.surfaces[surf];
|
2387
|
-
assert(!surfData.locked); // but we could unlock and re-lock if we must..
|
2388
|
-
|
2389
|
-
surfData.ctx.save();
|
2390
|
-
surfData.ctx.beginPath();
|
2391
|
-
surfData.ctx.translate(x, y);
|
2392
|
-
surfData.ctx.scale(rx, ry);
|
2393
|
-
surfData.ctx.arc(0, 0, 1, 0, 2 * Math.PI);
|
2394
|
-
surfData.ctx.restore();
|
2395
|
-
|
2396
|
-
surfData.ctx.save();
|
2397
|
-
surfData.ctx[action + 'Style'] = cssColor;
|
2398
|
-
surfData.ctx[action]();
|
2399
|
-
surfData.ctx.restore();
|
2400
|
-
},
|
2401
|
-
// the gfx library uses something different from the rest of SDL...
|
2402
|
-
translateColorToCSSRGBA: function(rgba) {
|
2403
|
-
return 'rgba(' + (rgba>>>24) + ',' + (rgba>>16 & 0xff) + ',' + (rgba>>8 & 0xff) + ',' + (rgba&0xff) + ')';
|
2404
|
-
}
|
2405
|
-
},
|
2406
|
-
|
2407
|
-
boxColor__deps: ['$SDL_gfx'],
|
2408
|
-
boxColor: function(surf, x1, y1, x2, y2, color) {
|
2409
|
-
return SDL_gfx.drawRectangle(surf, x1, y1, x2, y2, 'fill', SDL_gfx.translateColorToCSSRGBA(color));
|
2410
|
-
},
|
2411
|
-
|
2412
|
-
boxRGBA__deps: ['$SDL_gfx'],
|
2413
|
-
boxRGBA: function(surf, x1, y1, x2, y2, r, g, b, a) {
|
2414
|
-
return SDL_gfx.drawRectangle(surf, x1, y1, x2, y2, 'fill', SDL.translateRGBAToCSSRGBA(r, g, b, a));
|
2415
|
-
},
|
2416
|
-
|
2417
|
-
rectangleColor__deps: ['$SDL_gfx'],
|
2418
|
-
rectangleColor: function(surf, x1, y1, x2, y2, color) {
|
2419
|
-
return SDL_gfx.drawRectangle(surf, x1, y1, x2, y2, 'stroke', SDL_gfx.translateColorToCSSRGBA(color));
|
2420
|
-
},
|
2421
|
-
|
2422
|
-
rectangleRGBA__deps: ['$SDL_gfx'],
|
2423
|
-
rectangleRGBA: function(surf, x1, y1, x2, y2, r, g, b, a) {
|
2424
|
-
return SDL_gfx.drawRectangle(surf, x1, y1, x2, y2, 'stroke', SDL.translateRGBAToCSSRGBA(r, g, b, a));
|
2425
|
-
},
|
2426
|
-
|
2427
|
-
ellipseColor__deps: ['$SDL_gfx'],
|
2428
|
-
ellipseColor: function(surf, x, y, rx, ry, color) {
|
2429
|
-
return SDL_gfx.drawEllipse(surf, x, y, rx, ry, 'stroke', SDL_gfx.translateColorToCSSRGBA(color));
|
2430
|
-
},
|
2431
|
-
|
2432
|
-
ellipseRGBA__deps: ['$SDL_gfx'],
|
2433
|
-
ellipseRGBA: function(surf, x, y, rx, ry, r, g, b, a) {
|
2434
|
-
return SDL_gfx.drawEllipse(surf, x, y, rx, ry, 'stroke', SDL.translateRGBAToCSSRGBA(r, g, b, a));
|
2435
|
-
},
|
2436
|
-
|
2437
|
-
filledEllipseColor__deps: ['$SDL_gfx'],
|
2438
|
-
filledEllipseColor: function(surf, x, y, rx, ry, color) {
|
2439
|
-
return SDL_gfx.drawEllipse(surf, x, y, rx, ry, 'fill', SDL_gfx.translateColorToCSSRGBA(color));
|
2440
|
-
},
|
2441
|
-
|
2442
|
-
filledEllipseRGBA__deps: ['$SDL_gfx'],
|
2443
|
-
filledEllipseRGBA: function(surf, x, y, rx, ry, r, g, b, a) {
|
2444
|
-
return SDL_gfx.drawEllipse(surf, x, y, rx, ry, 'fill', SDL.translateRGBAToCSSRGBA(r, g, b, a));
|
2445
|
-
},
|
2446
|
-
|
2447
|
-
lineColor__deps: ['$SDL_gfx'],
|
2448
|
-
lineColor: function(surf, x1, y1, x2, y2, color) {
|
2449
|
-
return SDL_gfx.drawLine(surf, x1, y1, x2, y2, SDL_gfx.translateColorToCSSRGBA(color));
|
2450
|
-
},
|
2451
|
-
|
2452
|
-
lineRGBA__deps: ['$SDL_gfx'],
|
2453
|
-
lineRGBA: function(surf, x1, y1, x2, y2, r, g, b, a) {
|
2454
|
-
return SDL_gfx.drawLine(surf, x1, y1, x2, y2, SDL.translateRGBAToCSSRGBA(r, g, b, a));
|
2455
|
-
},
|
2456
|
-
|
2457
|
-
pixelRGBA__deps: ['boxRGBA'],
|
2458
|
-
pixelRGBA: function(surf, x1, y1, r, g, b, a) {
|
2459
|
-
// This cannot be fast, to render many pixels this way!
|
2460
|
-
_boxRGBA(surf, x1, y1, x1, y1, r, g, b, a);
|
2461
|
-
},
|
2462
|
-
|
2463
|
-
// GL
|
2464
|
-
|
2465
|
-
SDL_GL_SetAttribute: function(attr, value) {
|
2466
|
-
if (!(attr in SDL.glAttributes)) {
|
2467
|
-
abort('Unknown SDL GL attribute (' + attr + '). Please check if your SDL version is supported.');
|
2468
|
-
}
|
2469
|
-
|
2470
|
-
SDL.glAttributes[attr] = value;
|
2471
|
-
},
|
2472
|
-
|
2473
|
-
SDL_GL_GetAttribute: function(attr, value) {
|
2474
|
-
if (!(attr in SDL.glAttributes)) {
|
2475
|
-
abort('Unknown SDL GL attribute (' + attr + '). Please check if your SDL version is supported.');
|
2476
|
-
}
|
2477
|
-
|
2478
|
-
if (value) {{{ makeSetValue('value', '0', 'SDL.glAttributes[attr]', 'i32') }}};
|
2479
|
-
|
2480
|
-
return 0;
|
2481
|
-
},
|
2482
|
-
|
2483
|
-
SDL_GL_GetProcAddress__deps: ['emscripten_GetProcAddress'],
|
2484
|
-
SDL_GL_GetProcAddress: function(name_) {
|
2485
|
-
return _emscripten_GetProcAddress(Pointer_stringify(name_));
|
2486
|
-
},
|
2487
|
-
|
2488
|
-
SDL_GL_SwapBuffers: function() {},
|
2489
|
-
|
2490
|
-
// SDL 2
|
2491
|
-
|
2492
|
-
SDL_GL_ExtensionSupported: function(extension) {
|
2493
|
-
return Module.ctx.getExtension(extension) | 0;
|
2494
|
-
},
|
2495
|
-
|
2496
|
-
SDL_DestroyWindow: function(window) {},
|
2497
|
-
|
2498
|
-
SDL_DestroyRenderer: function(renderer) {},
|
2499
|
-
|
2500
|
-
SDL_GetWindowFlags: function(x, y) {
|
2501
|
-
if (Browser.isFullScreen) {
|
2502
|
-
return 1;
|
2503
|
-
}
|
2504
|
-
|
2505
|
-
return 0;
|
2506
|
-
},
|
2507
|
-
|
2508
|
-
SDL_GL_SwapWindow: function(window) {},
|
2509
|
-
|
2510
|
-
SDL_GL_MakeCurrent: function(window, context) {},
|
2511
|
-
|
2512
|
-
SDL_GL_DeleteContext: function(context) {},
|
2513
|
-
|
2514
|
-
SDL_GL_SetSwapInterval: function(state) {},
|
2515
|
-
|
2516
|
-
SDL_SetWindowTitle: function(window, title) {
|
2517
|
-
if (title) document.title = Pointer_stringify(title);
|
2518
|
-
},
|
2519
|
-
|
2520
|
-
SDL_GetWindowSize: function(window, width, height){
|
2521
|
-
var w = Module['canvas'].width;
|
2522
|
-
var h = Module['canvas'].height;
|
2523
|
-
if (width) {{{ makeSetValue('width', '0', 'w', 'i32') }}};
|
2524
|
-
if (height) {{{ makeSetValue('height', '0', 'h', 'i32') }}};
|
2525
|
-
},
|
2526
|
-
|
2527
|
-
SDL_LogSetOutputFunction: function(callback, userdata) {},
|
2528
|
-
|
2529
|
-
SDL_SetWindowFullscreen: function(window, fullscreen) {
|
2530
|
-
if (Browser.isFullScreen) {
|
2531
|
-
Module['canvas'].cancelFullScreen();
|
2532
|
-
return 1;
|
2533
|
-
} else {
|
2534
|
-
return 0;
|
2535
|
-
}
|
2536
|
-
},
|
2537
|
-
|
2538
|
-
SDL_GetWindowFlags: function() {},
|
2539
|
-
|
2540
|
-
SDL_ClearError: function() {},
|
2541
|
-
|
2542
|
-
SDL_getenv: 'getenv',
|
2543
|
-
|
2544
|
-
// TODO
|
2545
|
-
|
2546
|
-
SDL_SetGamma: function(r, g, b) {
|
2547
|
-
return -1;
|
2548
|
-
},
|
2549
|
-
|
2550
|
-
SDL_SetGammaRamp: function(redTable, greenTable, blueTable) {
|
2551
|
-
return -1;
|
2552
|
-
},
|
2553
|
-
|
2554
|
-
// Joysticks
|
2555
|
-
|
2556
|
-
SDL_NumJoysticks: function() {
|
2557
|
-
var count = 0;
|
2558
|
-
var gamepads = SDL.getGamepads();
|
2559
|
-
// The length is not the number of gamepads; check which ones are defined.
|
2560
|
-
for (var i = 0; i < gamepads.length; i++) {
|
2561
|
-
if (gamepads[i] !== undefined) count++;
|
2562
|
-
}
|
2563
|
-
return count;
|
2564
|
-
},
|
2565
|
-
|
2566
|
-
SDL_JoystickName: function(deviceIndex) {
|
2567
|
-
var gamepad = SDL.getGamepad(deviceIndex);
|
2568
|
-
if (gamepad) {
|
2569
|
-
var name = gamepad.id;
|
2570
|
-
if (SDL.joystickNamePool.hasOwnProperty(name)) {
|
2571
|
-
return SDL.joystickNamePool[name];
|
2572
|
-
}
|
2573
|
-
return SDL.joystickNamePool[name] = allocate(intArrayFromString(name), 'i8', ALLOC_NORMAL);
|
2574
|
-
}
|
2575
|
-
return 0;
|
2576
|
-
},
|
2577
|
-
|
2578
|
-
SDL_JoystickOpen: function(deviceIndex) {
|
2579
|
-
var gamepad = SDL.getGamepad(deviceIndex);
|
2580
|
-
if (gamepad) {
|
2581
|
-
// Use this as a unique 'pointer' for this joystick.
|
2582
|
-
var joystick = deviceIndex+1;
|
2583
|
-
SDL.recordJoystickState(joystick, gamepad);
|
2584
|
-
return joystick;
|
2585
|
-
}
|
2586
|
-
return 0;
|
2587
|
-
},
|
2588
|
-
|
2589
|
-
SDL_JoystickOpened: function(deviceIndex) {
|
2590
|
-
return SDL.lastJoystickState.hasOwnProperty(deviceIndex+1) ? 1 : 0;
|
2591
|
-
},
|
2592
|
-
|
2593
|
-
SDL_JoystickIndex: function(joystick) {
|
2594
|
-
// joystick pointers are simply the deviceIndex+1.
|
2595
|
-
return joystick - 1;
|
2596
|
-
},
|
2597
|
-
|
2598
|
-
SDL_JoystickNumAxes: function(joystick) {
|
2599
|
-
var gamepad = SDL.getGamepad(joystick - 1);
|
2600
|
-
if (gamepad) {
|
2601
|
-
return gamepad.axes.length;
|
2602
|
-
}
|
2603
|
-
return 0;
|
2604
|
-
},
|
2605
|
-
|
2606
|
-
SDL_JoystickNumBalls: function(joystick) { return 0; },
|
2607
|
-
|
2608
|
-
SDL_JoystickNumHats: function(joystick) { return 0; },
|
2609
|
-
|
2610
|
-
SDL_JoystickNumButtons: function(joystick) {
|
2611
|
-
var gamepad = SDL.getGamepad(joystick - 1);
|
2612
|
-
if (gamepad) {
|
2613
|
-
return gamepad.buttons.length;
|
2614
|
-
}
|
2615
|
-
return 0;
|
2616
|
-
},
|
2617
|
-
|
2618
|
-
SDL_JoystickUpdate: function() {
|
2619
|
-
SDL.queryJoysticks();
|
2620
|
-
},
|
2621
|
-
|
2622
|
-
SDL_JoystickEventState: function(state) {
|
2623
|
-
if (state < 0) {
|
2624
|
-
// SDL_QUERY: Return current state.
|
2625
|
-
return SDL.joystickEventState;
|
2626
|
-
}
|
2627
|
-
return SDL.joystickEventState = state;
|
2628
|
-
},
|
2629
|
-
|
2630
|
-
SDL_JoystickGetAxis: function(joystick, axis) {
|
2631
|
-
var gamepad = SDL.getGamepad(joystick - 1);
|
2632
|
-
if (gamepad && gamepad.axes.length > axis) {
|
2633
|
-
return SDL.joystickAxisValueConversion(gamepad.axes[axis]);
|
2634
|
-
}
|
2635
|
-
return 0;
|
2636
|
-
},
|
2637
|
-
|
2638
|
-
SDL_JoystickGetHat: function(joystick, hat) { return 0; },
|
2639
|
-
|
2640
|
-
SDL_JoystickGetBall: function(joystick, ball, dxptr, dyptr) { return -1; },
|
2641
|
-
|
2642
|
-
SDL_JoystickGetButton: function(joystick, button) {
|
2643
|
-
var gamepad = SDL.getGamepad(joystick - 1);
|
2644
|
-
if (gamepad && gamepad.buttons.length > button) {
|
2645
|
-
return SDL.getJoystickButtonState(gamepad.buttons[button]) ? 1 : 0;
|
2646
|
-
}
|
2647
|
-
return 0;
|
2648
|
-
},
|
2649
|
-
|
2650
|
-
SDL_JoystickClose: function(joystick) {
|
2651
|
-
delete SDL.lastJoystickState[joystick];
|
2652
|
-
},
|
2653
|
-
|
2654
|
-
// Misc
|
2655
|
-
|
2656
|
-
SDL_InitSubSystem: function(flags) { return 0 },
|
2657
|
-
|
2658
|
-
SDL_RWFromConstMem: function(mem, size) {
|
2659
|
-
var id = SDL.rwops.length; // TODO: recycle ids when they are null
|
2660
|
-
SDL.rwops.push({ bytes: mem, count: size });
|
2661
|
-
return id;
|
2662
|
-
},
|
2663
|
-
SDL_RWFromMem: 'SDL_RWFromConstMem',
|
2664
|
-
|
2665
|
-
SDL_RWFromFile: function(_name, mode) {
|
2666
|
-
var id = SDL.rwops.length; // TODO: recycle ids when they are null
|
2667
|
-
var name = Pointer_stringify(_name)
|
2668
|
-
SDL.rwops.push({ filename: name, mimetype: Browser.getMimetype(name) });
|
2669
|
-
return id;
|
2670
|
-
},
|
2671
|
-
|
2672
|
-
SDL_FreeRW: function(rwopsID) {
|
2673
|
-
SDL.rwops[rwopsID] = null;
|
2674
|
-
while (SDL.rwops.length > 0 && SDL.rwops[SDL.rwops.length-1] === null) {
|
2675
|
-
SDL.rwops.pop();
|
2676
|
-
}
|
2677
|
-
},
|
2678
|
-
|
2679
|
-
SDL_EnableUNICODE: function(on) {
|
2680
|
-
var ret = SDL.unicode || 0;
|
2681
|
-
SDL.unicode = on;
|
2682
|
-
return ret;
|
2683
|
-
},
|
2684
|
-
|
2685
|
-
SDL_AddTimer: function(interval, callback, param) {
|
2686
|
-
return window.setTimeout(function() {
|
2687
|
-
Runtime.dynCall('iii', callback, [interval, param]);
|
2688
|
-
}, interval);
|
2689
|
-
},
|
2690
|
-
SDL_RemoveTimer: function(id) {
|
2691
|
-
window.clearTimeout(id);
|
2692
|
-
return true;
|
2693
|
-
},
|
2694
|
-
|
2695
|
-
SDL_CreateThread: function() {
|
2696
|
-
throw 'SDL threads cannot be supported in the web platform because they assume shared state. See emscripten_create_worker etc. for a message-passing concurrency model that does let you run code in another thread.'
|
2697
|
-
},
|
2698
|
-
|
2699
|
-
SDL_WaitThread: function() { throw 'SDL_WaitThread' },
|
2700
|
-
SDL_GetThreadID: function() { throw 'SDL_GetThreadID' },
|
2701
|
-
SDL_ThreadID: function() { return 0; },
|
2702
|
-
SDL_AllocRW: function() { throw 'SDL_AllocRW: TODO' },
|
2703
|
-
SDL_CondBroadcast: function() { throw 'SDL_CondBroadcast: TODO' },
|
2704
|
-
SDL_CondWaitTimeout: function() { throw 'SDL_CondWaitTimeout: TODO' },
|
2705
|
-
SDL_WM_IconifyWindow: function() { throw 'SDL_WM_IconifyWindow TODO' },
|
2706
|
-
|
2707
|
-
Mix_SetPostMix: function() { Runtime.warnOnce('Mix_SetPostMix: TODO') },
|
2708
|
-
Mix_QuerySpec: function() { throw 'Mix_QuerySpec: TODO' },
|
2709
|
-
Mix_FadeInChannelTimed: function() { throw 'Mix_FadeInChannelTimed' },
|
2710
|
-
Mix_FadeOutChannel: function() { throw 'Mix_FadeOutChannel' },
|
2711
|
-
|
2712
|
-
Mix_Linked_Version: function() { throw 'Mix_Linked_Version: TODO' },
|
2713
|
-
SDL_SaveBMP_RW: function() { throw 'SDL_SaveBMP_RW: TODO' },
|
2714
|
-
|
2715
|
-
SDL_WM_SetIcon: function() { /* This function would set the application window icon surface, which doesn't apply for web canvases, so a no-op. */ },
|
2716
|
-
SDL_HasRDTSC: function() { return 0; },
|
2717
|
-
SDL_HasMMX: function() { return 0; },
|
2718
|
-
SDL_HasMMXExt: function() { return 0; },
|
2719
|
-
SDL_Has3DNow: function() { return 0; },
|
2720
|
-
SDL_Has3DNowExt: function() { return 0; },
|
2721
|
-
SDL_HasSSE: function() { return 0; },
|
2722
|
-
SDL_HasSSE2: function() { return 0; },
|
2723
|
-
SDL_HasAltiVec: function() { return 0; }
|
2724
|
-
};
|
2725
|
-
|
2726
|
-
autoAddDeps(LibrarySDL, '$SDL');
|
2727
|
-
mergeInto(LibraryManager.library, LibrarySDL);
|
2728
|
-
|