@ -190,7 +190,7 @@ Module['FS_createPath']("/", "assets", true, true);
}
}
loadPackage ( { "files" : [ { "filename" : "/assets/MAINICON.ico" , "start" : 0 , "end" : 766 } , { "filename" : "/assets/atk.png" , "start" : 766 , "end" : 1443 } , { "filename" : "/assets/attackLine.png" , "start" : 1443 , "end" : 2084 } , { "filename" : "/assets/bit_restorer.png" , "start" : 2084 , "end" : 11632 } , { "filename" : "/assets/corrupter.png" , "start" : 11632 , "end" : 22695 } , { "filename" : "/assets/down_arrow.png" , "start" : 22695 , "end ": 233 36} , { "filename" : "/assets/left_shifter.png" , "start" : 23336 , "end" : 32541 } , { "filename" : "/assets/machine2.wav" , "start" : 32541 , "end" : 111149 , "audio" : 1 } , { "filename" : "/assets/material.png" , "start" : 111149 , "end" : 111844 } , { "filename" : "/assets/memory_collection_point.png" , "start" : 111844 , "end" : 112790 } , { "filename" : "/assets/memory_collection_point_highlight.png" , "start" : 112790 , "end" : 124867 } , { "filename" : "/assets/memory_swapper.png" , "start" : 124867 , "end" : 136317 } , { "filename" : "/assets/minimap_hud.png" , "start" : 136317 , "end" : 139775 } , { "filename" : "/assets/outline.png" , "start" : 139775 , "end" : 140384 } , { "filename" : "/assets/prc.png" , "start" : 140384 , "end" : 149687 } , { "filename" : "/assets/prc_icon.png" , "start" : 149687 , "end" : 150439 } , { "filename" : "/assets/ram_bank.png" , "start" : 150439 , "end" : 152703 } , { "filename" : "/assets/range_indicator.png" , "start" : 152703 , "end" : 16173 8 } , { "filename" : "/assets/red_x.png" , "start" : 16173 8 , "end" : 162350 } , { "filename" : "/assets/right_shifter.png" , "start" : 162350 , "end" : 171574 } , { "filename" : "/assets/rld.png" , "start" : 171574 , "end" : 179245 } , { "filename" : "/assets/rld_icon.png" , "start" : 179245 , "end" : 179911 } , { "filename" : "/assets/rng.png" , "start" : 179911 , "end" : 189043 } , { "filename" : "/assets/rng_icon.png" , "start" : 189043 , "end" : 189 75 0 } , { "filename" : "/assets/selection_circle.png" , "start" : 189750 , "end" : 190429 } , { "filename" : "/assets/shell.png" , "start" : 190429 , "end" : 197303 } , { "filename" : "/assets/sonar.wav" , "start" : 197303 , "end" : 453791 , "audio" : 1 } , { "filename" : "/assets/spd.png" , "start" : 453791 , "end" : 462333 } , { "filename" : "/assets/spd_icon.png" , "start" : 462333 , "end" : 463024 } , { "filename" : "/assets/targetLine.png" , "start" : 463024 , "end" : 463646 } , { "filename" : "/assets/tile.png" , "start" : 463646 , "end" : 464981 } , { "filename" : "/assets/unit.png" , "start" : 464981 , "end" : 465711 } ] , "remote_package_size" : 465711 } ) ;
loadPackage ( { "files" : [ { "filename" : "/assets/MAINICON.ico" , "start" : 0 , "end" : 766 } , { "filename" : "/assets/atk.png" , "start" : 766 , "end" : 1443 } , { "filename" : "/assets/attackLine.png" , "start" : 1443 , "end" : 2084 } , { "filename" : "/assets/bit_restorer.png" , "start" : 2084 , "end" : 11632 } , { "filename" : "/assets/corrupter.png" , "start" : 11632 , "end" : 22695 } , { "filename" : "/assets/cosmos.mp3" , "start" : 22695 , "end" : 9174299 , "audio" : 1 } , { "filename" : "/assets/ down_arrow.png" , "start" : 9174299 , "end" : 9174940 } , { "filename" : "/assets/gravity.mp3" , "start ": 9174940 , "end" : 1685 34 62 , "audio" : 1 } , { "filename" : "/assets/left_shifter.png" , "start" : 16853462 , "end" : 16862667 } , { "filename" : "/assets/machine2.wav" , "start" : 16862667 , "end" : 16941275 , "audio" : 1 } , { "filename" : "/assets/material.png" , "start" : 16941275 , "end" : 16941970 } , { "filename" : "/assets/memory_collection_point.png" , "start" : 16941970 , "end" : 16942916 } , { "filename" : "/assets/memory_collection_point_highlight.png" , "start" : 16942916 , "end" : 16954993 } , { "filename" : "/assets/memory_swapper.png" , "start" : 16954993 , "end" : 16966443 } , { "filename" : "/assets/minimap_hud.png" , "start" : 16966443 , "end" : 16969901 } , { "filename" : "/assets/outline.png" , "start" : 16969901 , "end" : 16970510 } , { "filename" : "/assets/prc.png" , "start" : 16970510 , "end" : 16979813 } , { "filename" : "/assets/prc_icon.png" , "start" : 16979813 , "end" : 16980565 } , { "filename" : "/assets/ram_bank.png" , "start" : 16980565 , "end" : 16982829 } , { "filename" : "/assets/range_indicator.png" , "start" : 16982829 , "end" : 1699 1864 } , { "filename" : "/assets/red_x.png" , "start" : 1699 1864 , "end" : 16992476 } , { "filename" : "/assets/right_shifter.png" , "start" : 16992476 , "end" : 17001700 } , { "filename" : "/assets/rld.png" , "start" : 17001700 , "end" : 17009371 } , { "filename" : "/assets/rld_icon.png" , "start" : 17009371 , "end" : 17010037 } , { "filename" : "/assets/rng.png" , "start" : 17010037 , "end" : 17019169 } , { "filename" : "/assets/rng_icon.png" , "start" : 17019169 , "end" : 17019876 } , { "filename" : "/assets/selection_circle.png" , "start" : 17019876 , "end" : 17020555 } , { "filename" : "/assets/shell.png" , "start" : 17020555 , "end" : 17027429 } , { "filename" : "/assets/sonar.wav" , "start" : 17027429 , "end" : 17283917 , "audio" : 1 } , { "filename" : "/assets/spd.png" , "start" : 17283917 , "end" : 17292459 } , { "filename" : "/assets/spd_icon.png" , "start" : 17292459 , "end" : 17293150 } , { "filename" : "/assets/targetLine.png" , "start" : 17293150 , "end" : 17293772 } , { "filename" : "/assets/tile.png" , "start" : 17293772 , "end" : 17295107 } , { "filename" : "/assets/unit.png" , "start" : 17295107 , "end" : 17295837 } ] , "remote_package_size" : 17295837 } ) ;
} ) ( ) ;
@ -1187,27 +1187,31 @@ function dbg(text) {
// === Body ===
var ASM _CONSTS = {
5371724 : ( ) => { return Module . canvas . getBoundingClientRect ( ) . left } ,
5371776 : ( ) => { return Module . canvas . getBoundingClientRect ( ) . top } ,
5371827 : ( ) => { return Module . olc _MOUSEX ; } ,
5371855 : ( ) => { return Module . olc _MOUSEY ; } ,
5371883 : ( ) => { window . onunload = Module . _olc _OnPageUnload ; } ,
5371927 : ( $0 , $1 ) => { Module . olc _AspectRatio = $0 / $1 ; onmousemove = function ( e ) { Module . olc _MOUSEX = e . clientX ; Module . olc _MOUSEY = e . clientY ; } ; ontouchmove = function ( e ) { Module . olc _MOUSEX = e . touches [ 0 ] . clientX ; Module . olc _MOUSEY = e . touches [ 0 ] . clientY ; } ; ontouchstart = function ( e ) { Module . olc _MOUSEX = e . touches [ 0 ] . clientX ; Module . olc _MOUSEY = e . touches [ 0 ] . clientY ; } ; Module . olc _AssumeDefaultShells = ( document . querySelectorAll ( '.emscripten' ) . length >= 3 ) ? true : false ; var olc _ResizeHandler = function ( ) { let isFullscreen = ( document . fullscreenElement != null ) ; let width = ( isFullscreen ) ? window . innerWidth : Module . canvas . parentNode . clientWidth ; let height = ( isFullscreen ) ? window . innerHeight : Module . canvas . parentNode . clientHeight ; let viewWidth = width ; let viewHeight = width / Module . olc _AspectRatio ; if ( viewHeight > height ) { viewWidth = height * Module . olc _AspectRatio ; viewHeight = height ; } viewWidth = parseInt ( viewWidth ) ; viewHeight = parseInt ( viewHeight ) ; setTimeout ( function ( ) { if ( Module . olc _AssumeDefaultShells ) Module . canvas . parentNode . setAttribute ( 'style' , 'width: 100%; height: 70vh; margin-left: auto; margin-right: auto;' ) ; Module . canvas . setAttribute ( 'width' , viewWidth ) ; Module . canvas . setAttribute ( 'height' , viewHeight ) ; Module . canvas . setAttribute ( 'style' , ` width: ${ viewWidth } px; height: ${ viewHeight } px; ` ) ; Module . _olc _PGE _UpdateWindowSize ( viewWidth , viewHeight ) ; Module . canvas . focus ( ) ; } , 200 ) ; } ; var olc _Init = function ( ) { if ( Module . olc _AspectRatio === undefined ) { setTimeout ( function ( ) { Module . olc _Init ( ) ; } , 50 ) ; return ; } let resizeObserver = new ResizeObserver ( function ( entries ) { Module . olc _ResizeHandler ( ) ; } ) . observe ( Module . canvas . parentNode ) ; let mutationObserver = new MutationObserver ( function ( mutationsList , observer ) { setTimeout ( function ( ) { Module . olc _ResizeHandler ( ) ; } , 200 ) ; } ) . observe ( Module . canvas . parentNode , { attributes : false , childList : true , subtree : false } ) ; window . addEventListener ( 'fullscreenchange' , function ( e ) { setTimeout ( function ( ) { Module . olc _ResizeHandler ( ) ; } , 200 ) ; } ) ; } ; Module . olc _ResizeHandler = ( Module . olc _ResizeHandler != undefined ) ? Module . olc _ResizeHandler : olc _ResizeHandler ; Module . olc _Init = ( Module . olc _Init != undefined ) ? Module . olc _Init : olc _Init ; Module . olc _Init ( ) ; } ,
5374159 : ( ) => { if ( typeof ( AudioContext ) !== 'undefined' ) { return true ; } else if ( typeof ( webkitAudioContext ) !== 'undefined' ) { return true ; } return false ; } ,
5374306 : ( ) => { if ( ( typeof ( navigator . mediaDevices ) !== 'undefined' ) && ( typeof ( navigator . mediaDevices . getUserMedia ) !== 'undefined' ) ) { return true ; } else if ( typeof ( navigator . webkitGetUserMedia ) !== 'undefined' ) { return true ; } return false ; } ,
5374540 : ( $0 ) => { if ( typeof ( Module [ 'SDL2' ] ) === 'undefined' ) { Module [ 'SDL2' ] = { } ; } var SDL2 = Module [ 'SDL2' ] ; if ( ! $0 ) { SDL2 . audio = { } ; } else { SDL2 . capture = { } ; } if ( ! SDL2 . audioContext ) { if ( typeof ( AudioContext ) !== 'undefined' ) { SDL2 . audioContext = new AudioContext ( ) ; } else if ( typeof ( webkitAudioContext ) !== 'undefined' ) { SDL2 . audioContext = new webkitAudioContext ( ) ; } if ( SDL2 . audioContext ) { autoResumeAudioContext ( SDL2 . audioContext ) ; } } return SDL2 . audioContext === undefined ? - 1 : 0 ; } ,
5375033 : ( ) => { var SDL2 = Module [ 'SDL2' ] ; return SDL2 . audioContext . sampleRate ; } ,
5375101 : ( $0 , $1 , $2 , $3 ) => { var SDL2 = Module [ 'SDL2' ] ; var have _microphone = function ( stream ) { if ( SDL2 . capture . silenceTimer !== undefined ) { clearTimeout ( SDL2 . capture . silenceTimer ) ; SDL2 . capture . silenceTimer = undefined ; } SDL2 . capture . mediaStreamNode = SDL2 . audioContext . createMediaStreamSource ( stream ) ; SDL2 . capture . scriptProcessorNode = SDL2 . audioContext . createScriptProcessor ( $1 , $0 , 1 ) ; SDL2 . capture . scriptProcessorNode . onaudioprocess = function ( audioProcessingEvent ) { if ( ( SDL2 === undefined ) || ( SDL2 . capture === undefined ) ) { return ; } audioProcessingEvent . outputBuffer . getChannelData ( 0 ) . fill ( 0.0 ) ; SDL2 . capture . currentCaptureBuffer = audioProcessingEvent . inputBuffer ; dynCall ( 'vi' , $2 , [ $3 ] ) ; } ; SDL2 . capture . mediaStreamNode . connect ( SDL2 . capture . scriptProcessorNode ) ; SDL2 . capture . scriptProcessorNode . connect ( SDL2 . audioContext . destination ) ; SDL2 . capture . stream = stream ; } ; var no _microphone = function ( error ) { } ; SDL2 . capture . silenceBuffer = SDL2 . audioContext . createBuffer ( $0 , $1 , SDL2 . audioContext . sampleRate ) ; SDL2 . capture . silenceBuffer . getChannelData ( 0 ) . fill ( 0.0 ) ; var silence _callback = function ( ) { SDL2 . capture . currentCaptureBuffer = SDL2 . capture . silenceBuffer ; dynCall ( 'vi' , $2 , [ $3 ] ) ; } ; SDL2 . capture . silenceTimer = setTimeout ( silence _callback , ( $1 / SDL2 . audioContext . sampleRate ) * 1000 ) ; if ( ( navigator . mediaDevices !== undefined ) && ( navigator . mediaDevices . getUserMedia !== undefined ) ) { navigator . mediaDevices . getUserMedia ( { audio : true , video : false } ) . then ( have _microphone ) . catch ( no _microphone ) ; } else if ( navigator . webkitGetUserMedia !== undefined ) { navigator . webkitGetUserMedia ( { audio : true , video : false } , have _microphone , no _microphone ) ; } } ,
5376753 : ( $0 , $1 , $2 , $3 ) => { var SDL2 = Module [ 'SDL2' ] ; SDL2 . audio . scriptProcessorNode = SDL2 . audioContext [ 'createScriptProcessor' ] ( $1 , 0 , $0 ) ; SDL2 . audio . scriptProcessorNode [ 'onaudioprocess' ] = function ( e ) { if ( ( SDL2 === undefined ) || ( SDL2 . audio === undefined ) ) { return ; } SDL2 . audio . currentOutputBuffer = e [ 'outputBuffer' ] ; dynCall ( 'vi' , $2 , [ $3 ] ) ; } ; SDL2 . audio . scriptProcessorNode [ 'connect' ] ( SDL2 . audioContext [ 'destination' ] ) ; } ,
5377163 : ( $0 , $1 ) => { var SDL2 = Module [ 'SDL2' ] ; var numChannels = SDL2 . capture . currentCaptureBuffer . numberOfChannels ; for ( var c = 0 ; c < numChannels ; ++ c ) { var channelData = SDL2 . capture . currentCaptureBuffer . getChannelData ( c ) ; if ( channelData . length != $1 ) { throw 'Web Audio capture buffer length mismatch! Destination size: ' + channelData . length + ' samples vs expected ' + $1 + ' samples!' ; } if ( numChannels == 1 ) { for ( var j = 0 ; j < $1 ; ++ j ) { setValue ( $0 + ( j * 4 ) , channelData [ j ] , 'float' ) ; } } else { for ( var j = 0 ; j < $1 ; ++ j ) { setValue ( $0 + ( ( ( j * numChannels ) + c ) * 4 ) , channelData [ j ] , 'float' ) ; } } } } ,
5377768 : ( $0 , $1 ) => { var SDL2 = Module [ 'SDL2' ] ; var numChannels = SDL2 . audio . currentOutputBuffer [ 'numberOfChannels' ] ; for ( var c = 0 ; c < numChannels ; ++ c ) { var channelData = SDL2 . audio . currentOutputBuffer [ 'getChannelData' ] ( c ) ; if ( channelData . length != $1 ) { throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData . length + ' samples vs expected ' + $1 + ' samples!' ; } for ( var j = 0 ; j < $1 ; ++ j ) { channelData [ j ] = HEAPF32 [ $0 + ( ( j * numChannels + c ) << 2 ) >> 2 ] ; } } } ,
5378248 : ( $0 ) => { var SDL2 = Module [ 'SDL2' ] ; if ( $0 ) { if ( SDL2 . capture . silenceTimer !== undefined ) { clearTimeout ( SDL2 . capture . silenceTimer ) ; } if ( SDL2 . capture . stream !== undefined ) { var tracks = SDL2 . capture . stream . getAudioTracks ( ) ; for ( var i = 0 ; i < tracks . length ; i ++ ) { SDL2 . capture . stream . removeTrack ( tracks [ i ] ) ; } SDL2 . capture . stream = undefined ; } if ( SDL2 . capture . scriptProcessorNode !== undefined ) { SDL2 . capture . scriptProcessorNode . onaudioprocess = function ( audioProcessingEvent ) { } ; SDL2 . capture . scriptProcessorNode . disconnect ( ) ; SDL2 . capture . scriptProcessorNode = undefined ; } if ( SDL2 . capture . mediaStreamNode !== undefined ) { SDL2 . capture . mediaStreamNode . disconnect ( ) ; SDL2 . capture . mediaStreamNode = undefined ; } if ( SDL2 . capture . silenceBuffer !== undefined ) { SDL2 . capture . silenceBuffer = undefined } SDL2 . capture = undefined ; } else { if ( SDL2 . audio . scriptProcessorNode != undefined ) { SDL2 . audio . scriptProcessorNode . disconnect ( ) ; SDL2 . audio . scriptProcessorNode = undefined ; } SDL2 . audio = undefined ; } if ( ( SDL2 . audioContext !== undefined ) && ( SDL2 . audio === undefined ) && ( SDL2 . capture === undefined ) ) { SDL2 . audioContext . close ( ) ; SDL2 . audioContext = undefined ; } } ,
5379420 : ( $0 , $1 , $2 ) => { var w = $0 ; var h = $1 ; var pixels = $2 ; if ( ! Module [ 'SDL2' ] ) Module [ 'SDL2' ] = { } ; var SDL2 = Module [ 'SDL2' ] ; if ( SDL2 . ctxCanvas !== Module [ 'canvas' ] ) { SDL2 . ctx = Module [ 'createContext' ] ( Module [ 'canvas' ] , false , true ) ; SDL2 . ctxCanvas = Module [ 'canvas' ] ; } if ( SDL2 . w !== w || SDL2 . h !== h || SDL2 . imageCtx !== SDL2 . ctx ) { SDL2 . image = SDL2 . ctx . createImageData ( w , h ) ; SDL2 . w = w ; SDL2 . h = h ; SDL2 . imageCtx = SDL2 . ctx ; } var data = SDL2 . image . data ; var src = pixels >> 2 ; var dst = 0 ; var num ; if ( typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray ) { num = data . length ; while ( dst < num ) { var val = HEAP32 [ src ] ; data [ dst ] = val & 0xff ; data [ dst + 1 ] = ( val >> 8 ) & 0xff ; data [ dst + 2 ] = ( val >> 16 ) & 0xff ; data [ dst + 3 ] = 0xff ; src ++ ; dst += 4 ; } } else { if ( SDL2 . data32Data !== data ) { SDL2 . data32 = new Int32Array ( data . buffer ) ; SDL2 . data8 = new Uint8Array ( data . buffer ) ; SDL2 . data32Data = data ; } var data32 = SDL2 . data32 ; num = data32 . length ; data32 . set ( HEAP32 . subarray ( src , src + num ) ) ; var data8 = SDL2 . data8 ; var i = 3 ; var j = i + 4 * num ; if ( num % 8 == 0 ) { while ( i < j ) { data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; } } else { while ( i < j ) { data8 [ i ] = 0xff ; i = i + 4 | 0 ; } } } SDL2 . ctx . putImageData ( SDL2 . image , 0 , 0 ) ; } ,
5380889 : ( $0 , $1 , $2 , $3 , $4 ) => { var w = $0 ; var h = $1 ; var hot _x = $2 ; var hot _y = $3 ; var pixels = $4 ; var canvas = document . createElement ( "canvas" ) ; canvas . width = w ; canvas . height = h ; var ctx = canvas . getContext ( "2d" ) ; var image = ctx . createImageData ( w , h ) ; var data = image . data ; var src = pixels >> 2 ; var dst = 0 ; var num ; if ( typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray ) { num = data . length ; while ( dst < num ) { var val = HEAP32 [ src ] ; data [ dst ] = val & 0xff ; data [ dst + 1 ] = ( val >> 8 ) & 0xff ; data [ dst + 2 ] = ( val >> 16 ) & 0xff ; data [ dst + 3 ] = ( val >> 24 ) & 0xff ; src ++ ; dst += 4 ; } } else { var data32 = new Int32Array ( data . buffer ) ; num = data32 . length ; data32 . set ( HEAP32 . subarray ( src , src + num ) ) ; } ctx . putImageData ( image , 0 , 0 ) ; var url = hot _x === 0 && hot _y === 0 ? "url(" + canvas . toDataURL ( ) + "), auto" : "url(" + canvas . toDataURL ( ) + ") " + hot _x + " " + hot _y + ", auto" ; var urlBuf = _malloc ( url . length + 1 ) ; stringToUTF8 ( url , urlBuf , url . length + 1 ) ; return urlBuf ; } ,
5381878 : ( $0 ) => { if ( Module [ 'canvas' ] ) { Module [ 'canvas' ] . style [ 'cursor' ] = UTF8ToString ( $0 ) ; } } ,
5381961 : ( ) => { if ( Module [ 'canvas' ] ) { Module [ 'canvas' ] . style [ 'cursor' ] = 'none' ; } } ,
5382030 : ( ) => { return window . innerWidth ; } ,
5382060 : ( ) => { return window . innerHeight ; }
5371644 : ( ) => { return Module . canvas . getBoundingClientRect ( ) . left } ,
5371696 : ( ) => { return Module . canvas . getBoundingClientRect ( ) . top } ,
5371747 : ( ) => { return Module . olc _MOUSEX ; } ,
5371775 : ( ) => { return Module . olc _MOUSEY ; } ,
5371803 : ( ) => { return Module . olc _MOUSEDOWN } ,
5371833 : ( ) => { return Module . olc _MOUSEUP } ,
5371861 : ( ) => { Module . olc _MOUSEDOWN = - 1 } ,
5371887 : ( ) => { Module . olc _MOUSEUP = - 1 } ,
5371911 : ( ) => { window . onunload = Module . _olc _OnPageUnload ; } ,
5371955 : ( $0 , $1 ) => { Module . olc _AspectRatio = $0 / $1 ; Module . olc _MOUSEDOWN = - 1 ; Module . olc _MOUSEUP = - 1 ; onmousemove = function ( e ) { Module . olc _MOUSEX = e . clientX ; Module . olc _MOUSEY = e . clientY ; } ; onmousedown = function ( e ) { Module . olc _MOUSEDOWN = e . button ; } ; onmouseup = function ( e ) { Module . olc _MOUSEUP = e . button ; } ; ontouchmove = function ( e ) { Module . olc _MOUSEX = e . touches [ 0 ] . clientX ; Module . olc _MOUSEY = e . touches [ 0 ] . clientY ; } ; ontouchstart = function ( e ) { Module . olc _MOUSEX = e . touches [ 0 ] . clientX ; Module . olc _MOUSEY = e . touches [ 0 ] . clientY ; } ; Module . olc _AssumeDefaultShells = ( document . querySelectorAll ( '.emscripten' ) . length >= 3 ) ? true : false ; var olc _ResizeHandler = function ( ) { let isFullscreen = ( document . fullscreenElement != null ) ; let width = ( isFullscreen ) ? window . innerWidth : Module . canvas . parentNode . clientWidth ; let height = ( isFullscreen ) ? window . innerHeight : Module . canvas . parentNode . clientHeight ; let viewWidth = width ; let viewHeight = width / Module . olc _AspectRatio ; if ( viewHeight > height ) { viewWidth = height * Module . olc _AspectRatio ; viewHeight = height ; } viewWidth = parseInt ( viewWidth ) ; viewHeight = parseInt ( viewHeight ) ; setTimeout ( function ( ) { if ( Module . olc _AssumeDefaultShells ) Module . canvas . parentNode . setAttribute ( 'style' , 'width: 100%; height: 70vh; margin-left: auto; margin-right: auto;' ) ; Module . canvas . setAttribute ( 'width' , viewWidth ) ; Module . canvas . setAttribute ( 'height' , viewHeight ) ; Module . canvas . setAttribute ( 'style' , ` width: ${ viewWidth } px; height: ${ viewHeight } px; ` ) ; Module . _olc _PGE _UpdateWindowSize ( viewWidth , viewHeight ) ; Module . canvas . focus ( ) ; } , 200 ) ; } ; var olc _Init = function ( ) { if ( Module . olc _AspectRatio === undefined ) { setTimeout ( function ( ) { Module . olc _Init ( ) ; } , 50 ) ; return ; } let resizeObserver = new ResizeObserver ( function ( entries ) { Module . olc _ResizeHandler ( ) ; } ) . observe ( Module . canvas . parentNode ) ; let mutationObserver = new MutationObserver ( function ( mutationsList , observer ) { setTimeout ( function ( ) { Module . olc _ResizeHandler ( ) ; } , 200 ) ; } ) . observe ( Module . canvas . parentNode , { attributes : false , childList : true , subtree : false } ) ; window . addEventListener ( 'fullscreenchange' , function ( e ) { setTimeout ( function ( ) { Module . olc _ResizeHandler ( ) ; } , 200 ) ; } ) ; } ; Module . olc _ResizeHandler = ( Module . olc _ResizeHandler != undefined ) ? Module . olc _ResizeHandler : olc _ResizeHandler ; Module . olc _Init = ( Module . olc _Init != undefined ) ? Module . olc _Init : olc _Init ; Module . olc _Init ( ) ; } ,
5374349 : ( ) => { if ( typeof ( AudioContext ) !== 'undefined' ) { return true ; } else if ( typeof ( webkitAudioContext ) !== 'undefined' ) { return true ; } return false ; } ,
5374496 : ( ) => { if ( ( typeof ( navigator . mediaDevices ) !== 'undefined' ) && ( typeof ( navigator . mediaDevices . getUserMedia ) !== 'undefined' ) ) { return true ; } else if ( typeof ( navigator . webkitGetUserMedia ) !== 'undefined' ) { return true ; } return false ; } ,
5374730 : ( $0 ) => { if ( typeof ( Module [ 'SDL2' ] ) === 'undefined' ) { Module [ 'SDL2' ] = { } ; } var SDL2 = Module [ 'SDL2' ] ; if ( ! $0 ) { SDL2 . audio = { } ; } else { SDL2 . capture = { } ; } if ( ! SDL2 . audioContext ) { if ( typeof ( AudioContext ) !== 'undefined' ) { SDL2 . audioContext = new AudioContext ( ) ; } else if ( typeof ( webkitAudioContext ) !== 'undefined' ) { SDL2 . audioContext = new webkitAudioContext ( ) ; } if ( SDL2 . audioContext ) { autoResumeAudioContext ( SDL2 . audioContext ) ; } } return SDL2 . audioContext === undefined ? - 1 : 0 ; } ,
5375223 : ( ) => { var SDL2 = Module [ 'SDL2' ] ; return SDL2 . audioContext . sampleRate ; } ,
5375291 : ( $0 , $1 , $2 , $3 ) => { var SDL2 = Module [ 'SDL2' ] ; var have _microphone = function ( stream ) { if ( SDL2 . capture . silenceTimer !== undefined ) { clearTimeout ( SDL2 . capture . silenceTimer ) ; SDL2 . capture . silenceTimer = undefined ; } SDL2 . capture . mediaStreamNode = SDL2 . audioContext . createMediaStreamSource ( stream ) ; SDL2 . capture . scriptProcessorNode = SDL2 . audioContext . createScriptProcessor ( $1 , $0 , 1 ) ; SDL2 . capture . scriptProcessorNode . onaudioprocess = function ( audioProcessingEvent ) { if ( ( SDL2 === undefined ) || ( SDL2 . capture === undefined ) ) { return ; } audioProcessingEvent . outputBuffer . getChannelData ( 0 ) . fill ( 0.0 ) ; SDL2 . capture . currentCaptureBuffer = audioProcessingEvent . inputBuffer ; dynCall ( 'vi' , $2 , [ $3 ] ) ; } ; SDL2 . capture . mediaStreamNode . connect ( SDL2 . capture . scriptProcessorNode ) ; SDL2 . capture . scriptProcessorNode . connect ( SDL2 . audioContext . destination ) ; SDL2 . capture . stream = stream ; } ; var no _microphone = function ( error ) { } ; SDL2 . capture . silenceBuffer = SDL2 . audioContext . createBuffer ( $0 , $1 , SDL2 . audioContext . sampleRate ) ; SDL2 . capture . silenceBuffer . getChannelData ( 0 ) . fill ( 0.0 ) ; var silence _callback = function ( ) { SDL2 . capture . currentCaptureBuffer = SDL2 . capture . silenceBuffer ; dynCall ( 'vi' , $2 , [ $3 ] ) ; } ; SDL2 . capture . silenceTimer = setTimeout ( silence _callback , ( $1 / SDL2 . audioContext . sampleRate ) * 1000 ) ; if ( ( navigator . mediaDevices !== undefined ) && ( navigator . mediaDevices . getUserMedia !== undefined ) ) { navigator . mediaDevices . getUserMedia ( { audio : true , video : false } ) . then ( have _microphone ) . catch ( no _microphone ) ; } else if ( navigator . webkitGetUserMedia !== undefined ) { navigator . webkitGetUserMedia ( { audio : true , video : false } , have _microphone , no _microphone ) ; } } ,
5376943 : ( $0 , $1 , $2 , $3 ) => { var SDL2 = Module [ 'SDL2' ] ; SDL2 . audio . scriptProcessorNode = SDL2 . audioContext [ 'createScriptProcessor' ] ( $1 , 0 , $0 ) ; SDL2 . audio . scriptProcessorNode [ 'onaudioprocess' ] = function ( e ) { if ( ( SDL2 === undefined ) || ( SDL2 . audio === undefined ) ) { return ; } SDL2 . audio . currentOutputBuffer = e [ 'outputBuffer' ] ; dynCall ( 'vi' , $2 , [ $3 ] ) ; } ; SDL2 . audio . scriptProcessorNode [ 'connect' ] ( SDL2 . audioContext [ 'destination' ] ) ; } ,
5377353 : ( $0 , $1 ) => { var SDL2 = Module [ 'SDL2' ] ; var numChannels = SDL2 . capture . currentCaptureBuffer . numberOfChannels ; for ( var c = 0 ; c < numChannels ; ++ c ) { var channelData = SDL2 . capture . currentCaptureBuffer . getChannelData ( c ) ; if ( channelData . length != $1 ) { throw 'Web Audio capture buffer length mismatch! Destination size: ' + channelData . length + ' samples vs expected ' + $1 + ' samples!' ; } if ( numChannels == 1 ) { for ( var j = 0 ; j < $1 ; ++ j ) { setValue ( $0 + ( j * 4 ) , channelData [ j ] , 'float' ) ; } } else { for ( var j = 0 ; j < $1 ; ++ j ) { setValue ( $0 + ( ( ( j * numChannels ) + c ) * 4 ) , channelData [ j ] , 'float' ) ; } } } } ,
5377958 : ( $0 , $1 ) => { var SDL2 = Module [ 'SDL2' ] ; var numChannels = SDL2 . audio . currentOutputBuffer [ 'numberOfChannels' ] ; for ( var c = 0 ; c < numChannels ; ++ c ) { var channelData = SDL2 . audio . currentOutputBuffer [ 'getChannelData' ] ( c ) ; if ( channelData . length != $1 ) { throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData . length + ' samples vs expected ' + $1 + ' samples!' ; } for ( var j = 0 ; j < $1 ; ++ j ) { channelData [ j ] = HEAPF32 [ $0 + ( ( j * numChannels + c ) << 2 ) >> 2 ] ; } } } ,
5378438 : ( $0 ) => { var SDL2 = Module [ 'SDL2' ] ; if ( $0 ) { if ( SDL2 . capture . silenceTimer !== undefined ) { clearTimeout ( SDL2 . capture . silenceTimer ) ; } if ( SDL2 . capture . stream !== undefined ) { var tracks = SDL2 . capture . stream . getAudioTracks ( ) ; for ( var i = 0 ; i < tracks . length ; i ++ ) { SDL2 . capture . stream . removeTrack ( tracks [ i ] ) ; } SDL2 . capture . stream = undefined ; } if ( SDL2 . capture . scriptProcessorNode !== undefined ) { SDL2 . capture . scriptProcessorNode . onaudioprocess = function ( audioProcessingEvent ) { } ; SDL2 . capture . scriptProcessorNode . disconnect ( ) ; SDL2 . capture . scriptProcessorNode = undefined ; } if ( SDL2 . capture . mediaStreamNode !== undefined ) { SDL2 . capture . mediaStreamNode . disconnect ( ) ; SDL2 . capture . mediaStreamNode = undefined ; } if ( SDL2 . capture . silenceBuffer !== undefined ) { SDL2 . capture . silenceBuffer = undefined } SDL2 . capture = undefined ; } else { if ( SDL2 . audio . scriptProcessorNode != undefined ) { SDL2 . audio . scriptProcessorNode . disconnect ( ) ; SDL2 . audio . scriptProcessorNode = undefined ; } SDL2 . audio = undefined ; } if ( ( SDL2 . audioContext !== undefined ) && ( SDL2 . audio === undefined ) && ( SDL2 . capture === undefined ) ) { SDL2 . audioContext . close ( ) ; SDL2 . audioContext = undefined ; } } ,
5379610 : ( $0 , $1 , $2 ) => { var w = $0 ; var h = $1 ; var pixels = $2 ; if ( ! Module [ 'SDL2' ] ) Module [ 'SDL2' ] = { } ; var SDL2 = Module [ 'SDL2' ] ; if ( SDL2 . ctxCanvas !== Module [ 'canvas' ] ) { SDL2 . ctx = Module [ 'createContext' ] ( Module [ 'canvas' ] , false , true ) ; SDL2 . ctxCanvas = Module [ 'canvas' ] ; } if ( SDL2 . w !== w || SDL2 . h !== h || SDL2 . imageCtx !== SDL2 . ctx ) { SDL2 . image = SDL2 . ctx . createImageData ( w , h ) ; SDL2 . w = w ; SDL2 . h = h ; SDL2 . imageCtx = SDL2 . ctx ; } var data = SDL2 . image . data ; var src = pixels >> 2 ; var dst = 0 ; var num ; if ( typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray ) { num = data . length ; while ( dst < num ) { var val = HEAP32 [ src ] ; data [ dst ] = val & 0xff ; data [ dst + 1 ] = ( val >> 8 ) & 0xff ; data [ dst + 2 ] = ( val >> 16 ) & 0xff ; data [ dst + 3 ] = 0xff ; src ++ ; dst += 4 ; } } else { if ( SDL2 . data32Data !== data ) { SDL2 . data32 = new Int32Array ( data . buffer ) ; SDL2 . data8 = new Uint8Array ( data . buffer ) ; SDL2 . data32Data = data ; } var data32 = SDL2 . data32 ; num = data32 . length ; data32 . set ( HEAP32 . subarray ( src , src + num ) ) ; var data8 = SDL2 . data8 ; var i = 3 ; var j = i + 4 * num ; if ( num % 8 == 0 ) { while ( i < j ) { data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; data8 [ i ] = 0xff ; i = i + 4 | 0 ; } } else { while ( i < j ) { data8 [ i ] = 0xff ; i = i + 4 | 0 ; } } } SDL2 . ctx . putImageData ( SDL2 . image , 0 , 0 ) ; } ,
5381079 : ( $0 , $1 , $2 , $3 , $4 ) => { var w = $0 ; var h = $1 ; var hot _x = $2 ; var hot _y = $3 ; var pixels = $4 ; var canvas = document . createElement ( "canvas" ) ; canvas . width = w ; canvas . height = h ; var ctx = canvas . getContext ( "2d" ) ; var image = ctx . createImageData ( w , h ) ; var data = image . data ; var src = pixels >> 2 ; var dst = 0 ; var num ; if ( typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray ) { num = data . length ; while ( dst < num ) { var val = HEAP32 [ src ] ; data [ dst ] = val & 0xff ; data [ dst + 1 ] = ( val >> 8 ) & 0xff ; data [ dst + 2 ] = ( val >> 16 ) & 0xff ; data [ dst + 3 ] = ( val >> 24 ) & 0xff ; src ++ ; dst += 4 ; } } else { var data32 = new Int32Array ( data . buffer ) ; num = data32 . length ; data32 . set ( HEAP32 . subarray ( src , src + num ) ) ; } ctx . putImageData ( image , 0 , 0 ) ; var url = hot _x === 0 && hot _y === 0 ? "url(" + canvas . toDataURL ( ) + "), auto" : "url(" + canvas . toDataURL ( ) + ") " + hot _x + " " + hot _y + ", auto" ; var urlBuf = _malloc ( url . length + 1 ) ; stringToUTF8 ( url , urlBuf , url . length + 1 ) ; return urlBuf ; } ,
5382068 : ( $0 ) => { if ( Module [ 'canvas' ] ) { Module [ 'canvas' ] . style [ 'cursor' ] = UTF8ToString ( $0 ) ; } } ,
5382151 : ( ) => { if ( Module [ 'canvas' ] ) { Module [ 'canvas' ] . style [ 'cursor' ] = 'none' ; } } ,
5382220 : ( ) => { return window . innerWidth ; } ,
5382250 : ( ) => { return window . innerHeight ; }
} ;